mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
339 lines
9.3 KiB
Go
339 lines
9.3 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 BillingGatewayAuthorization type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BillingGatewayAuthorization{}
|
|
|
|
// BillingGatewayAuthorization struct for BillingGatewayAuthorization
|
|
type BillingGatewayAuthorization struct {
|
|
From *string `json:"from,omitempty"`
|
|
Nonce *string `json:"nonce,omitempty"`
|
|
To *string `json:"to,omitempty"`
|
|
ValidAfter *string `json:"validAfter,omitempty"`
|
|
ValidBefore *string `json:"validBefore,omitempty"`
|
|
Value *string `json:"value,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BillingGatewayAuthorization BillingGatewayAuthorization
|
|
|
|
// NewBillingGatewayAuthorization instantiates a new BillingGatewayAuthorization 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 NewBillingGatewayAuthorization() *BillingGatewayAuthorization {
|
|
this := BillingGatewayAuthorization{}
|
|
return &this
|
|
}
|
|
|
|
// NewBillingGatewayAuthorizationWithDefaults instantiates a new BillingGatewayAuthorization 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 NewBillingGatewayAuthorizationWithDefaults() *BillingGatewayAuthorization {
|
|
this := BillingGatewayAuthorization{}
|
|
return &this
|
|
}
|
|
|
|
// GetFrom returns the From field value if set, zero value otherwise.
|
|
func (o *BillingGatewayAuthorization) GetFrom() string {
|
|
if o == nil || IsNil(o.From) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.From
|
|
}
|
|
|
|
// GetFromOk returns a tuple with the From field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingGatewayAuthorization) GetFromOk() (*string, bool) {
|
|
if o == nil || IsNil(o.From) {
|
|
return nil, false
|
|
}
|
|
return o.From, true
|
|
}
|
|
|
|
// HasFrom returns a boolean if a field has been set.
|
|
func (o *BillingGatewayAuthorization) HasFrom() bool {
|
|
if o != nil && !IsNil(o.From) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFrom gets a reference to the given string and assigns it to the From field.
|
|
func (o *BillingGatewayAuthorization) SetFrom(v string) {
|
|
o.From = &v
|
|
}
|
|
|
|
// GetNonce returns the Nonce field value if set, zero value otherwise.
|
|
func (o *BillingGatewayAuthorization) GetNonce() string {
|
|
if o == nil || IsNil(o.Nonce) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Nonce
|
|
}
|
|
|
|
// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingGatewayAuthorization) GetNonceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Nonce) {
|
|
return nil, false
|
|
}
|
|
return o.Nonce, true
|
|
}
|
|
|
|
// HasNonce returns a boolean if a field has been set.
|
|
func (o *BillingGatewayAuthorization) HasNonce() bool {
|
|
if o != nil && !IsNil(o.Nonce) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNonce gets a reference to the given string and assigns it to the Nonce field.
|
|
func (o *BillingGatewayAuthorization) SetNonce(v string) {
|
|
o.Nonce = &v
|
|
}
|
|
|
|
// GetTo returns the To field value if set, zero value otherwise.
|
|
func (o *BillingGatewayAuthorization) GetTo() string {
|
|
if o == nil || IsNil(o.To) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.To
|
|
}
|
|
|
|
// GetToOk returns a tuple with the To field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingGatewayAuthorization) GetToOk() (*string, bool) {
|
|
if o == nil || IsNil(o.To) {
|
|
return nil, false
|
|
}
|
|
return o.To, true
|
|
}
|
|
|
|
// HasTo returns a boolean if a field has been set.
|
|
func (o *BillingGatewayAuthorization) HasTo() bool {
|
|
if o != nil && !IsNil(o.To) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTo gets a reference to the given string and assigns it to the To field.
|
|
func (o *BillingGatewayAuthorization) SetTo(v string) {
|
|
o.To = &v
|
|
}
|
|
|
|
// GetValidAfter returns the ValidAfter field value if set, zero value otherwise.
|
|
func (o *BillingGatewayAuthorization) GetValidAfter() string {
|
|
if o == nil || IsNil(o.ValidAfter) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ValidAfter
|
|
}
|
|
|
|
// GetValidAfterOk returns a tuple with the ValidAfter field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingGatewayAuthorization) GetValidAfterOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ValidAfter) {
|
|
return nil, false
|
|
}
|
|
return o.ValidAfter, true
|
|
}
|
|
|
|
// HasValidAfter returns a boolean if a field has been set.
|
|
func (o *BillingGatewayAuthorization) HasValidAfter() bool {
|
|
if o != nil && !IsNil(o.ValidAfter) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetValidAfter gets a reference to the given string and assigns it to the ValidAfter field.
|
|
func (o *BillingGatewayAuthorization) SetValidAfter(v string) {
|
|
o.ValidAfter = &v
|
|
}
|
|
|
|
// GetValidBefore returns the ValidBefore field value if set, zero value otherwise.
|
|
func (o *BillingGatewayAuthorization) GetValidBefore() string {
|
|
if o == nil || IsNil(o.ValidBefore) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ValidBefore
|
|
}
|
|
|
|
// GetValidBeforeOk returns a tuple with the ValidBefore field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingGatewayAuthorization) GetValidBeforeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ValidBefore) {
|
|
return nil, false
|
|
}
|
|
return o.ValidBefore, true
|
|
}
|
|
|
|
// HasValidBefore returns a boolean if a field has been set.
|
|
func (o *BillingGatewayAuthorization) HasValidBefore() bool {
|
|
if o != nil && !IsNil(o.ValidBefore) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetValidBefore gets a reference to the given string and assigns it to the ValidBefore field.
|
|
func (o *BillingGatewayAuthorization) SetValidBefore(v string) {
|
|
o.ValidBefore = &v
|
|
}
|
|
|
|
// GetValue returns the Value field value if set, zero value otherwise.
|
|
func (o *BillingGatewayAuthorization) GetValue() string {
|
|
if o == nil || IsNil(o.Value) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Value
|
|
}
|
|
|
|
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingGatewayAuthorization) GetValueOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Value) {
|
|
return nil, false
|
|
}
|
|
return o.Value, true
|
|
}
|
|
|
|
// HasValue returns a boolean if a field has been set.
|
|
func (o *BillingGatewayAuthorization) HasValue() bool {
|
|
if o != nil && !IsNil(o.Value) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetValue gets a reference to the given string and assigns it to the Value field.
|
|
func (o *BillingGatewayAuthorization) SetValue(v string) {
|
|
o.Value = &v
|
|
}
|
|
|
|
func (o BillingGatewayAuthorization) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BillingGatewayAuthorization) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.From) {
|
|
toSerialize["from"] = o.From
|
|
}
|
|
if !IsNil(o.Nonce) {
|
|
toSerialize["nonce"] = o.Nonce
|
|
}
|
|
if !IsNil(o.To) {
|
|
toSerialize["to"] = o.To
|
|
}
|
|
if !IsNil(o.ValidAfter) {
|
|
toSerialize["validAfter"] = o.ValidAfter
|
|
}
|
|
if !IsNil(o.ValidBefore) {
|
|
toSerialize["validBefore"] = o.ValidBefore
|
|
}
|
|
if !IsNil(o.Value) {
|
|
toSerialize["value"] = o.Value
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BillingGatewayAuthorization) UnmarshalJSON(data []byte) (err error) {
|
|
varBillingGatewayAuthorization := _BillingGatewayAuthorization{}
|
|
|
|
err = json.Unmarshal(data, &varBillingGatewayAuthorization)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BillingGatewayAuthorization(varBillingGatewayAuthorization)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "from")
|
|
delete(additionalProperties, "nonce")
|
|
delete(additionalProperties, "to")
|
|
delete(additionalProperties, "validAfter")
|
|
delete(additionalProperties, "validBefore")
|
|
delete(additionalProperties, "value")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBillingGatewayAuthorization struct {
|
|
value *BillingGatewayAuthorization
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBillingGatewayAuthorization) Get() *BillingGatewayAuthorization {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBillingGatewayAuthorization) Set(val *BillingGatewayAuthorization) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBillingGatewayAuthorization) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBillingGatewayAuthorization) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBillingGatewayAuthorization(val *BillingGatewayAuthorization) *NullableBillingGatewayAuthorization {
|
|
return &NullableBillingGatewayAuthorization{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBillingGatewayAuthorization) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBillingGatewayAuthorization) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|