mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
339 lines
8.0 KiB
Go
339 lines
8.0 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 SpanBody type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &SpanBody{}
|
|
|
|
// SpanBody struct for SpanBody
|
|
type SpanBody struct {
|
|
Duration *int32 `json:"duration,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Kind *string `json:"kind,omitempty"`
|
|
Parent *string `json:"parent,omitempty"`
|
|
Status *string `json:"status,omitempty"`
|
|
Trace *string `json:"trace,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _SpanBody SpanBody
|
|
|
|
// NewSpanBody instantiates a new SpanBody 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 NewSpanBody() *SpanBody {
|
|
this := SpanBody{}
|
|
return &this
|
|
}
|
|
|
|
// NewSpanBodyWithDefaults instantiates a new SpanBody 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 NewSpanBodyWithDefaults() *SpanBody {
|
|
this := SpanBody{}
|
|
return &this
|
|
}
|
|
|
|
// GetDuration returns the Duration field value if set, zero value otherwise.
|
|
func (o *SpanBody) GetDuration() int32 {
|
|
if o == nil || IsNil(o.Duration) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Duration
|
|
}
|
|
|
|
// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SpanBody) GetDurationOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Duration) {
|
|
return nil, false
|
|
}
|
|
return o.Duration, true
|
|
}
|
|
|
|
// HasDuration returns a boolean if a field has been set.
|
|
func (o *SpanBody) HasDuration() bool {
|
|
if o != nil && !IsNil(o.Duration) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDuration gets a reference to the given int32 and assigns it to the Duration field.
|
|
func (o *SpanBody) SetDuration(v int32) {
|
|
o.Duration = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *SpanBody) GetId() string {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SpanBody) GetIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *SpanBody) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *SpanBody) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *SpanBody) GetKind() string {
|
|
if o == nil || IsNil(o.Kind) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Kind
|
|
}
|
|
|
|
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SpanBody) GetKindOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Kind) {
|
|
return nil, false
|
|
}
|
|
return o.Kind, true
|
|
}
|
|
|
|
// HasKind returns a boolean if a field has been set.
|
|
func (o *SpanBody) HasKind() bool {
|
|
if o != nil && !IsNil(o.Kind) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKind gets a reference to the given string and assigns it to the Kind field.
|
|
func (o *SpanBody) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetParent returns the Parent field value if set, zero value otherwise.
|
|
func (o *SpanBody) GetParent() string {
|
|
if o == nil || IsNil(o.Parent) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Parent
|
|
}
|
|
|
|
// GetParentOk returns a tuple with the Parent field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SpanBody) GetParentOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Parent) {
|
|
return nil, false
|
|
}
|
|
return o.Parent, true
|
|
}
|
|
|
|
// HasParent returns a boolean if a field has been set.
|
|
func (o *SpanBody) HasParent() bool {
|
|
if o != nil && !IsNil(o.Parent) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetParent gets a reference to the given string and assigns it to the Parent field.
|
|
func (o *SpanBody) SetParent(v string) {
|
|
o.Parent = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *SpanBody) 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 *SpanBody) 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 *SpanBody) 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 *SpanBody) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetTrace returns the Trace field value if set, zero value otherwise.
|
|
func (o *SpanBody) GetTrace() string {
|
|
if o == nil || IsNil(o.Trace) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Trace
|
|
}
|
|
|
|
// GetTraceOk returns a tuple with the Trace field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SpanBody) GetTraceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Trace) {
|
|
return nil, false
|
|
}
|
|
return o.Trace, true
|
|
}
|
|
|
|
// HasTrace returns a boolean if a field has been set.
|
|
func (o *SpanBody) HasTrace() bool {
|
|
if o != nil && !IsNil(o.Trace) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTrace gets a reference to the given string and assigns it to the Trace field.
|
|
func (o *SpanBody) SetTrace(v string) {
|
|
o.Trace = &v
|
|
}
|
|
|
|
func (o SpanBody) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o SpanBody) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Duration) {
|
|
toSerialize["duration"] = o.Duration
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Parent) {
|
|
toSerialize["parent"] = o.Parent
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
if !IsNil(o.Trace) {
|
|
toSerialize["trace"] = o.Trace
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *SpanBody) UnmarshalJSON(data []byte) (err error) {
|
|
varSpanBody := _SpanBody{}
|
|
|
|
err = json.Unmarshal(data, &varSpanBody)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = SpanBody(varSpanBody)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "duration")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "parent")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "trace")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableSpanBody struct {
|
|
value *SpanBody
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSpanBody) Get() *SpanBody {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSpanBody) Set(val *SpanBody) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSpanBody) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSpanBody) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSpanBody(val *SpanBody) *NullableSpanBody {
|
|
return &NullableSpanBody{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSpanBody) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSpanBody) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|