/* STACKIT File Storage (SFS) API used to create and manage NFS Shares. API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package sfsbeta import ( "encoding/json" ) // checks if the Error type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Error{} /* types and functions for error_description */ // isAny type ErrorGetErrorDescriptionAttributeType = any type ErrorGetErrorDescriptionArgType = any type ErrorGetErrorDescriptionRetType = any func getErrorGetErrorDescriptionAttributeTypeOk(arg ErrorGetErrorDescriptionAttributeType) (ret ErrorGetErrorDescriptionRetType, ok bool) { if arg == nil { return nil, false } return arg, true } func setErrorGetErrorDescriptionAttributeType(arg *ErrorGetErrorDescriptionAttributeType, val ErrorGetErrorDescriptionRetType) { *arg = val } /* types and functions for title */ // isNotNullableString type ErrorGetTitleAttributeType = *string func getErrorGetTitleAttributeTypeOk(arg ErrorGetTitleAttributeType) (ret ErrorGetTitleRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setErrorGetTitleAttributeType(arg *ErrorGetTitleAttributeType, val ErrorGetTitleRetType) { *arg = &val } type ErrorGetTitleArgType = string type ErrorGetTitleRetType = string /* types and functions for type */ // isNotNullableString type ErrorGetTypeAttributeType = *string func getErrorGetTypeAttributeTypeOk(arg ErrorGetTypeAttributeType) (ret ErrorGetTypeRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setErrorGetTypeAttributeType(arg *ErrorGetTypeAttributeType, val ErrorGetTypeRetType) { *arg = &val } type ErrorGetTypeArgType = string type ErrorGetTypeRetType = string // Error struct for Error type Error struct { // Deprecated: Human-readable string of the error that occured ErrorDescription ErrorGetErrorDescriptionAttributeType `json:"error_description,omitempty"` // Human-readable description of the error that occurred. // REQUIRED Title ErrorGetTitleAttributeType `json:"title" required:"true"` // URI Uniquely identifies the error type. It will be in the format of storage.stackit.cloud/ e.g. storage.stackit.cloud/validation-error // REQUIRED Type ErrorGetTypeAttributeType `json:"type" required:"true"` } type _Error Error // NewError instantiates a new Error 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 NewError(title ErrorGetTitleArgType, types ErrorGetTypeArgType) *Error { this := Error{} setErrorGetTitleAttributeType(&this.Title, title) setErrorGetTypeAttributeType(&this.Type, types) return &this } // NewErrorWithDefaults instantiates a new Error 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 NewErrorWithDefaults() *Error { this := Error{} return &this } // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise (both if not set or set to explicit null). // Deprecated func (o *Error) GetErrorDescription() (res ErrorGetErrorDescriptionRetType) { res, _ = o.GetErrorDescriptionOk() return } // GetErrorDescriptionOk returns a tuple with the ErrorDescription 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 // Deprecated func (o *Error) GetErrorDescriptionOk() (ret ErrorGetErrorDescriptionRetType, ok bool) { return getErrorGetErrorDescriptionAttributeTypeOk(o.ErrorDescription) } // HasErrorDescription returns a boolean if a field has been set. func (o *Error) HasErrorDescription() bool { _, ok := o.GetErrorDescriptionOk() return ok } // SetErrorDescription gets a reference to the given interface{} and assigns it to the ErrorDescription field. // Deprecated func (o *Error) SetErrorDescription(v ErrorGetErrorDescriptionRetType) { setErrorGetErrorDescriptionAttributeType(&o.ErrorDescription, v) } // GetTitle returns the Title field value func (o *Error) GetTitle() (ret ErrorGetTitleRetType) { ret, _ = o.GetTitleOk() return ret } // GetTitleOk returns a tuple with the Title field value // and a boolean to check if the value has been set. func (o *Error) GetTitleOk() (ret ErrorGetTitleRetType, ok bool) { return getErrorGetTitleAttributeTypeOk(o.Title) } // SetTitle sets field value func (o *Error) SetTitle(v ErrorGetTitleRetType) { setErrorGetTitleAttributeType(&o.Title, v) } // GetType returns the Type field value func (o *Error) GetType() (ret ErrorGetTypeRetType) { ret, _ = o.GetTypeOk() return ret } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *Error) GetTypeOk() (ret ErrorGetTypeRetType, ok bool) { return getErrorGetTypeAttributeTypeOk(o.Type) } // SetType sets field value func (o *Error) SetType(v ErrorGetTypeRetType) { setErrorGetTypeAttributeType(&o.Type, v) } func (o Error) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getErrorGetErrorDescriptionAttributeTypeOk(o.ErrorDescription); ok { toSerialize["ErrorDescription"] = val } if val, ok := getErrorGetTitleAttributeTypeOk(o.Title); ok { toSerialize["Title"] = val } if val, ok := getErrorGetTypeAttributeTypeOk(o.Type); ok { toSerialize["Type"] = val } return toSerialize, nil } type NullableError struct { value *Error isSet bool } func (v NullableError) Get() *Error { return v.value } func (v *NullableError) Set(val *Error) { v.value = val v.isSet = true } func (v NullableError) IsSet() bool { return v.isSet } func (v *NullableError) Unset() { v.value = nil v.isSet = false } func NewNullableError(val *Error) *NullableError { return &NullableError{value: val, isSet: true} } func (v NullableError) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }