Files
sdk/model_iam_create_session_in.go

299 lines
7.8 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"
"fmt"
)
// checks if the IamCreateSessionIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamCreateSessionIn{}
// IamCreateSessionIn struct for IamCreateSessionIn
type IamCreateSessionIn struct {
Application string `json:"application"`
ExclusiveSignin *bool `json:"exclusiveSignin,omitempty"`
Name string `json:"name"`
Owner string `json:"owner"`
SessionId []string `json:"sessionId,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamCreateSessionIn IamCreateSessionIn
// NewIamCreateSessionIn instantiates a new IamCreateSessionIn 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 NewIamCreateSessionIn(application string, name string, owner string) *IamCreateSessionIn {
this := IamCreateSessionIn{}
this.Application = application
this.Name = name
this.Owner = owner
return &this
}
// NewIamCreateSessionInWithDefaults instantiates a new IamCreateSessionIn 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 NewIamCreateSessionInWithDefaults() *IamCreateSessionIn {
this := IamCreateSessionIn{}
return &this
}
// GetApplication returns the Application field value
func (o *IamCreateSessionIn) GetApplication() string {
if o == nil {
var ret string
return ret
}
return o.Application
}
// GetApplicationOk returns a tuple with the Application field value
// and a boolean to check if the value has been set.
func (o *IamCreateSessionIn) GetApplicationOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Application, true
}
// SetApplication sets field value
func (o *IamCreateSessionIn) SetApplication(v string) {
o.Application = v
}
// GetExclusiveSignin returns the ExclusiveSignin field value if set, zero value otherwise.
func (o *IamCreateSessionIn) 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 *IamCreateSessionIn) 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 *IamCreateSessionIn) 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 *IamCreateSessionIn) SetExclusiveSignin(v bool) {
o.ExclusiveSignin = &v
}
// GetName returns the Name field value
func (o *IamCreateSessionIn) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *IamCreateSessionIn) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *IamCreateSessionIn) SetName(v string) {
o.Name = v
}
// GetOwner returns the Owner field value
func (o *IamCreateSessionIn) GetOwner() string {
if o == nil {
var ret string
return ret
}
return o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value
// and a boolean to check if the value has been set.
func (o *IamCreateSessionIn) GetOwnerOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Owner, true
}
// SetOwner sets field value
func (o *IamCreateSessionIn) SetOwner(v string) {
o.Owner = v
}
// GetSessionId returns the SessionId field value if set, zero value otherwise.
func (o *IamCreateSessionIn) 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 *IamCreateSessionIn) 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 *IamCreateSessionIn) 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 *IamCreateSessionIn) SetSessionId(v []string) {
o.SessionId = v
}
func (o IamCreateSessionIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamCreateSessionIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["application"] = o.Application
if !IsNil(o.ExclusiveSignin) {
toSerialize["exclusiveSignin"] = o.ExclusiveSignin
}
toSerialize["name"] = o.Name
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 *IamCreateSessionIn) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"application",
"name",
"owner",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varIamCreateSessionIn := _IamCreateSessionIn{}
err = json.Unmarshal(data, &varIamCreateSessionIn)
if err != nil {
return err
}
*o = IamCreateSessionIn(varIamCreateSessionIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "application")
delete(additionalProperties, "exclusiveSignin")
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "sessionId")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamCreateSessionIn struct {
value *IamCreateSessionIn
isSet bool
}
func (v NullableIamCreateSessionIn) Get() *IamCreateSessionIn {
return v.value
}
func (v *NullableIamCreateSessionIn) Set(val *IamCreateSessionIn) {
v.value = val
v.isSet = true
}
func (v NullableIamCreateSessionIn) IsSet() bool {
return v.isSet
}
func (v *NullableIamCreateSessionIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamCreateSessionIn(val *IamCreateSessionIn) *NullableIamCreateSessionIn {
return &NullableIamCreateSessionIn{value: val, isSet: true}
}
func (v NullableIamCreateSessionIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamCreateSessionIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}