mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.0 KiB
Go
345 lines
9.0 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 ProviderSlackFile type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ProviderSlackFile{}
|
|
|
|
// ProviderSlackFile struct for ProviderSlackFile
|
|
type ProviderSlackFile struct {
|
|
// ID is the file's Slack ID and the handle the file read takes.
|
|
Id *string `json:"id,omitempty"`
|
|
// Mimetype is the type Slack recorded at upload. It is the uploader's word, so it describes the file rather than deciding how the bytes are served.
|
|
Mimetype *string `json:"mimetype,omitempty"`
|
|
// Name is the filename as uploaded.
|
|
Name *string `json:"name,omitempty"`
|
|
// Permalink opens the file in Slack, for a person. It needs a Slack session and is never the bytes.
|
|
Permalink *string `json:"permalink,omitempty"`
|
|
// Size is the file's length in bytes.
|
|
Size *int64 `json:"size,omitempty"`
|
|
// Title is the title Slack displays, which may differ from the filename.
|
|
Title *string `json:"title,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ProviderSlackFile ProviderSlackFile
|
|
|
|
// NewProviderSlackFile instantiates a new ProviderSlackFile 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 NewProviderSlackFile() *ProviderSlackFile {
|
|
this := ProviderSlackFile{}
|
|
return &this
|
|
}
|
|
|
|
// NewProviderSlackFileWithDefaults instantiates a new ProviderSlackFile 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 NewProviderSlackFileWithDefaults() *ProviderSlackFile {
|
|
this := ProviderSlackFile{}
|
|
return &this
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *ProviderSlackFile) 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 *ProviderSlackFile) 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 *ProviderSlackFile) 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 *ProviderSlackFile) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetMimetype returns the Mimetype field value if set, zero value otherwise.
|
|
func (o *ProviderSlackFile) GetMimetype() string {
|
|
if o == nil || IsNil(o.Mimetype) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Mimetype
|
|
}
|
|
|
|
// GetMimetypeOk returns a tuple with the Mimetype field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderSlackFile) GetMimetypeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Mimetype) {
|
|
return nil, false
|
|
}
|
|
return o.Mimetype, true
|
|
}
|
|
|
|
// HasMimetype returns a boolean if a field has been set.
|
|
func (o *ProviderSlackFile) HasMimetype() bool {
|
|
if o != nil && !IsNil(o.Mimetype) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMimetype gets a reference to the given string and assigns it to the Mimetype field.
|
|
func (o *ProviderSlackFile) SetMimetype(v string) {
|
|
o.Mimetype = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ProviderSlackFile) 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 *ProviderSlackFile) 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 *ProviderSlackFile) 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 *ProviderSlackFile) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetPermalink returns the Permalink field value if set, zero value otherwise.
|
|
func (o *ProviderSlackFile) GetPermalink() string {
|
|
if o == nil || IsNil(o.Permalink) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Permalink
|
|
}
|
|
|
|
// GetPermalinkOk returns a tuple with the Permalink field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderSlackFile) GetPermalinkOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Permalink) {
|
|
return nil, false
|
|
}
|
|
return o.Permalink, true
|
|
}
|
|
|
|
// HasPermalink returns a boolean if a field has been set.
|
|
func (o *ProviderSlackFile) HasPermalink() bool {
|
|
if o != nil && !IsNil(o.Permalink) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPermalink gets a reference to the given string and assigns it to the Permalink field.
|
|
func (o *ProviderSlackFile) SetPermalink(v string) {
|
|
o.Permalink = &v
|
|
}
|
|
|
|
// GetSize returns the Size field value if set, zero value otherwise.
|
|
func (o *ProviderSlackFile) GetSize() int64 {
|
|
if o == nil || IsNil(o.Size) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Size
|
|
}
|
|
|
|
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderSlackFile) GetSizeOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Size) {
|
|
return nil, false
|
|
}
|
|
return o.Size, true
|
|
}
|
|
|
|
// HasSize returns a boolean if a field has been set.
|
|
func (o *ProviderSlackFile) HasSize() bool {
|
|
if o != nil && !IsNil(o.Size) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSize gets a reference to the given int64 and assigns it to the Size field.
|
|
func (o *ProviderSlackFile) SetSize(v int64) {
|
|
o.Size = &v
|
|
}
|
|
|
|
// GetTitle returns the Title field value if set, zero value otherwise.
|
|
func (o *ProviderSlackFile) GetTitle() string {
|
|
if o == nil || IsNil(o.Title) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Title
|
|
}
|
|
|
|
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProviderSlackFile) GetTitleOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Title) {
|
|
return nil, false
|
|
}
|
|
return o.Title, true
|
|
}
|
|
|
|
// HasTitle returns a boolean if a field has been set.
|
|
func (o *ProviderSlackFile) HasTitle() bool {
|
|
if o != nil && !IsNil(o.Title) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTitle gets a reference to the given string and assigns it to the Title field.
|
|
func (o *ProviderSlackFile) SetTitle(v string) {
|
|
o.Title = &v
|
|
}
|
|
|
|
func (o ProviderSlackFile) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ProviderSlackFile) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Mimetype) {
|
|
toSerialize["mimetype"] = o.Mimetype
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Permalink) {
|
|
toSerialize["permalink"] = o.Permalink
|
|
}
|
|
if !IsNil(o.Size) {
|
|
toSerialize["size"] = o.Size
|
|
}
|
|
if !IsNil(o.Title) {
|
|
toSerialize["title"] = o.Title
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ProviderSlackFile) UnmarshalJSON(data []byte) (err error) {
|
|
varProviderSlackFile := _ProviderSlackFile{}
|
|
|
|
err = json.Unmarshal(data, &varProviderSlackFile)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ProviderSlackFile(varProviderSlackFile)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "mimetype")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "permalink")
|
|
delete(additionalProperties, "size")
|
|
delete(additionalProperties, "title")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableProviderSlackFile struct {
|
|
value *ProviderSlackFile
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableProviderSlackFile) Get() *ProviderSlackFile {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableProviderSlackFile) Set(val *ProviderSlackFile) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableProviderSlackFile) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableProviderSlackFile) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableProviderSlackFile(val *ProviderSlackFile) *NullableProviderSlackFile {
|
|
return &NullableProviderSlackFile{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableProviderSlackFile) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableProviderSlackFile) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|