Files
sdk/model_o11y_datastore_query.go

228 lines
5.9 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 O11yDatastoreQuery type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yDatastoreQuery{}
// O11yDatastoreQuery struct for O11yDatastoreQuery
type O11yDatastoreQuery struct {
Disabled *bool `json:"disabled,omitempty"`
Legend *string `json:"legend,omitempty"`
Query *string `json:"query,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yDatastoreQuery O11yDatastoreQuery
// NewO11yDatastoreQuery instantiates a new O11yDatastoreQuery 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 NewO11yDatastoreQuery() *O11yDatastoreQuery {
this := O11yDatastoreQuery{}
return &this
}
// NewO11yDatastoreQueryWithDefaults instantiates a new O11yDatastoreQuery 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 NewO11yDatastoreQueryWithDefaults() *O11yDatastoreQuery {
this := O11yDatastoreQuery{}
return &this
}
// GetDisabled returns the Disabled field value if set, zero value otherwise.
func (o *O11yDatastoreQuery) GetDisabled() bool {
if o == nil || IsNil(o.Disabled) {
var ret bool
return ret
}
return *o.Disabled
}
// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yDatastoreQuery) GetDisabledOk() (*bool, bool) {
if o == nil || IsNil(o.Disabled) {
return nil, false
}
return o.Disabled, true
}
// HasDisabled returns a boolean if a field has been set.
func (o *O11yDatastoreQuery) HasDisabled() bool {
if o != nil && !IsNil(o.Disabled) {
return true
}
return false
}
// SetDisabled gets a reference to the given bool and assigns it to the Disabled field.
func (o *O11yDatastoreQuery) SetDisabled(v bool) {
o.Disabled = &v
}
// GetLegend returns the Legend field value if set, zero value otherwise.
func (o *O11yDatastoreQuery) GetLegend() string {
if o == nil || IsNil(o.Legend) {
var ret string
return ret
}
return *o.Legend
}
// GetLegendOk returns a tuple with the Legend field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yDatastoreQuery) GetLegendOk() (*string, bool) {
if o == nil || IsNil(o.Legend) {
return nil, false
}
return o.Legend, true
}
// HasLegend returns a boolean if a field has been set.
func (o *O11yDatastoreQuery) HasLegend() bool {
if o != nil && !IsNil(o.Legend) {
return true
}
return false
}
// SetLegend gets a reference to the given string and assigns it to the Legend field.
func (o *O11yDatastoreQuery) SetLegend(v string) {
o.Legend = &v
}
// GetQuery returns the Query field value if set, zero value otherwise.
func (o *O11yDatastoreQuery) GetQuery() string {
if o == nil || IsNil(o.Query) {
var ret string
return ret
}
return *o.Query
}
// GetQueryOk returns a tuple with the Query field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yDatastoreQuery) GetQueryOk() (*string, bool) {
if o == nil || IsNil(o.Query) {
return nil, false
}
return o.Query, true
}
// HasQuery returns a boolean if a field has been set.
func (o *O11yDatastoreQuery) HasQuery() bool {
if o != nil && !IsNil(o.Query) {
return true
}
return false
}
// SetQuery gets a reference to the given string and assigns it to the Query field.
func (o *O11yDatastoreQuery) SetQuery(v string) {
o.Query = &v
}
func (o O11yDatastoreQuery) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yDatastoreQuery) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Disabled) {
toSerialize["disabled"] = o.Disabled
}
if !IsNil(o.Legend) {
toSerialize["legend"] = o.Legend
}
if !IsNil(o.Query) {
toSerialize["query"] = o.Query
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yDatastoreQuery) UnmarshalJSON(data []byte) (err error) {
varO11yDatastoreQuery := _O11yDatastoreQuery{}
err = json.Unmarshal(data, &varO11yDatastoreQuery)
if err != nil {
return err
}
*o = O11yDatastoreQuery(varO11yDatastoreQuery)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "disabled")
delete(additionalProperties, "legend")
delete(additionalProperties, "query")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yDatastoreQuery struct {
value *O11yDatastoreQuery
isSet bool
}
func (v NullableO11yDatastoreQuery) Get() *O11yDatastoreQuery {
return v.value
}
func (v *NullableO11yDatastoreQuery) Set(val *O11yDatastoreQuery) {
v.value = val
v.isSet = true
}
func (v NullableO11yDatastoreQuery) IsSet() bool {
return v.isSet
}
func (v *NullableO11yDatastoreQuery) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yDatastoreQuery(val *O11yDatastoreQuery) *NullableO11yDatastoreQuery {
return &NullableO11yDatastoreQuery{value: val, isSet: true}
}
func (v NullableO11yDatastoreQuery) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yDatastoreQuery) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}