mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
377 lines
9.3 KiB
Go
377 lines
9.3 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 HfDataset type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &HfDataset{}
|
|
|
|
// HfDataset struct for HfDataset
|
|
type HfDataset struct {
|
|
Downloads *int32 `json:"downloads,omitempty"`
|
|
Gated interface{} `json:"gated,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
LastModified *string `json:"lastModified,omitempty"`
|
|
Likes *int32 `json:"likes,omitempty"`
|
|
Private *bool `json:"private,omitempty"`
|
|
Tags []string `json:"tags,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _HfDataset HfDataset
|
|
|
|
// NewHfDataset instantiates a new HfDataset 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 NewHfDataset() *HfDataset {
|
|
this := HfDataset{}
|
|
return &this
|
|
}
|
|
|
|
// NewHfDatasetWithDefaults instantiates a new HfDataset 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 NewHfDatasetWithDefaults() *HfDataset {
|
|
this := HfDataset{}
|
|
return &this
|
|
}
|
|
|
|
// GetDownloads returns the Downloads field value if set, zero value otherwise.
|
|
func (o *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) SetGated(v interface{}) {
|
|
o.Gated = v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetLastModified returns the LastModified field value if set, zero value otherwise.
|
|
func (o *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) SetLastModified(v string) {
|
|
o.LastModified = &v
|
|
}
|
|
|
|
// GetLikes returns the Likes field value if set, zero value otherwise.
|
|
func (o *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) SetLikes(v int32) {
|
|
o.Likes = &v
|
|
}
|
|
|
|
// GetPrivate returns the Private field value if set, zero value otherwise.
|
|
func (o *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) SetPrivate(v bool) {
|
|
o.Private = &v
|
|
}
|
|
|
|
// GetTags returns the Tags field value if set, zero value otherwise.
|
|
func (o *HfDataset) 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 *HfDataset) 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 *HfDataset) 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 *HfDataset) SetTags(v []string) {
|
|
o.Tags = v
|
|
}
|
|
|
|
func (o HfDataset) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o HfDataset) 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.Likes) {
|
|
toSerialize["likes"] = o.Likes
|
|
}
|
|
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 *HfDataset) UnmarshalJSON(data []byte) (err error) {
|
|
varHfDataset := _HfDataset{}
|
|
|
|
err = json.Unmarshal(data, &varHfDataset)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = HfDataset(varHfDataset)
|
|
|
|
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, "likes")
|
|
delete(additionalProperties, "private")
|
|
delete(additionalProperties, "tags")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableHfDataset struct {
|
|
value *HfDataset
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableHfDataset) Get() *HfDataset {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableHfDataset) Set(val *HfDataset) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableHfDataset) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableHfDataset) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableHfDataset(val *HfDataset) *NullableHfDataset {
|
|
return &NullableHfDataset{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableHfDataset) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableHfDataset) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|