## 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>
780 lines
24 KiB
Go
780 lines
24 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"
|
|
"time"
|
|
)
|
|
|
|
// checks if the WrappingKey type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &WrappingKey{}
|
|
|
|
/*
|
|
types and functions for access_scope
|
|
*/
|
|
|
|
// isEnumRef
|
|
type WrappingKeyGetAccessScopeAttributeType = *AccessScope
|
|
type WrappingKeyGetAccessScopeArgType = AccessScope
|
|
type WrappingKeyGetAccessScopeRetType = AccessScope
|
|
|
|
func getWrappingKeyGetAccessScopeAttributeTypeOk(arg WrappingKeyGetAccessScopeAttributeType) (ret WrappingKeyGetAccessScopeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetAccessScopeAttributeType(arg *WrappingKeyGetAccessScopeAttributeType, val WrappingKeyGetAccessScopeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for algorithm
|
|
*/
|
|
|
|
// isEnumRef
|
|
type WrappingKeyGetAlgorithmAttributeType = *WrappingAlgorithm
|
|
type WrappingKeyGetAlgorithmArgType = WrappingAlgorithm
|
|
type WrappingKeyGetAlgorithmRetType = WrappingAlgorithm
|
|
|
|
func getWrappingKeyGetAlgorithmAttributeTypeOk(arg WrappingKeyGetAlgorithmAttributeType) (ret WrappingKeyGetAlgorithmRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetAlgorithmAttributeType(arg *WrappingKeyGetAlgorithmAttributeType, val WrappingKeyGetAlgorithmRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for backend
|
|
*/
|
|
|
|
// isEnumRef
|
|
type WrappingKeyGetBackendAttributeType = *Backend
|
|
type WrappingKeyGetBackendArgType = Backend
|
|
type WrappingKeyGetBackendRetType = Backend
|
|
|
|
func getWrappingKeyGetBackendAttributeTypeOk(arg WrappingKeyGetBackendAttributeType) (ret WrappingKeyGetBackendRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetBackendAttributeType(arg *WrappingKeyGetBackendAttributeType, val WrappingKeyGetBackendRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for createdAt
|
|
*/
|
|
|
|
// isDateTime
|
|
type WrappingKeyGetCreatedAtAttributeType = *time.Time
|
|
type WrappingKeyGetCreatedAtArgType = time.Time
|
|
type WrappingKeyGetCreatedAtRetType = time.Time
|
|
|
|
func getWrappingKeyGetCreatedAtAttributeTypeOk(arg WrappingKeyGetCreatedAtAttributeType) (ret WrappingKeyGetCreatedAtRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetCreatedAtAttributeType(arg *WrappingKeyGetCreatedAtAttributeType, val WrappingKeyGetCreatedAtRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for description
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type WrappingKeyGetDescriptionAttributeType = *string
|
|
|
|
func getWrappingKeyGetDescriptionAttributeTypeOk(arg WrappingKeyGetDescriptionAttributeType) (ret WrappingKeyGetDescriptionRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetDescriptionAttributeType(arg *WrappingKeyGetDescriptionAttributeType, val WrappingKeyGetDescriptionRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type WrappingKeyGetDescriptionArgType = string
|
|
type WrappingKeyGetDescriptionRetType = string
|
|
|
|
/*
|
|
types and functions for displayName
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type WrappingKeyGetDisplayNameAttributeType = *string
|
|
|
|
func getWrappingKeyGetDisplayNameAttributeTypeOk(arg WrappingKeyGetDisplayNameAttributeType) (ret WrappingKeyGetDisplayNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetDisplayNameAttributeType(arg *WrappingKeyGetDisplayNameAttributeType, val WrappingKeyGetDisplayNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type WrappingKeyGetDisplayNameArgType = string
|
|
type WrappingKeyGetDisplayNameRetType = string
|
|
|
|
/*
|
|
types and functions for expiresAt
|
|
*/
|
|
|
|
// isDateTime
|
|
type WrappingKeyGetExpiresAtAttributeType = *time.Time
|
|
type WrappingKeyGetExpiresAtArgType = time.Time
|
|
type WrappingKeyGetExpiresAtRetType = time.Time
|
|
|
|
func getWrappingKeyGetExpiresAtAttributeTypeOk(arg WrappingKeyGetExpiresAtAttributeType) (ret WrappingKeyGetExpiresAtRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetExpiresAtAttributeType(arg *WrappingKeyGetExpiresAtAttributeType, val WrappingKeyGetExpiresAtRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for id
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type WrappingKeyGetIdAttributeType = *string
|
|
|
|
func getWrappingKeyGetIdAttributeTypeOk(arg WrappingKeyGetIdAttributeType) (ret WrappingKeyGetIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetIdAttributeType(arg *WrappingKeyGetIdAttributeType, val WrappingKeyGetIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type WrappingKeyGetIdArgType = string
|
|
type WrappingKeyGetIdRetType = string
|
|
|
|
/*
|
|
types and functions for keyRingId
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type WrappingKeyGetKeyRingIdAttributeType = *string
|
|
|
|
func getWrappingKeyGetKeyRingIdAttributeTypeOk(arg WrappingKeyGetKeyRingIdAttributeType) (ret WrappingKeyGetKeyRingIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetKeyRingIdAttributeType(arg *WrappingKeyGetKeyRingIdAttributeType, val WrappingKeyGetKeyRingIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type WrappingKeyGetKeyRingIdArgType = string
|
|
type WrappingKeyGetKeyRingIdRetType = string
|
|
|
|
/*
|
|
types and functions for protection
|
|
*/
|
|
|
|
// isEnumRef
|
|
type WrappingKeyGetProtectionAttributeType = *Protection
|
|
type WrappingKeyGetProtectionArgType = Protection
|
|
type WrappingKeyGetProtectionRetType = Protection
|
|
|
|
func getWrappingKeyGetProtectionAttributeTypeOk(arg WrappingKeyGetProtectionAttributeType) (ret WrappingKeyGetProtectionRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetProtectionAttributeType(arg *WrappingKeyGetProtectionAttributeType, val WrappingKeyGetProtectionRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for publicKey
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type WrappingKeyGetPublicKeyAttributeType = *string
|
|
|
|
func getWrappingKeyGetPublicKeyAttributeTypeOk(arg WrappingKeyGetPublicKeyAttributeType) (ret WrappingKeyGetPublicKeyRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetPublicKeyAttributeType(arg *WrappingKeyGetPublicKeyAttributeType, val WrappingKeyGetPublicKeyRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type WrappingKeyGetPublicKeyArgType = string
|
|
type WrappingKeyGetPublicKeyRetType = string
|
|
|
|
/*
|
|
types and functions for purpose
|
|
*/
|
|
|
|
// isEnumRef
|
|
type WrappingKeyGetPurposeAttributeType = *WrappingPurpose
|
|
type WrappingKeyGetPurposeArgType = WrappingPurpose
|
|
type WrappingKeyGetPurposeRetType = WrappingPurpose
|
|
|
|
func getWrappingKeyGetPurposeAttributeTypeOk(arg WrappingKeyGetPurposeAttributeType) (ret WrappingKeyGetPurposeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetPurposeAttributeType(arg *WrappingKeyGetPurposeAttributeType, val WrappingKeyGetPurposeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for state
|
|
*/
|
|
|
|
// isEnum
|
|
|
|
// WrappingKeyState The current state of the wrapping key.
|
|
// value type for enums
|
|
type WrappingKeyState string
|
|
|
|
// List of State
|
|
const (
|
|
WRAPPINGKEYSTATE_ACTIVE WrappingKeyState = "active"
|
|
WRAPPINGKEYSTATE_CREATING WrappingKeyState = "creating"
|
|
WRAPPINGKEYSTATE_EXPIRED WrappingKeyState = "expired"
|
|
WRAPPINGKEYSTATE_DELETED WrappingKeyState = "deleted"
|
|
WRAPPINGKEYSTATE_KEY_MATERIAL_UNAVAILABLE WrappingKeyState = "key_material_unavailable"
|
|
)
|
|
|
|
// All allowed values of WrappingKey enum
|
|
var AllowedWrappingKeyStateEnumValues = []WrappingKeyState{
|
|
"active",
|
|
"creating",
|
|
"expired",
|
|
"deleted",
|
|
"key_material_unavailable",
|
|
}
|
|
|
|
func (v *WrappingKeyState) 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 WrappingKeyState
|
|
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 := WrappingKeyState(value)
|
|
for _, existing := range AllowedWrappingKeyStateEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid WrappingKey", value)
|
|
}
|
|
|
|
// NewWrappingKeyStateFromValue returns a pointer to a valid WrappingKeyState
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewWrappingKeyStateFromValue(v WrappingKeyState) (*WrappingKeyState, error) {
|
|
ev := WrappingKeyState(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for WrappingKeyState: valid values are %v", v, AllowedWrappingKeyStateEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v WrappingKeyState) IsValid() bool {
|
|
for _, existing := range AllowedWrappingKeyStateEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to StateState value
|
|
func (v WrappingKeyState) Ptr() *WrappingKeyState {
|
|
return &v
|
|
}
|
|
|
|
type NullableWrappingKeyState struct {
|
|
value *WrappingKeyState
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWrappingKeyState) Get() *WrappingKeyState {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWrappingKeyState) Set(val *WrappingKeyState) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWrappingKeyState) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWrappingKeyState) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWrappingKeyState(val *WrappingKeyState) *NullableWrappingKeyState {
|
|
return &NullableWrappingKeyState{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWrappingKeyState) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWrappingKeyState) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
type WrappingKeyGetStateAttributeType = *WrappingKeyState
|
|
type WrappingKeyGetStateArgType = WrappingKeyState
|
|
type WrappingKeyGetStateRetType = WrappingKeyState
|
|
|
|
func getWrappingKeyGetStateAttributeTypeOk(arg WrappingKeyGetStateAttributeType) (ret WrappingKeyGetStateRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWrappingKeyGetStateAttributeType(arg *WrappingKeyGetStateAttributeType, val WrappingKeyGetStateRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// WrappingKey struct for WrappingKey
|
|
type WrappingKey struct {
|
|
// REQUIRED
|
|
AccessScope WrappingKeyGetAccessScopeAttributeType `json:"access_scope" required:"true"`
|
|
// REQUIRED
|
|
Algorithm WrappingKeyGetAlgorithmAttributeType `json:"algorithm" required:"true"`
|
|
// Deprecated: Check the GitHub changelog for alternatives
|
|
// REQUIRED
|
|
Backend WrappingKeyGetBackendAttributeType `json:"backend" required:"true"`
|
|
// The date and time the creation of the wrapping key was triggered.
|
|
// REQUIRED
|
|
CreatedAt WrappingKeyGetCreatedAtAttributeType `json:"createdAt" required:"true"`
|
|
// A user chosen description to distinguish multiple wrapping keys.
|
|
Description WrappingKeyGetDescriptionAttributeType `json:"description,omitempty"`
|
|
// The display name to distinguish multiple wrapping keys.
|
|
// REQUIRED
|
|
DisplayName WrappingKeyGetDisplayNameAttributeType `json:"displayName" required:"true"`
|
|
// The date and time the wrapping key will expire.
|
|
// REQUIRED
|
|
ExpiresAt WrappingKeyGetExpiresAtAttributeType `json:"expiresAt" required:"true"`
|
|
// A auto generated unique id which identifies the wrapping keys.
|
|
// REQUIRED
|
|
Id WrappingKeyGetIdAttributeType `json:"id" required:"true"`
|
|
// The unique id of the key ring this wrapping key is assigned to.
|
|
// REQUIRED
|
|
KeyRingId WrappingKeyGetKeyRingIdAttributeType `json:"keyRingId" required:"true"`
|
|
// REQUIRED
|
|
Protection WrappingKeyGetProtectionAttributeType `json:"protection" required:"true"`
|
|
// The public key of the wrapping key.
|
|
PublicKey WrappingKeyGetPublicKeyAttributeType `json:"publicKey,omitempty"`
|
|
// REQUIRED
|
|
Purpose WrappingKeyGetPurposeAttributeType `json:"purpose" required:"true"`
|
|
// The current state of the wrapping key.
|
|
// REQUIRED
|
|
State WrappingKeyGetStateAttributeType `json:"state" required:"true"`
|
|
}
|
|
|
|
type _WrappingKey WrappingKey
|
|
|
|
// NewWrappingKey instantiates a new WrappingKey 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 NewWrappingKey(accessScope WrappingKeyGetAccessScopeArgType, algorithm WrappingKeyGetAlgorithmArgType, backend WrappingKeyGetBackendArgType, createdAt WrappingKeyGetCreatedAtArgType, displayName WrappingKeyGetDisplayNameArgType, expiresAt WrappingKeyGetExpiresAtArgType, id WrappingKeyGetIdArgType, keyRingId WrappingKeyGetKeyRingIdArgType, protection WrappingKeyGetProtectionArgType, purpose WrappingKeyGetPurposeArgType, state WrappingKeyGetStateArgType) *WrappingKey {
|
|
this := WrappingKey{}
|
|
setWrappingKeyGetAccessScopeAttributeType(&this.AccessScope, accessScope)
|
|
setWrappingKeyGetAlgorithmAttributeType(&this.Algorithm, algorithm)
|
|
setWrappingKeyGetBackendAttributeType(&this.Backend, backend)
|
|
setWrappingKeyGetCreatedAtAttributeType(&this.CreatedAt, createdAt)
|
|
setWrappingKeyGetDisplayNameAttributeType(&this.DisplayName, displayName)
|
|
setWrappingKeyGetExpiresAtAttributeType(&this.ExpiresAt, expiresAt)
|
|
setWrappingKeyGetIdAttributeType(&this.Id, id)
|
|
setWrappingKeyGetKeyRingIdAttributeType(&this.KeyRingId, keyRingId)
|
|
setWrappingKeyGetProtectionAttributeType(&this.Protection, protection)
|
|
setWrappingKeyGetPurposeAttributeType(&this.Purpose, purpose)
|
|
setWrappingKeyGetStateAttributeType(&this.State, state)
|
|
return &this
|
|
}
|
|
|
|
// NewWrappingKeyWithDefaults instantiates a new WrappingKey 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 NewWrappingKeyWithDefaults() *WrappingKey {
|
|
this := WrappingKey{}
|
|
var accessScope AccessScope = ACCESSSCOPE_PUBLIC
|
|
this.AccessScope = &accessScope
|
|
return &this
|
|
}
|
|
|
|
// GetAccessScope returns the AccessScope field value
|
|
func (o *WrappingKey) GetAccessScope() (ret WrappingKeyGetAccessScopeRetType) {
|
|
ret, _ = o.GetAccessScopeOk()
|
|
return ret
|
|
}
|
|
|
|
// GetAccessScopeOk returns a tuple with the AccessScope field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetAccessScopeOk() (ret WrappingKeyGetAccessScopeRetType, ok bool) {
|
|
return getWrappingKeyGetAccessScopeAttributeTypeOk(o.AccessScope)
|
|
}
|
|
|
|
// SetAccessScope sets field value
|
|
func (o *WrappingKey) SetAccessScope(v WrappingKeyGetAccessScopeRetType) {
|
|
setWrappingKeyGetAccessScopeAttributeType(&o.AccessScope, v)
|
|
}
|
|
|
|
// GetAlgorithm returns the Algorithm field value
|
|
func (o *WrappingKey) GetAlgorithm() (ret WrappingKeyGetAlgorithmRetType) {
|
|
ret, _ = o.GetAlgorithmOk()
|
|
return ret
|
|
}
|
|
|
|
// GetAlgorithmOk returns a tuple with the Algorithm field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetAlgorithmOk() (ret WrappingKeyGetAlgorithmRetType, ok bool) {
|
|
return getWrappingKeyGetAlgorithmAttributeTypeOk(o.Algorithm)
|
|
}
|
|
|
|
// SetAlgorithm sets field value
|
|
func (o *WrappingKey) SetAlgorithm(v WrappingKeyGetAlgorithmRetType) {
|
|
setWrappingKeyGetAlgorithmAttributeType(&o.Algorithm, v)
|
|
}
|
|
|
|
// GetBackend returns the Backend field value
|
|
// Deprecated
|
|
func (o *WrappingKey) GetBackend() (ret WrappingKeyGetBackendRetType) {
|
|
ret, _ = o.GetBackendOk()
|
|
return ret
|
|
}
|
|
|
|
// GetBackendOk returns a tuple with the Backend field value
|
|
// and a boolean to check if the value has been set.
|
|
// Deprecated
|
|
func (o *WrappingKey) GetBackendOk() (ret WrappingKeyGetBackendRetType, ok bool) {
|
|
return getWrappingKeyGetBackendAttributeTypeOk(o.Backend)
|
|
}
|
|
|
|
// SetBackend sets field value
|
|
// Deprecated
|
|
func (o *WrappingKey) SetBackend(v WrappingKeyGetBackendRetType) {
|
|
setWrappingKeyGetBackendAttributeType(&o.Backend, v)
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value
|
|
func (o *WrappingKey) GetCreatedAt() (ret WrappingKeyGetCreatedAtRetType) {
|
|
ret, _ = o.GetCreatedAtOk()
|
|
return ret
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetCreatedAtOk() (ret WrappingKeyGetCreatedAtRetType, ok bool) {
|
|
return getWrappingKeyGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
|
}
|
|
|
|
// SetCreatedAt sets field value
|
|
func (o *WrappingKey) SetCreatedAt(v WrappingKeyGetCreatedAtRetType) {
|
|
setWrappingKeyGetCreatedAtAttributeType(&o.CreatedAt, v)
|
|
}
|
|
|
|
// GetDescription returns the Description field value if set, zero value otherwise.
|
|
func (o *WrappingKey) GetDescription() (res WrappingKeyGetDescriptionRetType) {
|
|
res, _ = o.GetDescriptionOk()
|
|
return
|
|
}
|
|
|
|
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetDescriptionOk() (ret WrappingKeyGetDescriptionRetType, ok bool) {
|
|
return getWrappingKeyGetDescriptionAttributeTypeOk(o.Description)
|
|
}
|
|
|
|
// HasDescription returns a boolean if a field has been set.
|
|
func (o *WrappingKey) HasDescription() bool {
|
|
_, ok := o.GetDescriptionOk()
|
|
return ok
|
|
}
|
|
|
|
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
|
func (o *WrappingKey) SetDescription(v WrappingKeyGetDescriptionRetType) {
|
|
setWrappingKeyGetDescriptionAttributeType(&o.Description, v)
|
|
}
|
|
|
|
// GetDisplayName returns the DisplayName field value
|
|
func (o *WrappingKey) GetDisplayName() (ret WrappingKeyGetDisplayNameRetType) {
|
|
ret, _ = o.GetDisplayNameOk()
|
|
return ret
|
|
}
|
|
|
|
// GetDisplayNameOk returns a tuple with the DisplayName field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetDisplayNameOk() (ret WrappingKeyGetDisplayNameRetType, ok bool) {
|
|
return getWrappingKeyGetDisplayNameAttributeTypeOk(o.DisplayName)
|
|
}
|
|
|
|
// SetDisplayName sets field value
|
|
func (o *WrappingKey) SetDisplayName(v WrappingKeyGetDisplayNameRetType) {
|
|
setWrappingKeyGetDisplayNameAttributeType(&o.DisplayName, v)
|
|
}
|
|
|
|
// GetExpiresAt returns the ExpiresAt field value
|
|
func (o *WrappingKey) GetExpiresAt() (ret WrappingKeyGetExpiresAtRetType) {
|
|
ret, _ = o.GetExpiresAtOk()
|
|
return ret
|
|
}
|
|
|
|
// GetExpiresAtOk returns a tuple with the ExpiresAt field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetExpiresAtOk() (ret WrappingKeyGetExpiresAtRetType, ok bool) {
|
|
return getWrappingKeyGetExpiresAtAttributeTypeOk(o.ExpiresAt)
|
|
}
|
|
|
|
// SetExpiresAt sets field value
|
|
func (o *WrappingKey) SetExpiresAt(v WrappingKeyGetExpiresAtRetType) {
|
|
setWrappingKeyGetExpiresAtAttributeType(&o.ExpiresAt, v)
|
|
}
|
|
|
|
// GetId returns the Id field value
|
|
func (o *WrappingKey) GetId() (ret WrappingKeyGetIdRetType) {
|
|
ret, _ = o.GetIdOk()
|
|
return ret
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetIdOk() (ret WrappingKeyGetIdRetType, ok bool) {
|
|
return getWrappingKeyGetIdAttributeTypeOk(o.Id)
|
|
}
|
|
|
|
// SetId sets field value
|
|
func (o *WrappingKey) SetId(v WrappingKeyGetIdRetType) {
|
|
setWrappingKeyGetIdAttributeType(&o.Id, v)
|
|
}
|
|
|
|
// GetKeyRingId returns the KeyRingId field value
|
|
func (o *WrappingKey) GetKeyRingId() (ret WrappingKeyGetKeyRingIdRetType) {
|
|
ret, _ = o.GetKeyRingIdOk()
|
|
return ret
|
|
}
|
|
|
|
// GetKeyRingIdOk returns a tuple with the KeyRingId field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetKeyRingIdOk() (ret WrappingKeyGetKeyRingIdRetType, ok bool) {
|
|
return getWrappingKeyGetKeyRingIdAttributeTypeOk(o.KeyRingId)
|
|
}
|
|
|
|
// SetKeyRingId sets field value
|
|
func (o *WrappingKey) SetKeyRingId(v WrappingKeyGetKeyRingIdRetType) {
|
|
setWrappingKeyGetKeyRingIdAttributeType(&o.KeyRingId, v)
|
|
}
|
|
|
|
// GetProtection returns the Protection field value
|
|
func (o *WrappingKey) GetProtection() (ret WrappingKeyGetProtectionRetType) {
|
|
ret, _ = o.GetProtectionOk()
|
|
return ret
|
|
}
|
|
|
|
// GetProtectionOk returns a tuple with the Protection field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetProtectionOk() (ret WrappingKeyGetProtectionRetType, ok bool) {
|
|
return getWrappingKeyGetProtectionAttributeTypeOk(o.Protection)
|
|
}
|
|
|
|
// SetProtection sets field value
|
|
func (o *WrappingKey) SetProtection(v WrappingKeyGetProtectionRetType) {
|
|
setWrappingKeyGetProtectionAttributeType(&o.Protection, v)
|
|
}
|
|
|
|
// GetPublicKey returns the PublicKey field value if set, zero value otherwise.
|
|
func (o *WrappingKey) GetPublicKey() (res WrappingKeyGetPublicKeyRetType) {
|
|
res, _ = o.GetPublicKeyOk()
|
|
return
|
|
}
|
|
|
|
// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetPublicKeyOk() (ret WrappingKeyGetPublicKeyRetType, ok bool) {
|
|
return getWrappingKeyGetPublicKeyAttributeTypeOk(o.PublicKey)
|
|
}
|
|
|
|
// HasPublicKey returns a boolean if a field has been set.
|
|
func (o *WrappingKey) HasPublicKey() bool {
|
|
_, ok := o.GetPublicKeyOk()
|
|
return ok
|
|
}
|
|
|
|
// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field.
|
|
func (o *WrappingKey) SetPublicKey(v WrappingKeyGetPublicKeyRetType) {
|
|
setWrappingKeyGetPublicKeyAttributeType(&o.PublicKey, v)
|
|
}
|
|
|
|
// GetPurpose returns the Purpose field value
|
|
func (o *WrappingKey) GetPurpose() (ret WrappingKeyGetPurposeRetType) {
|
|
ret, _ = o.GetPurposeOk()
|
|
return ret
|
|
}
|
|
|
|
// GetPurposeOk returns a tuple with the Purpose field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetPurposeOk() (ret WrappingKeyGetPurposeRetType, ok bool) {
|
|
return getWrappingKeyGetPurposeAttributeTypeOk(o.Purpose)
|
|
}
|
|
|
|
// SetPurpose sets field value
|
|
func (o *WrappingKey) SetPurpose(v WrappingKeyGetPurposeRetType) {
|
|
setWrappingKeyGetPurposeAttributeType(&o.Purpose, v)
|
|
}
|
|
|
|
// GetState returns the State field value
|
|
func (o *WrappingKey) GetState() (ret WrappingKeyGetStateRetType) {
|
|
ret, _ = o.GetStateOk()
|
|
return ret
|
|
}
|
|
|
|
// GetStateOk returns a tuple with the State field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WrappingKey) GetStateOk() (ret WrappingKeyGetStateRetType, ok bool) {
|
|
return getWrappingKeyGetStateAttributeTypeOk(o.State)
|
|
}
|
|
|
|
// SetState sets field value
|
|
func (o *WrappingKey) SetState(v WrappingKeyGetStateRetType) {
|
|
setWrappingKeyGetStateAttributeType(&o.State, v)
|
|
}
|
|
|
|
func (o WrappingKey) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getWrappingKeyGetAccessScopeAttributeTypeOk(o.AccessScope); ok {
|
|
toSerialize["AccessScope"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetAlgorithmAttributeTypeOk(o.Algorithm); ok {
|
|
toSerialize["Algorithm"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetBackendAttributeTypeOk(o.Backend); ok {
|
|
toSerialize["Backend"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
|
toSerialize["CreatedAt"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetDescriptionAttributeTypeOk(o.Description); ok {
|
|
toSerialize["Description"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetDisplayNameAttributeTypeOk(o.DisplayName); ok {
|
|
toSerialize["DisplayName"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetExpiresAtAttributeTypeOk(o.ExpiresAt); ok {
|
|
toSerialize["ExpiresAt"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetIdAttributeTypeOk(o.Id); ok {
|
|
toSerialize["Id"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetKeyRingIdAttributeTypeOk(o.KeyRingId); ok {
|
|
toSerialize["KeyRingId"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetProtectionAttributeTypeOk(o.Protection); ok {
|
|
toSerialize["Protection"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetPublicKeyAttributeTypeOk(o.PublicKey); ok {
|
|
toSerialize["PublicKey"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetPurposeAttributeTypeOk(o.Purpose); ok {
|
|
toSerialize["Purpose"] = val
|
|
}
|
|
if val, ok := getWrappingKeyGetStateAttributeTypeOk(o.State); ok {
|
|
toSerialize["State"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableWrappingKey struct {
|
|
value *WrappingKey
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWrappingKey) Get() *WrappingKey {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWrappingKey) Set(val *WrappingKey) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWrappingKey) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWrappingKey) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWrappingKey(val *WrappingKey) *NullableWrappingKey {
|
|
return &NullableWrappingKey{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWrappingKey) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWrappingKey) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|