terraform-provider-stackitp.../pkg/sqlserverflexalpha/model_error.go

262 lines
6.8 KiB
Go

/*
STACKIT MSSQL Service API
This is the documentation for the STACKIT MSSQL service
API version: 3alpha1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package sqlserverflexalpha
import (
"encoding/json"
)
// checks if the Error type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Error{}
/*
types and functions for code
*/
// isInteger
type ErrorGetCodeAttributeType = *int64
type ErrorGetCodeArgType = int64
type ErrorGetCodeRetType = int64
func getErrorGetCodeAttributeTypeOk(arg ErrorGetCodeAttributeType) (ret ErrorGetCodeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setErrorGetCodeAttributeType(arg *ErrorGetCodeAttributeType, val ErrorGetCodeRetType) {
*arg = &val
}
/*
types and functions for message
*/
// isNotNullableString
type ErrorGetMessageAttributeType = *string
func getErrorGetMessageAttributeTypeOk(arg ErrorGetMessageAttributeType) (ret ErrorGetMessageRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setErrorGetMessageAttributeType(arg *ErrorGetMessageAttributeType, val ErrorGetMessageRetType) {
*arg = &val
}
type ErrorGetMessageArgType = string
type ErrorGetMessageRetType = string
/*
types and functions for traceId
*/
// isNotNullableString
type ErrorGetTraceIdAttributeType = *string
func getErrorGetTraceIdAttributeTypeOk(arg ErrorGetTraceIdAttributeType) (ret ErrorGetTraceIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setErrorGetTraceIdAttributeType(arg *ErrorGetTraceIdAttributeType, val ErrorGetTraceIdRetType) {
*arg = &val
}
type ErrorGetTraceIdArgType = string
type ErrorGetTraceIdRetType = 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 {
// The http error code of the error.
// Can be cast to int32 without loss of precision.
// REQUIRED
Code ErrorGetCodeAttributeType `json:"code" required:"true" validate:"required,errorCode"`
// More detailed information about the error.
// REQUIRED
Message ErrorGetMessageAttributeType `json:"message" required:"true" validate:"required,errorMsg"`
// The trace id of the request.
// REQUIRED
TraceId ErrorGetTraceIdAttributeType `json:"traceId" required:"true" validate:"required,traceID"`
// Describes in which state the api was when the error happened.
// REQUIRED
Type ErrorGetTypeAttributeType `json:"type" required:"true" validate:"required,errorType"`
}
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(code ErrorGetCodeArgType, message ErrorGetMessageArgType, traceId ErrorGetTraceIdArgType, types ErrorGetTypeArgType) *Error {
this := Error{}
setErrorGetCodeAttributeType(&this.Code, code)
setErrorGetMessageAttributeType(&this.Message, message)
setErrorGetTraceIdAttributeType(&this.TraceId, traceId)
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
}
// GetCode returns the Code field value
func (o *Error) GetCode() (ret ErrorGetCodeRetType) {
ret, _ = o.GetCodeOk()
return ret
}
// GetCodeOk returns a tuple with the Code field value
// and a boolean to check if the value has been set.
func (o *Error) GetCodeOk() (ret ErrorGetCodeRetType, ok bool) {
return getErrorGetCodeAttributeTypeOk(o.Code)
}
// SetCode sets field value
func (o *Error) SetCode(v ErrorGetCodeRetType) {
setErrorGetCodeAttributeType(&o.Code, v)
}
// GetMessage returns the Message field value
func (o *Error) GetMessage() (ret ErrorGetMessageRetType) {
ret, _ = o.GetMessageOk()
return ret
}
// GetMessageOk returns a tuple with the Message field value
// and a boolean to check if the value has been set.
func (o *Error) GetMessageOk() (ret ErrorGetMessageRetType, ok bool) {
return getErrorGetMessageAttributeTypeOk(o.Message)
}
// SetMessage sets field value
func (o *Error) SetMessage(v ErrorGetMessageRetType) {
setErrorGetMessageAttributeType(&o.Message, v)
}
// GetTraceId returns the TraceId field value
func (o *Error) GetTraceId() (ret ErrorGetTraceIdRetType) {
ret, _ = o.GetTraceIdOk()
return ret
}
// GetTraceIdOk returns a tuple with the TraceId field value
// and a boolean to check if the value has been set.
func (o *Error) GetTraceIdOk() (ret ErrorGetTraceIdRetType, ok bool) {
return getErrorGetTraceIdAttributeTypeOk(o.TraceId)
}
// SetTraceId sets field value
func (o *Error) SetTraceId(v ErrorGetTraceIdRetType) {
setErrorGetTraceIdAttributeType(&o.TraceId, 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 := getErrorGetCodeAttributeTypeOk(o.Code); ok {
toSerialize["Code"] = val
}
if val, ok := getErrorGetMessageAttributeTypeOk(o.Message); ok {
toSerialize["Message"] = val
}
if val, ok := getErrorGetTraceIdAttributeTypeOk(o.TraceId); ok {
toSerialize["TraceId"] = 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)
}