Files
sdk/model_projects_upload_grant.go

339 lines
8.9 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 ProjectsUploadGrant type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProjectsUploadGrant{}
// ProjectsUploadGrant struct for ProjectsUploadGrant
type ProjectsUploadGrant struct {
Copy *bool `json:"copy,omitempty"`
ExpiresAt *int32 `json:"expiresAt,omitempty"`
Fields map[string]string `json:"fields,omitempty"`
MaxBytes *int32 `json:"maxBytes,omitempty"`
Prefix *string `json:"prefix,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProjectsUploadGrant ProjectsUploadGrant
// NewProjectsUploadGrant instantiates a new ProjectsUploadGrant 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 NewProjectsUploadGrant() *ProjectsUploadGrant {
this := ProjectsUploadGrant{}
return &this
}
// NewProjectsUploadGrantWithDefaults instantiates a new ProjectsUploadGrant 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 NewProjectsUploadGrantWithDefaults() *ProjectsUploadGrant {
this := ProjectsUploadGrant{}
return &this
}
// GetCopy returns the Copy field value if set, zero value otherwise.
func (o *ProjectsUploadGrant) GetCopy() bool {
if o == nil || IsNil(o.Copy) {
var ret bool
return ret
}
return *o.Copy
}
// GetCopyOk returns a tuple with the Copy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectsUploadGrant) GetCopyOk() (*bool, bool) {
if o == nil || IsNil(o.Copy) {
return nil, false
}
return o.Copy, true
}
// HasCopy returns a boolean if a field has been set.
func (o *ProjectsUploadGrant) HasCopy() bool {
if o != nil && !IsNil(o.Copy) {
return true
}
return false
}
// SetCopy gets a reference to the given bool and assigns it to the Copy field.
func (o *ProjectsUploadGrant) SetCopy(v bool) {
o.Copy = &v
}
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
func (o *ProjectsUploadGrant) GetExpiresAt() int32 {
if o == nil || IsNil(o.ExpiresAt) {
var ret int32
return ret
}
return *o.ExpiresAt
}
// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectsUploadGrant) GetExpiresAtOk() (*int32, bool) {
if o == nil || IsNil(o.ExpiresAt) {
return nil, false
}
return o.ExpiresAt, true
}
// HasExpiresAt returns a boolean if a field has been set.
func (o *ProjectsUploadGrant) HasExpiresAt() bool {
if o != nil && !IsNil(o.ExpiresAt) {
return true
}
return false
}
// SetExpiresAt gets a reference to the given int32 and assigns it to the ExpiresAt field.
func (o *ProjectsUploadGrant) SetExpiresAt(v int32) {
o.ExpiresAt = &v
}
// GetFields returns the Fields field value if set, zero value otherwise.
func (o *ProjectsUploadGrant) GetFields() map[string]string {
if o == nil || IsNil(o.Fields) {
var ret map[string]string
return ret
}
return o.Fields
}
// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectsUploadGrant) GetFieldsOk() (map[string]string, bool) {
if o == nil || IsNil(o.Fields) {
return map[string]string{}, false
}
return o.Fields, true
}
// HasFields returns a boolean if a field has been set.
func (o *ProjectsUploadGrant) HasFields() bool {
if o != nil && !IsNil(o.Fields) {
return true
}
return false
}
// SetFields gets a reference to the given map[string]string and assigns it to the Fields field.
func (o *ProjectsUploadGrant) SetFields(v map[string]string) {
o.Fields = v
}
// GetMaxBytes returns the MaxBytes field value if set, zero value otherwise.
func (o *ProjectsUploadGrant) GetMaxBytes() int32 {
if o == nil || IsNil(o.MaxBytes) {
var ret int32
return ret
}
return *o.MaxBytes
}
// GetMaxBytesOk returns a tuple with the MaxBytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectsUploadGrant) GetMaxBytesOk() (*int32, bool) {
if o == nil || IsNil(o.MaxBytes) {
return nil, false
}
return o.MaxBytes, true
}
// HasMaxBytes returns a boolean if a field has been set.
func (o *ProjectsUploadGrant) HasMaxBytes() bool {
if o != nil && !IsNil(o.MaxBytes) {
return true
}
return false
}
// SetMaxBytes gets a reference to the given int32 and assigns it to the MaxBytes field.
func (o *ProjectsUploadGrant) SetMaxBytes(v int32) {
o.MaxBytes = &v
}
// GetPrefix returns the Prefix field value if set, zero value otherwise.
func (o *ProjectsUploadGrant) GetPrefix() string {
if o == nil || IsNil(o.Prefix) {
var ret string
return ret
}
return *o.Prefix
}
// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectsUploadGrant) GetPrefixOk() (*string, bool) {
if o == nil || IsNil(o.Prefix) {
return nil, false
}
return o.Prefix, true
}
// HasPrefix returns a boolean if a field has been set.
func (o *ProjectsUploadGrant) HasPrefix() bool {
if o != nil && !IsNil(o.Prefix) {
return true
}
return false
}
// SetPrefix gets a reference to the given string and assigns it to the Prefix field.
func (o *ProjectsUploadGrant) SetPrefix(v string) {
o.Prefix = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *ProjectsUploadGrant) 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 *ProjectsUploadGrant) 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 *ProjectsUploadGrant) 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 *ProjectsUploadGrant) SetUrl(v string) {
o.Url = &v
}
func (o ProjectsUploadGrant) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProjectsUploadGrant) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Copy) {
toSerialize["copy"] = o.Copy
}
if !IsNil(o.ExpiresAt) {
toSerialize["expiresAt"] = o.ExpiresAt
}
if !IsNil(o.Fields) {
toSerialize["fields"] = o.Fields
}
if !IsNil(o.MaxBytes) {
toSerialize["maxBytes"] = o.MaxBytes
}
if !IsNil(o.Prefix) {
toSerialize["prefix"] = o.Prefix
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProjectsUploadGrant) UnmarshalJSON(data []byte) (err error) {
varProjectsUploadGrant := _ProjectsUploadGrant{}
err = json.Unmarshal(data, &varProjectsUploadGrant)
if err != nil {
return err
}
*o = ProjectsUploadGrant(varProjectsUploadGrant)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "copy")
delete(additionalProperties, "expiresAt")
delete(additionalProperties, "fields")
delete(additionalProperties, "maxBytes")
delete(additionalProperties, "prefix")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProjectsUploadGrant struct {
value *ProjectsUploadGrant
isSet bool
}
func (v NullableProjectsUploadGrant) Get() *ProjectsUploadGrant {
return v.value
}
func (v *NullableProjectsUploadGrant) Set(val *ProjectsUploadGrant) {
v.value = val
v.isSet = true
}
func (v NullableProjectsUploadGrant) IsSet() bool {
return v.isSet
}
func (v *NullableProjectsUploadGrant) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProjectsUploadGrant(val *ProjectsUploadGrant) *NullableProjectsUploadGrant {
return &NullableProjectsUploadGrant{value: val, isSet: true}
}
func (v NullableProjectsUploadGrant) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProjectsUploadGrant) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}