Files
sdk/model_space_file_url.go

269 lines
7.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 SpaceFileURL type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SpaceFileURL{}
// SpaceFileURL struct for SpaceFileURL
type SpaceFileURL struct {
// Expiry is how many seconds the URL stays valid. A presigned URL has no server-side revocation, so this IS its revocation window.
ExpiresIn *int64 `json:"expiresIn,omitempty"`
// File is the file name the URL was signed for, relative to the drive and path-cleaned — so it is what the store will actually read or write, which is not always the string the caller sent. The signature covers this one space, this one drive and this one file: a URL minted here reaches nothing else.
File *string `json:"file,omitempty"`
// Method is the verb the URL is signed for — \"GET\" to read, \"PUT\" to write.
Method *string `json:"method,omitempty"`
// URL is the presigned URL, signed against the PUBLIC host so a browser can follow it.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SpaceFileURL SpaceFileURL
// NewSpaceFileURL instantiates a new SpaceFileURL 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 NewSpaceFileURL() *SpaceFileURL {
this := SpaceFileURL{}
return &this
}
// NewSpaceFileURLWithDefaults instantiates a new SpaceFileURL 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 NewSpaceFileURLWithDefaults() *SpaceFileURL {
this := SpaceFileURL{}
return &this
}
// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise.
func (o *SpaceFileURL) GetExpiresIn() int64 {
if o == nil || IsNil(o.ExpiresIn) {
var ret int64
return ret
}
return *o.ExpiresIn
}
// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileURL) GetExpiresInOk() (*int64, bool) {
if o == nil || IsNil(o.ExpiresIn) {
return nil, false
}
return o.ExpiresIn, true
}
// HasExpiresIn returns a boolean if a field has been set.
func (o *SpaceFileURL) HasExpiresIn() bool {
if o != nil && !IsNil(o.ExpiresIn) {
return true
}
return false
}
// SetExpiresIn gets a reference to the given int64 and assigns it to the ExpiresIn field.
func (o *SpaceFileURL) SetExpiresIn(v int64) {
o.ExpiresIn = &v
}
// GetFile returns the File field value if set, zero value otherwise.
func (o *SpaceFileURL) GetFile() string {
if o == nil || IsNil(o.File) {
var ret string
return ret
}
return *o.File
}
// GetFileOk returns a tuple with the File field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileURL) GetFileOk() (*string, bool) {
if o == nil || IsNil(o.File) {
return nil, false
}
return o.File, true
}
// HasFile returns a boolean if a field has been set.
func (o *SpaceFileURL) HasFile() bool {
if o != nil && !IsNil(o.File) {
return true
}
return false
}
// SetFile gets a reference to the given string and assigns it to the File field.
func (o *SpaceFileURL) SetFile(v string) {
o.File = &v
}
// GetMethod returns the Method field value if set, zero value otherwise.
func (o *SpaceFileURL) GetMethod() string {
if o == nil || IsNil(o.Method) {
var ret string
return ret
}
return *o.Method
}
// GetMethodOk returns a tuple with the Method field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileURL) GetMethodOk() (*string, bool) {
if o == nil || IsNil(o.Method) {
return nil, false
}
return o.Method, true
}
// HasMethod returns a boolean if a field has been set.
func (o *SpaceFileURL) HasMethod() bool {
if o != nil && !IsNil(o.Method) {
return true
}
return false
}
// SetMethod gets a reference to the given string and assigns it to the Method field.
func (o *SpaceFileURL) SetMethod(v string) {
o.Method = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *SpaceFileURL) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileURL) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *SpaceFileURL) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *SpaceFileURL) SetUrl(v string) {
o.Url = &v
}
func (o SpaceFileURL) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SpaceFileURL) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExpiresIn) {
toSerialize["expiresIn"] = o.ExpiresIn
}
if !IsNil(o.File) {
toSerialize["file"] = o.File
}
if !IsNil(o.Method) {
toSerialize["method"] = o.Method
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SpaceFileURL) UnmarshalJSON(data []byte) (err error) {
varSpaceFileURL := _SpaceFileURL{}
err = json.Unmarshal(data, &varSpaceFileURL)
if err != nil {
return err
}
*o = SpaceFileURL(varSpaceFileURL)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expiresIn")
delete(additionalProperties, "file")
delete(additionalProperties, "method")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSpaceFileURL struct {
value *SpaceFileURL
isSet bool
}
func (v NullableSpaceFileURL) Get() *SpaceFileURL {
return v.value
}
func (v *NullableSpaceFileURL) Set(val *SpaceFileURL) {
v.value = val
v.isSet = true
}
func (v NullableSpaceFileURL) IsSet() bool {
return v.isSet
}
func (v *NullableSpaceFileURL) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSpaceFileURL(val *SpaceFileURL) *NullableSpaceFileURL {
return &NullableSpaceFileURL{value: val, isSet: true}
}
func (v NullableSpaceFileURL) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSpaceFileURL) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}