119 lines
2.7 KiB
Go
119 lines
2.7 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"
|
|
"fmt"
|
|
)
|
|
|
|
// GatewayStatus Describes the status of the surrounding infrastructure.
|
|
type GatewayStatus string
|
|
|
|
// List of GatewayStatus
|
|
const (
|
|
GATEWAYSTATUS_PENDING GatewayStatus = "PENDING"
|
|
GATEWAYSTATUS_READY GatewayStatus = "READY"
|
|
GATEWAYSTATUS_ERROR GatewayStatus = "ERROR"
|
|
GATEWAYSTATUS_DELETING GatewayStatus = "DELETING"
|
|
)
|
|
|
|
// All allowed values of GatewayStatus enum
|
|
var AllowedGatewayStatusEnumValues = []GatewayStatus{
|
|
"PENDING",
|
|
"READY",
|
|
"ERROR",
|
|
"DELETING",
|
|
}
|
|
|
|
func (v *GatewayStatus) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Allow unmarshalling zero value for testing purposes
|
|
var zeroValue string
|
|
if value == zeroValue {
|
|
return nil
|
|
}
|
|
enumTypeValue := GatewayStatus(value)
|
|
for _, existing := range AllowedGatewayStatusEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid GatewayStatus", value)
|
|
}
|
|
|
|
// NewGatewayStatusFromValue returns a pointer to a valid GatewayStatus
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewGatewayStatusFromValue(v string) (*GatewayStatus, error) {
|
|
ev := GatewayStatus(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for GatewayStatus: valid values are %v", v, AllowedGatewayStatusEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v GatewayStatus) IsValid() bool {
|
|
for _, existing := range AllowedGatewayStatusEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to GatewayStatus value
|
|
func (v GatewayStatus) Ptr() *GatewayStatus {
|
|
return &v
|
|
}
|
|
|
|
type NullableGatewayStatus struct {
|
|
value *GatewayStatus
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGatewayStatus) Get() *GatewayStatus {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGatewayStatus) Set(val *GatewayStatus) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGatewayStatus) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGatewayStatus) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGatewayStatus(val *GatewayStatus) *NullableGatewayStatus {
|
|
return &NullableGatewayStatus{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGatewayStatus) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGatewayStatus) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|