Files
sdk/model_capture_batch.go

191 lines
4.7 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 CaptureBatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CaptureBatch{}
// CaptureBatch struct for CaptureBatch
type CaptureBatch struct {
Batch []CaptureEvent `json:"batch,omitempty"`
Events []CaptureEvent `json:"events,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CaptureBatch CaptureBatch
// NewCaptureBatch instantiates a new CaptureBatch 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 NewCaptureBatch() *CaptureBatch {
this := CaptureBatch{}
return &this
}
// NewCaptureBatchWithDefaults instantiates a new CaptureBatch 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 NewCaptureBatchWithDefaults() *CaptureBatch {
this := CaptureBatch{}
return &this
}
// GetBatch returns the Batch field value if set, zero value otherwise.
func (o *CaptureBatch) GetBatch() []CaptureEvent {
if o == nil || IsNil(o.Batch) {
var ret []CaptureEvent
return ret
}
return o.Batch
}
// GetBatchOk returns a tuple with the Batch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaptureBatch) GetBatchOk() ([]CaptureEvent, bool) {
if o == nil || IsNil(o.Batch) {
return nil, false
}
return o.Batch, true
}
// HasBatch returns a boolean if a field has been set.
func (o *CaptureBatch) HasBatch() bool {
if o != nil && !IsNil(o.Batch) {
return true
}
return false
}
// SetBatch gets a reference to the given []CaptureEvent and assigns it to the Batch field.
func (o *CaptureBatch) SetBatch(v []CaptureEvent) {
o.Batch = v
}
// GetEvents returns the Events field value if set, zero value otherwise.
func (o *CaptureBatch) GetEvents() []CaptureEvent {
if o == nil || IsNil(o.Events) {
var ret []CaptureEvent
return ret
}
return o.Events
}
// GetEventsOk returns a tuple with the Events field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaptureBatch) GetEventsOk() ([]CaptureEvent, bool) {
if o == nil || IsNil(o.Events) {
return nil, false
}
return o.Events, true
}
// HasEvents returns a boolean if a field has been set.
func (o *CaptureBatch) HasEvents() bool {
if o != nil && !IsNil(o.Events) {
return true
}
return false
}
// SetEvents gets a reference to the given []CaptureEvent and assigns it to the Events field.
func (o *CaptureBatch) SetEvents(v []CaptureEvent) {
o.Events = v
}
func (o CaptureBatch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CaptureBatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Batch) {
toSerialize["batch"] = o.Batch
}
if !IsNil(o.Events) {
toSerialize["events"] = o.Events
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CaptureBatch) UnmarshalJSON(data []byte) (err error) {
varCaptureBatch := _CaptureBatch{}
err = json.Unmarshal(data, &varCaptureBatch)
if err != nil {
return err
}
*o = CaptureBatch(varCaptureBatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "batch")
delete(additionalProperties, "events")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCaptureBatch struct {
value *CaptureBatch
isSet bool
}
func (v NullableCaptureBatch) Get() *CaptureBatch {
return v.value
}
func (v *NullableCaptureBatch) Set(val *CaptureBatch) {
v.value = val
v.isSet = true
}
func (v NullableCaptureBatch) IsSet() bool {
return v.isSet
}
func (v *NullableCaptureBatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCaptureBatch(val *CaptureBatch) *NullableCaptureBatch {
return &NullableCaptureBatch{value: val, isSet: true}
}
func (v NullableCaptureBatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCaptureBatch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}