Files
sdk/model_iam_accept_body.go

228 lines
5.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"
)
// checks if the IamAcceptBody type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamAcceptBody{}
// IamAcceptBody struct for IamAcceptBody
type IamAcceptBody struct {
Code *string `json:"code,omitempty"`
EmailCode *string `json:"emailCode,omitempty"`
Owner *string `json:"owner,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamAcceptBody IamAcceptBody
// NewIamAcceptBody instantiates a new IamAcceptBody 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 NewIamAcceptBody() *IamAcceptBody {
this := IamAcceptBody{}
return &this
}
// NewIamAcceptBodyWithDefaults instantiates a new IamAcceptBody 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 NewIamAcceptBodyWithDefaults() *IamAcceptBody {
this := IamAcceptBody{}
return &this
}
// GetCode returns the Code field value if set, zero value otherwise.
func (o *IamAcceptBody) GetCode() string {
if o == nil || IsNil(o.Code) {
var ret string
return ret
}
return *o.Code
}
// GetCodeOk returns a tuple with the Code field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAcceptBody) GetCodeOk() (*string, bool) {
if o == nil || IsNil(o.Code) {
return nil, false
}
return o.Code, true
}
// HasCode returns a boolean if a field has been set.
func (o *IamAcceptBody) HasCode() bool {
if o != nil && !IsNil(o.Code) {
return true
}
return false
}
// SetCode gets a reference to the given string and assigns it to the Code field.
func (o *IamAcceptBody) SetCode(v string) {
o.Code = &v
}
// GetEmailCode returns the EmailCode field value if set, zero value otherwise.
func (o *IamAcceptBody) GetEmailCode() string {
if o == nil || IsNil(o.EmailCode) {
var ret string
return ret
}
return *o.EmailCode
}
// GetEmailCodeOk returns a tuple with the EmailCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAcceptBody) GetEmailCodeOk() (*string, bool) {
if o == nil || IsNil(o.EmailCode) {
return nil, false
}
return o.EmailCode, true
}
// HasEmailCode returns a boolean if a field has been set.
func (o *IamAcceptBody) HasEmailCode() bool {
if o != nil && !IsNil(o.EmailCode) {
return true
}
return false
}
// SetEmailCode gets a reference to the given string and assigns it to the EmailCode field.
func (o *IamAcceptBody) SetEmailCode(v string) {
o.EmailCode = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *IamAcceptBody) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAcceptBody) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *IamAcceptBody) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *IamAcceptBody) SetOwner(v string) {
o.Owner = &v
}
func (o IamAcceptBody) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamAcceptBody) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Code) {
toSerialize["code"] = o.Code
}
if !IsNil(o.EmailCode) {
toSerialize["emailCode"] = o.EmailCode
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamAcceptBody) UnmarshalJSON(data []byte) (err error) {
varIamAcceptBody := _IamAcceptBody{}
err = json.Unmarshal(data, &varIamAcceptBody)
if err != nil {
return err
}
*o = IamAcceptBody(varIamAcceptBody)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "code")
delete(additionalProperties, "emailCode")
delete(additionalProperties, "owner")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamAcceptBody struct {
value *IamAcceptBody
isSet bool
}
func (v NullableIamAcceptBody) Get() *IamAcceptBody {
return v.value
}
func (v *NullableIamAcceptBody) Set(val *IamAcceptBody) {
v.value = val
v.isSet = true
}
func (v NullableIamAcceptBody) IsSet() bool {
return v.isSet
}
func (v *NullableIamAcceptBody) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamAcceptBody(val *IamAcceptBody) *NullableIamAcceptBody {
return &NullableIamAcceptBody{value: val, isSet: true}
}
func (v NullableIamAcceptBody) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamAcceptBody) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}