Files
sdk/model_library_item_patch.go

307 lines
7.8 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 LibraryItemPatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LibraryItemPatch{}
// LibraryItemPatch struct for LibraryItemPatch
type LibraryItemPatch struct {
// Commit finishes a reserved upload once its bytes have been PUT.
Commit *bool `json:"commit,omitempty"`
// ID is the item, from the path.
Id *string `json:"id,omitempty"`
// Name renames it.
Name *string `json:"name,omitempty"`
// Project moves it to one of the organization's projects; \"\" moves it out.
Project *string `json:"project,omitempty"`
// Shared shows it to every member of your organization, or stops.
Shared *bool `json:"shared,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LibraryItemPatch LibraryItemPatch
// NewLibraryItemPatch instantiates a new LibraryItemPatch 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 NewLibraryItemPatch() *LibraryItemPatch {
this := LibraryItemPatch{}
return &this
}
// NewLibraryItemPatchWithDefaults instantiates a new LibraryItemPatch 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 NewLibraryItemPatchWithDefaults() *LibraryItemPatch {
this := LibraryItemPatch{}
return &this
}
// GetCommit returns the Commit field value if set, zero value otherwise.
func (o *LibraryItemPatch) GetCommit() bool {
if o == nil || IsNil(o.Commit) {
var ret bool
return ret
}
return *o.Commit
}
// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryItemPatch) GetCommitOk() (*bool, bool) {
if o == nil || IsNil(o.Commit) {
return nil, false
}
return o.Commit, true
}
// HasCommit returns a boolean if a field has been set.
func (o *LibraryItemPatch) HasCommit() bool {
if o != nil && !IsNil(o.Commit) {
return true
}
return false
}
// SetCommit gets a reference to the given bool and assigns it to the Commit field.
func (o *LibraryItemPatch) SetCommit(v bool) {
o.Commit = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *LibraryItemPatch) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryItemPatch) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *LibraryItemPatch) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *LibraryItemPatch) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *LibraryItemPatch) GetName() string {
if o == nil || IsNil(o.Name) {
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 *LibraryItemPatch) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *LibraryItemPatch) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *LibraryItemPatch) SetName(v string) {
o.Name = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *LibraryItemPatch) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryItemPatch) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *LibraryItemPatch) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *LibraryItemPatch) SetProject(v string) {
o.Project = &v
}
// GetShared returns the Shared field value if set, zero value otherwise.
func (o *LibraryItemPatch) GetShared() bool {
if o == nil || IsNil(o.Shared) {
var ret bool
return ret
}
return *o.Shared
}
// GetSharedOk returns a tuple with the Shared field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryItemPatch) GetSharedOk() (*bool, bool) {
if o == nil || IsNil(o.Shared) {
return nil, false
}
return o.Shared, true
}
// HasShared returns a boolean if a field has been set.
func (o *LibraryItemPatch) HasShared() bool {
if o != nil && !IsNil(o.Shared) {
return true
}
return false
}
// SetShared gets a reference to the given bool and assigns it to the Shared field.
func (o *LibraryItemPatch) SetShared(v bool) {
o.Shared = &v
}
func (o LibraryItemPatch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LibraryItemPatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Commit) {
toSerialize["commit"] = o.Commit
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Shared) {
toSerialize["shared"] = o.Shared
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LibraryItemPatch) UnmarshalJSON(data []byte) (err error) {
varLibraryItemPatch := _LibraryItemPatch{}
err = json.Unmarshal(data, &varLibraryItemPatch)
if err != nil {
return err
}
*o = LibraryItemPatch(varLibraryItemPatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "commit")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "project")
delete(additionalProperties, "shared")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLibraryItemPatch struct {
value *LibraryItemPatch
isSet bool
}
func (v NullableLibraryItemPatch) Get() *LibraryItemPatch {
return v.value
}
func (v *NullableLibraryItemPatch) Set(val *LibraryItemPatch) {
v.value = val
v.isSet = true
}
func (v NullableLibraryItemPatch) IsSet() bool {
return v.isSet
}
func (v *NullableLibraryItemPatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLibraryItemPatch(val *LibraryItemPatch) *NullableLibraryItemPatch {
return &NullableLibraryItemPatch{value: val, isSet: true}
}
func (v NullableLibraryItemPatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLibraryItemPatch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}