Files
sdk/model_account_api_key_list.go

155 lines
4.1 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 AccountApiKeyList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AccountApiKeyList{}
// AccountApiKeyList struct for AccountApiKeyList
type AccountApiKeyList struct {
// Keys is every key the caller may see, newest first: their own, or every key of the org when the caller administers it. Revoked keys stay listed.
Keys []AccountApiKey `json:"keys,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AccountApiKeyList AccountApiKeyList
// NewAccountApiKeyList instantiates a new AccountApiKeyList 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 NewAccountApiKeyList() *AccountApiKeyList {
this := AccountApiKeyList{}
return &this
}
// NewAccountApiKeyListWithDefaults instantiates a new AccountApiKeyList 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 NewAccountApiKeyListWithDefaults() *AccountApiKeyList {
this := AccountApiKeyList{}
return &this
}
// GetKeys returns the Keys field value if set, zero value otherwise.
func (o *AccountApiKeyList) GetKeys() []AccountApiKey {
if o == nil || IsNil(o.Keys) {
var ret []AccountApiKey
return ret
}
return o.Keys
}
// GetKeysOk returns a tuple with the Keys field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccountApiKeyList) GetKeysOk() ([]AccountApiKey, bool) {
if o == nil || IsNil(o.Keys) {
return nil, false
}
return o.Keys, true
}
// HasKeys returns a boolean if a field has been set.
func (o *AccountApiKeyList) HasKeys() bool {
if o != nil && !IsNil(o.Keys) {
return true
}
return false
}
// SetKeys gets a reference to the given []AccountApiKey and assigns it to the Keys field.
func (o *AccountApiKeyList) SetKeys(v []AccountApiKey) {
o.Keys = v
}
func (o AccountApiKeyList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AccountApiKeyList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Keys) {
toSerialize["keys"] = o.Keys
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AccountApiKeyList) UnmarshalJSON(data []byte) (err error) {
varAccountApiKeyList := _AccountApiKeyList{}
err = json.Unmarshal(data, &varAccountApiKeyList)
if err != nil {
return err
}
*o = AccountApiKeyList(varAccountApiKeyList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "keys")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAccountApiKeyList struct {
value *AccountApiKeyList
isSet bool
}
func (v NullableAccountApiKeyList) Get() *AccountApiKeyList {
return v.value
}
func (v *NullableAccountApiKeyList) Set(val *AccountApiKeyList) {
v.value = val
v.isSet = true
}
func (v NullableAccountApiKeyList) IsSet() bool {
return v.isSet
}
func (v *NullableAccountApiKeyList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAccountApiKeyList(val *AccountApiKeyList) *NullableAccountApiKeyList {
return &NullableAccountApiKeyList{value: val, isSet: true}
}
func (v NullableAccountApiKeyList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAccountApiKeyList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}