mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
228 lines
5.7 KiB
Go
228 lines
5.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 CaptureResult type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CaptureResult{}
|
|
|
|
// CaptureResult struct for CaptureResult
|
|
type CaptureResult struct {
|
|
Accepted *int32 `json:"accepted,omitempty"`
|
|
Dropped *int32 `json:"dropped,omitempty"`
|
|
Withheld *int32 `json:"withheld,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CaptureResult CaptureResult
|
|
|
|
// NewCaptureResult instantiates a new CaptureResult 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 NewCaptureResult() *CaptureResult {
|
|
this := CaptureResult{}
|
|
return &this
|
|
}
|
|
|
|
// NewCaptureResultWithDefaults instantiates a new CaptureResult 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 NewCaptureResultWithDefaults() *CaptureResult {
|
|
this := CaptureResult{}
|
|
return &this
|
|
}
|
|
|
|
// GetAccepted returns the Accepted field value if set, zero value otherwise.
|
|
func (o *CaptureResult) GetAccepted() int32 {
|
|
if o == nil || IsNil(o.Accepted) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Accepted
|
|
}
|
|
|
|
// GetAcceptedOk returns a tuple with the Accepted field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CaptureResult) GetAcceptedOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Accepted) {
|
|
return nil, false
|
|
}
|
|
return o.Accepted, true
|
|
}
|
|
|
|
// HasAccepted returns a boolean if a field has been set.
|
|
func (o *CaptureResult) HasAccepted() bool {
|
|
if o != nil && !IsNil(o.Accepted) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAccepted gets a reference to the given int32 and assigns it to the Accepted field.
|
|
func (o *CaptureResult) SetAccepted(v int32) {
|
|
o.Accepted = &v
|
|
}
|
|
|
|
// GetDropped returns the Dropped field value if set, zero value otherwise.
|
|
func (o *CaptureResult) GetDropped() int32 {
|
|
if o == nil || IsNil(o.Dropped) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Dropped
|
|
}
|
|
|
|
// GetDroppedOk returns a tuple with the Dropped field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CaptureResult) GetDroppedOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Dropped) {
|
|
return nil, false
|
|
}
|
|
return o.Dropped, true
|
|
}
|
|
|
|
// HasDropped returns a boolean if a field has been set.
|
|
func (o *CaptureResult) HasDropped() bool {
|
|
if o != nil && !IsNil(o.Dropped) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDropped gets a reference to the given int32 and assigns it to the Dropped field.
|
|
func (o *CaptureResult) SetDropped(v int32) {
|
|
o.Dropped = &v
|
|
}
|
|
|
|
// GetWithheld returns the Withheld field value if set, zero value otherwise.
|
|
func (o *CaptureResult) GetWithheld() int32 {
|
|
if o == nil || IsNil(o.Withheld) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Withheld
|
|
}
|
|
|
|
// GetWithheldOk returns a tuple with the Withheld field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CaptureResult) GetWithheldOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Withheld) {
|
|
return nil, false
|
|
}
|
|
return o.Withheld, true
|
|
}
|
|
|
|
// HasWithheld returns a boolean if a field has been set.
|
|
func (o *CaptureResult) HasWithheld() bool {
|
|
if o != nil && !IsNil(o.Withheld) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWithheld gets a reference to the given int32 and assigns it to the Withheld field.
|
|
func (o *CaptureResult) SetWithheld(v int32) {
|
|
o.Withheld = &v
|
|
}
|
|
|
|
func (o CaptureResult) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CaptureResult) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Accepted) {
|
|
toSerialize["accepted"] = o.Accepted
|
|
}
|
|
if !IsNil(o.Dropped) {
|
|
toSerialize["dropped"] = o.Dropped
|
|
}
|
|
if !IsNil(o.Withheld) {
|
|
toSerialize["withheld"] = o.Withheld
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CaptureResult) UnmarshalJSON(data []byte) (err error) {
|
|
varCaptureResult := _CaptureResult{}
|
|
|
|
err = json.Unmarshal(data, &varCaptureResult)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CaptureResult(varCaptureResult)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "accepted")
|
|
delete(additionalProperties, "dropped")
|
|
delete(additionalProperties, "withheld")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCaptureResult struct {
|
|
value *CaptureResult
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCaptureResult) Get() *CaptureResult {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCaptureResult) Set(val *CaptureResult) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCaptureResult) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCaptureResult) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCaptureResult(val *CaptureResult) *NullableCaptureResult {
|
|
return &NullableCaptureResult{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCaptureResult) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCaptureResult) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|