mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
154 lines
3.8 KiB
Go
154 lines
3.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"
|
|
)
|
|
|
|
// checks if the IamTokenResult type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &IamTokenResult{}
|
|
|
|
// IamTokenResult struct for IamTokenResult
|
|
type IamTokenResult struct {
|
|
Token *IamToken `json:"token,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _IamTokenResult IamTokenResult
|
|
|
|
// NewIamTokenResult instantiates a new IamTokenResult 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 NewIamTokenResult() *IamTokenResult {
|
|
this := IamTokenResult{}
|
|
return &this
|
|
}
|
|
|
|
// NewIamTokenResultWithDefaults instantiates a new IamTokenResult 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 NewIamTokenResultWithDefaults() *IamTokenResult {
|
|
this := IamTokenResult{}
|
|
return &this
|
|
}
|
|
|
|
// GetToken returns the Token field value if set, zero value otherwise.
|
|
func (o *IamTokenResult) GetToken() IamToken {
|
|
if o == nil || IsNil(o.Token) {
|
|
var ret IamToken
|
|
return ret
|
|
}
|
|
return *o.Token
|
|
}
|
|
|
|
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *IamTokenResult) GetTokenOk() (*IamToken, bool) {
|
|
if o == nil || IsNil(o.Token) {
|
|
return nil, false
|
|
}
|
|
return o.Token, true
|
|
}
|
|
|
|
// HasToken returns a boolean if a field has been set.
|
|
func (o *IamTokenResult) HasToken() bool {
|
|
if o != nil && !IsNil(o.Token) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken gets a reference to the given IamToken and assigns it to the Token field.
|
|
func (o *IamTokenResult) SetToken(v IamToken) {
|
|
o.Token = &v
|
|
}
|
|
|
|
func (o IamTokenResult) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o IamTokenResult) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Token) {
|
|
toSerialize["token"] = o.Token
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *IamTokenResult) UnmarshalJSON(data []byte) (err error) {
|
|
varIamTokenResult := _IamTokenResult{}
|
|
|
|
err = json.Unmarshal(data, &varIamTokenResult)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = IamTokenResult(varIamTokenResult)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "token")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableIamTokenResult struct {
|
|
value *IamTokenResult
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableIamTokenResult) Get() *IamTokenResult {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableIamTokenResult) Set(val *IamTokenResult) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableIamTokenResult) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableIamTokenResult) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableIamTokenResult(val *IamTokenResult) *NullableIamTokenResult {
|
|
return &NullableIamTokenResult{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableIamTokenResult) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableIamTokenResult) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|