mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.5 KiB
Go
307 lines
7.5 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 PrincipalStep type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PrincipalStep{}
|
|
|
|
// PrincipalStep struct for PrincipalStep
|
|
type PrincipalStep struct {
|
|
// Code is the step's stable name, for a caller that branches on it.
|
|
Code *string `json:"code,omitempty"`
|
|
// Rule is why.
|
|
Rule *PrincipalRule `json:"rule,omitempty"`
|
|
// What must happen, in words.
|
|
What *string `json:"what,omitempty"`
|
|
// Where it is done, when it is done on this platform.
|
|
Where *string `json:"where,omitempty"`
|
|
// Who does it: payer, payee, or \"Hanzo platform reviewer\".
|
|
Who *string `json:"who,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PrincipalStep PrincipalStep
|
|
|
|
// NewPrincipalStep instantiates a new PrincipalStep 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 NewPrincipalStep() *PrincipalStep {
|
|
this := PrincipalStep{}
|
|
return &this
|
|
}
|
|
|
|
// NewPrincipalStepWithDefaults instantiates a new PrincipalStep 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 NewPrincipalStepWithDefaults() *PrincipalStep {
|
|
this := PrincipalStep{}
|
|
return &this
|
|
}
|
|
|
|
// GetCode returns the Code field value if set, zero value otherwise.
|
|
func (o *PrincipalStep) GetCode() string {
|
|
if o == nil || IsNil(o.Code) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Code
|
|
}
|
|
|
|
// GetCodeOk returns a tuple with the Code field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalStep) GetCodeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Code) {
|
|
return nil, false
|
|
}
|
|
return o.Code, true
|
|
}
|
|
|
|
// HasCode returns a boolean if a field has been set.
|
|
func (o *PrincipalStep) HasCode() bool {
|
|
if o != nil && !IsNil(o.Code) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCode gets a reference to the given string and assigns it to the Code field.
|
|
func (o *PrincipalStep) SetCode(v string) {
|
|
o.Code = &v
|
|
}
|
|
|
|
// GetRule returns the Rule field value if set, zero value otherwise.
|
|
func (o *PrincipalStep) 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 *PrincipalStep) 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 *PrincipalStep) 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 *PrincipalStep) SetRule(v PrincipalRule) {
|
|
o.Rule = &v
|
|
}
|
|
|
|
// GetWhat returns the What field value if set, zero value otherwise.
|
|
func (o *PrincipalStep) GetWhat() string {
|
|
if o == nil || IsNil(o.What) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.What
|
|
}
|
|
|
|
// GetWhatOk returns a tuple with the What field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalStep) GetWhatOk() (*string, bool) {
|
|
if o == nil || IsNil(o.What) {
|
|
return nil, false
|
|
}
|
|
return o.What, true
|
|
}
|
|
|
|
// HasWhat returns a boolean if a field has been set.
|
|
func (o *PrincipalStep) HasWhat() bool {
|
|
if o != nil && !IsNil(o.What) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWhat gets a reference to the given string and assigns it to the What field.
|
|
func (o *PrincipalStep) SetWhat(v string) {
|
|
o.What = &v
|
|
}
|
|
|
|
// GetWhere returns the Where field value if set, zero value otherwise.
|
|
func (o *PrincipalStep) GetWhere() string {
|
|
if o == nil || IsNil(o.Where) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Where
|
|
}
|
|
|
|
// GetWhereOk returns a tuple with the Where field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalStep) GetWhereOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Where) {
|
|
return nil, false
|
|
}
|
|
return o.Where, true
|
|
}
|
|
|
|
// HasWhere returns a boolean if a field has been set.
|
|
func (o *PrincipalStep) HasWhere() bool {
|
|
if o != nil && !IsNil(o.Where) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWhere gets a reference to the given string and assigns it to the Where field.
|
|
func (o *PrincipalStep) SetWhere(v string) {
|
|
o.Where = &v
|
|
}
|
|
|
|
// GetWho returns the Who field value if set, zero value otherwise.
|
|
func (o *PrincipalStep) GetWho() string {
|
|
if o == nil || IsNil(o.Who) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Who
|
|
}
|
|
|
|
// GetWhoOk returns a tuple with the Who field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalStep) GetWhoOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Who) {
|
|
return nil, false
|
|
}
|
|
return o.Who, true
|
|
}
|
|
|
|
// HasWho returns a boolean if a field has been set.
|
|
func (o *PrincipalStep) HasWho() bool {
|
|
if o != nil && !IsNil(o.Who) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWho gets a reference to the given string and assigns it to the Who field.
|
|
func (o *PrincipalStep) SetWho(v string) {
|
|
o.Who = &v
|
|
}
|
|
|
|
func (o PrincipalStep) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PrincipalStep) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Code) {
|
|
toSerialize["code"] = o.Code
|
|
}
|
|
if !IsNil(o.Rule) {
|
|
toSerialize["rule"] = o.Rule
|
|
}
|
|
if !IsNil(o.What) {
|
|
toSerialize["what"] = o.What
|
|
}
|
|
if !IsNil(o.Where) {
|
|
toSerialize["where"] = o.Where
|
|
}
|
|
if !IsNil(o.Who) {
|
|
toSerialize["who"] = o.Who
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PrincipalStep) UnmarshalJSON(data []byte) (err error) {
|
|
varPrincipalStep := _PrincipalStep{}
|
|
|
|
err = json.Unmarshal(data, &varPrincipalStep)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PrincipalStep(varPrincipalStep)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "code")
|
|
delete(additionalProperties, "rule")
|
|
delete(additionalProperties, "what")
|
|
delete(additionalProperties, "where")
|
|
delete(additionalProperties, "who")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePrincipalStep struct {
|
|
value *PrincipalStep
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePrincipalStep) Get() *PrincipalStep {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePrincipalStep) Set(val *PrincipalStep) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePrincipalStep) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePrincipalStep) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePrincipalStep(val *PrincipalStep) *NullablePrincipalStep {
|
|
return &NullablePrincipalStep{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePrincipalStep) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePrincipalStep) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|