terraform-provider-stackitp.../pkg/iaasbeta/model_keypair.go
2026-01-21 09:07:29 +01:00

370 lines
11 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"
"time"
)
// checks if the Keypair type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Keypair{}
/*
types and functions for createdAt
*/
// isDateTime
type KeypairGetCreatedAtAttributeType = *time.Time
type KeypairGetCreatedAtArgType = time.Time
type KeypairGetCreatedAtRetType = time.Time
func getKeypairGetCreatedAtAttributeTypeOk(arg KeypairGetCreatedAtAttributeType) (ret KeypairGetCreatedAtRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setKeypairGetCreatedAtAttributeType(arg *KeypairGetCreatedAtAttributeType, val KeypairGetCreatedAtRetType) {
*arg = &val
}
/*
types and functions for fingerprint
*/
// isNotNullableString
type KeypairGetFingerprintAttributeType = *string
func getKeypairGetFingerprintAttributeTypeOk(arg KeypairGetFingerprintAttributeType) (ret KeypairGetFingerprintRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setKeypairGetFingerprintAttributeType(arg *KeypairGetFingerprintAttributeType, val KeypairGetFingerprintRetType) {
*arg = &val
}
type KeypairGetFingerprintArgType = string
type KeypairGetFingerprintRetType = string
/*
types and functions for labels
*/
// isFreeform
type KeypairGetLabelsAttributeType = *map[string]interface{}
type KeypairGetLabelsArgType = map[string]interface{}
type KeypairGetLabelsRetType = map[string]interface{}
func getKeypairGetLabelsAttributeTypeOk(arg KeypairGetLabelsAttributeType) (ret KeypairGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setKeypairGetLabelsAttributeType(arg *KeypairGetLabelsAttributeType, val KeypairGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type KeypairGetNameAttributeType = *string
func getKeypairGetNameAttributeTypeOk(arg KeypairGetNameAttributeType) (ret KeypairGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setKeypairGetNameAttributeType(arg *KeypairGetNameAttributeType, val KeypairGetNameRetType) {
*arg = &val
}
type KeypairGetNameArgType = string
type KeypairGetNameRetType = string
/*
types and functions for publicKey
*/
// isNotNullableString
type KeypairGetPublicKeyAttributeType = *string
func getKeypairGetPublicKeyAttributeTypeOk(arg KeypairGetPublicKeyAttributeType) (ret KeypairGetPublicKeyRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setKeypairGetPublicKeyAttributeType(arg *KeypairGetPublicKeyAttributeType, val KeypairGetPublicKeyRetType) {
*arg = &val
}
type KeypairGetPublicKeyArgType = string
type KeypairGetPublicKeyRetType = string
/*
types and functions for updatedAt
*/
// isDateTime
type KeypairGetUpdatedAtAttributeType = *time.Time
type KeypairGetUpdatedAtArgType = time.Time
type KeypairGetUpdatedAtRetType = time.Time
func getKeypairGetUpdatedAtAttributeTypeOk(arg KeypairGetUpdatedAtAttributeType) (ret KeypairGetUpdatedAtRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setKeypairGetUpdatedAtAttributeType(arg *KeypairGetUpdatedAtAttributeType, val KeypairGetUpdatedAtRetType) {
*arg = &val
}
// Keypair Object that represents the public key of an SSH keypair and its name.
type Keypair struct {
// Date-time when resource was created.
CreatedAt KeypairGetCreatedAtAttributeType `json:"createdAt,omitempty"`
// Object that represents an SSH keypair MD5 fingerprint.
Fingerprint KeypairGetFingerprintAttributeType `json:"fingerprint,omitempty"`
// Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key.
Labels KeypairGetLabelsAttributeType `json:"labels,omitempty"`
// The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-].
Name KeypairGetNameAttributeType `json:"name,omitempty"`
// Object that represents a public SSH key.
// REQUIRED
PublicKey KeypairGetPublicKeyAttributeType `json:"publicKey" required:"true"`
// Date-time when resource was last updated.
UpdatedAt KeypairGetUpdatedAtAttributeType `json:"updatedAt,omitempty"`
}
type _Keypair Keypair
// NewKeypair instantiates a new Keypair 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 NewKeypair(publicKey KeypairGetPublicKeyArgType) *Keypair {
this := Keypair{}
setKeypairGetPublicKeyAttributeType(&this.PublicKey, publicKey)
return &this
}
// NewKeypairWithDefaults instantiates a new Keypair 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 NewKeypairWithDefaults() *Keypair {
this := Keypair{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *Keypair) GetCreatedAt() (res KeypairGetCreatedAtRetType) {
res, _ = o.GetCreatedAtOk()
return
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Keypair) GetCreatedAtOk() (ret KeypairGetCreatedAtRetType, ok bool) {
return getKeypairGetCreatedAtAttributeTypeOk(o.CreatedAt)
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *Keypair) HasCreatedAt() bool {
_, ok := o.GetCreatedAtOk()
return ok
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *Keypair) SetCreatedAt(v KeypairGetCreatedAtRetType) {
setKeypairGetCreatedAtAttributeType(&o.CreatedAt, v)
}
// GetFingerprint returns the Fingerprint field value if set, zero value otherwise.
func (o *Keypair) GetFingerprint() (res KeypairGetFingerprintRetType) {
res, _ = o.GetFingerprintOk()
return
}
// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Keypair) GetFingerprintOk() (ret KeypairGetFingerprintRetType, ok bool) {
return getKeypairGetFingerprintAttributeTypeOk(o.Fingerprint)
}
// HasFingerprint returns a boolean if a field has been set.
func (o *Keypair) HasFingerprint() bool {
_, ok := o.GetFingerprintOk()
return ok
}
// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field.
func (o *Keypair) SetFingerprint(v KeypairGetFingerprintRetType) {
setKeypairGetFingerprintAttributeType(&o.Fingerprint, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *Keypair) GetLabels() (res KeypairGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Keypair) GetLabelsOk() (ret KeypairGetLabelsRetType, ok bool) {
return getKeypairGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *Keypair) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field.
func (o *Keypair) SetLabels(v KeypairGetLabelsRetType) {
setKeypairGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Keypair) GetName() (res KeypairGetNameRetType) {
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 *Keypair) GetNameOk() (ret KeypairGetNameRetType, ok bool) {
return getKeypairGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *Keypair) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Keypair) SetName(v KeypairGetNameRetType) {
setKeypairGetNameAttributeType(&o.Name, v)
}
// GetPublicKey returns the PublicKey field value
func (o *Keypair) GetPublicKey() (ret KeypairGetPublicKeyRetType) {
ret, _ = o.GetPublicKeyOk()
return ret
}
// GetPublicKeyOk returns a tuple with the PublicKey field value
// and a boolean to check if the value has been set.
func (o *Keypair) GetPublicKeyOk() (ret KeypairGetPublicKeyRetType, ok bool) {
return getKeypairGetPublicKeyAttributeTypeOk(o.PublicKey)
}
// SetPublicKey sets field value
func (o *Keypair) SetPublicKey(v KeypairGetPublicKeyRetType) {
setKeypairGetPublicKeyAttributeType(&o.PublicKey, v)
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *Keypair) GetUpdatedAt() (res KeypairGetUpdatedAtRetType) {
res, _ = o.GetUpdatedAtOk()
return
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Keypair) GetUpdatedAtOk() (ret KeypairGetUpdatedAtRetType, ok bool) {
return getKeypairGetUpdatedAtAttributeTypeOk(o.UpdatedAt)
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *Keypair) HasUpdatedAt() bool {
_, ok := o.GetUpdatedAtOk()
return ok
}
// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
func (o *Keypair) SetUpdatedAt(v KeypairGetUpdatedAtRetType) {
setKeypairGetUpdatedAtAttributeType(&o.UpdatedAt, v)
}
func (o Keypair) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getKeypairGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
toSerialize["CreatedAt"] = val
}
if val, ok := getKeypairGetFingerprintAttributeTypeOk(o.Fingerprint); ok {
toSerialize["Fingerprint"] = val
}
if val, ok := getKeypairGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getKeypairGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getKeypairGetPublicKeyAttributeTypeOk(o.PublicKey); ok {
toSerialize["PublicKey"] = val
}
if val, ok := getKeypairGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok {
toSerialize["UpdatedAt"] = val
}
return toSerialize, nil
}
type NullableKeypair struct {
value *Keypair
isSet bool
}
func (v NullableKeypair) Get() *Keypair {
return v.value
}
func (v *NullableKeypair) Set(val *Keypair) {
v.value = val
v.isSet = true
}
func (v NullableKeypair) IsSet() bool {
return v.isSet
}
func (v *NullableKeypair) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKeypair(val *Keypair) *NullableKeypair {
return &NullableKeypair{value: val, isSet: true}
}
func (v NullableKeypair) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKeypair) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}