/* 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" ) // checks if the CreateKeyPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateKeyPayload{} /* types and functions for access_scope */ // isEnumRef type CreateKeyPayloadGetAccessScopeAttributeType = *AccessScope type CreateKeyPayloadGetAccessScopeArgType = AccessScope type CreateKeyPayloadGetAccessScopeRetType = AccessScope func getCreateKeyPayloadGetAccessScopeAttributeTypeOk(arg CreateKeyPayloadGetAccessScopeAttributeType) (ret CreateKeyPayloadGetAccessScopeRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateKeyPayloadGetAccessScopeAttributeType(arg *CreateKeyPayloadGetAccessScopeAttributeType, val CreateKeyPayloadGetAccessScopeRetType) { *arg = &val } /* types and functions for algorithm */ // isEnumRef type CreateKeyPayloadGetAlgorithmAttributeType = *Algorithm type CreateKeyPayloadGetAlgorithmArgType = Algorithm type CreateKeyPayloadGetAlgorithmRetType = Algorithm func getCreateKeyPayloadGetAlgorithmAttributeTypeOk(arg CreateKeyPayloadGetAlgorithmAttributeType) (ret CreateKeyPayloadGetAlgorithmRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateKeyPayloadGetAlgorithmAttributeType(arg *CreateKeyPayloadGetAlgorithmAttributeType, val CreateKeyPayloadGetAlgorithmRetType) { *arg = &val } /* types and functions for backend */ // isEnumRef type CreateKeyPayloadGetBackendAttributeType = *Backend type CreateKeyPayloadGetBackendArgType = Backend type CreateKeyPayloadGetBackendRetType = Backend func getCreateKeyPayloadGetBackendAttributeTypeOk(arg CreateKeyPayloadGetBackendAttributeType) (ret CreateKeyPayloadGetBackendRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateKeyPayloadGetBackendAttributeType(arg *CreateKeyPayloadGetBackendAttributeType, val CreateKeyPayloadGetBackendRetType) { *arg = &val } /* types and functions for description */ // isNotNullableString type CreateKeyPayloadGetDescriptionAttributeType = *string func getCreateKeyPayloadGetDescriptionAttributeTypeOk(arg CreateKeyPayloadGetDescriptionAttributeType) (ret CreateKeyPayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateKeyPayloadGetDescriptionAttributeType(arg *CreateKeyPayloadGetDescriptionAttributeType, val CreateKeyPayloadGetDescriptionRetType) { *arg = &val } type CreateKeyPayloadGetDescriptionArgType = string type CreateKeyPayloadGetDescriptionRetType = string /* types and functions for displayName */ // isNotNullableString type CreateKeyPayloadGetDisplayNameAttributeType = *string func getCreateKeyPayloadGetDisplayNameAttributeTypeOk(arg CreateKeyPayloadGetDisplayNameAttributeType) (ret CreateKeyPayloadGetDisplayNameRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateKeyPayloadGetDisplayNameAttributeType(arg *CreateKeyPayloadGetDisplayNameAttributeType, val CreateKeyPayloadGetDisplayNameRetType) { *arg = &val } type CreateKeyPayloadGetDisplayNameArgType = string type CreateKeyPayloadGetDisplayNameRetType = string /* types and functions for importOnly */ // isBoolean type CreateKeyPayloadgetImportOnlyAttributeType = *bool type CreateKeyPayloadgetImportOnlyArgType = bool type CreateKeyPayloadgetImportOnlyRetType = bool func getCreateKeyPayloadgetImportOnlyAttributeTypeOk(arg CreateKeyPayloadgetImportOnlyAttributeType) (ret CreateKeyPayloadgetImportOnlyRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateKeyPayloadgetImportOnlyAttributeType(arg *CreateKeyPayloadgetImportOnlyAttributeType, val CreateKeyPayloadgetImportOnlyRetType) { *arg = &val } /* types and functions for protection */ // isEnumRef type CreateKeyPayloadGetProtectionAttributeType = *Protection type CreateKeyPayloadGetProtectionArgType = Protection type CreateKeyPayloadGetProtectionRetType = Protection func getCreateKeyPayloadGetProtectionAttributeTypeOk(arg CreateKeyPayloadGetProtectionAttributeType) (ret CreateKeyPayloadGetProtectionRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateKeyPayloadGetProtectionAttributeType(arg *CreateKeyPayloadGetProtectionAttributeType, val CreateKeyPayloadGetProtectionRetType) { *arg = &val } /* types and functions for purpose */ // isEnumRef type CreateKeyPayloadGetPurposeAttributeType = *Purpose type CreateKeyPayloadGetPurposeArgType = Purpose type CreateKeyPayloadGetPurposeRetType = Purpose func getCreateKeyPayloadGetPurposeAttributeTypeOk(arg CreateKeyPayloadGetPurposeAttributeType) (ret CreateKeyPayloadGetPurposeRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateKeyPayloadGetPurposeAttributeType(arg *CreateKeyPayloadGetPurposeAttributeType, val CreateKeyPayloadGetPurposeRetType) { *arg = &val } // CreateKeyPayload struct for CreateKeyPayload type CreateKeyPayload struct { AccessScope CreateKeyPayloadGetAccessScopeAttributeType `json:"access_scope,omitempty"` // REQUIRED Algorithm CreateKeyPayloadGetAlgorithmAttributeType `json:"algorithm" required:"true"` // Deprecated: Check the GitHub changelog for alternatives // REQUIRED Backend CreateKeyPayloadGetBackendAttributeType `json:"backend" required:"true"` // A user chosen description to distinguish multiple keys. Description CreateKeyPayloadGetDescriptionAttributeType `json:"description,omitempty"` // The display name to distinguish multiple keys. Valid characters: letters, digits, underscores and hyphens. // REQUIRED DisplayName CreateKeyPayloadGetDisplayNameAttributeType `json:"displayName" required:"true"` // States whether versions can be created or only imported. ImportOnly CreateKeyPayloadgetImportOnlyAttributeType `json:"importOnly,omitempty"` Protection CreateKeyPayloadGetProtectionAttributeType `json:"protection,omitempty"` // REQUIRED Purpose CreateKeyPayloadGetPurposeAttributeType `json:"purpose" required:"true"` } type _CreateKeyPayload CreateKeyPayload // NewCreateKeyPayload instantiates a new CreateKeyPayload 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 NewCreateKeyPayload(algorithm CreateKeyPayloadGetAlgorithmArgType, backend CreateKeyPayloadGetBackendArgType, displayName CreateKeyPayloadGetDisplayNameArgType, purpose CreateKeyPayloadGetPurposeArgType) *CreateKeyPayload { this := CreateKeyPayload{} setCreateKeyPayloadGetAlgorithmAttributeType(&this.Algorithm, algorithm) setCreateKeyPayloadGetBackendAttributeType(&this.Backend, backend) setCreateKeyPayloadGetDisplayNameAttributeType(&this.DisplayName, displayName) setCreateKeyPayloadGetPurposeAttributeType(&this.Purpose, purpose) return &this } // NewCreateKeyPayloadWithDefaults instantiates a new CreateKeyPayload 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 NewCreateKeyPayloadWithDefaults() *CreateKeyPayload { this := CreateKeyPayload{} var accessScope AccessScope = ACCESSSCOPE_PUBLIC this.AccessScope = &accessScope var importOnly bool = false this.ImportOnly = &importOnly return &this } // GetAccessScope returns the AccessScope field value if set, zero value otherwise. func (o *CreateKeyPayload) GetAccessScope() (res CreateKeyPayloadGetAccessScopeRetType) { res, _ = o.GetAccessScopeOk() return } // GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateKeyPayload) GetAccessScopeOk() (ret CreateKeyPayloadGetAccessScopeRetType, ok bool) { return getCreateKeyPayloadGetAccessScopeAttributeTypeOk(o.AccessScope) } // HasAccessScope returns a boolean if a field has been set. func (o *CreateKeyPayload) HasAccessScope() bool { _, ok := o.GetAccessScopeOk() return ok } // SetAccessScope gets a reference to the given AccessScope and assigns it to the AccessScope field. func (o *CreateKeyPayload) SetAccessScope(v CreateKeyPayloadGetAccessScopeRetType) { setCreateKeyPayloadGetAccessScopeAttributeType(&o.AccessScope, v) } // GetAlgorithm returns the Algorithm field value func (o *CreateKeyPayload) GetAlgorithm() (ret CreateKeyPayloadGetAlgorithmRetType) { 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 *CreateKeyPayload) GetAlgorithmOk() (ret CreateKeyPayloadGetAlgorithmRetType, ok bool) { return getCreateKeyPayloadGetAlgorithmAttributeTypeOk(o.Algorithm) } // SetAlgorithm sets field value func (o *CreateKeyPayload) SetAlgorithm(v CreateKeyPayloadGetAlgorithmRetType) { setCreateKeyPayloadGetAlgorithmAttributeType(&o.Algorithm, v) } // GetBackend returns the Backend field value // Deprecated func (o *CreateKeyPayload) GetBackend() (ret CreateKeyPayloadGetBackendRetType) { 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 *CreateKeyPayload) GetBackendOk() (ret CreateKeyPayloadGetBackendRetType, ok bool) { return getCreateKeyPayloadGetBackendAttributeTypeOk(o.Backend) } // SetBackend sets field value // Deprecated func (o *CreateKeyPayload) SetBackend(v CreateKeyPayloadGetBackendRetType) { setCreateKeyPayloadGetBackendAttributeType(&o.Backend, v) } // GetDescription returns the Description field value if set, zero value otherwise. func (o *CreateKeyPayload) GetDescription() (res CreateKeyPayloadGetDescriptionRetType) { 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 *CreateKeyPayload) GetDescriptionOk() (ret CreateKeyPayloadGetDescriptionRetType, ok bool) { return getCreateKeyPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *CreateKeyPayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. func (o *CreateKeyPayload) SetDescription(v CreateKeyPayloadGetDescriptionRetType) { setCreateKeyPayloadGetDescriptionAttributeType(&o.Description, v) } // GetDisplayName returns the DisplayName field value func (o *CreateKeyPayload) GetDisplayName() (ret CreateKeyPayloadGetDisplayNameRetType) { 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 *CreateKeyPayload) GetDisplayNameOk() (ret CreateKeyPayloadGetDisplayNameRetType, ok bool) { return getCreateKeyPayloadGetDisplayNameAttributeTypeOk(o.DisplayName) } // SetDisplayName sets field value func (o *CreateKeyPayload) SetDisplayName(v CreateKeyPayloadGetDisplayNameRetType) { setCreateKeyPayloadGetDisplayNameAttributeType(&o.DisplayName, v) } // GetImportOnly returns the ImportOnly field value if set, zero value otherwise. func (o *CreateKeyPayload) GetImportOnly() (res CreateKeyPayloadgetImportOnlyRetType) { res, _ = o.GetImportOnlyOk() return } // GetImportOnlyOk returns a tuple with the ImportOnly field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateKeyPayload) GetImportOnlyOk() (ret CreateKeyPayloadgetImportOnlyRetType, ok bool) { return getCreateKeyPayloadgetImportOnlyAttributeTypeOk(o.ImportOnly) } // HasImportOnly returns a boolean if a field has been set. func (o *CreateKeyPayload) HasImportOnly() bool { _, ok := o.GetImportOnlyOk() return ok } // SetImportOnly gets a reference to the given bool and assigns it to the ImportOnly field. func (o *CreateKeyPayload) SetImportOnly(v CreateKeyPayloadgetImportOnlyRetType) { setCreateKeyPayloadgetImportOnlyAttributeType(&o.ImportOnly, v) } // GetProtection returns the Protection field value if set, zero value otherwise. func (o *CreateKeyPayload) GetProtection() (res CreateKeyPayloadGetProtectionRetType) { res, _ = o.GetProtectionOk() return } // GetProtectionOk returns a tuple with the Protection field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CreateKeyPayload) GetProtectionOk() (ret CreateKeyPayloadGetProtectionRetType, ok bool) { return getCreateKeyPayloadGetProtectionAttributeTypeOk(o.Protection) } // HasProtection returns a boolean if a field has been set. func (o *CreateKeyPayload) HasProtection() bool { _, ok := o.GetProtectionOk() return ok } // SetProtection gets a reference to the given Protection and assigns it to the Protection field. func (o *CreateKeyPayload) SetProtection(v CreateKeyPayloadGetProtectionRetType) { setCreateKeyPayloadGetProtectionAttributeType(&o.Protection, v) } // GetPurpose returns the Purpose field value func (o *CreateKeyPayload) GetPurpose() (ret CreateKeyPayloadGetPurposeRetType) { 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 *CreateKeyPayload) GetPurposeOk() (ret CreateKeyPayloadGetPurposeRetType, ok bool) { return getCreateKeyPayloadGetPurposeAttributeTypeOk(o.Purpose) } // SetPurpose sets field value func (o *CreateKeyPayload) SetPurpose(v CreateKeyPayloadGetPurposeRetType) { setCreateKeyPayloadGetPurposeAttributeType(&o.Purpose, v) } func (o CreateKeyPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateKeyPayloadGetAccessScopeAttributeTypeOk(o.AccessScope); ok { toSerialize["AccessScope"] = val } if val, ok := getCreateKeyPayloadGetAlgorithmAttributeTypeOk(o.Algorithm); ok { toSerialize["Algorithm"] = val } if val, ok := getCreateKeyPayloadGetBackendAttributeTypeOk(o.Backend); ok { toSerialize["Backend"] = val } if val, ok := getCreateKeyPayloadGetDescriptionAttributeTypeOk(o.Description); ok { toSerialize["Description"] = val } if val, ok := getCreateKeyPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { toSerialize["DisplayName"] = val } if val, ok := getCreateKeyPayloadgetImportOnlyAttributeTypeOk(o.ImportOnly); ok { toSerialize["ImportOnly"] = val } if val, ok := getCreateKeyPayloadGetProtectionAttributeTypeOk(o.Protection); ok { toSerialize["Protection"] = val } if val, ok := getCreateKeyPayloadGetPurposeAttributeTypeOk(o.Purpose); ok { toSerialize["Purpose"] = val } return toSerialize, nil } type NullableCreateKeyPayload struct { value *CreateKeyPayload isSet bool } func (v NullableCreateKeyPayload) Get() *CreateKeyPayload { return v.value } func (v *NullableCreateKeyPayload) Set(val *CreateKeyPayload) { v.value = val v.isSet = true } func (v NullableCreateKeyPayload) IsSet() bool { return v.isSet } func (v *NullableCreateKeyPayload) Unset() { v.value = nil v.isSet = false } func NewNullableCreateKeyPayload(val *CreateKeyPayload) *NullableCreateKeyPayload { return &NullableCreateKeyPayload{value: val, isSet: true} } func (v NullableCreateKeyPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableCreateKeyPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }