model_zone.go raw

   1  /*
   2  Intelligent DNS API
   3  
   4  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
   5  
   6  API version: 1.0.0
   7  */
   8  
   9  // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
  10  
  11  package idns
  12  
  13  import (
  14  	"encoding/json"
  15  )
  16  
  17  // checks if the Zone type satisfies the MappedNullable interface at compile time
  18  var _ MappedNullable = &Zone{}
  19  
  20  // Zone struct for Zone
  21  type Zone struct {
  22  	// Hosted zone id
  23  	Id *int32 `json:"id,omitempty"`
  24  	// Hosted zone name
  25  	Name *string `json:"name,omitempty"`
  26  	// Hosted zone domain
  27  	Domain *string `json:"domain,omitempty"`
  28  	// If hosted zone is active
  29  	IsActive *bool `json:"is_active,omitempty"`
  30  	Retry NullableInt32 `json:"retry,omitempty"`
  31  	NxTtl NullableInt32 `json:"nx_ttl,omitempty"`
  32  	SoaTtl NullableInt32 `json:"soa_ttl,omitempty"`
  33  	Refresh NullableInt32 `json:"refresh,omitempty"`
  34  	Expiry NullableInt32 `json:"expiry,omitempty"`
  35  	// List of nameservers
  36  	Nameservers []string `json:"nameservers,omitempty"`
  37  }
  38  
  39  // NewZone instantiates a new Zone object
  40  // This constructor will assign default values to properties that have it defined,
  41  // and makes sure properties required by API are set, but the set of arguments
  42  // will change when the set of required properties is changed
  43  func NewZone() *Zone {
  44  	this := Zone{}
  45  	return &this
  46  }
  47  
  48  // NewZoneWithDefaults instantiates a new Zone object
  49  // This constructor will only assign default values to properties that have it defined,
  50  // but it doesn't guarantee that properties required by API are set
  51  func NewZoneWithDefaults() *Zone {
  52  	this := Zone{}
  53  	return &this
  54  }
  55  
  56  // GetId returns the Id field value if set, zero value otherwise.
  57  func (o *Zone) GetId() int32 {
  58  	if o == nil || IsNil(o.Id) {
  59  		var ret int32
  60  		return ret
  61  	}
  62  	return *o.Id
  63  }
  64  
  65  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
  66  // and a boolean to check if the value has been set.
  67  func (o *Zone) GetIdOk() (*int32, bool) {
  68  	if o == nil || IsNil(o.Id) {
  69  		return nil, false
  70  	}
  71  	return o.Id, true
  72  }
  73  
  74  // HasId returns a boolean if a field has been set.
  75  func (o *Zone) HasId() bool {
  76  	if o != nil && !IsNil(o.Id) {
  77  		return true
  78  	}
  79  
  80  	return false
  81  }
  82  
  83  // SetId gets a reference to the given int32 and assigns it to the Id field.
  84  func (o *Zone) SetId(v int32) {
  85  	o.Id = &v
  86  }
  87  
  88  // GetName returns the Name field value if set, zero value otherwise.
  89  func (o *Zone) GetName() string {
  90  	if o == nil || IsNil(o.Name) {
  91  		var ret string
  92  		return ret
  93  	}
  94  	return *o.Name
  95  }
  96  
  97  // GetNameOk returns a tuple with the Name field value if set, nil otherwise
  98  // and a boolean to check if the value has been set.
  99  func (o *Zone) GetNameOk() (*string, bool) {
 100  	if o == nil || IsNil(o.Name) {
 101  		return nil, false
 102  	}
 103  	return o.Name, true
 104  }
 105  
 106  // HasName returns a boolean if a field has been set.
 107  func (o *Zone) HasName() bool {
 108  	if o != nil && !IsNil(o.Name) {
 109  		return true
 110  	}
 111  
 112  	return false
 113  }
 114  
 115  // SetName gets a reference to the given string and assigns it to the Name field.
 116  func (o *Zone) SetName(v string) {
 117  	o.Name = &v
 118  }
 119  
 120  // GetDomain returns the Domain field value if set, zero value otherwise.
 121  func (o *Zone) GetDomain() string {
 122  	if o == nil || IsNil(o.Domain) {
 123  		var ret string
 124  		return ret
 125  	}
 126  	return *o.Domain
 127  }
 128  
 129  // GetDomainOk returns a tuple with the Domain field value if set, nil otherwise
 130  // and a boolean to check if the value has been set.
 131  func (o *Zone) GetDomainOk() (*string, bool) {
 132  	if o == nil || IsNil(o.Domain) {
 133  		return nil, false
 134  	}
 135  	return o.Domain, true
 136  }
 137  
 138  // HasDomain returns a boolean if a field has been set.
 139  func (o *Zone) HasDomain() bool {
 140  	if o != nil && !IsNil(o.Domain) {
 141  		return true
 142  	}
 143  
 144  	return false
 145  }
 146  
 147  // SetDomain gets a reference to the given string and assigns it to the Domain field.
 148  func (o *Zone) SetDomain(v string) {
 149  	o.Domain = &v
 150  }
 151  
 152  // GetIsActive returns the IsActive field value if set, zero value otherwise.
 153  func (o *Zone) GetIsActive() bool {
 154  	if o == nil || IsNil(o.IsActive) {
 155  		var ret bool
 156  		return ret
 157  	}
 158  	return *o.IsActive
 159  }
 160  
 161  // GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise
 162  // and a boolean to check if the value has been set.
 163  func (o *Zone) GetIsActiveOk() (*bool, bool) {
 164  	if o == nil || IsNil(o.IsActive) {
 165  		return nil, false
 166  	}
 167  	return o.IsActive, true
 168  }
 169  
 170  // HasIsActive returns a boolean if a field has been set.
 171  func (o *Zone) HasIsActive() bool {
 172  	if o != nil && !IsNil(o.IsActive) {
 173  		return true
 174  	}
 175  
 176  	return false
 177  }
 178  
 179  // SetIsActive gets a reference to the given bool and assigns it to the IsActive field.
 180  func (o *Zone) SetIsActive(v bool) {
 181  	o.IsActive = &v
 182  }
 183  
 184  // GetRetry returns the Retry field value if set, zero value otherwise (both if not set or set to explicit null).
 185  func (o *Zone) GetRetry() int32 {
 186  	if o == nil || IsNil(o.Retry.Get()) {
 187  		var ret int32
 188  		return ret
 189  	}
 190  	return *o.Retry.Get()
 191  }
 192  
 193  // GetRetryOk returns a tuple with the Retry field value if set, nil otherwise
 194  // and a boolean to check if the value has been set.
 195  // NOTE: If the value is an explicit nil, `nil, true` will be returned
 196  func (o *Zone) GetRetryOk() (*int32, bool) {
 197  	if o == nil {
 198  		return nil, false
 199  	}
 200  	return o.Retry.Get(), o.Retry.IsSet()
 201  }
 202  
 203  // HasRetry returns a boolean if a field has been set.
 204  func (o *Zone) HasRetry() bool {
 205  	if o != nil && o.Retry.IsSet() {
 206  		return true
 207  	}
 208  
 209  	return false
 210  }
 211  
 212  // SetRetry gets a reference to the given NullableInt32 and assigns it to the Retry field.
 213  func (o *Zone) SetRetry(v int32) {
 214  	o.Retry.Set(&v)
 215  }
 216  // SetRetryNil sets the value for Retry to be an explicit nil
 217  func (o *Zone) SetRetryNil() {
 218  	o.Retry.Set(nil)
 219  }
 220  
 221  // UnsetRetry ensures that no value is present for Retry, not even an explicit nil
 222  func (o *Zone) UnsetRetry() {
 223  	o.Retry.Unset()
 224  }
 225  
 226  // GetNxTtl returns the NxTtl field value if set, zero value otherwise (both if not set or set to explicit null).
 227  func (o *Zone) GetNxTtl() int32 {
 228  	if o == nil || IsNil(o.NxTtl.Get()) {
 229  		var ret int32
 230  		return ret
 231  	}
 232  	return *o.NxTtl.Get()
 233  }
 234  
 235  // GetNxTtlOk returns a tuple with the NxTtl field value if set, nil otherwise
 236  // and a boolean to check if the value has been set.
 237  // NOTE: If the value is an explicit nil, `nil, true` will be returned
 238  func (o *Zone) GetNxTtlOk() (*int32, bool) {
 239  	if o == nil {
 240  		return nil, false
 241  	}
 242  	return o.NxTtl.Get(), o.NxTtl.IsSet()
 243  }
 244  
 245  // HasNxTtl returns a boolean if a field has been set.
 246  func (o *Zone) HasNxTtl() bool {
 247  	if o != nil && o.NxTtl.IsSet() {
 248  		return true
 249  	}
 250  
 251  	return false
 252  }
 253  
 254  // SetNxTtl gets a reference to the given NullableInt32 and assigns it to the NxTtl field.
 255  func (o *Zone) SetNxTtl(v int32) {
 256  	o.NxTtl.Set(&v)
 257  }
 258  // SetNxTtlNil sets the value for NxTtl to be an explicit nil
 259  func (o *Zone) SetNxTtlNil() {
 260  	o.NxTtl.Set(nil)
 261  }
 262  
 263  // UnsetNxTtl ensures that no value is present for NxTtl, not even an explicit nil
 264  func (o *Zone) UnsetNxTtl() {
 265  	o.NxTtl.Unset()
 266  }
 267  
 268  // GetSoaTtl returns the SoaTtl field value if set, zero value otherwise (both if not set or set to explicit null).
 269  func (o *Zone) GetSoaTtl() int32 {
 270  	if o == nil || IsNil(o.SoaTtl.Get()) {
 271  		var ret int32
 272  		return ret
 273  	}
 274  	return *o.SoaTtl.Get()
 275  }
 276  
 277  // GetSoaTtlOk returns a tuple with the SoaTtl field value if set, nil otherwise
 278  // and a boolean to check if the value has been set.
 279  // NOTE: If the value is an explicit nil, `nil, true` will be returned
 280  func (o *Zone) GetSoaTtlOk() (*int32, bool) {
 281  	if o == nil {
 282  		return nil, false
 283  	}
 284  	return o.SoaTtl.Get(), o.SoaTtl.IsSet()
 285  }
 286  
 287  // HasSoaTtl returns a boolean if a field has been set.
 288  func (o *Zone) HasSoaTtl() bool {
 289  	if o != nil && o.SoaTtl.IsSet() {
 290  		return true
 291  	}
 292  
 293  	return false
 294  }
 295  
 296  // SetSoaTtl gets a reference to the given NullableInt32 and assigns it to the SoaTtl field.
 297  func (o *Zone) SetSoaTtl(v int32) {
 298  	o.SoaTtl.Set(&v)
 299  }
 300  // SetSoaTtlNil sets the value for SoaTtl to be an explicit nil
 301  func (o *Zone) SetSoaTtlNil() {
 302  	o.SoaTtl.Set(nil)
 303  }
 304  
 305  // UnsetSoaTtl ensures that no value is present for SoaTtl, not even an explicit nil
 306  func (o *Zone) UnsetSoaTtl() {
 307  	o.SoaTtl.Unset()
 308  }
 309  
 310  // GetRefresh returns the Refresh field value if set, zero value otherwise (both if not set or set to explicit null).
 311  func (o *Zone) GetRefresh() int32 {
 312  	if o == nil || IsNil(o.Refresh.Get()) {
 313  		var ret int32
 314  		return ret
 315  	}
 316  	return *o.Refresh.Get()
 317  }
 318  
 319  // GetRefreshOk returns a tuple with the Refresh field value if set, nil otherwise
 320  // and a boolean to check if the value has been set.
 321  // NOTE: If the value is an explicit nil, `nil, true` will be returned
 322  func (o *Zone) GetRefreshOk() (*int32, bool) {
 323  	if o == nil {
 324  		return nil, false
 325  	}
 326  	return o.Refresh.Get(), o.Refresh.IsSet()
 327  }
 328  
 329  // HasRefresh returns a boolean if a field has been set.
 330  func (o *Zone) HasRefresh() bool {
 331  	if o != nil && o.Refresh.IsSet() {
 332  		return true
 333  	}
 334  
 335  	return false
 336  }
 337  
 338  // SetRefresh gets a reference to the given NullableInt32 and assigns it to the Refresh field.
 339  func (o *Zone) SetRefresh(v int32) {
 340  	o.Refresh.Set(&v)
 341  }
 342  // SetRefreshNil sets the value for Refresh to be an explicit nil
 343  func (o *Zone) SetRefreshNil() {
 344  	o.Refresh.Set(nil)
 345  }
 346  
 347  // UnsetRefresh ensures that no value is present for Refresh, not even an explicit nil
 348  func (o *Zone) UnsetRefresh() {
 349  	o.Refresh.Unset()
 350  }
 351  
 352  // GetExpiry returns the Expiry field value if set, zero value otherwise (both if not set or set to explicit null).
 353  func (o *Zone) GetExpiry() int32 {
 354  	if o == nil || IsNil(o.Expiry.Get()) {
 355  		var ret int32
 356  		return ret
 357  	}
 358  	return *o.Expiry.Get()
 359  }
 360  
 361  // GetExpiryOk returns a tuple with the Expiry field value if set, nil otherwise
 362  // and a boolean to check if the value has been set.
 363  // NOTE: If the value is an explicit nil, `nil, true` will be returned
 364  func (o *Zone) GetExpiryOk() (*int32, bool) {
 365  	if o == nil {
 366  		return nil, false
 367  	}
 368  	return o.Expiry.Get(), o.Expiry.IsSet()
 369  }
 370  
 371  // HasExpiry returns a boolean if a field has been set.
 372  func (o *Zone) HasExpiry() bool {
 373  	if o != nil && o.Expiry.IsSet() {
 374  		return true
 375  	}
 376  
 377  	return false
 378  }
 379  
 380  // SetExpiry gets a reference to the given NullableInt32 and assigns it to the Expiry field.
 381  func (o *Zone) SetExpiry(v int32) {
 382  	o.Expiry.Set(&v)
 383  }
 384  // SetExpiryNil sets the value for Expiry to be an explicit nil
 385  func (o *Zone) SetExpiryNil() {
 386  	o.Expiry.Set(nil)
 387  }
 388  
 389  // UnsetExpiry ensures that no value is present for Expiry, not even an explicit nil
 390  func (o *Zone) UnsetExpiry() {
 391  	o.Expiry.Unset()
 392  }
 393  
 394  // GetNameservers returns the Nameservers field value if set, zero value otherwise (both if not set or set to explicit null).
 395  func (o *Zone) GetNameservers() []string {
 396  	if o == nil {
 397  		var ret []string
 398  		return ret
 399  	}
 400  	return o.Nameservers
 401  }
 402  
 403  // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise
 404  // and a boolean to check if the value has been set.
 405  // NOTE: If the value is an explicit nil, `nil, true` will be returned
 406  func (o *Zone) GetNameserversOk() ([]string, bool) {
 407  	if o == nil || IsNil(o.Nameservers) {
 408  		return nil, false
 409  	}
 410  	return o.Nameservers, true
 411  }
 412  
 413  // HasNameservers returns a boolean if a field has been set.
 414  func (o *Zone) HasNameservers() bool {
 415  	if o != nil && IsNil(o.Nameservers) {
 416  		return true
 417  	}
 418  
 419  	return false
 420  }
 421  
 422  // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field.
 423  func (o *Zone) SetNameservers(v []string) {
 424  	o.Nameservers = v
 425  }
 426  
 427  func (o Zone) MarshalJSON() ([]byte, error) {
 428  	toSerialize,err := o.ToMap()
 429  	if err != nil {
 430  		return []byte{}, err
 431  	}
 432  	return json.Marshal(toSerialize)
 433  }
 434  
 435  func (o Zone) ToMap() (map[string]interface{}, error) {
 436  	toSerialize := map[string]interface{}{}
 437  	if !IsNil(o.Id) {
 438  		toSerialize["id"] = o.Id
 439  	}
 440  	if !IsNil(o.Name) {
 441  		toSerialize["name"] = o.Name
 442  	}
 443  	if !IsNil(o.Domain) {
 444  		toSerialize["domain"] = o.Domain
 445  	}
 446  	if !IsNil(o.IsActive) {
 447  		toSerialize["is_active"] = o.IsActive
 448  	}
 449  	if o.Retry.IsSet() {
 450  		toSerialize["retry"] = o.Retry.Get()
 451  	}
 452  	if o.NxTtl.IsSet() {
 453  		toSerialize["nx_ttl"] = o.NxTtl.Get()
 454  	}
 455  	if o.SoaTtl.IsSet() {
 456  		toSerialize["soa_ttl"] = o.SoaTtl.Get()
 457  	}
 458  	if o.Refresh.IsSet() {
 459  		toSerialize["refresh"] = o.Refresh.Get()
 460  	}
 461  	if o.Expiry.IsSet() {
 462  		toSerialize["expiry"] = o.Expiry.Get()
 463  	}
 464  	if o.Nameservers != nil {
 465  		toSerialize["nameservers"] = o.Nameservers
 466  	}
 467  	return toSerialize, nil
 468  }
 469  
 470  type NullableZone struct {
 471  	value *Zone
 472  	isSet bool
 473  }
 474  
 475  func (v NullableZone) Get() *Zone {
 476  	return v.value
 477  }
 478  
 479  func (v *NullableZone) Set(val *Zone) {
 480  	v.value = val
 481  	v.isSet = true
 482  }
 483  
 484  func (v NullableZone) IsSet() bool {
 485  	return v.isSet
 486  }
 487  
 488  func (v *NullableZone) Unset() {
 489  	v.value = nil
 490  	v.isSet = false
 491  }
 492  
 493  func NewNullableZone(val *Zone) *NullableZone {
 494  	return &NullableZone{value: val, isSet: true}
 495  }
 496  
 497  func (v NullableZone) MarshalJSON() ([]byte, error) {
 498  	return json.Marshal(v.value)
 499  }
 500  
 501  func (v *NullableZone) UnmarshalJSON(src []byte) error {
 502  	v.isSet = true
 503  	return json.Unmarshal(src, &v.value)
 504  }
 505  
 506  
 507