mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
192 lines
4.8 KiB
Go
192 lines
4.8 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 TrainCapture type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrainCapture{}
|
|
|
|
// TrainCapture struct for TrainCapture
|
|
type TrainCapture struct {
|
|
On *bool `json:"on,omitempty"`
|
|
// RetentionDays is how long a decision's states are kept unless a correction names it.
|
|
RetentionDays *int64 `json:"retention_days,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrainCapture TrainCapture
|
|
|
|
// NewTrainCapture instantiates a new TrainCapture 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 NewTrainCapture() *TrainCapture {
|
|
this := TrainCapture{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrainCaptureWithDefaults instantiates a new TrainCapture 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 NewTrainCaptureWithDefaults() *TrainCapture {
|
|
this := TrainCapture{}
|
|
return &this
|
|
}
|
|
|
|
// GetOn returns the On field value if set, zero value otherwise.
|
|
func (o *TrainCapture) GetOn() bool {
|
|
if o == nil || IsNil(o.On) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.On
|
|
}
|
|
|
|
// GetOnOk returns a tuple with the On field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapture) GetOnOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.On) {
|
|
return nil, false
|
|
}
|
|
return o.On, true
|
|
}
|
|
|
|
// HasOn returns a boolean if a field has been set.
|
|
func (o *TrainCapture) HasOn() bool {
|
|
if o != nil && !IsNil(o.On) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOn gets a reference to the given bool and assigns it to the On field.
|
|
func (o *TrainCapture) SetOn(v bool) {
|
|
o.On = &v
|
|
}
|
|
|
|
// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise.
|
|
func (o *TrainCapture) GetRetentionDays() int64 {
|
|
if o == nil || IsNil(o.RetentionDays) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.RetentionDays
|
|
}
|
|
|
|
// GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrainCapture) GetRetentionDaysOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.RetentionDays) {
|
|
return nil, false
|
|
}
|
|
return o.RetentionDays, true
|
|
}
|
|
|
|
// HasRetentionDays returns a boolean if a field has been set.
|
|
func (o *TrainCapture) HasRetentionDays() bool {
|
|
if o != nil && !IsNil(o.RetentionDays) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRetentionDays gets a reference to the given int64 and assigns it to the RetentionDays field.
|
|
func (o *TrainCapture) SetRetentionDays(v int64) {
|
|
o.RetentionDays = &v
|
|
}
|
|
|
|
func (o TrainCapture) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrainCapture) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.On) {
|
|
toSerialize["on"] = o.On
|
|
}
|
|
if !IsNil(o.RetentionDays) {
|
|
toSerialize["retention_days"] = o.RetentionDays
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrainCapture) UnmarshalJSON(data []byte) (err error) {
|
|
varTrainCapture := _TrainCapture{}
|
|
|
|
err = json.Unmarshal(data, &varTrainCapture)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrainCapture(varTrainCapture)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "on")
|
|
delete(additionalProperties, "retention_days")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrainCapture struct {
|
|
value *TrainCapture
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrainCapture) Get() *TrainCapture {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrainCapture) Set(val *TrainCapture) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrainCapture) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrainCapture) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrainCapture(val *TrainCapture) *NullableTrainCapture {
|
|
return &NullableTrainCapture{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrainCapture) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrainCapture) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|