Files
sdk/model_op.go

265 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 Op type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Op{}
// Op struct for Op
type Op struct {
Href *string `json:"href,omitempty"`
Method *string `json:"method,omitempty"`
OperationId *string `json:"operationId,omitempty"`
Summary *string `json:"summary,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Op Op
// NewOp instantiates a new Op 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 NewOp() *Op {
this := Op{}
return &this
}
// NewOpWithDefaults instantiates a new Op 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 NewOpWithDefaults() *Op {
this := Op{}
return &this
}
// GetHref returns the Href field value if set, zero value otherwise.
func (o *Op) GetHref() string {
if o == nil || IsNil(o.Href) {
var ret string
return ret
}
return *o.Href
}
// GetHrefOk returns a tuple with the Href field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Op) GetHrefOk() (*string, bool) {
if o == nil || IsNil(o.Href) {
return nil, false
}
return o.Href, true
}
// HasHref returns a boolean if a field has been set.
func (o *Op) HasHref() bool {
if o != nil && !IsNil(o.Href) {
return true
}
return false
}
// SetHref gets a reference to the given string and assigns it to the Href field.
func (o *Op) SetHref(v string) {
o.Href = &v
}
// GetMethod returns the Method field value if set, zero value otherwise.
func (o *Op) 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 *Op) 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 *Op) 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 *Op) SetMethod(v string) {
o.Method = &v
}
// GetOperationId returns the OperationId field value if set, zero value otherwise.
func (o *Op) GetOperationId() string {
if o == nil || IsNil(o.OperationId) {
var ret string
return ret
}
return *o.OperationId
}
// GetOperationIdOk returns a tuple with the OperationId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Op) GetOperationIdOk() (*string, bool) {
if o == nil || IsNil(o.OperationId) {
return nil, false
}
return o.OperationId, true
}
// HasOperationId returns a boolean if a field has been set.
func (o *Op) HasOperationId() bool {
if o != nil && !IsNil(o.OperationId) {
return true
}
return false
}
// SetOperationId gets a reference to the given string and assigns it to the OperationId field.
func (o *Op) SetOperationId(v string) {
o.OperationId = &v
}
// GetSummary returns the Summary field value if set, zero value otherwise.
func (o *Op) GetSummary() string {
if o == nil || IsNil(o.Summary) {
var ret string
return ret
}
return *o.Summary
}
// GetSummaryOk returns a tuple with the Summary field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Op) GetSummaryOk() (*string, bool) {
if o == nil || IsNil(o.Summary) {
return nil, false
}
return o.Summary, true
}
// HasSummary returns a boolean if a field has been set.
func (o *Op) HasSummary() bool {
if o != nil && !IsNil(o.Summary) {
return true
}
return false
}
// SetSummary gets a reference to the given string and assigns it to the Summary field.
func (o *Op) SetSummary(v string) {
o.Summary = &v
}
func (o Op) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Op) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Href) {
toSerialize["href"] = o.Href
}
if !IsNil(o.Method) {
toSerialize["method"] = o.Method
}
if !IsNil(o.OperationId) {
toSerialize["operationId"] = o.OperationId
}
if !IsNil(o.Summary) {
toSerialize["summary"] = o.Summary
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Op) UnmarshalJSON(data []byte) (err error) {
varOp := _Op{}
err = json.Unmarshal(data, &varOp)
if err != nil {
return err
}
*o = Op(varOp)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "href")
delete(additionalProperties, "method")
delete(additionalProperties, "operationId")
delete(additionalProperties, "summary")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOp struct {
value *Op
isSet bool
}
func (v NullableOp) Get() *Op {
return v.value
}
func (v *NullableOp) Set(val *Op) {
v.value = val
v.isSet = true
}
func (v NullableOp) IsSet() bool {
return v.isSet
}
func (v *NullableOp) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOp(val *Op) *NullableOp {
return &NullableOp{value: val, isSet: true}
}
func (v NullableOp) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOp) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}