Files
sdk/model_billing_signed_payment.go

269 lines
7.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 BillingSignedPayment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingSignedPayment{}
// BillingSignedPayment struct for BillingSignedPayment
type BillingSignedPayment struct {
// Authorization is the EIP-3009 TransferWithAuthorization as signed: every field a string, addresses and nonce 0x hex, value in USDC base units.
Authorization *BillingGatewayAuthorization `json:"authorization,omitempty"`
// Network is the CAIP-2 network the payment was signed for, one of the terms' accepts, e.g. \"eip155:8453\".
Network *string `json:"network,omitempty"`
// Salt is the salt the terms issued with the nonce.
Salt *string `json:"salt,omitempty"`
// Signature is the 65-byte EIP-712 signature, 0x hex.
Signature *string `json:"signature,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingSignedPayment BillingSignedPayment
// NewBillingSignedPayment instantiates a new BillingSignedPayment 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 NewBillingSignedPayment() *BillingSignedPayment {
this := BillingSignedPayment{}
return &this
}
// NewBillingSignedPaymentWithDefaults instantiates a new BillingSignedPayment 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 NewBillingSignedPaymentWithDefaults() *BillingSignedPayment {
this := BillingSignedPayment{}
return &this
}
// GetAuthorization returns the Authorization field value if set, zero value otherwise.
func (o *BillingSignedPayment) GetAuthorization() BillingGatewayAuthorization {
if o == nil || IsNil(o.Authorization) {
var ret BillingGatewayAuthorization
return ret
}
return *o.Authorization
}
// GetAuthorizationOk returns a tuple with the Authorization field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSignedPayment) GetAuthorizationOk() (*BillingGatewayAuthorization, bool) {
if o == nil || IsNil(o.Authorization) {
return nil, false
}
return o.Authorization, true
}
// HasAuthorization returns a boolean if a field has been set.
func (o *BillingSignedPayment) HasAuthorization() bool {
if o != nil && !IsNil(o.Authorization) {
return true
}
return false
}
// SetAuthorization gets a reference to the given BillingGatewayAuthorization and assigns it to the Authorization field.
func (o *BillingSignedPayment) SetAuthorization(v BillingGatewayAuthorization) {
o.Authorization = &v
}
// GetNetwork returns the Network field value if set, zero value otherwise.
func (o *BillingSignedPayment) GetNetwork() string {
if o == nil || IsNil(o.Network) {
var ret string
return ret
}
return *o.Network
}
// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSignedPayment) GetNetworkOk() (*string, bool) {
if o == nil || IsNil(o.Network) {
return nil, false
}
return o.Network, true
}
// HasNetwork returns a boolean if a field has been set.
func (o *BillingSignedPayment) HasNetwork() bool {
if o != nil && !IsNil(o.Network) {
return true
}
return false
}
// SetNetwork gets a reference to the given string and assigns it to the Network field.
func (o *BillingSignedPayment) SetNetwork(v string) {
o.Network = &v
}
// GetSalt returns the Salt field value if set, zero value otherwise.
func (o *BillingSignedPayment) GetSalt() string {
if o == nil || IsNil(o.Salt) {
var ret string
return ret
}
return *o.Salt
}
// GetSaltOk returns a tuple with the Salt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSignedPayment) GetSaltOk() (*string, bool) {
if o == nil || IsNil(o.Salt) {
return nil, false
}
return o.Salt, true
}
// HasSalt returns a boolean if a field has been set.
func (o *BillingSignedPayment) HasSalt() bool {
if o != nil && !IsNil(o.Salt) {
return true
}
return false
}
// SetSalt gets a reference to the given string and assigns it to the Salt field.
func (o *BillingSignedPayment) SetSalt(v string) {
o.Salt = &v
}
// GetSignature returns the Signature field value if set, zero value otherwise.
func (o *BillingSignedPayment) GetSignature() string {
if o == nil || IsNil(o.Signature) {
var ret string
return ret
}
return *o.Signature
}
// GetSignatureOk returns a tuple with the Signature field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingSignedPayment) GetSignatureOk() (*string, bool) {
if o == nil || IsNil(o.Signature) {
return nil, false
}
return o.Signature, true
}
// HasSignature returns a boolean if a field has been set.
func (o *BillingSignedPayment) HasSignature() bool {
if o != nil && !IsNil(o.Signature) {
return true
}
return false
}
// SetSignature gets a reference to the given string and assigns it to the Signature field.
func (o *BillingSignedPayment) SetSignature(v string) {
o.Signature = &v
}
func (o BillingSignedPayment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingSignedPayment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Authorization) {
toSerialize["authorization"] = o.Authorization
}
if !IsNil(o.Network) {
toSerialize["network"] = o.Network
}
if !IsNil(o.Salt) {
toSerialize["salt"] = o.Salt
}
if !IsNil(o.Signature) {
toSerialize["signature"] = o.Signature
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingSignedPayment) UnmarshalJSON(data []byte) (err error) {
varBillingSignedPayment := _BillingSignedPayment{}
err = json.Unmarshal(data, &varBillingSignedPayment)
if err != nil {
return err
}
*o = BillingSignedPayment(varBillingSignedPayment)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "authorization")
delete(additionalProperties, "network")
delete(additionalProperties, "salt")
delete(additionalProperties, "signature")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingSignedPayment struct {
value *BillingSignedPayment
isSet bool
}
func (v NullableBillingSignedPayment) Get() *BillingSignedPayment {
return v.value
}
func (v *NullableBillingSignedPayment) Set(val *BillingSignedPayment) {
v.value = val
v.isSet = true
}
func (v NullableBillingSignedPayment) IsSet() bool {
return v.isSet
}
func (v *NullableBillingSignedPayment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingSignedPayment(val *BillingSignedPayment) *NullableBillingSignedPayment {
return &NullableBillingSignedPayment{value: val, isSet: true}
}
func (v NullableBillingSignedPayment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingSignedPayment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}