Files
sdk/model_s3_presign_response.go

269 lines
7.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 S3PresignResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &S3PresignResponse{}
// S3PresignResponse struct for S3PresignResponse
type S3PresignResponse struct {
// seconds until the URL expires
ExpiresIn *int64 `json:"expiresIn,omitempty"`
// Key is the object key the URL was signed for, relative to the bucket root 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 bucket and this one key: a URL minted here reaches nothing else.
Key *string `json:"key,omitempty"`
// \"PUT\" (upload) or \"GET\" (download)
Method *string `json:"method,omitempty"`
// presigned URL the browser follows directly
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _S3PresignResponse S3PresignResponse
// NewS3PresignResponse instantiates a new S3PresignResponse 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 NewS3PresignResponse() *S3PresignResponse {
this := S3PresignResponse{}
return &this
}
// NewS3PresignResponseWithDefaults instantiates a new S3PresignResponse 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 NewS3PresignResponseWithDefaults() *S3PresignResponse {
this := S3PresignResponse{}
return &this
}
// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise.
func (o *S3PresignResponse) 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 *S3PresignResponse) 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 *S3PresignResponse) 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 *S3PresignResponse) SetExpiresIn(v int64) {
o.ExpiresIn = &v
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *S3PresignResponse) GetKey() string {
if o == nil || IsNil(o.Key) {
var ret string
return ret
}
return *o.Key
}
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *S3PresignResponse) GetKeyOk() (*string, bool) {
if o == nil || IsNil(o.Key) {
return nil, false
}
return o.Key, true
}
// HasKey returns a boolean if a field has been set.
func (o *S3PresignResponse) HasKey() bool {
if o != nil && !IsNil(o.Key) {
return true
}
return false
}
// SetKey gets a reference to the given string and assigns it to the Key field.
func (o *S3PresignResponse) SetKey(v string) {
o.Key = &v
}
// GetMethod returns the Method field value if set, zero value otherwise.
func (o *S3PresignResponse) 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 *S3PresignResponse) 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 *S3PresignResponse) 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 *S3PresignResponse) SetMethod(v string) {
o.Method = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *S3PresignResponse) 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 *S3PresignResponse) 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 *S3PresignResponse) 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 *S3PresignResponse) SetUrl(v string) {
o.Url = &v
}
func (o S3PresignResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o S3PresignResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExpiresIn) {
toSerialize["expiresIn"] = o.ExpiresIn
}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
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 *S3PresignResponse) UnmarshalJSON(data []byte) (err error) {
varS3PresignResponse := _S3PresignResponse{}
err = json.Unmarshal(data, &varS3PresignResponse)
if err != nil {
return err
}
*o = S3PresignResponse(varS3PresignResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expiresIn")
delete(additionalProperties, "key")
delete(additionalProperties, "method")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableS3PresignResponse struct {
value *S3PresignResponse
isSet bool
}
func (v NullableS3PresignResponse) Get() *S3PresignResponse {
return v.value
}
func (v *NullableS3PresignResponse) Set(val *S3PresignResponse) {
v.value = val
v.isSet = true
}
func (v NullableS3PresignResponse) IsSet() bool {
return v.isSet
}
func (v *NullableS3PresignResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableS3PresignResponse(val *S3PresignResponse) *NullableS3PresignResponse {
return &NullableS3PresignResponse{value: val, isSet: true}
}
func (v NullableS3PresignResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableS3PresignResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}