## Description
<!-- **Please link some issue here describing what you are trying to achieve.**
In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->
relates to #1234
## Checklist
- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)
Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
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)
|
|
}
|