terraform-provider-stackitp.../pkg/kmsbeta/model_algorithm.go
Marcel S. Henselin 9f41c4da7f
Some checks failed
Publish / Check GoReleaser config (push) Successful in 4s
Release / goreleaser (push) Failing after 29s
Publish / Publish provider (push) Failing after 4m24s
feat: auto generated files and new structure (#4)
## 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>
2026-01-29 14:10:25 +00:00

133 lines
3.3 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"
)
// Algorithm The algorithm the key material uses.
type Algorithm string
// List of algorithm
const (
ALGORITHM_AES_256_GCM Algorithm = "aes_256_gcm"
ALGORITHM_RSA_2048_OAEP_SHA256 Algorithm = "rsa_2048_oaep_sha256"
ALGORITHM_RSA_3072_OAEP_SHA256 Algorithm = "rsa_3072_oaep_sha256"
ALGORITHM_RSA_4096_OAEP_SHA256 Algorithm = "rsa_4096_oaep_sha256"
ALGORITHM_RSA_4096_OAEP_SHA512 Algorithm = "rsa_4096_oaep_sha512"
ALGORITHM_HMAC_SHA256 Algorithm = "hmac_sha256"
ALGORITHM_HMAC_SHA384 Algorithm = "hmac_sha384"
ALGORITHM_HMAC_SHA512 Algorithm = "hmac_sha512"
ALGORITHM_ECDSA_P256_SHA256 Algorithm = "ecdsa_p256_sha256"
ALGORITHM_ECDSA_P384_SHA384 Algorithm = "ecdsa_p384_sha384"
ALGORITHM_ECDSA_P521_SHA512 Algorithm = "ecdsa_p521_sha512"
)
// All allowed values of Algorithm enum
var AllowedAlgorithmEnumValues = []Algorithm{
"aes_256_gcm",
"rsa_2048_oaep_sha256",
"rsa_3072_oaep_sha256",
"rsa_4096_oaep_sha256",
"rsa_4096_oaep_sha512",
"hmac_sha256",
"hmac_sha384",
"hmac_sha512",
"ecdsa_p256_sha256",
"ecdsa_p384_sha384",
"ecdsa_p521_sha512",
}
func (v *Algorithm) 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 := Algorithm(value)
for _, existing := range AllowedAlgorithmEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid Algorithm", value)
}
// NewAlgorithmFromValue returns a pointer to a valid Algorithm
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewAlgorithmFromValue(v string) (*Algorithm, error) {
ev := Algorithm(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for Algorithm: valid values are %v", v, AllowedAlgorithmEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v Algorithm) IsValid() bool {
for _, existing := range AllowedAlgorithmEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to algorithm value
func (v Algorithm) Ptr() *Algorithm {
return &v
}
type NullableAlgorithm struct {
value *Algorithm
isSet bool
}
func (v NullableAlgorithm) Get() *Algorithm {
return v.value
}
func (v *NullableAlgorithm) Set(val *Algorithm) {
v.value = val
v.isSet = true
}
func (v NullableAlgorithm) IsSet() bool {
return v.isSet
}
func (v *NullableAlgorithm) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAlgorithm(val *Algorithm) *NullableAlgorithm {
return &NullableAlgorithm{value: val, isSet: true}
}
func (v NullableAlgorithm) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAlgorithm) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}