garage-admin-sdk-golang/model_key_info.go

260 lines
7.0 KiB
Go

/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// KeyInfo struct for KeyInfo
type KeyInfo struct {
Name *string `json:"name,omitempty"`
AccessKeyId *string `json:"accessKeyId,omitempty"`
SecretAccessKey *string `json:"secretAccessKey,omitempty"`
Permissions *KeyInfoPermissions `json:"permissions,omitempty"`
Buckets []KeyInfoBucketsInner `json:"buckets,omitempty"`
}
// NewKeyInfo instantiates a new KeyInfo 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 NewKeyInfo() *KeyInfo {
this := KeyInfo{}
return &this
}
// NewKeyInfoWithDefaults instantiates a new KeyInfo 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 NewKeyInfoWithDefaults() *KeyInfo {
this := KeyInfo{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *KeyInfo) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// 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 *KeyInfo) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *KeyInfo) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *KeyInfo) SetName(v string) {
o.Name = &v
}
// GetAccessKeyId returns the AccessKeyId field value if set, zero value otherwise.
func (o *KeyInfo) GetAccessKeyId() string {
if o == nil || o.AccessKeyId == nil {
var ret string
return ret
}
return *o.AccessKeyId
}
// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetAccessKeyIdOk() (*string, bool) {
if o == nil || o.AccessKeyId == nil {
return nil, false
}
return o.AccessKeyId, true
}
// HasAccessKeyId returns a boolean if a field has been set.
func (o *KeyInfo) HasAccessKeyId() bool {
if o != nil && o.AccessKeyId != nil {
return true
}
return false
}
// SetAccessKeyId gets a reference to the given string and assigns it to the AccessKeyId field.
func (o *KeyInfo) SetAccessKeyId(v string) {
o.AccessKeyId = &v
}
// GetSecretAccessKey returns the SecretAccessKey field value if set, zero value otherwise.
func (o *KeyInfo) GetSecretAccessKey() string {
if o == nil || o.SecretAccessKey == nil {
var ret string
return ret
}
return *o.SecretAccessKey
}
// GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetSecretAccessKeyOk() (*string, bool) {
if o == nil || o.SecretAccessKey == nil {
return nil, false
}
return o.SecretAccessKey, true
}
// HasSecretAccessKey returns a boolean if a field has been set.
func (o *KeyInfo) HasSecretAccessKey() bool {
if o != nil && o.SecretAccessKey != nil {
return true
}
return false
}
// SetSecretAccessKey gets a reference to the given string and assigns it to the SecretAccessKey field.
func (o *KeyInfo) SetSecretAccessKey(v string) {
o.SecretAccessKey = &v
}
// GetPermissions returns the Permissions field value if set, zero value otherwise.
func (o *KeyInfo) GetPermissions() KeyInfoPermissions {
if o == nil || o.Permissions == nil {
var ret KeyInfoPermissions
return ret
}
return *o.Permissions
}
// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetPermissionsOk() (*KeyInfoPermissions, bool) {
if o == nil || o.Permissions == nil {
return nil, false
}
return o.Permissions, true
}
// HasPermissions returns a boolean if a field has been set.
func (o *KeyInfo) HasPermissions() bool {
if o != nil && o.Permissions != nil {
return true
}
return false
}
// SetPermissions gets a reference to the given KeyInfoPermissions and assigns it to the Permissions field.
func (o *KeyInfo) SetPermissions(v KeyInfoPermissions) {
o.Permissions = &v
}
// GetBuckets returns the Buckets field value if set, zero value otherwise.
func (o *KeyInfo) GetBuckets() []KeyInfoBucketsInner {
if o == nil || o.Buckets == nil {
var ret []KeyInfoBucketsInner
return ret
}
return o.Buckets
}
// GetBucketsOk returns a tuple with the Buckets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetBucketsOk() ([]KeyInfoBucketsInner, bool) {
if o == nil || o.Buckets == nil {
return nil, false
}
return o.Buckets, true
}
// HasBuckets returns a boolean if a field has been set.
func (o *KeyInfo) HasBuckets() bool {
if o != nil && o.Buckets != nil {
return true
}
return false
}
// SetBuckets gets a reference to the given []KeyInfoBucketsInner and assigns it to the Buckets field.
func (o *KeyInfo) SetBuckets(v []KeyInfoBucketsInner) {
o.Buckets = v
}
func (o KeyInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.AccessKeyId != nil {
toSerialize["accessKeyId"] = o.AccessKeyId
}
if o.SecretAccessKey != nil {
toSerialize["secretAccessKey"] = o.SecretAccessKey
}
if o.Permissions != nil {
toSerialize["permissions"] = o.Permissions
}
if o.Buckets != nil {
toSerialize["buckets"] = o.Buckets
}
return json.Marshal(toSerialize)
}
type NullableKeyInfo struct {
value *KeyInfo
isSet bool
}
func (v NullableKeyInfo) Get() *KeyInfo {
return v.value
}
func (v *NullableKeyInfo) Set(val *KeyInfo) {
v.value = val
v.isSet = true
}
func (v NullableKeyInfo) IsSet() bool {
return v.isSet
}
func (v *NullableKeyInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKeyInfo(val *KeyInfo) *NullableKeyInfo {
return &NullableKeyInfo{value: val, isSet: true}
}
func (v NullableKeyInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKeyInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}