113 lines
2.6 KiB
Go
113 lines
2.6 KiB
Go
/*
|
|
STACKIT Key Management Service API
|
|
|
|
### DEPRECATED! This service is no longer maintained. Please use the version v1 instead. This API provides endpoints for managing keys and key rings.
|
|
|
|
API version: 1beta.0.0
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package kmsbeta
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// Protection The underlying system that is responsible for protecting the key material. Overrides the deprecated 'backend' field.
|
|
type Protection string
|
|
|
|
// List of protection
|
|
const (
|
|
PROTECTION_SOFTWARE Protection = "software"
|
|
)
|
|
|
|
// All allowed values of Protection enum
|
|
var AllowedProtectionEnumValues = []Protection{
|
|
"software",
|
|
}
|
|
|
|
func (v *Protection) 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 := Protection(value)
|
|
for _, existing := range AllowedProtectionEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid Protection", value)
|
|
}
|
|
|
|
// NewProtectionFromValue returns a pointer to a valid Protection
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewProtectionFromValue(v string) (*Protection, error) {
|
|
ev := Protection(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for Protection: valid values are %v", v, AllowedProtectionEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v Protection) IsValid() bool {
|
|
for _, existing := range AllowedProtectionEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to protection value
|
|
func (v Protection) Ptr() *Protection {
|
|
return &v
|
|
}
|
|
|
|
type NullableProtection struct {
|
|
value *Protection
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableProtection) Get() *Protection {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableProtection) Set(val *Protection) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableProtection) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableProtection) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableProtection(val *Protection) *NullableProtection {
|
|
return &NullableProtection{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableProtection) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableProtection) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|