Files
sdk/model_auto_run_resp.go

231 lines
5.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 AutoRunResp type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AutoRunResp{}
// AutoRunResp struct for AutoRunResp
type AutoRunResp struct {
// Error is the provider-level failure message when not ok.
Error *string `json:"error,omitempty"`
// Ok reports whether the action ran to completion.
Ok *bool `json:"ok,omitempty"`
Output interface{} `json:"output,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AutoRunResp AutoRunResp
// NewAutoRunResp instantiates a new AutoRunResp 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 NewAutoRunResp() *AutoRunResp {
this := AutoRunResp{}
return &this
}
// NewAutoRunRespWithDefaults instantiates a new AutoRunResp 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 NewAutoRunRespWithDefaults() *AutoRunResp {
this := AutoRunResp{}
return &this
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *AutoRunResp) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoRunResp) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *AutoRunResp) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *AutoRunResp) SetError(v string) {
o.Error = &v
}
// GetOk returns the Ok field value if set, zero value otherwise.
func (o *AutoRunResp) GetOk() bool {
if o == nil || IsNil(o.Ok) {
var ret bool
return ret
}
return *o.Ok
}
// GetOkOk returns a tuple with the Ok field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoRunResp) GetOkOk() (*bool, bool) {
if o == nil || IsNil(o.Ok) {
return nil, false
}
return o.Ok, true
}
// HasOk returns a boolean if a field has been set.
func (o *AutoRunResp) HasOk() bool {
if o != nil && !IsNil(o.Ok) {
return true
}
return false
}
// SetOk gets a reference to the given bool and assigns it to the Ok field.
func (o *AutoRunResp) SetOk(v bool) {
o.Ok = &v
}
// GetOutput returns the Output field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AutoRunResp) GetOutput() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Output
}
// GetOutputOk returns a tuple with the Output field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AutoRunResp) GetOutputOk() (*interface{}, bool) {
if o == nil || IsNil(o.Output) {
return nil, false
}
return &o.Output, true
}
// HasOutput returns a boolean if a field has been set.
func (o *AutoRunResp) HasOutput() bool {
if o != nil && !IsNil(o.Output) {
return true
}
return false
}
// SetOutput gets a reference to the given interface{} and assigns it to the Output field.
func (o *AutoRunResp) SetOutput(v interface{}) {
o.Output = v
}
func (o AutoRunResp) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AutoRunResp) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.Ok) {
toSerialize["ok"] = o.Ok
}
if o.Output != nil {
toSerialize["output"] = o.Output
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AutoRunResp) UnmarshalJSON(data []byte) (err error) {
varAutoRunResp := _AutoRunResp{}
err = json.Unmarshal(data, &varAutoRunResp)
if err != nil {
return err
}
*o = AutoRunResp(varAutoRunResp)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "error")
delete(additionalProperties, "ok")
delete(additionalProperties, "output")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAutoRunResp struct {
value *AutoRunResp
isSet bool
}
func (v NullableAutoRunResp) Get() *AutoRunResp {
return v.value
}
func (v *NullableAutoRunResp) Set(val *AutoRunResp) {
v.value = val
v.isSet = true
}
func (v NullableAutoRunResp) IsSet() bool {
return v.isSet
}
func (v *NullableAutoRunResp) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAutoRunResp(val *AutoRunResp) *NullableAutoRunResp {
return &NullableAutoRunResp{value: val, isSet: true}
}
func (v NullableAutoRunResp) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAutoRunResp) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}