Files
sdk/model_train_upload.go

307 lines
7.7 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 TrainUpload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainUpload{}
// TrainUpload struct for TrainUpload
type TrainUpload struct {
// Expires is when the grant stops being accepted, unix seconds.
Expires *int64 `json:"expires,omitempty"`
// Headers must be sent verbatim with the single PUT; the signature covers them.
Headers map[string]string `json:"headers,omitempty"`
// Method is PUT.
Method *string `json:"method,omitempty"`
// Parts are the object's consecutive byte ranges, each PUT to its own address.
Parts []TrainPart `json:"parts,omitempty"`
// URL is the presigned address of a single PUT; empty when Parts is given.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainUpload TrainUpload
// NewTrainUpload instantiates a new TrainUpload 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 NewTrainUpload() *TrainUpload {
this := TrainUpload{}
return &this
}
// NewTrainUploadWithDefaults instantiates a new TrainUpload 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 NewTrainUploadWithDefaults() *TrainUpload {
this := TrainUpload{}
return &this
}
// GetExpires returns the Expires field value if set, zero value otherwise.
func (o *TrainUpload) GetExpires() int64 {
if o == nil || IsNil(o.Expires) {
var ret int64
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 *TrainUpload) GetExpiresOk() (*int64, 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 *TrainUpload) HasExpires() bool {
if o != nil && !IsNil(o.Expires) {
return true
}
return false
}
// SetExpires gets a reference to the given int64 and assigns it to the Expires field.
func (o *TrainUpload) SetExpires(v int64) {
o.Expires = &v
}
// GetHeaders returns the Headers field value if set, zero value otherwise.
func (o *TrainUpload) GetHeaders() map[string]string {
if o == nil || IsNil(o.Headers) {
var ret map[string]string
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 *TrainUpload) GetHeadersOk() (map[string]string, bool) {
if o == nil || IsNil(o.Headers) {
return map[string]string{}, false
}
return o.Headers, true
}
// HasHeaders returns a boolean if a field has been set.
func (o *TrainUpload) HasHeaders() bool {
if o != nil && !IsNil(o.Headers) {
return true
}
return false
}
// SetHeaders gets a reference to the given map[string]string and assigns it to the Headers field.
func (o *TrainUpload) SetHeaders(v map[string]string) {
o.Headers = v
}
// GetMethod returns the Method field value if set, zero value otherwise.
func (o *TrainUpload) 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 *TrainUpload) 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 *TrainUpload) 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 *TrainUpload) SetMethod(v string) {
o.Method = &v
}
// GetParts returns the Parts field value if set, zero value otherwise.
func (o *TrainUpload) GetParts() []TrainPart {
if o == nil || IsNil(o.Parts) {
var ret []TrainPart
return ret
}
return o.Parts
}
// GetPartsOk returns a tuple with the Parts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainUpload) GetPartsOk() ([]TrainPart, bool) {
if o == nil || IsNil(o.Parts) {
return nil, false
}
return o.Parts, true
}
// HasParts returns a boolean if a field has been set.
func (o *TrainUpload) HasParts() bool {
if o != nil && !IsNil(o.Parts) {
return true
}
return false
}
// SetParts gets a reference to the given []TrainPart and assigns it to the Parts field.
func (o *TrainUpload) SetParts(v []TrainPart) {
o.Parts = v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *TrainUpload) 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 *TrainUpload) 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 *TrainUpload) 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 *TrainUpload) SetUrl(v string) {
o.Url = &v
}
func (o TrainUpload) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainUpload) 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.Method) {
toSerialize["method"] = o.Method
}
if !IsNil(o.Parts) {
toSerialize["parts"] = o.Parts
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainUpload) UnmarshalJSON(data []byte) (err error) {
varTrainUpload := _TrainUpload{}
err = json.Unmarshal(data, &varTrainUpload)
if err != nil {
return err
}
*o = TrainUpload(varTrainUpload)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expires")
delete(additionalProperties, "headers")
delete(additionalProperties, "method")
delete(additionalProperties, "parts")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainUpload struct {
value *TrainUpload
isSet bool
}
func (v NullableTrainUpload) Get() *TrainUpload {
return v.value
}
func (v *NullableTrainUpload) Set(val *TrainUpload) {
v.value = val
v.isSet = true
}
func (v NullableTrainUpload) IsSet() bool {
return v.isSet
}
func (v *NullableTrainUpload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainUpload(val *TrainUpload) *NullableTrainUpload {
return &NullableTrainUpload{value: val, isSet: true}
}
func (v NullableTrainUpload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainUpload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}