mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.8 KiB
Go
269 lines
6.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 PrincipalMethod type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PrincipalMethod{}
|
|
|
|
// PrincipalMethod struct for PrincipalMethod
|
|
type PrincipalMethod struct {
|
|
// Net is what the payee receives, U.S. dollars.
|
|
Net *string `json:"net,omitempty"`
|
|
// Rail is the rail: ledger or chain.
|
|
Rail *string `json:"rail,omitempty"`
|
|
// Rule is why.
|
|
Rule *PrincipalRule `json:"rule,omitempty"`
|
|
// Withheld is what the payer keeps back and deposits itself, U.S. dollars.
|
|
Withheld *string `json:"withheld,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PrincipalMethod PrincipalMethod
|
|
|
|
// NewPrincipalMethod instantiates a new PrincipalMethod 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 NewPrincipalMethod() *PrincipalMethod {
|
|
this := PrincipalMethod{}
|
|
return &this
|
|
}
|
|
|
|
// NewPrincipalMethodWithDefaults instantiates a new PrincipalMethod 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 NewPrincipalMethodWithDefaults() *PrincipalMethod {
|
|
this := PrincipalMethod{}
|
|
return &this
|
|
}
|
|
|
|
// GetNet returns the Net field value if set, zero value otherwise.
|
|
func (o *PrincipalMethod) GetNet() string {
|
|
if o == nil || IsNil(o.Net) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Net
|
|
}
|
|
|
|
// GetNetOk returns a tuple with the Net field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalMethod) GetNetOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Net) {
|
|
return nil, false
|
|
}
|
|
return o.Net, true
|
|
}
|
|
|
|
// HasNet returns a boolean if a field has been set.
|
|
func (o *PrincipalMethod) HasNet() bool {
|
|
if o != nil && !IsNil(o.Net) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNet gets a reference to the given string and assigns it to the Net field.
|
|
func (o *PrincipalMethod) SetNet(v string) {
|
|
o.Net = &v
|
|
}
|
|
|
|
// GetRail returns the Rail field value if set, zero value otherwise.
|
|
func (o *PrincipalMethod) GetRail() string {
|
|
if o == nil || IsNil(o.Rail) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Rail
|
|
}
|
|
|
|
// GetRailOk returns a tuple with the Rail field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalMethod) GetRailOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Rail) {
|
|
return nil, false
|
|
}
|
|
return o.Rail, true
|
|
}
|
|
|
|
// HasRail returns a boolean if a field has been set.
|
|
func (o *PrincipalMethod) HasRail() bool {
|
|
if o != nil && !IsNil(o.Rail) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRail gets a reference to the given string and assigns it to the Rail field.
|
|
func (o *PrincipalMethod) SetRail(v string) {
|
|
o.Rail = &v
|
|
}
|
|
|
|
// GetRule returns the Rule field value if set, zero value otherwise.
|
|
func (o *PrincipalMethod) GetRule() PrincipalRule {
|
|
if o == nil || IsNil(o.Rule) {
|
|
var ret PrincipalRule
|
|
return ret
|
|
}
|
|
return *o.Rule
|
|
}
|
|
|
|
// GetRuleOk returns a tuple with the Rule field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalMethod) GetRuleOk() (*PrincipalRule, bool) {
|
|
if o == nil || IsNil(o.Rule) {
|
|
return nil, false
|
|
}
|
|
return o.Rule, true
|
|
}
|
|
|
|
// HasRule returns a boolean if a field has been set.
|
|
func (o *PrincipalMethod) HasRule() bool {
|
|
if o != nil && !IsNil(o.Rule) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRule gets a reference to the given PrincipalRule and assigns it to the Rule field.
|
|
func (o *PrincipalMethod) SetRule(v PrincipalRule) {
|
|
o.Rule = &v
|
|
}
|
|
|
|
// GetWithheld returns the Withheld field value if set, zero value otherwise.
|
|
func (o *PrincipalMethod) GetWithheld() string {
|
|
if o == nil || IsNil(o.Withheld) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Withheld
|
|
}
|
|
|
|
// GetWithheldOk returns a tuple with the Withheld field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalMethod) GetWithheldOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Withheld) {
|
|
return nil, false
|
|
}
|
|
return o.Withheld, true
|
|
}
|
|
|
|
// HasWithheld returns a boolean if a field has been set.
|
|
func (o *PrincipalMethod) HasWithheld() bool {
|
|
if o != nil && !IsNil(o.Withheld) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWithheld gets a reference to the given string and assigns it to the Withheld field.
|
|
func (o *PrincipalMethod) SetWithheld(v string) {
|
|
o.Withheld = &v
|
|
}
|
|
|
|
func (o PrincipalMethod) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PrincipalMethod) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Net) {
|
|
toSerialize["net"] = o.Net
|
|
}
|
|
if !IsNil(o.Rail) {
|
|
toSerialize["rail"] = o.Rail
|
|
}
|
|
if !IsNil(o.Rule) {
|
|
toSerialize["rule"] = o.Rule
|
|
}
|
|
if !IsNil(o.Withheld) {
|
|
toSerialize["withheld"] = o.Withheld
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PrincipalMethod) UnmarshalJSON(data []byte) (err error) {
|
|
varPrincipalMethod := _PrincipalMethod{}
|
|
|
|
err = json.Unmarshal(data, &varPrincipalMethod)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PrincipalMethod(varPrincipalMethod)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "net")
|
|
delete(additionalProperties, "rail")
|
|
delete(additionalProperties, "rule")
|
|
delete(additionalProperties, "withheld")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePrincipalMethod struct {
|
|
value *PrincipalMethod
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePrincipalMethod) Get() *PrincipalMethod {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePrincipalMethod) Set(val *PrincipalMethod) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePrincipalMethod) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePrincipalMethod) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePrincipalMethod(val *PrincipalMethod) *NullablePrincipalMethod {
|
|
return &NullablePrincipalMethod{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePrincipalMethod) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePrincipalMethod) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|