mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
262 lines
6.6 KiB
Go
262 lines
6.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"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the IamUpdateSessionIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &IamUpdateSessionIn{}
|
|
|
|
// IamUpdateSessionIn struct for IamUpdateSessionIn
|
|
type IamUpdateSessionIn struct {
|
|
Application string `json:"application"`
|
|
Name string `json:"name"`
|
|
Owner string `json:"owner"`
|
|
SessionId []string `json:"sessionId,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _IamUpdateSessionIn IamUpdateSessionIn
|
|
|
|
// NewIamUpdateSessionIn instantiates a new IamUpdateSessionIn 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 NewIamUpdateSessionIn(application string, name string, owner string) *IamUpdateSessionIn {
|
|
this := IamUpdateSessionIn{}
|
|
this.Application = application
|
|
this.Name = name
|
|
this.Owner = owner
|
|
return &this
|
|
}
|
|
|
|
// NewIamUpdateSessionInWithDefaults instantiates a new IamUpdateSessionIn 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 NewIamUpdateSessionInWithDefaults() *IamUpdateSessionIn {
|
|
this := IamUpdateSessionIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetApplication returns the Application field value
|
|
func (o *IamUpdateSessionIn) 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 *IamUpdateSessionIn) GetApplicationOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Application, true
|
|
}
|
|
|
|
// SetApplication sets field value
|
|
func (o *IamUpdateSessionIn) SetApplication(v string) {
|
|
o.Application = v
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *IamUpdateSessionIn) 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 *IamUpdateSessionIn) GetNameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Name, true
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *IamUpdateSessionIn) SetName(v string) {
|
|
o.Name = v
|
|
}
|
|
|
|
// GetOwner returns the Owner field value
|
|
func (o *IamUpdateSessionIn) 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 *IamUpdateSessionIn) GetOwnerOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Owner, true
|
|
}
|
|
|
|
// SetOwner sets field value
|
|
func (o *IamUpdateSessionIn) SetOwner(v string) {
|
|
o.Owner = v
|
|
}
|
|
|
|
// GetSessionId returns the SessionId field value if set, zero value otherwise.
|
|
func (o *IamUpdateSessionIn) 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 *IamUpdateSessionIn) 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 *IamUpdateSessionIn) 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 *IamUpdateSessionIn) SetSessionId(v []string) {
|
|
o.SessionId = v
|
|
}
|
|
|
|
func (o IamUpdateSessionIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o IamUpdateSessionIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["application"] = o.Application
|
|
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 *IamUpdateSessionIn) 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)
|
|
}
|
|
}
|
|
|
|
varIamUpdateSessionIn := _IamUpdateSessionIn{}
|
|
|
|
err = json.Unmarshal(data, &varIamUpdateSessionIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = IamUpdateSessionIn(varIamUpdateSessionIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "application")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "owner")
|
|
delete(additionalProperties, "sessionId")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableIamUpdateSessionIn struct {
|
|
value *IamUpdateSessionIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableIamUpdateSessionIn) Get() *IamUpdateSessionIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableIamUpdateSessionIn) Set(val *IamUpdateSessionIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableIamUpdateSessionIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableIamUpdateSessionIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableIamUpdateSessionIn(val *IamUpdateSessionIn) *NullableIamUpdateSessionIn {
|
|
return &NullableIamUpdateSessionIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableIamUpdateSessionIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableIamUpdateSessionIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|