269 lines
7.4 KiB
Go
269 lines
7.4 KiB
Go
/*
|
|
STACKIT VPN API
|
|
|
|
The STACKIT VPN API provides endpoints to provision and manage VPN instances in your STACKIT project.
|
|
|
|
API version: 1alpha1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package vpnalpha
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the APIError type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &APIError{}
|
|
|
|
/*
|
|
types and functions for code
|
|
*/
|
|
|
|
// isInteger
|
|
type APIErrorGetCodeAttributeType = *int64
|
|
type APIErrorGetCodeArgType = int64
|
|
type APIErrorGetCodeRetType = int64
|
|
|
|
func getAPIErrorGetCodeAttributeTypeOk(arg APIErrorGetCodeAttributeType) (ret APIErrorGetCodeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setAPIErrorGetCodeAttributeType(arg *APIErrorGetCodeAttributeType, val APIErrorGetCodeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for details
|
|
*/
|
|
|
|
// isArray
|
|
type APIErrorGetDetailsAttributeType = *[]APIErrorDetail
|
|
type APIErrorGetDetailsArgType = []APIErrorDetail
|
|
type APIErrorGetDetailsRetType = []APIErrorDetail
|
|
|
|
func getAPIErrorGetDetailsAttributeTypeOk(arg APIErrorGetDetailsAttributeType) (ret APIErrorGetDetailsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setAPIErrorGetDetailsAttributeType(arg *APIErrorGetDetailsAttributeType, val APIErrorGetDetailsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for message
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type APIErrorGetMessageAttributeType = *string
|
|
|
|
func getAPIErrorGetMessageAttributeTypeOk(arg APIErrorGetMessageAttributeType) (ret APIErrorGetMessageRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setAPIErrorGetMessageAttributeType(arg *APIErrorGetMessageAttributeType, val APIErrorGetMessageRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type APIErrorGetMessageArgType = string
|
|
type APIErrorGetMessageRetType = string
|
|
|
|
/*
|
|
types and functions for status
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type APIErrorGetStatusAttributeType = *string
|
|
|
|
func getAPIErrorGetStatusAttributeTypeOk(arg APIErrorGetStatusAttributeType) (ret APIErrorGetStatusRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setAPIErrorGetStatusAttributeType(arg *APIErrorGetStatusAttributeType, val APIErrorGetStatusRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type APIErrorGetStatusArgType = string
|
|
type APIErrorGetStatusRetType = string
|
|
|
|
// APIError struct for APIError
|
|
type APIError struct {
|
|
// The HTTP status code.
|
|
// Can be cast to int32 without loss of precision.
|
|
// REQUIRED
|
|
Code APIErrorGetCodeAttributeType `json:"code" required:"true"`
|
|
// Can contain more details on the error.
|
|
Details APIErrorGetDetailsAttributeType `json:"details,omitempty"`
|
|
// A message describing the error.
|
|
// REQUIRED
|
|
Message APIErrorGetMessageAttributeType `json:"message" required:"true"`
|
|
// The HTTP status code text.
|
|
Status APIErrorGetStatusAttributeType `json:"status,omitempty"`
|
|
}
|
|
|
|
type _APIError APIError
|
|
|
|
// NewAPIError instantiates a new APIError 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 NewAPIError(code APIErrorGetCodeArgType, message APIErrorGetMessageArgType) *APIError {
|
|
this := APIError{}
|
|
setAPIErrorGetCodeAttributeType(&this.Code, code)
|
|
setAPIErrorGetMessageAttributeType(&this.Message, message)
|
|
return &this
|
|
}
|
|
|
|
// NewAPIErrorWithDefaults instantiates a new APIError 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 NewAPIErrorWithDefaults() *APIError {
|
|
this := APIError{}
|
|
return &this
|
|
}
|
|
|
|
// GetCode returns the Code field value
|
|
func (o *APIError) GetCode() (ret APIErrorGetCodeRetType) {
|
|
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 *APIError) GetCodeOk() (ret APIErrorGetCodeRetType, ok bool) {
|
|
return getAPIErrorGetCodeAttributeTypeOk(o.Code)
|
|
}
|
|
|
|
// SetCode sets field value
|
|
func (o *APIError) SetCode(v APIErrorGetCodeRetType) {
|
|
setAPIErrorGetCodeAttributeType(&o.Code, v)
|
|
}
|
|
|
|
// GetDetails returns the Details field value if set, zero value otherwise.
|
|
func (o *APIError) GetDetails() (res APIErrorGetDetailsRetType) {
|
|
res, _ = o.GetDetailsOk()
|
|
return
|
|
}
|
|
|
|
// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *APIError) GetDetailsOk() (ret APIErrorGetDetailsRetType, ok bool) {
|
|
return getAPIErrorGetDetailsAttributeTypeOk(o.Details)
|
|
}
|
|
|
|
// HasDetails returns a boolean if a field has been set.
|
|
func (o *APIError) HasDetails() bool {
|
|
_, ok := o.GetDetailsOk()
|
|
return ok
|
|
}
|
|
|
|
// SetDetails gets a reference to the given []APIErrorDetail and assigns it to the Details field.
|
|
func (o *APIError) SetDetails(v APIErrorGetDetailsRetType) {
|
|
setAPIErrorGetDetailsAttributeType(&o.Details, v)
|
|
}
|
|
|
|
// GetMessage returns the Message field value
|
|
func (o *APIError) GetMessage() (ret APIErrorGetMessageRetType) {
|
|
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 *APIError) GetMessageOk() (ret APIErrorGetMessageRetType, ok bool) {
|
|
return getAPIErrorGetMessageAttributeTypeOk(o.Message)
|
|
}
|
|
|
|
// SetMessage sets field value
|
|
func (o *APIError) SetMessage(v APIErrorGetMessageRetType) {
|
|
setAPIErrorGetMessageAttributeType(&o.Message, v)
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *APIError) GetStatus() (res APIErrorGetStatusRetType) {
|
|
res, _ = o.GetStatusOk()
|
|
return
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *APIError) GetStatusOk() (ret APIErrorGetStatusRetType, ok bool) {
|
|
return getAPIErrorGetStatusAttributeTypeOk(o.Status)
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *APIError) HasStatus() bool {
|
|
_, ok := o.GetStatusOk()
|
|
return ok
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *APIError) SetStatus(v APIErrorGetStatusRetType) {
|
|
setAPIErrorGetStatusAttributeType(&o.Status, v)
|
|
}
|
|
|
|
func (o APIError) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getAPIErrorGetCodeAttributeTypeOk(o.Code); ok {
|
|
toSerialize["Code"] = val
|
|
}
|
|
if val, ok := getAPIErrorGetDetailsAttributeTypeOk(o.Details); ok {
|
|
toSerialize["Details"] = val
|
|
}
|
|
if val, ok := getAPIErrorGetMessageAttributeTypeOk(o.Message); ok {
|
|
toSerialize["Message"] = val
|
|
}
|
|
if val, ok := getAPIErrorGetStatusAttributeTypeOk(o.Status); ok {
|
|
toSerialize["Status"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableAPIError struct {
|
|
value *APIError
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAPIError) Get() *APIError {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAPIError) Set(val *APIError) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAPIError) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAPIError) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAPIError(val *APIError) *NullableAPIError {
|
|
return &NullableAPIError{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAPIError) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAPIError) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|