Files
sdk/model_kms_kms_secrets.go

231 lines
6.0 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the KmsKmsSecrets type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KmsKmsSecrets{}
// KmsKmsSecrets struct for KmsKmsSecrets
type KmsKmsSecrets struct {
// Names is the same listing reduced to bare names, which is the shape the KMS operator reads. Both are emitted so either consumer keeps working.
Names []string `json:"names,omitempty"`
// Secrets are the descriptors: name, path, environment and sealing scheme. No value and no ciphertext appears here.
Secrets []KmsSecretMeta `json:"secrets,omitempty"`
// Total is how many descriptors this listing carries.
Total *int64 `json:"total,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KmsKmsSecrets KmsKmsSecrets
// NewKmsKmsSecrets instantiates a new KmsKmsSecrets 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 NewKmsKmsSecrets() *KmsKmsSecrets {
this := KmsKmsSecrets{}
return &this
}
// NewKmsKmsSecretsWithDefaults instantiates a new KmsKmsSecrets 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 NewKmsKmsSecretsWithDefaults() *KmsKmsSecrets {
this := KmsKmsSecrets{}
return &this
}
// GetNames returns the Names field value if set, zero value otherwise.
func (o *KmsKmsSecrets) GetNames() []string {
if o == nil || IsNil(o.Names) {
var ret []string
return ret
}
return o.Names
}
// GetNamesOk returns a tuple with the Names field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KmsKmsSecrets) GetNamesOk() ([]string, bool) {
if o == nil || IsNil(o.Names) {
return nil, false
}
return o.Names, true
}
// HasNames returns a boolean if a field has been set.
func (o *KmsKmsSecrets) HasNames() bool {
if o != nil && !IsNil(o.Names) {
return true
}
return false
}
// SetNames gets a reference to the given []string and assigns it to the Names field.
func (o *KmsKmsSecrets) SetNames(v []string) {
o.Names = v
}
// GetSecrets returns the Secrets field value if set, zero value otherwise.
func (o *KmsKmsSecrets) GetSecrets() []KmsSecretMeta {
if o == nil || IsNil(o.Secrets) {
var ret []KmsSecretMeta
return ret
}
return o.Secrets
}
// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KmsKmsSecrets) GetSecretsOk() ([]KmsSecretMeta, bool) {
if o == nil || IsNil(o.Secrets) {
return nil, false
}
return o.Secrets, true
}
// HasSecrets returns a boolean if a field has been set.
func (o *KmsKmsSecrets) HasSecrets() bool {
if o != nil && !IsNil(o.Secrets) {
return true
}
return false
}
// SetSecrets gets a reference to the given []KmsSecretMeta and assigns it to the Secrets field.
func (o *KmsKmsSecrets) SetSecrets(v []KmsSecretMeta) {
o.Secrets = v
}
// GetTotal returns the Total field value if set, zero value otherwise.
func (o *KmsKmsSecrets) GetTotal() int64 {
if o == nil || IsNil(o.Total) {
var ret int64
return ret
}
return *o.Total
}
// GetTotalOk returns a tuple with the Total field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KmsKmsSecrets) GetTotalOk() (*int64, bool) {
if o == nil || IsNil(o.Total) {
return nil, false
}
return o.Total, true
}
// HasTotal returns a boolean if a field has been set.
func (o *KmsKmsSecrets) HasTotal() bool {
if o != nil && !IsNil(o.Total) {
return true
}
return false
}
// SetTotal gets a reference to the given int64 and assigns it to the Total field.
func (o *KmsKmsSecrets) SetTotal(v int64) {
o.Total = &v
}
func (o KmsKmsSecrets) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KmsKmsSecrets) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Names) {
toSerialize["names"] = o.Names
}
if !IsNil(o.Secrets) {
toSerialize["secrets"] = o.Secrets
}
if !IsNil(o.Total) {
toSerialize["total"] = o.Total
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *KmsKmsSecrets) UnmarshalJSON(data []byte) (err error) {
varKmsKmsSecrets := _KmsKmsSecrets{}
err = json.Unmarshal(data, &varKmsKmsSecrets)
if err != nil {
return err
}
*o = KmsKmsSecrets(varKmsKmsSecrets)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "names")
delete(additionalProperties, "secrets")
delete(additionalProperties, "total")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKmsKmsSecrets struct {
value *KmsKmsSecrets
isSet bool
}
func (v NullableKmsKmsSecrets) Get() *KmsKmsSecrets {
return v.value
}
func (v *NullableKmsKmsSecrets) Set(val *KmsKmsSecrets) {
v.value = val
v.isSet = true
}
func (v NullableKmsKmsSecrets) IsSet() bool {
return v.isSet
}
func (v *NullableKmsKmsSecrets) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKmsKmsSecrets(val *KmsKmsSecrets) *NullableKmsKmsSecrets {
return &NullableKmsKmsSecrets{value: val, isSet: true}
}
func (v NullableKmsKmsSecrets) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKmsKmsSecrets) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}