mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
302 lines
7.3 KiB
Go
302 lines
7.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 Exception type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Exception{}
|
|
|
|
// Exception struct for Exception
|
|
type Exception struct {
|
|
Frames []Frame `json:"frames,omitempty"`
|
|
Handled *bool `json:"handled,omitempty"`
|
|
Message *string `json:"message,omitempty"`
|
|
Stack *string `json:"stack,omitempty"`
|
|
Type *string `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Exception Exception
|
|
|
|
// NewException instantiates a new Exception 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 NewException() *Exception {
|
|
this := Exception{}
|
|
return &this
|
|
}
|
|
|
|
// NewExceptionWithDefaults instantiates a new Exception 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 NewExceptionWithDefaults() *Exception {
|
|
this := Exception{}
|
|
return &this
|
|
}
|
|
|
|
// GetFrames returns the Frames field value if set, zero value otherwise.
|
|
func (o *Exception) GetFrames() []Frame {
|
|
if o == nil || IsNil(o.Frames) {
|
|
var ret []Frame
|
|
return ret
|
|
}
|
|
return o.Frames
|
|
}
|
|
|
|
// GetFramesOk returns a tuple with the Frames field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Exception) GetFramesOk() ([]Frame, bool) {
|
|
if o == nil || IsNil(o.Frames) {
|
|
return nil, false
|
|
}
|
|
return o.Frames, true
|
|
}
|
|
|
|
// HasFrames returns a boolean if a field has been set.
|
|
func (o *Exception) HasFrames() bool {
|
|
if o != nil && !IsNil(o.Frames) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFrames gets a reference to the given []Frame and assigns it to the Frames field.
|
|
func (o *Exception) SetFrames(v []Frame) {
|
|
o.Frames = v
|
|
}
|
|
|
|
// GetHandled returns the Handled field value if set, zero value otherwise.
|
|
func (o *Exception) GetHandled() bool {
|
|
if o == nil || IsNil(o.Handled) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Handled
|
|
}
|
|
|
|
// GetHandledOk returns a tuple with the Handled field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Exception) GetHandledOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Handled) {
|
|
return nil, false
|
|
}
|
|
return o.Handled, true
|
|
}
|
|
|
|
// HasHandled returns a boolean if a field has been set.
|
|
func (o *Exception) HasHandled() bool {
|
|
if o != nil && !IsNil(o.Handled) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHandled gets a reference to the given bool and assigns it to the Handled field.
|
|
func (o *Exception) SetHandled(v bool) {
|
|
o.Handled = &v
|
|
}
|
|
|
|
// GetMessage returns the Message field value if set, zero value otherwise.
|
|
func (o *Exception) GetMessage() string {
|
|
if o == nil || IsNil(o.Message) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Message
|
|
}
|
|
|
|
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Exception) GetMessageOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Message) {
|
|
return nil, false
|
|
}
|
|
return o.Message, true
|
|
}
|
|
|
|
// HasMessage returns a boolean if a field has been set.
|
|
func (o *Exception) HasMessage() bool {
|
|
if o != nil && !IsNil(o.Message) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMessage gets a reference to the given string and assigns it to the Message field.
|
|
func (o *Exception) SetMessage(v string) {
|
|
o.Message = &v
|
|
}
|
|
|
|
// GetStack returns the Stack field value if set, zero value otherwise.
|
|
func (o *Exception) GetStack() string {
|
|
if o == nil || IsNil(o.Stack) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Stack
|
|
}
|
|
|
|
// GetStackOk returns a tuple with the Stack field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Exception) GetStackOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Stack) {
|
|
return nil, false
|
|
}
|
|
return o.Stack, true
|
|
}
|
|
|
|
// HasStack returns a boolean if a field has been set.
|
|
func (o *Exception) HasStack() bool {
|
|
if o != nil && !IsNil(o.Stack) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStack gets a reference to the given string and assigns it to the Stack field.
|
|
func (o *Exception) SetStack(v string) {
|
|
o.Stack = &v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *Exception) GetType() string {
|
|
if o == nil || IsNil(o.Type) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Type
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Exception) GetTypeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Type) {
|
|
return nil, false
|
|
}
|
|
return o.Type, true
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *Exception) HasType() bool {
|
|
if o != nil && !IsNil(o.Type) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetType gets a reference to the given string and assigns it to the Type field.
|
|
func (o *Exception) SetType(v string) {
|
|
o.Type = &v
|
|
}
|
|
|
|
func (o Exception) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Exception) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Frames) {
|
|
toSerialize["frames"] = o.Frames
|
|
}
|
|
if !IsNil(o.Handled) {
|
|
toSerialize["handled"] = o.Handled
|
|
}
|
|
if !IsNil(o.Message) {
|
|
toSerialize["message"] = o.Message
|
|
}
|
|
if !IsNil(o.Stack) {
|
|
toSerialize["stack"] = o.Stack
|
|
}
|
|
if !IsNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Exception) UnmarshalJSON(data []byte) (err error) {
|
|
varException := _Exception{}
|
|
|
|
err = json.Unmarshal(data, &varException)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Exception(varException)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "frames")
|
|
delete(additionalProperties, "handled")
|
|
delete(additionalProperties, "message")
|
|
delete(additionalProperties, "stack")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableException struct {
|
|
value *Exception
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableException) Get() *Exception {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableException) Set(val *Exception) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableException) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableException) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableException(val *Exception) *NullableException {
|
|
return &NullableException{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableException) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableException) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|