garage-admin-sdk-golang/model_add_key_request.go

125 lines
3.5 KiB
Go

/*
Garage Administration API v0+garage-v0.9.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.9.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// AddKeyRequest struct for AddKeyRequest
type AddKeyRequest struct {
Name NullableString `json:"name,omitempty"`
}
// 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
}
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AddKeyRequest) GetName() string {
if o == nil || o.Name.Get() == nil {
var ret string
return ret
}
return *o.Name.Get()
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AddKeyRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Name.Get(), o.Name.IsSet()
}
// HasName returns a boolean if a field has been set.
func (o *AddKeyRequest) HasName() bool {
if o != nil && o.Name.IsSet() {
return true
}
return false
}
// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *AddKeyRequest) SetName(v string) {
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()
}
func (o AddKeyRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Name.IsSet() {
toSerialize["name"] = o.Name.Get()
}
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)
}