garage-admin-sdk-golang/model_add_key_request.go

126 lines
3.5 KiB
Go
Raw Normal View History

2022-11-13 13:22:00 +00:00
/*
2023-11-22 17:28:14 +00:00
Garage Administration API v0+garage-v0.9.0
2022-11-13 13:22:00 +00:00
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!*
2023-11-22 17:28:14 +00:00
API version: v0.9.0
2022-11-13 13:22:00 +00:00
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// AddKeyRequest struct for AddKeyRequest
type AddKeyRequest struct {
2023-11-22 17:28:14 +00:00
Name NullableString `json:"name,omitempty"`
2022-11-13 13:22:00 +00:00
}
// NewAddKeyRequest instantiates a new AddKeyRequest 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 NewAddKeyRequest() *AddKeyRequest {
this := AddKeyRequest{}
return &this
}
// NewAddKeyRequestWithDefaults instantiates a new AddKeyRequest 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 NewAddKeyRequestWithDefaults() *AddKeyRequest {
this := AddKeyRequest{}
return &this
}
2023-11-22 17:28:14 +00:00
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
2022-11-13 13:22:00 +00:00
func (o *AddKeyRequest) GetName() string {
2023-11-22 17:28:14 +00:00
if o == nil || o.Name.Get() == nil {
2022-11-13 13:22:00 +00:00
var ret string
return ret
}
2023-11-22 17:28:14 +00:00
return *o.Name.Get()
2022-11-13 13:22:00 +00:00
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
2023-11-22 17:28:14 +00:00
// NOTE: If the value is an explicit nil, `nil, true` will be returned
2022-11-13 13:22:00 +00:00
func (o *AddKeyRequest) GetNameOk() (*string, bool) {
2023-11-22 17:28:14 +00:00
if o == nil {
2022-11-13 13:22:00 +00:00
return nil, false
}
2023-11-22 17:28:14 +00:00
return o.Name.Get(), o.Name.IsSet()
2022-11-13 13:22:00 +00:00
}
// HasName returns a boolean if a field has been set.
func (o *AddKeyRequest) HasName() bool {
2023-11-22 17:28:14 +00:00
if o != nil && o.Name.IsSet() {
2022-11-13 13:22:00 +00:00
return true
}
return false
}
2023-11-22 17:28:14 +00:00
// SetName gets a reference to the given NullableString and assigns it to the Name field.
2022-11-13 13:22:00 +00:00
func (o *AddKeyRequest) SetName(v string) {
2023-11-22 17:28:14 +00:00
o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *AddKeyRequest) SetNameNil() {
o.Name.Set(nil)
}
// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *AddKeyRequest) UnsetName() {
o.Name.Unset()
2022-11-13 13:22:00 +00:00
}
func (o AddKeyRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
2023-11-22 17:28:14 +00:00
if o.Name.IsSet() {
toSerialize["name"] = o.Name.Get()
2022-11-13 13:22:00 +00:00
}
return json.Marshal(toSerialize)
}
type NullableAddKeyRequest struct {
value *AddKeyRequest
isSet bool
}
func (v NullableAddKeyRequest) Get() *AddKeyRequest {
return v.value
}
func (v *NullableAddKeyRequest) Set(val *AddKeyRequest) {
v.value = val
v.isSet = true
}
func (v NullableAddKeyRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAddKeyRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAddKeyRequest(val *AddKeyRequest) *NullableAddKeyRequest {
return &NullableAddKeyRequest{value: val, isSet: true}
}
func (v NullableAddKeyRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAddKeyRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}