## 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>
527 lines
14 KiB
Go
527 lines
14 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"
|
|
)
|
|
|
|
// checks if the Plan type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Plan{}
|
|
|
|
/*
|
|
types and functions for maxBandwidth
|
|
*/
|
|
|
|
// isInteger
|
|
type PlanGetMaxBandwidthAttributeType = *int64
|
|
type PlanGetMaxBandwidthArgType = int64
|
|
type PlanGetMaxBandwidthRetType = int64
|
|
|
|
func getPlanGetMaxBandwidthAttributeTypeOk(arg PlanGetMaxBandwidthAttributeType) (ret PlanGetMaxBandwidthRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPlanGetMaxBandwidthAttributeType(arg *PlanGetMaxBandwidthAttributeType, val PlanGetMaxBandwidthRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for maxConnections
|
|
*/
|
|
|
|
// isInteger
|
|
type PlanGetMaxConnectionsAttributeType = *int64
|
|
type PlanGetMaxConnectionsArgType = int64
|
|
type PlanGetMaxConnectionsRetType = int64
|
|
|
|
func getPlanGetMaxConnectionsAttributeTypeOk(arg PlanGetMaxConnectionsAttributeType) (ret PlanGetMaxConnectionsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPlanGetMaxConnectionsAttributeType(arg *PlanGetMaxConnectionsAttributeType, val PlanGetMaxConnectionsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type PlanGetNameAttributeType = *string
|
|
|
|
func getPlanGetNameAttributeTypeOk(arg PlanGetNameAttributeType) (ret PlanGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPlanGetNameAttributeType(arg *PlanGetNameAttributeType, val PlanGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type PlanGetNameArgType = string
|
|
type PlanGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for planId
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type PlanGetPlanIdAttributeType = *string
|
|
|
|
func getPlanGetPlanIdAttributeTypeOk(arg PlanGetPlanIdAttributeType) (ret PlanGetPlanIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPlanGetPlanIdAttributeType(arg *PlanGetPlanIdAttributeType, val PlanGetPlanIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type PlanGetPlanIdArgType = string
|
|
type PlanGetPlanIdRetType = string
|
|
|
|
/*
|
|
types and functions for region
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type PlanGetRegionAttributeType = *string
|
|
|
|
func getPlanGetRegionAttributeTypeOk(arg PlanGetRegionAttributeType) (ret PlanGetRegionRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPlanGetRegionAttributeType(arg *PlanGetRegionAttributeType, val PlanGetRegionRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type PlanGetRegionArgType = string
|
|
type PlanGetRegionRetType = string
|
|
|
|
/*
|
|
types and functions for sku
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type PlanGetSkuAttributeType = *string
|
|
|
|
func getPlanGetSkuAttributeTypeOk(arg PlanGetSkuAttributeType) (ret PlanGetSkuRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPlanGetSkuAttributeType(arg *PlanGetSkuAttributeType, val PlanGetSkuRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type PlanGetSkuArgType = string
|
|
type PlanGetSkuRetType = string
|
|
|
|
/*
|
|
types and functions for type
|
|
*/
|
|
|
|
// isEnum
|
|
|
|
// PlanTypes Service plan type
|
|
// value type for enums
|
|
type PlanTypes string
|
|
|
|
// List of Type
|
|
const (
|
|
PLANTYPE_HIGH_AVAILABILITY PlanTypes = "high-availability"
|
|
PLANTYPE_SINGLE PlanTypes = "single"
|
|
)
|
|
|
|
// All allowed values of Plan enum
|
|
var AllowedPlanTypesEnumValues = []PlanTypes{
|
|
"high-availability",
|
|
"single",
|
|
}
|
|
|
|
func (v *PlanTypes) UnmarshalJSON(src []byte) error {
|
|
// use a type alias to prevent infinite recursion during unmarshal,
|
|
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
|
|
type TmpJson PlanTypes
|
|
var value TmpJson
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Allow unmarshalling zero value for testing purposes
|
|
var zeroValue TmpJson
|
|
if value == zeroValue {
|
|
return nil
|
|
}
|
|
enumTypeValue := PlanTypes(value)
|
|
for _, existing := range AllowedPlanTypesEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid Plan", value)
|
|
}
|
|
|
|
// NewPlanTypesFromValue returns a pointer to a valid PlanTypes
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewPlanTypesFromValue(v PlanTypes) (*PlanTypes, error) {
|
|
ev := PlanTypes(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for PlanTypes: valid values are %v", v, AllowedPlanTypesEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v PlanTypes) IsValid() bool {
|
|
for _, existing := range AllowedPlanTypesEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to TypeTypes value
|
|
func (v PlanTypes) Ptr() *PlanTypes {
|
|
return &v
|
|
}
|
|
|
|
type NullablePlanTypes struct {
|
|
value *PlanTypes
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlanTypes) Get() *PlanTypes {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlanTypes) Set(val *PlanTypes) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlanTypes) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlanTypes) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlanTypes(val *PlanTypes) *NullablePlanTypes {
|
|
return &NullablePlanTypes{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlanTypes) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlanTypes) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
type PlanGetTypeAttributeType = *PlanTypes
|
|
type PlanGetTypeArgType = PlanTypes
|
|
type PlanGetTypeRetType = PlanTypes
|
|
|
|
func getPlanGetTypeAttributeTypeOk(arg PlanGetTypeAttributeType) (ret PlanGetTypeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setPlanGetTypeAttributeType(arg *PlanGetTypeAttributeType, val PlanGetTypeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// Plan struct for Plan
|
|
type Plan struct {
|
|
// Maximum bandwidth of a VPN instance.
|
|
// Can be cast to int32 without loss of precision.
|
|
MaxBandwidth PlanGetMaxBandwidthAttributeType `json:"maxBandwidth,omitempty"`
|
|
// Maximum concurrent connections of a VPN Gateway.
|
|
// Can be cast to int32 without loss of precision.
|
|
MaxConnections PlanGetMaxConnectionsAttributeType `json:"maxConnections,omitempty"`
|
|
// Service plan name
|
|
Name PlanGetNameAttributeType `json:"name,omitempty"`
|
|
// Service plan identifier
|
|
PlanId PlanGetPlanIdAttributeType `json:"planId,omitempty"`
|
|
// Region (read-only)
|
|
Region PlanGetRegionAttributeType `json:"region,omitempty"`
|
|
// Plan SKU
|
|
Sku PlanGetSkuAttributeType `json:"sku,omitempty"`
|
|
// Service plan type
|
|
Type PlanGetTypeAttributeType `json:"type,omitempty"`
|
|
}
|
|
|
|
// NewPlan instantiates a new Plan 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 NewPlan() *Plan {
|
|
this := Plan{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlanWithDefaults instantiates a new Plan 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 NewPlanWithDefaults() *Plan {
|
|
this := Plan{}
|
|
return &this
|
|
}
|
|
|
|
// GetMaxBandwidth returns the MaxBandwidth field value if set, zero value otherwise.
|
|
func (o *Plan) GetMaxBandwidth() (res PlanGetMaxBandwidthRetType) {
|
|
res, _ = o.GetMaxBandwidthOk()
|
|
return
|
|
}
|
|
|
|
// GetMaxBandwidthOk returns a tuple with the MaxBandwidth field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Plan) GetMaxBandwidthOk() (ret PlanGetMaxBandwidthRetType, ok bool) {
|
|
return getPlanGetMaxBandwidthAttributeTypeOk(o.MaxBandwidth)
|
|
}
|
|
|
|
// HasMaxBandwidth returns a boolean if a field has been set.
|
|
func (o *Plan) HasMaxBandwidth() bool {
|
|
_, ok := o.GetMaxBandwidthOk()
|
|
return ok
|
|
}
|
|
|
|
// SetMaxBandwidth gets a reference to the given int64 and assigns it to the MaxBandwidth field.
|
|
func (o *Plan) SetMaxBandwidth(v PlanGetMaxBandwidthRetType) {
|
|
setPlanGetMaxBandwidthAttributeType(&o.MaxBandwidth, v)
|
|
}
|
|
|
|
// GetMaxConnections returns the MaxConnections field value if set, zero value otherwise.
|
|
func (o *Plan) GetMaxConnections() (res PlanGetMaxConnectionsRetType) {
|
|
res, _ = o.GetMaxConnectionsOk()
|
|
return
|
|
}
|
|
|
|
// GetMaxConnectionsOk returns a tuple with the MaxConnections field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Plan) GetMaxConnectionsOk() (ret PlanGetMaxConnectionsRetType, ok bool) {
|
|
return getPlanGetMaxConnectionsAttributeTypeOk(o.MaxConnections)
|
|
}
|
|
|
|
// HasMaxConnections returns a boolean if a field has been set.
|
|
func (o *Plan) HasMaxConnections() bool {
|
|
_, ok := o.GetMaxConnectionsOk()
|
|
return ok
|
|
}
|
|
|
|
// SetMaxConnections gets a reference to the given int64 and assigns it to the MaxConnections field.
|
|
func (o *Plan) SetMaxConnections(v PlanGetMaxConnectionsRetType) {
|
|
setPlanGetMaxConnectionsAttributeType(&o.MaxConnections, v)
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *Plan) GetName() (res PlanGetNameRetType) {
|
|
res, _ = o.GetNameOk()
|
|
return
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Plan) GetNameOk() (ret PlanGetNameRetType, ok bool) {
|
|
return getPlanGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *Plan) HasName() bool {
|
|
_, ok := o.GetNameOk()
|
|
return ok
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *Plan) SetName(v PlanGetNameRetType) {
|
|
setPlanGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetPlanId returns the PlanId field value if set, zero value otherwise.
|
|
func (o *Plan) GetPlanId() (res PlanGetPlanIdRetType) {
|
|
res, _ = o.GetPlanIdOk()
|
|
return
|
|
}
|
|
|
|
// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Plan) GetPlanIdOk() (ret PlanGetPlanIdRetType, ok bool) {
|
|
return getPlanGetPlanIdAttributeTypeOk(o.PlanId)
|
|
}
|
|
|
|
// HasPlanId returns a boolean if a field has been set.
|
|
func (o *Plan) HasPlanId() bool {
|
|
_, ok := o.GetPlanIdOk()
|
|
return ok
|
|
}
|
|
|
|
// SetPlanId gets a reference to the given string and assigns it to the PlanId field.
|
|
func (o *Plan) SetPlanId(v PlanGetPlanIdRetType) {
|
|
setPlanGetPlanIdAttributeType(&o.PlanId, v)
|
|
}
|
|
|
|
// GetRegion returns the Region field value if set, zero value otherwise.
|
|
func (o *Plan) GetRegion() (res PlanGetRegionRetType) {
|
|
res, _ = o.GetRegionOk()
|
|
return
|
|
}
|
|
|
|
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Plan) GetRegionOk() (ret PlanGetRegionRetType, ok bool) {
|
|
return getPlanGetRegionAttributeTypeOk(o.Region)
|
|
}
|
|
|
|
// HasRegion returns a boolean if a field has been set.
|
|
func (o *Plan) HasRegion() bool {
|
|
_, ok := o.GetRegionOk()
|
|
return ok
|
|
}
|
|
|
|
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
|
func (o *Plan) SetRegion(v PlanGetRegionRetType) {
|
|
setPlanGetRegionAttributeType(&o.Region, v)
|
|
}
|
|
|
|
// GetSku returns the Sku field value if set, zero value otherwise.
|
|
func (o *Plan) GetSku() (res PlanGetSkuRetType) {
|
|
res, _ = o.GetSkuOk()
|
|
return
|
|
}
|
|
|
|
// GetSkuOk returns a tuple with the Sku field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Plan) GetSkuOk() (ret PlanGetSkuRetType, ok bool) {
|
|
return getPlanGetSkuAttributeTypeOk(o.Sku)
|
|
}
|
|
|
|
// HasSku returns a boolean if a field has been set.
|
|
func (o *Plan) HasSku() bool {
|
|
_, ok := o.GetSkuOk()
|
|
return ok
|
|
}
|
|
|
|
// SetSku gets a reference to the given string and assigns it to the Sku field.
|
|
func (o *Plan) SetSku(v PlanGetSkuRetType) {
|
|
setPlanGetSkuAttributeType(&o.Sku, v)
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *Plan) GetType() (res PlanGetTypeRetType) {
|
|
res, _ = o.GetTypeOk()
|
|
return
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Plan) GetTypeOk() (ret PlanGetTypeRetType, ok bool) {
|
|
return getPlanGetTypeAttributeTypeOk(o.Type)
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *Plan) HasType() bool {
|
|
_, ok := o.GetTypeOk()
|
|
return ok
|
|
}
|
|
|
|
// SetType gets a reference to the given string and assigns it to the Type field.
|
|
func (o *Plan) SetType(v PlanGetTypeRetType) {
|
|
setPlanGetTypeAttributeType(&o.Type, v)
|
|
}
|
|
|
|
func (o Plan) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getPlanGetMaxBandwidthAttributeTypeOk(o.MaxBandwidth); ok {
|
|
toSerialize["MaxBandwidth"] = val
|
|
}
|
|
if val, ok := getPlanGetMaxConnectionsAttributeTypeOk(o.MaxConnections); ok {
|
|
toSerialize["MaxConnections"] = val
|
|
}
|
|
if val, ok := getPlanGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getPlanGetPlanIdAttributeTypeOk(o.PlanId); ok {
|
|
toSerialize["PlanId"] = val
|
|
}
|
|
if val, ok := getPlanGetRegionAttributeTypeOk(o.Region); ok {
|
|
toSerialize["Region"] = val
|
|
}
|
|
if val, ok := getPlanGetSkuAttributeTypeOk(o.Sku); ok {
|
|
toSerialize["Sku"] = val
|
|
}
|
|
if val, ok := getPlanGetTypeAttributeTypeOk(o.Type); ok {
|
|
toSerialize["Type"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullablePlan struct {
|
|
value *Plan
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlan) Get() *Plan {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlan) Set(val *Plan) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlan) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlan) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlan(val *Plan) *NullablePlan {
|
|
return &NullablePlan{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlan) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlan) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|