Files
sdk/model_domain_offer.go

383 lines
9.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 DomainOffer type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DomainOffer{}
// DomainOffer struct for DomainOffer
type DomainOffer struct {
// whether it can be bought right now
Available *bool `json:"available,omitempty"`
// the currency both prices are in
Currency *string `json:"currency,omitempty"`
// the name this quote prices
Domain *string `json:"domain,omitempty"`
// whether the registry prices it above the standard rate
Premium *bool `json:"premium,omitempty"`
// sell (first-term registration)
PriceCents *int64 `json:"priceCents,omitempty"`
// sell (renewal)
RenewalPriceCents *int64 `json:"renewalPriceCents,omitempty"`
// the top-level domain the name sits under
Tld *string `json:"tld,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DomainOffer DomainOffer
// NewDomainOffer instantiates a new DomainOffer 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 NewDomainOffer() *DomainOffer {
this := DomainOffer{}
return &this
}
// NewDomainOfferWithDefaults instantiates a new DomainOffer 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 NewDomainOfferWithDefaults() *DomainOffer {
this := DomainOffer{}
return &this
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *DomainOffer) GetAvailable() bool {
if o == nil || IsNil(o.Available) {
var ret bool
return ret
}
return *o.Available
}
// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DomainOffer) GetAvailableOk() (*bool, bool) {
if o == nil || IsNil(o.Available) {
return nil, false
}
return o.Available, true
}
// HasAvailable returns a boolean if a field has been set.
func (o *DomainOffer) HasAvailable() bool {
if o != nil && !IsNil(o.Available) {
return true
}
return false
}
// SetAvailable gets a reference to the given bool and assigns it to the Available field.
func (o *DomainOffer) SetAvailable(v bool) {
o.Available = &v
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *DomainOffer) GetCurrency() string {
if o == nil || IsNil(o.Currency) {
var ret string
return ret
}
return *o.Currency
}
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DomainOffer) GetCurrencyOk() (*string, bool) {
if o == nil || IsNil(o.Currency) {
return nil, false
}
return o.Currency, true
}
// HasCurrency returns a boolean if a field has been set.
func (o *DomainOffer) HasCurrency() bool {
if o != nil && !IsNil(o.Currency) {
return true
}
return false
}
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
func (o *DomainOffer) SetCurrency(v string) {
o.Currency = &v
}
// GetDomain returns the Domain field value if set, zero value otherwise.
func (o *DomainOffer) GetDomain() string {
if o == nil || IsNil(o.Domain) {
var ret string
return ret
}
return *o.Domain
}
// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DomainOffer) GetDomainOk() (*string, bool) {
if o == nil || IsNil(o.Domain) {
return nil, false
}
return o.Domain, true
}
// HasDomain returns a boolean if a field has been set.
func (o *DomainOffer) HasDomain() bool {
if o != nil && !IsNil(o.Domain) {
return true
}
return false
}
// SetDomain gets a reference to the given string and assigns it to the Domain field.
func (o *DomainOffer) SetDomain(v string) {
o.Domain = &v
}
// GetPremium returns the Premium field value if set, zero value otherwise.
func (o *DomainOffer) GetPremium() bool {
if o == nil || IsNil(o.Premium) {
var ret bool
return ret
}
return *o.Premium
}
// GetPremiumOk returns a tuple with the Premium field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DomainOffer) GetPremiumOk() (*bool, bool) {
if o == nil || IsNil(o.Premium) {
return nil, false
}
return o.Premium, true
}
// HasPremium returns a boolean if a field has been set.
func (o *DomainOffer) HasPremium() bool {
if o != nil && !IsNil(o.Premium) {
return true
}
return false
}
// SetPremium gets a reference to the given bool and assigns it to the Premium field.
func (o *DomainOffer) SetPremium(v bool) {
o.Premium = &v
}
// GetPriceCents returns the PriceCents field value if set, zero value otherwise.
func (o *DomainOffer) GetPriceCents() int64 {
if o == nil || IsNil(o.PriceCents) {
var ret int64
return ret
}
return *o.PriceCents
}
// GetPriceCentsOk returns a tuple with the PriceCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DomainOffer) GetPriceCentsOk() (*int64, bool) {
if o == nil || IsNil(o.PriceCents) {
return nil, false
}
return o.PriceCents, true
}
// HasPriceCents returns a boolean if a field has been set.
func (o *DomainOffer) HasPriceCents() bool {
if o != nil && !IsNil(o.PriceCents) {
return true
}
return false
}
// SetPriceCents gets a reference to the given int64 and assigns it to the PriceCents field.
func (o *DomainOffer) SetPriceCents(v int64) {
o.PriceCents = &v
}
// GetRenewalPriceCents returns the RenewalPriceCents field value if set, zero value otherwise.
func (o *DomainOffer) GetRenewalPriceCents() int64 {
if o == nil || IsNil(o.RenewalPriceCents) {
var ret int64
return ret
}
return *o.RenewalPriceCents
}
// GetRenewalPriceCentsOk returns a tuple with the RenewalPriceCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DomainOffer) GetRenewalPriceCentsOk() (*int64, bool) {
if o == nil || IsNil(o.RenewalPriceCents) {
return nil, false
}
return o.RenewalPriceCents, true
}
// HasRenewalPriceCents returns a boolean if a field has been set.
func (o *DomainOffer) HasRenewalPriceCents() bool {
if o != nil && !IsNil(o.RenewalPriceCents) {
return true
}
return false
}
// SetRenewalPriceCents gets a reference to the given int64 and assigns it to the RenewalPriceCents field.
func (o *DomainOffer) SetRenewalPriceCents(v int64) {
o.RenewalPriceCents = &v
}
// GetTld returns the Tld field value if set, zero value otherwise.
func (o *DomainOffer) GetTld() string {
if o == nil || IsNil(o.Tld) {
var ret string
return ret
}
return *o.Tld
}
// GetTldOk returns a tuple with the Tld field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DomainOffer) GetTldOk() (*string, bool) {
if o == nil || IsNil(o.Tld) {
return nil, false
}
return o.Tld, true
}
// HasTld returns a boolean if a field has been set.
func (o *DomainOffer) HasTld() bool {
if o != nil && !IsNil(o.Tld) {
return true
}
return false
}
// SetTld gets a reference to the given string and assigns it to the Tld field.
func (o *DomainOffer) SetTld(v string) {
o.Tld = &v
}
func (o DomainOffer) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DomainOffer) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Available) {
toSerialize["available"] = o.Available
}
if !IsNil(o.Currency) {
toSerialize["currency"] = o.Currency
}
if !IsNil(o.Domain) {
toSerialize["domain"] = o.Domain
}
if !IsNil(o.Premium) {
toSerialize["premium"] = o.Premium
}
if !IsNil(o.PriceCents) {
toSerialize["priceCents"] = o.PriceCents
}
if !IsNil(o.RenewalPriceCents) {
toSerialize["renewalPriceCents"] = o.RenewalPriceCents
}
if !IsNil(o.Tld) {
toSerialize["tld"] = o.Tld
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DomainOffer) UnmarshalJSON(data []byte) (err error) {
varDomainOffer := _DomainOffer{}
err = json.Unmarshal(data, &varDomainOffer)
if err != nil {
return err
}
*o = DomainOffer(varDomainOffer)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "available")
delete(additionalProperties, "currency")
delete(additionalProperties, "domain")
delete(additionalProperties, "premium")
delete(additionalProperties, "priceCents")
delete(additionalProperties, "renewalPriceCents")
delete(additionalProperties, "tld")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDomainOffer struct {
value *DomainOffer
isSet bool
}
func (v NullableDomainOffer) Get() *DomainOffer {
return v.value
}
func (v *NullableDomainOffer) Set(val *DomainOffer) {
v.value = val
v.isSet = true
}
func (v NullableDomainOffer) IsSet() bool {
return v.isSet
}
func (v *NullableDomainOffer) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDomainOffer(val *DomainOffer) *NullableDomainOffer {
return &NullableDomainOffer{value: val, isSet: true}
}
func (v NullableDomainOffer) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDomainOffer) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}