Files
sdk/model_o11y_item_input.go

345 lines
9.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 O11yItemInput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yItemInput{}
// O11yItemInput struct for O11yItemInput
type O11yItemInput struct {
// Assignee is the reviewer this item is for, up to 512 characters.
Assignee *string `json:"assignee,omitempty"`
// ObjectID is the referenced object's id, paired with objectType.
ObjectId *string `json:"objectId,omitempty"`
// ObjectType is TRACE, OBSERVATION or SESSION — the generic form, paired with objectId.
ObjectType *string `json:"objectType,omitempty"`
// ObservationID references an observation — the console-friendly form of objectType=OBSERVATION.
ObservationId *string `json:"observationId,omitempty"`
// SessionID references a session — the console-friendly form of objectType=SESSION.
SessionId *string `json:"sessionId,omitempty"`
// TraceID references a trace — the console-friendly form of objectType=TRACE.
TraceId *string `json:"traceId,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yItemInput O11yItemInput
// NewO11yItemInput instantiates a new O11yItemInput 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 NewO11yItemInput() *O11yItemInput {
this := O11yItemInput{}
return &this
}
// NewO11yItemInputWithDefaults instantiates a new O11yItemInput 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 NewO11yItemInputWithDefaults() *O11yItemInput {
this := O11yItemInput{}
return &this
}
// GetAssignee returns the Assignee field value if set, zero value otherwise.
func (o *O11yItemInput) GetAssignee() string {
if o == nil || IsNil(o.Assignee) {
var ret string
return ret
}
return *o.Assignee
}
// GetAssigneeOk returns a tuple with the Assignee field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yItemInput) GetAssigneeOk() (*string, bool) {
if o == nil || IsNil(o.Assignee) {
return nil, false
}
return o.Assignee, true
}
// HasAssignee returns a boolean if a field has been set.
func (o *O11yItemInput) HasAssignee() bool {
if o != nil && !IsNil(o.Assignee) {
return true
}
return false
}
// SetAssignee gets a reference to the given string and assigns it to the Assignee field.
func (o *O11yItemInput) SetAssignee(v string) {
o.Assignee = &v
}
// GetObjectId returns the ObjectId field value if set, zero value otherwise.
func (o *O11yItemInput) GetObjectId() string {
if o == nil || IsNil(o.ObjectId) {
var ret string
return ret
}
return *o.ObjectId
}
// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yItemInput) GetObjectIdOk() (*string, bool) {
if o == nil || IsNil(o.ObjectId) {
return nil, false
}
return o.ObjectId, true
}
// HasObjectId returns a boolean if a field has been set.
func (o *O11yItemInput) HasObjectId() bool {
if o != nil && !IsNil(o.ObjectId) {
return true
}
return false
}
// SetObjectId gets a reference to the given string and assigns it to the ObjectId field.
func (o *O11yItemInput) SetObjectId(v string) {
o.ObjectId = &v
}
// GetObjectType returns the ObjectType field value if set, zero value otherwise.
func (o *O11yItemInput) GetObjectType() string {
if o == nil || IsNil(o.ObjectType) {
var ret string
return ret
}
return *o.ObjectType
}
// GetObjectTypeOk returns a tuple with the ObjectType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yItemInput) GetObjectTypeOk() (*string, bool) {
if o == nil || IsNil(o.ObjectType) {
return nil, false
}
return o.ObjectType, true
}
// HasObjectType returns a boolean if a field has been set.
func (o *O11yItemInput) HasObjectType() bool {
if o != nil && !IsNil(o.ObjectType) {
return true
}
return false
}
// SetObjectType gets a reference to the given string and assigns it to the ObjectType field.
func (o *O11yItemInput) SetObjectType(v string) {
o.ObjectType = &v
}
// GetObservationId returns the ObservationId field value if set, zero value otherwise.
func (o *O11yItemInput) GetObservationId() string {
if o == nil || IsNil(o.ObservationId) {
var ret string
return ret
}
return *o.ObservationId
}
// GetObservationIdOk returns a tuple with the ObservationId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yItemInput) GetObservationIdOk() (*string, bool) {
if o == nil || IsNil(o.ObservationId) {
return nil, false
}
return o.ObservationId, true
}
// HasObservationId returns a boolean if a field has been set.
func (o *O11yItemInput) HasObservationId() bool {
if o != nil && !IsNil(o.ObservationId) {
return true
}
return false
}
// SetObservationId gets a reference to the given string and assigns it to the ObservationId field.
func (o *O11yItemInput) SetObservationId(v string) {
o.ObservationId = &v
}
// GetSessionId returns the SessionId field value if set, zero value otherwise.
func (o *O11yItemInput) GetSessionId() string {
if o == nil || IsNil(o.SessionId) {
var ret string
return ret
}
return *o.SessionId
}
// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yItemInput) GetSessionIdOk() (*string, bool) {
if o == nil || IsNil(o.SessionId) {
return nil, false
}
return o.SessionId, true
}
// HasSessionId returns a boolean if a field has been set.
func (o *O11yItemInput) HasSessionId() bool {
if o != nil && !IsNil(o.SessionId) {
return true
}
return false
}
// SetSessionId gets a reference to the given string and assigns it to the SessionId field.
func (o *O11yItemInput) SetSessionId(v string) {
o.SessionId = &v
}
// GetTraceId returns the TraceId field value if set, zero value otherwise.
func (o *O11yItemInput) GetTraceId() string {
if o == nil || IsNil(o.TraceId) {
var ret string
return ret
}
return *o.TraceId
}
// GetTraceIdOk returns a tuple with the TraceId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yItemInput) GetTraceIdOk() (*string, bool) {
if o == nil || IsNil(o.TraceId) {
return nil, false
}
return o.TraceId, true
}
// HasTraceId returns a boolean if a field has been set.
func (o *O11yItemInput) HasTraceId() bool {
if o != nil && !IsNil(o.TraceId) {
return true
}
return false
}
// SetTraceId gets a reference to the given string and assigns it to the TraceId field.
func (o *O11yItemInput) SetTraceId(v string) {
o.TraceId = &v
}
func (o O11yItemInput) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yItemInput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Assignee) {
toSerialize["assignee"] = o.Assignee
}
if !IsNil(o.ObjectId) {
toSerialize["objectId"] = o.ObjectId
}
if !IsNil(o.ObjectType) {
toSerialize["objectType"] = o.ObjectType
}
if !IsNil(o.ObservationId) {
toSerialize["observationId"] = o.ObservationId
}
if !IsNil(o.SessionId) {
toSerialize["sessionId"] = o.SessionId
}
if !IsNil(o.TraceId) {
toSerialize["traceId"] = o.TraceId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yItemInput) UnmarshalJSON(data []byte) (err error) {
varO11yItemInput := _O11yItemInput{}
err = json.Unmarshal(data, &varO11yItemInput)
if err != nil {
return err
}
*o = O11yItemInput(varO11yItemInput)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "assignee")
delete(additionalProperties, "objectId")
delete(additionalProperties, "objectType")
delete(additionalProperties, "observationId")
delete(additionalProperties, "sessionId")
delete(additionalProperties, "traceId")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yItemInput struct {
value *O11yItemInput
isSet bool
}
func (v NullableO11yItemInput) Get() *O11yItemInput {
return v.value
}
func (v *NullableO11yItemInput) Set(val *O11yItemInput) {
v.value = val
v.isSet = true
}
func (v NullableO11yItemInput) IsSet() bool {
return v.isSet
}
func (v *NullableO11yItemInput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yItemInput(val *O11yItemInput) *NullableO11yItemInput {
return &NullableO11yItemInput{value: val, isSet: true}
}
func (v NullableO11yItemInput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yItemInput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}