Files
sdk/model_log_body.go

228 lines
5.3 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 LogBody type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LogBody{}
// LogBody struct for LogBody
type LogBody struct {
Body *string `json:"body,omitempty"`
Number *int32 `json:"number,omitempty"`
Severity *string `json:"severity,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LogBody LogBody
// NewLogBody instantiates a new LogBody 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 NewLogBody() *LogBody {
this := LogBody{}
return &this
}
// NewLogBodyWithDefaults instantiates a new LogBody 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 NewLogBodyWithDefaults() *LogBody {
this := LogBody{}
return &this
}
// GetBody returns the Body field value if set, zero value otherwise.
func (o *LogBody) GetBody() string {
if o == nil || IsNil(o.Body) {
var ret string
return ret
}
return *o.Body
}
// GetBodyOk returns a tuple with the Body field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LogBody) GetBodyOk() (*string, bool) {
if o == nil || IsNil(o.Body) {
return nil, false
}
return o.Body, true
}
// HasBody returns a boolean if a field has been set.
func (o *LogBody) HasBody() bool {
if o != nil && !IsNil(o.Body) {
return true
}
return false
}
// SetBody gets a reference to the given string and assigns it to the Body field.
func (o *LogBody) SetBody(v string) {
o.Body = &v
}
// GetNumber returns the Number field value if set, zero value otherwise.
func (o *LogBody) GetNumber() int32 {
if o == nil || IsNil(o.Number) {
var ret int32
return ret
}
return *o.Number
}
// GetNumberOk returns a tuple with the Number field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LogBody) GetNumberOk() (*int32, bool) {
if o == nil || IsNil(o.Number) {
return nil, false
}
return o.Number, true
}
// HasNumber returns a boolean if a field has been set.
func (o *LogBody) HasNumber() bool {
if o != nil && !IsNil(o.Number) {
return true
}
return false
}
// SetNumber gets a reference to the given int32 and assigns it to the Number field.
func (o *LogBody) SetNumber(v int32) {
o.Number = &v
}
// GetSeverity returns the Severity field value if set, zero value otherwise.
func (o *LogBody) GetSeverity() string {
if o == nil || IsNil(o.Severity) {
var ret string
return ret
}
return *o.Severity
}
// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LogBody) GetSeverityOk() (*string, bool) {
if o == nil || IsNil(o.Severity) {
return nil, false
}
return o.Severity, true
}
// HasSeverity returns a boolean if a field has been set.
func (o *LogBody) HasSeverity() bool {
if o != nil && !IsNil(o.Severity) {
return true
}
return false
}
// SetSeverity gets a reference to the given string and assigns it to the Severity field.
func (o *LogBody) SetSeverity(v string) {
o.Severity = &v
}
func (o LogBody) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LogBody) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Body) {
toSerialize["body"] = o.Body
}
if !IsNil(o.Number) {
toSerialize["number"] = o.Number
}
if !IsNil(o.Severity) {
toSerialize["severity"] = o.Severity
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LogBody) UnmarshalJSON(data []byte) (err error) {
varLogBody := _LogBody{}
err = json.Unmarshal(data, &varLogBody)
if err != nil {
return err
}
*o = LogBody(varLogBody)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "body")
delete(additionalProperties, "number")
delete(additionalProperties, "severity")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLogBody struct {
value *LogBody
isSet bool
}
func (v NullableLogBody) Get() *LogBody {
return v.value
}
func (v *NullableLogBody) Set(val *LogBody) {
v.value = val
v.isSet = true
}
func (v NullableLogBody) IsSet() bool {
return v.isSet
}
func (v *NullableLogBody) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLogBody(val *LogBody) *NullableLogBody {
return &NullableLogBody{value: val, isSet: true}
}
func (v NullableLogBody) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLogBody) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}