Files
sdk/model_iam_address.go

376 lines
9.0 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 IamAddress type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamAddress{}
// IamAddress struct for IamAddress
type IamAddress struct {
City *string `json:"city,omitempty"`
Line1 *string `json:"line1,omitempty"`
Line2 *string `json:"line2,omitempty"`
Region *string `json:"region,omitempty"`
State *string `json:"state,omitempty"`
Tag *string `json:"tag,omitempty"`
ZipCode *string `json:"zipCode,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamAddress IamAddress
// NewIamAddress instantiates a new IamAddress 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 NewIamAddress() *IamAddress {
this := IamAddress{}
return &this
}
// NewIamAddressWithDefaults instantiates a new IamAddress 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 NewIamAddressWithDefaults() *IamAddress {
this := IamAddress{}
return &this
}
// GetCity returns the City field value if set, zero value otherwise.
func (o *IamAddress) GetCity() string {
if o == nil || IsNil(o.City) {
var ret string
return ret
}
return *o.City
}
// GetCityOk returns a tuple with the City field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAddress) GetCityOk() (*string, bool) {
if o == nil || IsNil(o.City) {
return nil, false
}
return o.City, true
}
// HasCity returns a boolean if a field has been set.
func (o *IamAddress) HasCity() bool {
if o != nil && !IsNil(o.City) {
return true
}
return false
}
// SetCity gets a reference to the given string and assigns it to the City field.
func (o *IamAddress) SetCity(v string) {
o.City = &v
}
// GetLine1 returns the Line1 field value if set, zero value otherwise.
func (o *IamAddress) GetLine1() string {
if o == nil || IsNil(o.Line1) {
var ret string
return ret
}
return *o.Line1
}
// GetLine1Ok returns a tuple with the Line1 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAddress) GetLine1Ok() (*string, bool) {
if o == nil || IsNil(o.Line1) {
return nil, false
}
return o.Line1, true
}
// HasLine1 returns a boolean if a field has been set.
func (o *IamAddress) HasLine1() bool {
if o != nil && !IsNil(o.Line1) {
return true
}
return false
}
// SetLine1 gets a reference to the given string and assigns it to the Line1 field.
func (o *IamAddress) SetLine1(v string) {
o.Line1 = &v
}
// GetLine2 returns the Line2 field value if set, zero value otherwise.
func (o *IamAddress) GetLine2() string {
if o == nil || IsNil(o.Line2) {
var ret string
return ret
}
return *o.Line2
}
// GetLine2Ok returns a tuple with the Line2 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAddress) GetLine2Ok() (*string, bool) {
if o == nil || IsNil(o.Line2) {
return nil, false
}
return o.Line2, true
}
// HasLine2 returns a boolean if a field has been set.
func (o *IamAddress) HasLine2() bool {
if o != nil && !IsNil(o.Line2) {
return true
}
return false
}
// SetLine2 gets a reference to the given string and assigns it to the Line2 field.
func (o *IamAddress) SetLine2(v string) {
o.Line2 = &v
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *IamAddress) GetRegion() string {
if o == nil || IsNil(o.Region) {
var ret string
return ret
}
return *o.Region
}
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAddress) GetRegionOk() (*string, bool) {
if o == nil || IsNil(o.Region) {
return nil, false
}
return o.Region, true
}
// HasRegion returns a boolean if a field has been set.
func (o *IamAddress) HasRegion() bool {
if o != nil && !IsNil(o.Region) {
return true
}
return false
}
// SetRegion gets a reference to the given string and assigns it to the Region field.
func (o *IamAddress) SetRegion(v string) {
o.Region = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *IamAddress) GetState() string {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAddress) GetStateOk() (*string, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *IamAddress) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *IamAddress) SetState(v string) {
o.State = &v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *IamAddress) GetTag() string {
if o == nil || IsNil(o.Tag) {
var ret string
return ret
}
return *o.Tag
}
// GetTagOk returns a tuple with the Tag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAddress) GetTagOk() (*string, bool) {
if o == nil || IsNil(o.Tag) {
return nil, false
}
return o.Tag, true
}
// HasTag returns a boolean if a field has been set.
func (o *IamAddress) HasTag() bool {
if o != nil && !IsNil(o.Tag) {
return true
}
return false
}
// SetTag gets a reference to the given string and assigns it to the Tag field.
func (o *IamAddress) SetTag(v string) {
o.Tag = &v
}
// GetZipCode returns the ZipCode field value if set, zero value otherwise.
func (o *IamAddress) GetZipCode() string {
if o == nil || IsNil(o.ZipCode) {
var ret string
return ret
}
return *o.ZipCode
}
// GetZipCodeOk returns a tuple with the ZipCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamAddress) GetZipCodeOk() (*string, bool) {
if o == nil || IsNil(o.ZipCode) {
return nil, false
}
return o.ZipCode, true
}
// HasZipCode returns a boolean if a field has been set.
func (o *IamAddress) HasZipCode() bool {
if o != nil && !IsNil(o.ZipCode) {
return true
}
return false
}
// SetZipCode gets a reference to the given string and assigns it to the ZipCode field.
func (o *IamAddress) SetZipCode(v string) {
o.ZipCode = &v
}
func (o IamAddress) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamAddress) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.City) {
toSerialize["city"] = o.City
}
if !IsNil(o.Line1) {
toSerialize["line1"] = o.Line1
}
if !IsNil(o.Line2) {
toSerialize["line2"] = o.Line2
}
if !IsNil(o.Region) {
toSerialize["region"] = o.Region
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Tag) {
toSerialize["tag"] = o.Tag
}
if !IsNil(o.ZipCode) {
toSerialize["zipCode"] = o.ZipCode
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamAddress) UnmarshalJSON(data []byte) (err error) {
varIamAddress := _IamAddress{}
err = json.Unmarshal(data, &varIamAddress)
if err != nil {
return err
}
*o = IamAddress(varIamAddress)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "city")
delete(additionalProperties, "line1")
delete(additionalProperties, "line2")
delete(additionalProperties, "region")
delete(additionalProperties, "state")
delete(additionalProperties, "tag")
delete(additionalProperties, "zipCode")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamAddress struct {
value *IamAddress
isSet bool
}
func (v NullableIamAddress) Get() *IamAddress {
return v.value
}
func (v *NullableIamAddress) Set(val *IamAddress) {
v.value = val
v.isSet = true
}
func (v NullableIamAddress) IsSet() bool {
return v.isSet
}
func (v *NullableIamAddress) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamAddress(val *IamAddress) *NullableIamAddress {
return &NullableIamAddress{value: val, isSet: true}
}
func (v NullableIamAddress) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamAddress) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}