Files
sdk/model_patch.go

450 lines
11 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 Patch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Patch{}
// Patch struct for Patch
type Patch struct {
Category *string `json:"category,omitempty"`
ExpectedStatus *string `json:"expectedStatus,omitempty"`
InstallTime *string `json:"installTime,omitempty"`
Message *string `json:"message,omitempty"`
Name *string `json:"name,omitempty"`
Size *string `json:"size,omitempty"`
Status *string `json:"status,omitempty"`
Title *string `json:"title,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Patch Patch
// NewPatch instantiates a new Patch 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 NewPatch() *Patch {
this := Patch{}
return &this
}
// NewPatchWithDefaults instantiates a new Patch 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 NewPatchWithDefaults() *Patch {
this := Patch{}
return &this
}
// GetCategory returns the Category field value if set, zero value otherwise.
func (o *Patch) GetCategory() string {
if o == nil || IsNil(o.Category) {
var ret string
return ret
}
return *o.Category
}
// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Patch) GetCategoryOk() (*string, bool) {
if o == nil || IsNil(o.Category) {
return nil, false
}
return o.Category, true
}
// HasCategory returns a boolean if a field has been set.
func (o *Patch) HasCategory() bool {
if o != nil && !IsNil(o.Category) {
return true
}
return false
}
// SetCategory gets a reference to the given string and assigns it to the Category field.
func (o *Patch) SetCategory(v string) {
o.Category = &v
}
// GetExpectedStatus returns the ExpectedStatus field value if set, zero value otherwise.
func (o *Patch) GetExpectedStatus() string {
if o == nil || IsNil(o.ExpectedStatus) {
var ret string
return ret
}
return *o.ExpectedStatus
}
// GetExpectedStatusOk returns a tuple with the ExpectedStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Patch) GetExpectedStatusOk() (*string, bool) {
if o == nil || IsNil(o.ExpectedStatus) {
return nil, false
}
return o.ExpectedStatus, true
}
// HasExpectedStatus returns a boolean if a field has been set.
func (o *Patch) HasExpectedStatus() bool {
if o != nil && !IsNil(o.ExpectedStatus) {
return true
}
return false
}
// SetExpectedStatus gets a reference to the given string and assigns it to the ExpectedStatus field.
func (o *Patch) SetExpectedStatus(v string) {
o.ExpectedStatus = &v
}
// GetInstallTime returns the InstallTime field value if set, zero value otherwise.
func (o *Patch) GetInstallTime() string {
if o == nil || IsNil(o.InstallTime) {
var ret string
return ret
}
return *o.InstallTime
}
// GetInstallTimeOk returns a tuple with the InstallTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Patch) GetInstallTimeOk() (*string, bool) {
if o == nil || IsNil(o.InstallTime) {
return nil, false
}
return o.InstallTime, true
}
// HasInstallTime returns a boolean if a field has been set.
func (o *Patch) HasInstallTime() bool {
if o != nil && !IsNil(o.InstallTime) {
return true
}
return false
}
// SetInstallTime gets a reference to the given string and assigns it to the InstallTime field.
func (o *Patch) SetInstallTime(v string) {
o.InstallTime = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *Patch) GetMessage() string {
if o == nil || IsNil(o.Message) {
var ret string
return ret
}
return *o.Message
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Patch) GetMessageOk() (*string, bool) {
if o == nil || IsNil(o.Message) {
return nil, false
}
return o.Message, true
}
// HasMessage returns a boolean if a field has been set.
func (o *Patch) HasMessage() bool {
if o != nil && !IsNil(o.Message) {
return true
}
return false
}
// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *Patch) SetMessage(v string) {
o.Message = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Patch) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Patch) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *Patch) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Patch) SetName(v string) {
o.Name = &v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *Patch) GetSize() string {
if o == nil || IsNil(o.Size) {
var ret string
return ret
}
return *o.Size
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Patch) GetSizeOk() (*string, bool) {
if o == nil || IsNil(o.Size) {
return nil, false
}
return o.Size, true
}
// HasSize returns a boolean if a field has been set.
func (o *Patch) HasSize() bool {
if o != nil && !IsNil(o.Size) {
return true
}
return false
}
// SetSize gets a reference to the given string and assigns it to the Size field.
func (o *Patch) SetSize(v string) {
o.Size = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *Patch) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Patch) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *Patch) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *Patch) SetStatus(v string) {
o.Status = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *Patch) GetTitle() string {
if o == nil || IsNil(o.Title) {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Patch) GetTitleOk() (*string, bool) {
if o == nil || IsNil(o.Title) {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *Patch) HasTitle() bool {
if o != nil && !IsNil(o.Title) {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *Patch) SetTitle(v string) {
o.Title = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *Patch) 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 *Patch) 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 *Patch) 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 *Patch) SetUrl(v string) {
o.Url = &v
}
func (o Patch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Patch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Category) {
toSerialize["category"] = o.Category
}
if !IsNil(o.ExpectedStatus) {
toSerialize["expectedStatus"] = o.ExpectedStatus
}
if !IsNil(o.InstallTime) {
toSerialize["installTime"] = o.InstallTime
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Patch) UnmarshalJSON(data []byte) (err error) {
varPatch := _Patch{}
err = json.Unmarshal(data, &varPatch)
if err != nil {
return err
}
*o = Patch(varPatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "category")
delete(additionalProperties, "expectedStatus")
delete(additionalProperties, "installTime")
delete(additionalProperties, "message")
delete(additionalProperties, "name")
delete(additionalProperties, "size")
delete(additionalProperties, "status")
delete(additionalProperties, "title")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePatch struct {
value *Patch
isSet bool
}
func (v NullablePatch) Get() *Patch {
return v.value
}
func (v *NullablePatch) Set(val *Patch) {
v.value = val
v.isSet = true
}
func (v NullablePatch) IsSet() bool {
return v.isSet
}
func (v *NullablePatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePatch(val *Patch) *NullablePatch {
return &NullablePatch{value: val, isSet: true}
}
func (v NullablePatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePatch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}