## 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>
115 lines
2.5 KiB
Go
115 lines
2.5 KiB
Go
/*
|
|
STACKIT IaaS API
|
|
|
|
This API allows you to create and modify IaaS resources.
|
|
|
|
API version: 2beta1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package iaasbeta
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// StaticAreaID The identifier (ID) of a static area.
|
|
type StaticAreaID string
|
|
|
|
// List of StaticAreaID
|
|
const (
|
|
STATICAREAID_PUBLIC StaticAreaID = "PUBLIC"
|
|
STATICAREAID_SCHWARZ StaticAreaID = "SCHWARZ"
|
|
)
|
|
|
|
// All allowed values of StaticAreaID enum
|
|
var AllowedStaticAreaIDEnumValues = []StaticAreaID{
|
|
"PUBLIC",
|
|
"SCHWARZ",
|
|
}
|
|
|
|
func (v *StaticAreaID) 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 := StaticAreaID(value)
|
|
for _, existing := range AllowedStaticAreaIDEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid StaticAreaID", value)
|
|
}
|
|
|
|
// NewStaticAreaIDFromValue returns a pointer to a valid StaticAreaID
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewStaticAreaIDFromValue(v string) (*StaticAreaID, error) {
|
|
ev := StaticAreaID(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for StaticAreaID: valid values are %v", v, AllowedStaticAreaIDEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v StaticAreaID) IsValid() bool {
|
|
for _, existing := range AllowedStaticAreaIDEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to StaticAreaID value
|
|
func (v StaticAreaID) Ptr() *StaticAreaID {
|
|
return &v
|
|
}
|
|
|
|
type NullableStaticAreaID struct {
|
|
value *StaticAreaID
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableStaticAreaID) Get() *StaticAreaID {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableStaticAreaID) Set(val *StaticAreaID) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableStaticAreaID) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableStaticAreaID) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableStaticAreaID(val *StaticAreaID) *NullableStaticAreaID {
|
|
return &NullableStaticAreaID{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableStaticAreaID) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableStaticAreaID) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|