Files
sdk/model_iam_token_mutation.go

191 lines
4.9 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 IamTokenMutation type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamTokenMutation{}
// IamTokenMutation struct for IamTokenMutation
type IamTokenMutation struct {
Affected *bool `json:"affected,omitempty"`
Token *IamToken `json:"token,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamTokenMutation IamTokenMutation
// NewIamTokenMutation instantiates a new IamTokenMutation 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 NewIamTokenMutation() *IamTokenMutation {
this := IamTokenMutation{}
return &this
}
// NewIamTokenMutationWithDefaults instantiates a new IamTokenMutation 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 NewIamTokenMutationWithDefaults() *IamTokenMutation {
this := IamTokenMutation{}
return &this
}
// GetAffected returns the Affected field value if set, zero value otherwise.
func (o *IamTokenMutation) GetAffected() bool {
if o == nil || IsNil(o.Affected) {
var ret bool
return ret
}
return *o.Affected
}
// GetAffectedOk returns a tuple with the Affected field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamTokenMutation) GetAffectedOk() (*bool, bool) {
if o == nil || IsNil(o.Affected) {
return nil, false
}
return o.Affected, true
}
// HasAffected returns a boolean if a field has been set.
func (o *IamTokenMutation) HasAffected() bool {
if o != nil && !IsNil(o.Affected) {
return true
}
return false
}
// SetAffected gets a reference to the given bool and assigns it to the Affected field.
func (o *IamTokenMutation) SetAffected(v bool) {
o.Affected = &v
}
// GetToken returns the Token field value if set, zero value otherwise.
func (o *IamTokenMutation) 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 *IamTokenMutation) 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 *IamTokenMutation) 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 *IamTokenMutation) SetToken(v IamToken) {
o.Token = &v
}
func (o IamTokenMutation) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamTokenMutation) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Affected) {
toSerialize["affected"] = o.Affected
}
if !IsNil(o.Token) {
toSerialize["token"] = o.Token
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamTokenMutation) UnmarshalJSON(data []byte) (err error) {
varIamTokenMutation := _IamTokenMutation{}
err = json.Unmarshal(data, &varIamTokenMutation)
if err != nil {
return err
}
*o = IamTokenMutation(varIamTokenMutation)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "affected")
delete(additionalProperties, "token")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamTokenMutation struct {
value *IamTokenMutation
isSet bool
}
func (v NullableIamTokenMutation) Get() *IamTokenMutation {
return v.value
}
func (v *NullableIamTokenMutation) Set(val *IamTokenMutation) {
v.value = val
v.isSet = true
}
func (v NullableIamTokenMutation) IsSet() bool {
return v.isSet
}
func (v *NullableIamTokenMutation) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamTokenMutation(val *IamTokenMutation) *NullableIamTokenMutation {
return &NullableIamTokenMutation{value: val, isSet: true}
}
func (v NullableIamTokenMutation) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamTokenMutation) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}