Files
sdk/model_iam_mfa_props.go

339 lines
8.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 IamMfaProps type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamMfaProps{}
// IamMfaProps struct for IamMfaProps
type IamMfaProps struct {
CountryCode *string `json:"countryCode,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
IsPreferred *bool `json:"isPreferred,omitempty"`
MfaRememberInHours *int64 `json:"mfaRememberInHours,omitempty"`
MfaType *string `json:"mfaType,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamMfaProps IamMfaProps
// NewIamMfaProps instantiates a new IamMfaProps 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 NewIamMfaProps() *IamMfaProps {
this := IamMfaProps{}
return &this
}
// NewIamMfaPropsWithDefaults instantiates a new IamMfaProps 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 NewIamMfaPropsWithDefaults() *IamMfaProps {
this := IamMfaProps{}
return &this
}
// GetCountryCode returns the CountryCode field value if set, zero value otherwise.
func (o *IamMfaProps) GetCountryCode() string {
if o == nil || IsNil(o.CountryCode) {
var ret string
return ret
}
return *o.CountryCode
}
// GetCountryCodeOk returns a tuple with the CountryCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamMfaProps) GetCountryCodeOk() (*string, bool) {
if o == nil || IsNil(o.CountryCode) {
return nil, false
}
return o.CountryCode, true
}
// HasCountryCode returns a boolean if a field has been set.
func (o *IamMfaProps) HasCountryCode() bool {
if o != nil && !IsNil(o.CountryCode) {
return true
}
return false
}
// SetCountryCode gets a reference to the given string and assigns it to the CountryCode field.
func (o *IamMfaProps) SetCountryCode(v string) {
o.CountryCode = &v
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *IamMfaProps) GetEnabled() bool {
if o == nil || IsNil(o.Enabled) {
var ret bool
return ret
}
return *o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamMfaProps) GetEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.Enabled) {
return nil, false
}
return o.Enabled, true
}
// HasEnabled returns a boolean if a field has been set.
func (o *IamMfaProps) HasEnabled() bool {
if o != nil && !IsNil(o.Enabled) {
return true
}
return false
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *IamMfaProps) SetEnabled(v bool) {
o.Enabled = &v
}
// GetIsPreferred returns the IsPreferred field value if set, zero value otherwise.
func (o *IamMfaProps) GetIsPreferred() bool {
if o == nil || IsNil(o.IsPreferred) {
var ret bool
return ret
}
return *o.IsPreferred
}
// GetIsPreferredOk returns a tuple with the IsPreferred field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamMfaProps) GetIsPreferredOk() (*bool, bool) {
if o == nil || IsNil(o.IsPreferred) {
return nil, false
}
return o.IsPreferred, true
}
// HasIsPreferred returns a boolean if a field has been set.
func (o *IamMfaProps) HasIsPreferred() bool {
if o != nil && !IsNil(o.IsPreferred) {
return true
}
return false
}
// SetIsPreferred gets a reference to the given bool and assigns it to the IsPreferred field.
func (o *IamMfaProps) SetIsPreferred(v bool) {
o.IsPreferred = &v
}
// GetMfaRememberInHours returns the MfaRememberInHours field value if set, zero value otherwise.
func (o *IamMfaProps) GetMfaRememberInHours() int64 {
if o == nil || IsNil(o.MfaRememberInHours) {
var ret int64
return ret
}
return *o.MfaRememberInHours
}
// GetMfaRememberInHoursOk returns a tuple with the MfaRememberInHours field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamMfaProps) GetMfaRememberInHoursOk() (*int64, bool) {
if o == nil || IsNil(o.MfaRememberInHours) {
return nil, false
}
return o.MfaRememberInHours, true
}
// HasMfaRememberInHours returns a boolean if a field has been set.
func (o *IamMfaProps) HasMfaRememberInHours() bool {
if o != nil && !IsNil(o.MfaRememberInHours) {
return true
}
return false
}
// SetMfaRememberInHours gets a reference to the given int64 and assigns it to the MfaRememberInHours field.
func (o *IamMfaProps) SetMfaRememberInHours(v int64) {
o.MfaRememberInHours = &v
}
// GetMfaType returns the MfaType field value if set, zero value otherwise.
func (o *IamMfaProps) GetMfaType() string {
if o == nil || IsNil(o.MfaType) {
var ret string
return ret
}
return *o.MfaType
}
// GetMfaTypeOk returns a tuple with the MfaType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamMfaProps) GetMfaTypeOk() (*string, bool) {
if o == nil || IsNil(o.MfaType) {
return nil, false
}
return o.MfaType, true
}
// HasMfaType returns a boolean if a field has been set.
func (o *IamMfaProps) HasMfaType() bool {
if o != nil && !IsNil(o.MfaType) {
return true
}
return false
}
// SetMfaType gets a reference to the given string and assigns it to the MfaType field.
func (o *IamMfaProps) SetMfaType(v string) {
o.MfaType = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *IamMfaProps) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamMfaProps) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *IamMfaProps) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *IamMfaProps) SetUrl(v string) {
o.Url = &v
}
func (o IamMfaProps) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamMfaProps) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CountryCode) {
toSerialize["countryCode"] = o.CountryCode
}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.IsPreferred) {
toSerialize["isPreferred"] = o.IsPreferred
}
if !IsNil(o.MfaRememberInHours) {
toSerialize["mfaRememberInHours"] = o.MfaRememberInHours
}
if !IsNil(o.MfaType) {
toSerialize["mfaType"] = o.MfaType
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamMfaProps) UnmarshalJSON(data []byte) (err error) {
varIamMfaProps := _IamMfaProps{}
err = json.Unmarshal(data, &varIamMfaProps)
if err != nil {
return err
}
*o = IamMfaProps(varIamMfaProps)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "countryCode")
delete(additionalProperties, "enabled")
delete(additionalProperties, "isPreferred")
delete(additionalProperties, "mfaRememberInHours")
delete(additionalProperties, "mfaType")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamMfaProps struct {
value *IamMfaProps
isSet bool
}
func (v NullableIamMfaProps) Get() *IamMfaProps {
return v.value
}
func (v *NullableIamMfaProps) Set(val *IamMfaProps) {
v.value = val
v.isSet = true
}
func (v NullableIamMfaProps) IsSet() bool {
return v.isSet
}
func (v *NullableIamMfaProps) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamMfaProps(val *IamMfaProps) *NullableIamMfaProps {
return &NullableIamMfaProps{value: val, isSet: true}
}
func (v NullableIamMfaProps) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamMfaProps) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}