Files
sdk/model_library_library_upload.go

229 lines
6.1 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 LibraryLibraryUpload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LibraryLibraryUpload{}
// LibraryLibraryUpload struct for LibraryLibraryUpload
type LibraryLibraryUpload struct {
Expires *string `json:"expires,omitempty"`
// Headers are the ones the PUT must carry.
Headers []LibraryField `json:"headers,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LibraryLibraryUpload LibraryLibraryUpload
// NewLibraryLibraryUpload instantiates a new LibraryLibraryUpload 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 NewLibraryLibraryUpload() *LibraryLibraryUpload {
this := LibraryLibraryUpload{}
return &this
}
// NewLibraryLibraryUploadWithDefaults instantiates a new LibraryLibraryUpload 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 NewLibraryLibraryUploadWithDefaults() *LibraryLibraryUpload {
this := LibraryLibraryUpload{}
return &this
}
// GetExpires returns the Expires field value if set, zero value otherwise.
func (o *LibraryLibraryUpload) GetExpires() string {
if o == nil || IsNil(o.Expires) {
var ret string
return ret
}
return *o.Expires
}
// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryLibraryUpload) GetExpiresOk() (*string, bool) {
if o == nil || IsNil(o.Expires) {
return nil, false
}
return o.Expires, true
}
// HasExpires returns a boolean if a field has been set.
func (o *LibraryLibraryUpload) HasExpires() bool {
if o != nil && !IsNil(o.Expires) {
return true
}
return false
}
// SetExpires gets a reference to the given string and assigns it to the Expires field.
func (o *LibraryLibraryUpload) SetExpires(v string) {
o.Expires = &v
}
// GetHeaders returns the Headers field value if set, zero value otherwise.
func (o *LibraryLibraryUpload) GetHeaders() []LibraryField {
if o == nil || IsNil(o.Headers) {
var ret []LibraryField
return ret
}
return o.Headers
}
// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LibraryLibraryUpload) GetHeadersOk() ([]LibraryField, bool) {
if o == nil || IsNil(o.Headers) {
return nil, false
}
return o.Headers, true
}
// HasHeaders returns a boolean if a field has been set.
func (o *LibraryLibraryUpload) HasHeaders() bool {
if o != nil && !IsNil(o.Headers) {
return true
}
return false
}
// SetHeaders gets a reference to the given []LibraryField and assigns it to the Headers field.
func (o *LibraryLibraryUpload) SetHeaders(v []LibraryField) {
o.Headers = v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *LibraryLibraryUpload) 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 *LibraryLibraryUpload) 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 *LibraryLibraryUpload) 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 *LibraryLibraryUpload) SetUrl(v string) {
o.Url = &v
}
func (o LibraryLibraryUpload) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LibraryLibraryUpload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Expires) {
toSerialize["expires"] = o.Expires
}
if !IsNil(o.Headers) {
toSerialize["headers"] = o.Headers
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LibraryLibraryUpload) UnmarshalJSON(data []byte) (err error) {
varLibraryLibraryUpload := _LibraryLibraryUpload{}
err = json.Unmarshal(data, &varLibraryLibraryUpload)
if err != nil {
return err
}
*o = LibraryLibraryUpload(varLibraryLibraryUpload)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expires")
delete(additionalProperties, "headers")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLibraryLibraryUpload struct {
value *LibraryLibraryUpload
isSet bool
}
func (v NullableLibraryLibraryUpload) Get() *LibraryLibraryUpload {
return v.value
}
func (v *NullableLibraryLibraryUpload) Set(val *LibraryLibraryUpload) {
v.value = val
v.isSet = true
}
func (v NullableLibraryLibraryUpload) IsSet() bool {
return v.isSet
}
func (v *NullableLibraryLibraryUpload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLibraryLibraryUpload(val *LibraryLibraryUpload) *NullableLibraryLibraryUpload {
return &NullableLibraryLibraryUpload{value: val, isSet: true}
}
func (v NullableLibraryLibraryUpload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLibraryLibraryUpload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}