Files
sdk/model_hf_model.go

451 lines
11 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 HfModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &HfModel{}
// HfModel struct for HfModel
type HfModel struct {
Downloads *int32 `json:"downloads,omitempty"`
Gated interface{} `json:"gated,omitempty"`
Id *string `json:"id,omitempty"`
LastModified *string `json:"lastModified,omitempty"`
LibraryName *string `json:"library_name,omitempty"`
Likes *int32 `json:"likes,omitempty"`
PipelineTag *string `json:"pipeline_tag,omitempty"`
Private *bool `json:"private,omitempty"`
Tags []string `json:"tags,omitempty"`
AdditionalProperties map[string]interface{}
}
type _HfModel HfModel
// NewHfModel instantiates a new HfModel 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 NewHfModel() *HfModel {
this := HfModel{}
return &this
}
// NewHfModelWithDefaults instantiates a new HfModel 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 NewHfModelWithDefaults() *HfModel {
this := HfModel{}
return &this
}
// GetDownloads returns the Downloads field value if set, zero value otherwise.
func (o *HfModel) GetDownloads() int32 {
if o == nil || IsNil(o.Downloads) {
var ret int32
return ret
}
return *o.Downloads
}
// GetDownloadsOk returns a tuple with the Downloads field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HfModel) GetDownloadsOk() (*int32, bool) {
if o == nil || IsNil(o.Downloads) {
return nil, false
}
return o.Downloads, true
}
// HasDownloads returns a boolean if a field has been set.
func (o *HfModel) HasDownloads() bool {
if o != nil && !IsNil(o.Downloads) {
return true
}
return false
}
// SetDownloads gets a reference to the given int32 and assigns it to the Downloads field.
func (o *HfModel) SetDownloads(v int32) {
o.Downloads = &v
}
// GetGated returns the Gated field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *HfModel) GetGated() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Gated
}
// GetGatedOk returns a tuple with the Gated 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 *HfModel) GetGatedOk() (*interface{}, bool) {
if o == nil || IsNil(o.Gated) {
return nil, false
}
return &o.Gated, true
}
// HasGated returns a boolean if a field has been set.
func (o *HfModel) HasGated() bool {
if o != nil && !IsNil(o.Gated) {
return true
}
return false
}
// SetGated gets a reference to the given interface{} and assigns it to the Gated field.
func (o *HfModel) SetGated(v interface{}) {
o.Gated = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *HfModel) 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 *HfModel) 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 *HfModel) 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 *HfModel) SetId(v string) {
o.Id = &v
}
// GetLastModified returns the LastModified field value if set, zero value otherwise.
func (o *HfModel) GetLastModified() string {
if o == nil || IsNil(o.LastModified) {
var ret string
return ret
}
return *o.LastModified
}
// GetLastModifiedOk returns a tuple with the LastModified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HfModel) GetLastModifiedOk() (*string, bool) {
if o == nil || IsNil(o.LastModified) {
return nil, false
}
return o.LastModified, true
}
// HasLastModified returns a boolean if a field has been set.
func (o *HfModel) HasLastModified() bool {
if o != nil && !IsNil(o.LastModified) {
return true
}
return false
}
// SetLastModified gets a reference to the given string and assigns it to the LastModified field.
func (o *HfModel) SetLastModified(v string) {
o.LastModified = &v
}
// GetLibraryName returns the LibraryName field value if set, zero value otherwise.
func (o *HfModel) GetLibraryName() string {
if o == nil || IsNil(o.LibraryName) {
var ret string
return ret
}
return *o.LibraryName
}
// GetLibraryNameOk returns a tuple with the LibraryName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HfModel) GetLibraryNameOk() (*string, bool) {
if o == nil || IsNil(o.LibraryName) {
return nil, false
}
return o.LibraryName, true
}
// HasLibraryName returns a boolean if a field has been set.
func (o *HfModel) HasLibraryName() bool {
if o != nil && !IsNil(o.LibraryName) {
return true
}
return false
}
// SetLibraryName gets a reference to the given string and assigns it to the LibraryName field.
func (o *HfModel) SetLibraryName(v string) {
o.LibraryName = &v
}
// GetLikes returns the Likes field value if set, zero value otherwise.
func (o *HfModel) GetLikes() int32 {
if o == nil || IsNil(o.Likes) {
var ret int32
return ret
}
return *o.Likes
}
// GetLikesOk returns a tuple with the Likes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HfModel) GetLikesOk() (*int32, bool) {
if o == nil || IsNil(o.Likes) {
return nil, false
}
return o.Likes, true
}
// HasLikes returns a boolean if a field has been set.
func (o *HfModel) HasLikes() bool {
if o != nil && !IsNil(o.Likes) {
return true
}
return false
}
// SetLikes gets a reference to the given int32 and assigns it to the Likes field.
func (o *HfModel) SetLikes(v int32) {
o.Likes = &v
}
// GetPipelineTag returns the PipelineTag field value if set, zero value otherwise.
func (o *HfModel) GetPipelineTag() string {
if o == nil || IsNil(o.PipelineTag) {
var ret string
return ret
}
return *o.PipelineTag
}
// GetPipelineTagOk returns a tuple with the PipelineTag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HfModel) GetPipelineTagOk() (*string, bool) {
if o == nil || IsNil(o.PipelineTag) {
return nil, false
}
return o.PipelineTag, true
}
// HasPipelineTag returns a boolean if a field has been set.
func (o *HfModel) HasPipelineTag() bool {
if o != nil && !IsNil(o.PipelineTag) {
return true
}
return false
}
// SetPipelineTag gets a reference to the given string and assigns it to the PipelineTag field.
func (o *HfModel) SetPipelineTag(v string) {
o.PipelineTag = &v
}
// GetPrivate returns the Private field value if set, zero value otherwise.
func (o *HfModel) GetPrivate() bool {
if o == nil || IsNil(o.Private) {
var ret bool
return ret
}
return *o.Private
}
// GetPrivateOk returns a tuple with the Private field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HfModel) GetPrivateOk() (*bool, bool) {
if o == nil || IsNil(o.Private) {
return nil, false
}
return o.Private, true
}
// HasPrivate returns a boolean if a field has been set.
func (o *HfModel) HasPrivate() bool {
if o != nil && !IsNil(o.Private) {
return true
}
return false
}
// SetPrivate gets a reference to the given bool and assigns it to the Private field.
func (o *HfModel) SetPrivate(v bool) {
o.Private = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *HfModel) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HfModel) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *HfModel) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *HfModel) SetTags(v []string) {
o.Tags = v
}
func (o HfModel) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o HfModel) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Downloads) {
toSerialize["downloads"] = o.Downloads
}
if o.Gated != nil {
toSerialize["gated"] = o.Gated
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.LastModified) {
toSerialize["lastModified"] = o.LastModified
}
if !IsNil(o.LibraryName) {
toSerialize["library_name"] = o.LibraryName
}
if !IsNil(o.Likes) {
toSerialize["likes"] = o.Likes
}
if !IsNil(o.PipelineTag) {
toSerialize["pipeline_tag"] = o.PipelineTag
}
if !IsNil(o.Private) {
toSerialize["private"] = o.Private
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *HfModel) UnmarshalJSON(data []byte) (err error) {
varHfModel := _HfModel{}
err = json.Unmarshal(data, &varHfModel)
if err != nil {
return err
}
*o = HfModel(varHfModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "downloads")
delete(additionalProperties, "gated")
delete(additionalProperties, "id")
delete(additionalProperties, "lastModified")
delete(additionalProperties, "library_name")
delete(additionalProperties, "likes")
delete(additionalProperties, "pipeline_tag")
delete(additionalProperties, "private")
delete(additionalProperties, "tags")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableHfModel struct {
value *HfModel
isSet bool
}
func (v NullableHfModel) Get() *HfModel {
return v.value
}
func (v *NullableHfModel) Set(val *HfModel) {
v.value = val
v.isSet = true
}
func (v NullableHfModel) IsSet() bool {
return v.isSet
}
func (v *NullableHfModel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableHfModel(val *HfModel) *NullableHfModel {
return &NullableHfModel{value: val, isSet: true}
}
func (v NullableHfModel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableHfModel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}