Files
sdk/model_o11y_data_collected.go

191 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 O11yDataCollected type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yDataCollected{}
// O11yDataCollected struct for O11yDataCollected
type O11yDataCollected struct {
Logs []O11yCloudintegrationtypesCollectedLogAttribute `json:"logs,omitempty"`
Metrics []O11yCloudintegrationtypesCollectedMetric `json:"metrics,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yDataCollected O11yDataCollected
// NewO11yDataCollected instantiates a new O11yDataCollected 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 NewO11yDataCollected() *O11yDataCollected {
this := O11yDataCollected{}
return &this
}
// NewO11yDataCollectedWithDefaults instantiates a new O11yDataCollected 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 NewO11yDataCollectedWithDefaults() *O11yDataCollected {
this := O11yDataCollected{}
return &this
}
// GetLogs returns the Logs field value if set, zero value otherwise.
func (o *O11yDataCollected) GetLogs() []O11yCloudintegrationtypesCollectedLogAttribute {
if o == nil || IsNil(o.Logs) {
var ret []O11yCloudintegrationtypesCollectedLogAttribute
return ret
}
return o.Logs
}
// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yDataCollected) GetLogsOk() ([]O11yCloudintegrationtypesCollectedLogAttribute, bool) {
if o == nil || IsNil(o.Logs) {
return nil, false
}
return o.Logs, true
}
// HasLogs returns a boolean if a field has been set.
func (o *O11yDataCollected) HasLogs() bool {
if o != nil && !IsNil(o.Logs) {
return true
}
return false
}
// SetLogs gets a reference to the given []O11yCloudintegrationtypesCollectedLogAttribute and assigns it to the Logs field.
func (o *O11yDataCollected) SetLogs(v []O11yCloudintegrationtypesCollectedLogAttribute) {
o.Logs = v
}
// GetMetrics returns the Metrics field value if set, zero value otherwise.
func (o *O11yDataCollected) GetMetrics() []O11yCloudintegrationtypesCollectedMetric {
if o == nil || IsNil(o.Metrics) {
var ret []O11yCloudintegrationtypesCollectedMetric
return ret
}
return o.Metrics
}
// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yDataCollected) GetMetricsOk() ([]O11yCloudintegrationtypesCollectedMetric, bool) {
if o == nil || IsNil(o.Metrics) {
return nil, false
}
return o.Metrics, true
}
// HasMetrics returns a boolean if a field has been set.
func (o *O11yDataCollected) HasMetrics() bool {
if o != nil && !IsNil(o.Metrics) {
return true
}
return false
}
// SetMetrics gets a reference to the given []O11yCloudintegrationtypesCollectedMetric and assigns it to the Metrics field.
func (o *O11yDataCollected) SetMetrics(v []O11yCloudintegrationtypesCollectedMetric) {
o.Metrics = v
}
func (o O11yDataCollected) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yDataCollected) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Logs) {
toSerialize["logs"] = o.Logs
}
if !IsNil(o.Metrics) {
toSerialize["metrics"] = o.Metrics
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yDataCollected) UnmarshalJSON(data []byte) (err error) {
varO11yDataCollected := _O11yDataCollected{}
err = json.Unmarshal(data, &varO11yDataCollected)
if err != nil {
return err
}
*o = O11yDataCollected(varO11yDataCollected)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "logs")
delete(additionalProperties, "metrics")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yDataCollected struct {
value *O11yDataCollected
isSet bool
}
func (v NullableO11yDataCollected) Get() *O11yDataCollected {
return v.value
}
func (v *NullableO11yDataCollected) Set(val *O11yDataCollected) {
v.value = val
v.isSet = true
}
func (v NullableO11yDataCollected) IsSet() bool {
return v.isSet
}
func (v *NullableO11yDataCollected) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yDataCollected(val *O11yDataCollected) *NullableO11yDataCollected {
return &NullableO11yDataCollected{value: val, isSet: true}
}
func (v NullableO11yDataCollected) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yDataCollected) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}