Files
sdk/model_compute_sample_accepted.go

155 lines
4.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 ComputeSampleAccepted type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeSampleAccepted{}
// ComputeSampleAccepted struct for ComputeSampleAccepted
type ComputeSampleAccepted struct {
// Recorded is always true: the response is an acknowledgement, and the warehouse write is detached, so it reports acceptance, not durability.
Recorded *bool `json:"recorded,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeSampleAccepted ComputeSampleAccepted
// NewComputeSampleAccepted instantiates a new ComputeSampleAccepted 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 NewComputeSampleAccepted() *ComputeSampleAccepted {
this := ComputeSampleAccepted{}
return &this
}
// NewComputeSampleAcceptedWithDefaults instantiates a new ComputeSampleAccepted 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 NewComputeSampleAcceptedWithDefaults() *ComputeSampleAccepted {
this := ComputeSampleAccepted{}
return &this
}
// GetRecorded returns the Recorded field value if set, zero value otherwise.
func (o *ComputeSampleAccepted) GetRecorded() bool {
if o == nil || IsNil(o.Recorded) {
var ret bool
return ret
}
return *o.Recorded
}
// GetRecordedOk returns a tuple with the Recorded field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeSampleAccepted) GetRecordedOk() (*bool, bool) {
if o == nil || IsNil(o.Recorded) {
return nil, false
}
return o.Recorded, true
}
// HasRecorded returns a boolean if a field has been set.
func (o *ComputeSampleAccepted) HasRecorded() bool {
if o != nil && !IsNil(o.Recorded) {
return true
}
return false
}
// SetRecorded gets a reference to the given bool and assigns it to the Recorded field.
func (o *ComputeSampleAccepted) SetRecorded(v bool) {
o.Recorded = &v
}
func (o ComputeSampleAccepted) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeSampleAccepted) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Recorded) {
toSerialize["recorded"] = o.Recorded
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeSampleAccepted) UnmarshalJSON(data []byte) (err error) {
varComputeSampleAccepted := _ComputeSampleAccepted{}
err = json.Unmarshal(data, &varComputeSampleAccepted)
if err != nil {
return err
}
*o = ComputeSampleAccepted(varComputeSampleAccepted)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "recorded")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeSampleAccepted struct {
value *ComputeSampleAccepted
isSet bool
}
func (v NullableComputeSampleAccepted) Get() *ComputeSampleAccepted {
return v.value
}
func (v *NullableComputeSampleAccepted) Set(val *ComputeSampleAccepted) {
v.value = val
v.isSet = true
}
func (v NullableComputeSampleAccepted) IsSet() bool {
return v.isSet
}
func (v *NullableComputeSampleAccepted) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeSampleAccepted(val *ComputeSampleAccepted) *NullableComputeSampleAccepted {
return &NullableComputeSampleAccepted{value: val, isSet: true}
}
func (v NullableComputeSampleAccepted) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeSampleAccepted) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}