Files
sdk/model_iam_mfa_item.go

191 lines
4.5 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 IamMfaItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamMfaItem{}
// IamMfaItem struct for IamMfaItem
type IamMfaItem struct {
Name *string `json:"name,omitempty"`
Rule *string `json:"rule,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamMfaItem IamMfaItem
// NewIamMfaItem instantiates a new IamMfaItem 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 NewIamMfaItem() *IamMfaItem {
this := IamMfaItem{}
return &this
}
// NewIamMfaItemWithDefaults instantiates a new IamMfaItem 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 NewIamMfaItemWithDefaults() *IamMfaItem {
this := IamMfaItem{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *IamMfaItem) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamMfaItem) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *IamMfaItem) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *IamMfaItem) SetName(v string) {
o.Name = &v
}
// GetRule returns the Rule field value if set, zero value otherwise.
func (o *IamMfaItem) GetRule() string {
if o == nil || IsNil(o.Rule) {
var ret string
return ret
}
return *o.Rule
}
// GetRuleOk returns a tuple with the Rule field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamMfaItem) GetRuleOk() (*string, bool) {
if o == nil || IsNil(o.Rule) {
return nil, false
}
return o.Rule, true
}
// HasRule returns a boolean if a field has been set.
func (o *IamMfaItem) HasRule() bool {
if o != nil && !IsNil(o.Rule) {
return true
}
return false
}
// SetRule gets a reference to the given string and assigns it to the Rule field.
func (o *IamMfaItem) SetRule(v string) {
o.Rule = &v
}
func (o IamMfaItem) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamMfaItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Rule) {
toSerialize["rule"] = o.Rule
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamMfaItem) UnmarshalJSON(data []byte) (err error) {
varIamMfaItem := _IamMfaItem{}
err = json.Unmarshal(data, &varIamMfaItem)
if err != nil {
return err
}
*o = IamMfaItem(varIamMfaItem)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "name")
delete(additionalProperties, "rule")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamMfaItem struct {
value *IamMfaItem
isSet bool
}
func (v NullableIamMfaItem) Get() *IamMfaItem {
return v.value
}
func (v *NullableIamMfaItem) Set(val *IamMfaItem) {
v.value = val
v.isSet = true
}
func (v NullableIamMfaItem) IsSet() bool {
return v.isSet
}
func (v *NullableIamMfaItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamMfaItem(val *IamMfaItem) *NullableIamMfaItem {
return &NullableIamMfaItem{value: val, isSet: true}
}
func (v NullableIamMfaItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamMfaItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}