Files
sdk/model_library_keep_in.go

684 lines
17 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 LibraryKeepIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LibraryKeepIn{}
// LibraryKeepIn struct for LibraryKeepIn
type LibraryKeepIn struct {
// Bytes reserves an upload of this size, at most 2 GiB, when data is empty, and returns a signed PUT in upload.
Bytes *int64 `json:"bytes,omitempty"`
// Data is the bytes, base64, at most 10 MiB; omit when reserving with bytes.
Data *string `json:"data,omitempty"`
Height *int64 `json:"height,omitempty"`
// Key makes the save idempotent: the same source and key answer the item already kept.
Key *string `json:"key,omitempty"`
// Kind is image, video, audio, document, slides, type, model, code or file; absent derives it from mime.
Kind *string `json:"kind,omitempty"`
// Mime is its media type. Required.
Mime *string `json:"mime,omitempty"`
// Name is what it is called, a file name. Required.
Name *string `json:"name,omitempty"`
// Origin is the path on this site back to what made it, as /chat?thread=….
Origin *string `json:"origin,omitempty"`
Pages *int64 `json:"pages,omitempty"`
// Preview is a still that shows it, base64, at most 2 MiB.
Preview *string `json:"preview,omitempty"`
// Project is one of the organization's projects, by slug.
Project *string `json:"project,omitempty"`
// Ref is what made it: the conversation, the run.
Ref *string `json:"ref,omitempty"`
Seconds *float64 `json:"seconds,omitempty"`
// Source is the product it came from: chat, dev, studio or workflow. Required.
Source *string `json:"source,omitempty"`
// Width, Height, Seconds and Pages describe it when known.
Width *int64 `json:"width,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LibraryKeepIn LibraryKeepIn
// NewLibraryKeepIn instantiates a new LibraryKeepIn 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 NewLibraryKeepIn() *LibraryKeepIn {
this := LibraryKeepIn{}
return &this
}
// NewLibraryKeepInWithDefaults instantiates a new LibraryKeepIn 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 NewLibraryKeepInWithDefaults() *LibraryKeepIn {
this := LibraryKeepIn{}
return &this
}
// GetBytes returns the Bytes field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetBytes() int64 {
if o == nil || IsNil(o.Bytes) {
var ret int64
return ret
}
return *o.Bytes
}
// GetBytesOk returns a tuple with the Bytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetBytesOk() (*int64, bool) {
if o == nil || IsNil(o.Bytes) {
return nil, false
}
return o.Bytes, true
}
// HasBytes returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasBytes() bool {
if o != nil && !IsNil(o.Bytes) {
return true
}
return false
}
// SetBytes gets a reference to the given int64 and assigns it to the Bytes field.
func (o *LibraryKeepIn) SetBytes(v int64) {
o.Bytes = &v
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetData() string {
if o == nil || IsNil(o.Data) {
var ret string
return ret
}
return *o.Data
}
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetDataOk() (*string, bool) {
if o == nil || IsNil(o.Data) {
return nil, false
}
return o.Data, true
}
// HasData returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given string and assigns it to the Data field.
func (o *LibraryKeepIn) SetData(v string) {
o.Data = &v
}
// GetHeight returns the Height field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetHeight() int64 {
if o == nil || IsNil(o.Height) {
var ret int64
return ret
}
return *o.Height
}
// GetHeightOk returns a tuple with the Height field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetHeightOk() (*int64, bool) {
if o == nil || IsNil(o.Height) {
return nil, false
}
return o.Height, true
}
// HasHeight returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasHeight() bool {
if o != nil && !IsNil(o.Height) {
return true
}
return false
}
// SetHeight gets a reference to the given int64 and assigns it to the Height field.
func (o *LibraryKeepIn) SetHeight(v int64) {
o.Height = &v
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetKey() string {
if o == nil || IsNil(o.Key) {
var ret string
return ret
}
return *o.Key
}
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetKeyOk() (*string, bool) {
if o == nil || IsNil(o.Key) {
return nil, false
}
return o.Key, true
}
// HasKey returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasKey() bool {
if o != nil && !IsNil(o.Key) {
return true
}
return false
}
// SetKey gets a reference to the given string and assigns it to the Key field.
func (o *LibraryKeepIn) SetKey(v string) {
o.Key = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *LibraryKeepIn) SetKind(v string) {
o.Kind = &v
}
// GetMime returns the Mime field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetMime() string {
if o == nil || IsNil(o.Mime) {
var ret string
return ret
}
return *o.Mime
}
// GetMimeOk returns a tuple with the Mime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetMimeOk() (*string, bool) {
if o == nil || IsNil(o.Mime) {
return nil, false
}
return o.Mime, true
}
// HasMime returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasMime() bool {
if o != nil && !IsNil(o.Mime) {
return true
}
return false
}
// SetMime gets a reference to the given string and assigns it to the Mime field.
func (o *LibraryKeepIn) SetMime(v string) {
o.Mime = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *LibraryKeepIn) 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 *LibraryKeepIn) 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 *LibraryKeepIn) 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 *LibraryKeepIn) SetName(v string) {
o.Name = &v
}
// GetOrigin returns the Origin field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetOrigin() string {
if o == nil || IsNil(o.Origin) {
var ret string
return ret
}
return *o.Origin
}
// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetOriginOk() (*string, bool) {
if o == nil || IsNil(o.Origin) {
return nil, false
}
return o.Origin, true
}
// HasOrigin returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasOrigin() bool {
if o != nil && !IsNil(o.Origin) {
return true
}
return false
}
// SetOrigin gets a reference to the given string and assigns it to the Origin field.
func (o *LibraryKeepIn) SetOrigin(v string) {
o.Origin = &v
}
// GetPages returns the Pages field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetPages() int64 {
if o == nil || IsNil(o.Pages) {
var ret int64
return ret
}
return *o.Pages
}
// GetPagesOk returns a tuple with the Pages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetPagesOk() (*int64, bool) {
if o == nil || IsNil(o.Pages) {
return nil, false
}
return o.Pages, true
}
// HasPages returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasPages() bool {
if o != nil && !IsNil(o.Pages) {
return true
}
return false
}
// SetPages gets a reference to the given int64 and assigns it to the Pages field.
func (o *LibraryKeepIn) SetPages(v int64) {
o.Pages = &v
}
// GetPreview returns the Preview field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetPreview() string {
if o == nil || IsNil(o.Preview) {
var ret string
return ret
}
return *o.Preview
}
// GetPreviewOk returns a tuple with the Preview field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetPreviewOk() (*string, bool) {
if o == nil || IsNil(o.Preview) {
return nil, false
}
return o.Preview, true
}
// HasPreview returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasPreview() bool {
if o != nil && !IsNil(o.Preview) {
return true
}
return false
}
// SetPreview gets a reference to the given string and assigns it to the Preview field.
func (o *LibraryKeepIn) SetPreview(v string) {
o.Preview = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *LibraryKeepIn) 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 *LibraryKeepIn) 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 *LibraryKeepIn) 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 *LibraryKeepIn) SetProject(v string) {
o.Project = &v
}
// GetRef returns the Ref field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetRef() string {
if o == nil || IsNil(o.Ref) {
var ret string
return ret
}
return *o.Ref
}
// GetRefOk returns a tuple with the Ref field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetRefOk() (*string, bool) {
if o == nil || IsNil(o.Ref) {
return nil, false
}
return o.Ref, true
}
// HasRef returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasRef() bool {
if o != nil && !IsNil(o.Ref) {
return true
}
return false
}
// SetRef gets a reference to the given string and assigns it to the Ref field.
func (o *LibraryKeepIn) SetRef(v string) {
o.Ref = &v
}
// GetSeconds returns the Seconds field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetSeconds() float64 {
if o == nil || IsNil(o.Seconds) {
var ret float64
return ret
}
return *o.Seconds
}
// GetSecondsOk returns a tuple with the Seconds field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetSecondsOk() (*float64, bool) {
if o == nil || IsNil(o.Seconds) {
return nil, false
}
return o.Seconds, true
}
// HasSeconds returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasSeconds() bool {
if o != nil && !IsNil(o.Seconds) {
return true
}
return false
}
// SetSeconds gets a reference to the given float64 and assigns it to the Seconds field.
func (o *LibraryKeepIn) SetSeconds(v float64) {
o.Seconds = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *LibraryKeepIn) SetSource(v string) {
o.Source = &v
}
// GetWidth returns the Width field value if set, zero value otherwise.
func (o *LibraryKeepIn) GetWidth() int64 {
if o == nil || IsNil(o.Width) {
var ret int64
return ret
}
return *o.Width
}
// GetWidthOk returns a tuple with the Width field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryKeepIn) GetWidthOk() (*int64, bool) {
if o == nil || IsNil(o.Width) {
return nil, false
}
return o.Width, true
}
// HasWidth returns a boolean if a field has been set.
func (o *LibraryKeepIn) HasWidth() bool {
if o != nil && !IsNil(o.Width) {
return true
}
return false
}
// SetWidth gets a reference to the given int64 and assigns it to the Width field.
func (o *LibraryKeepIn) SetWidth(v int64) {
o.Width = &v
}
func (o LibraryKeepIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LibraryKeepIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Bytes) {
toSerialize["bytes"] = o.Bytes
}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if !IsNil(o.Height) {
toSerialize["height"] = o.Height
}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Mime) {
toSerialize["mime"] = o.Mime
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Origin) {
toSerialize["origin"] = o.Origin
}
if !IsNil(o.Pages) {
toSerialize["pages"] = o.Pages
}
if !IsNil(o.Preview) {
toSerialize["preview"] = o.Preview
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Ref) {
toSerialize["ref"] = o.Ref
}
if !IsNil(o.Seconds) {
toSerialize["seconds"] = o.Seconds
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Width) {
toSerialize["width"] = o.Width
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LibraryKeepIn) UnmarshalJSON(data []byte) (err error) {
varLibraryKeepIn := _LibraryKeepIn{}
err = json.Unmarshal(data, &varLibraryKeepIn)
if err != nil {
return err
}
*o = LibraryKeepIn(varLibraryKeepIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bytes")
delete(additionalProperties, "data")
delete(additionalProperties, "height")
delete(additionalProperties, "key")
delete(additionalProperties, "kind")
delete(additionalProperties, "mime")
delete(additionalProperties, "name")
delete(additionalProperties, "origin")
delete(additionalProperties, "pages")
delete(additionalProperties, "preview")
delete(additionalProperties, "project")
delete(additionalProperties, "ref")
delete(additionalProperties, "seconds")
delete(additionalProperties, "source")
delete(additionalProperties, "width")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLibraryKeepIn struct {
value *LibraryKeepIn
isSet bool
}
func (v NullableLibraryKeepIn) Get() *LibraryKeepIn {
return v.value
}
func (v *NullableLibraryKeepIn) Set(val *LibraryKeepIn) {
v.value = val
v.isSet = true
}
func (v NullableLibraryKeepIn) IsSet() bool {
return v.isSet
}
func (v *NullableLibraryKeepIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLibraryKeepIn(val *LibraryKeepIn) *NullableLibraryKeepIn {
return &NullableLibraryKeepIn{value: val, isSet: true}
}
func (v NullableLibraryKeepIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLibraryKeepIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}