Files
sdk/model_service.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 Service type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Service{}
// Service struct for Service
type Service struct {
ExpectedStatus *string `json:"expectedStatus,omitempty"`
Message *string `json:"message,omitempty"`
Name *string `json:"name,omitempty"`
No *int32 `json:"no,omitempty"`
Path *string `json:"path,omitempty"`
Port *int32 `json:"port,omitempty"`
ProcessId *int32 `json:"processId,omitempty"`
Status *string `json:"status,omitempty"`
SubStatus *string `json:"subStatus,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Service Service
// NewService instantiates a new Service 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 NewService() *Service {
this := Service{}
return &this
}
// NewServiceWithDefaults instantiates a new Service 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 NewServiceWithDefaults() *Service {
this := Service{}
return &this
}
// GetExpectedStatus returns the ExpectedStatus field value if set, zero value otherwise.
func (o *Service) 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 *Service) 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 *Service) 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 *Service) SetExpectedStatus(v string) {
o.ExpectedStatus = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *Service) 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 *Service) 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 *Service) 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 *Service) SetMessage(v string) {
o.Message = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Service) 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 *Service) 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 *Service) 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 *Service) SetName(v string) {
o.Name = &v
}
// GetNo returns the No field value if set, zero value otherwise.
func (o *Service) GetNo() int32 {
if o == nil || IsNil(o.No) {
var ret int32
return ret
}
return *o.No
}
// GetNoOk returns a tuple with the No field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Service) GetNoOk() (*int32, bool) {
if o == nil || IsNil(o.No) {
return nil, false
}
return o.No, true
}
// HasNo returns a boolean if a field has been set.
func (o *Service) HasNo() bool {
if o != nil && !IsNil(o.No) {
return true
}
return false
}
// SetNo gets a reference to the given int32 and assigns it to the No field.
func (o *Service) SetNo(v int32) {
o.No = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *Service) GetPath() string {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Service) GetPathOk() (*string, bool) {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *Service) HasPath() bool {
if o != nil && !IsNil(o.Path) {
return true
}
return false
}
// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *Service) SetPath(v string) {
o.Path = &v
}
// GetPort returns the Port field value if set, zero value otherwise.
func (o *Service) GetPort() int32 {
if o == nil || IsNil(o.Port) {
var ret int32
return ret
}
return *o.Port
}
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Service) GetPortOk() (*int32, bool) {
if o == nil || IsNil(o.Port) {
return nil, false
}
return o.Port, true
}
// HasPort returns a boolean if a field has been set.
func (o *Service) HasPort() bool {
if o != nil && !IsNil(o.Port) {
return true
}
return false
}
// SetPort gets a reference to the given int32 and assigns it to the Port field.
func (o *Service) SetPort(v int32) {
o.Port = &v
}
// GetProcessId returns the ProcessId field value if set, zero value otherwise.
func (o *Service) GetProcessId() int32 {
if o == nil || IsNil(o.ProcessId) {
var ret int32
return ret
}
return *o.ProcessId
}
// GetProcessIdOk returns a tuple with the ProcessId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Service) GetProcessIdOk() (*int32, bool) {
if o == nil || IsNil(o.ProcessId) {
return nil, false
}
return o.ProcessId, true
}
// HasProcessId returns a boolean if a field has been set.
func (o *Service) HasProcessId() bool {
if o != nil && !IsNil(o.ProcessId) {
return true
}
return false
}
// SetProcessId gets a reference to the given int32 and assigns it to the ProcessId field.
func (o *Service) SetProcessId(v int32) {
o.ProcessId = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *Service) 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 *Service) 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 *Service) 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 *Service) SetStatus(v string) {
o.Status = &v
}
// GetSubStatus returns the SubStatus field value if set, zero value otherwise.
func (o *Service) GetSubStatus() string {
if o == nil || IsNil(o.SubStatus) {
var ret string
return ret
}
return *o.SubStatus
}
// GetSubStatusOk returns a tuple with the SubStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Service) GetSubStatusOk() (*string, bool) {
if o == nil || IsNil(o.SubStatus) {
return nil, false
}
return o.SubStatus, true
}
// HasSubStatus returns a boolean if a field has been set.
func (o *Service) HasSubStatus() bool {
if o != nil && !IsNil(o.SubStatus) {
return true
}
return false
}
// SetSubStatus gets a reference to the given string and assigns it to the SubStatus field.
func (o *Service) SetSubStatus(v string) {
o.SubStatus = &v
}
func (o Service) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Service) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExpectedStatus) {
toSerialize["expectedStatus"] = o.ExpectedStatus
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.No) {
toSerialize["no"] = o.No
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Port) {
toSerialize["port"] = o.Port
}
if !IsNil(o.ProcessId) {
toSerialize["processId"] = o.ProcessId
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.SubStatus) {
toSerialize["subStatus"] = o.SubStatus
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Service) UnmarshalJSON(data []byte) (err error) {
varService := _Service{}
err = json.Unmarshal(data, &varService)
if err != nil {
return err
}
*o = Service(varService)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expectedStatus")
delete(additionalProperties, "message")
delete(additionalProperties, "name")
delete(additionalProperties, "no")
delete(additionalProperties, "path")
delete(additionalProperties, "port")
delete(additionalProperties, "processId")
delete(additionalProperties, "status")
delete(additionalProperties, "subStatus")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableService struct {
value *Service
isSet bool
}
func (v NullableService) Get() *Service {
return v.value
}
func (v *NullableService) Set(val *Service) {
v.value = val
v.isSet = true
}
func (v NullableService) IsSet() bool {
return v.isSet
}
func (v *NullableService) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableService(val *Service) *NullableService {
return &NullableService{value: val, isSet: true}
}
func (v NullableService) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableService) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}