Files
sdk/model_link_ingest_resp.go

231 lines
6.0 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 LinkIngestResp type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LinkIngestResp{}
// LinkIngestResp struct for LinkIngestResp
type LinkIngestResp struct {
// Accepted is how many samples this report landed.
Accepted *int64 `json:"accepted,omitempty"`
// Links is the link row each distinct (machine, provider, account) in the batch refreshed.
Links []LinkLinkView `json:"links,omitempty"`
// Stored reports whether history was durably written; false means the warehouse was unavailable and only the link rows were refreshed.
Stored *bool `json:"stored,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LinkIngestResp LinkIngestResp
// NewLinkIngestResp instantiates a new LinkIngestResp 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 NewLinkIngestResp() *LinkIngestResp {
this := LinkIngestResp{}
return &this
}
// NewLinkIngestRespWithDefaults instantiates a new LinkIngestResp 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 NewLinkIngestRespWithDefaults() *LinkIngestResp {
this := LinkIngestResp{}
return &this
}
// GetAccepted returns the Accepted field value if set, zero value otherwise.
func (o *LinkIngestResp) GetAccepted() int64 {
if o == nil || IsNil(o.Accepted) {
var ret int64
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 *LinkIngestResp) GetAcceptedOk() (*int64, 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 *LinkIngestResp) HasAccepted() bool {
if o != nil && !IsNil(o.Accepted) {
return true
}
return false
}
// SetAccepted gets a reference to the given int64 and assigns it to the Accepted field.
func (o *LinkIngestResp) SetAccepted(v int64) {
o.Accepted = &v
}
// GetLinks returns the Links field value if set, zero value otherwise.
func (o *LinkIngestResp) GetLinks() []LinkLinkView {
if o == nil || IsNil(o.Links) {
var ret []LinkLinkView
return ret
}
return o.Links
}
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkIngestResp) GetLinksOk() ([]LinkLinkView, bool) {
if o == nil || IsNil(o.Links) {
return nil, false
}
return o.Links, true
}
// HasLinks returns a boolean if a field has been set.
func (o *LinkIngestResp) HasLinks() bool {
if o != nil && !IsNil(o.Links) {
return true
}
return false
}
// SetLinks gets a reference to the given []LinkLinkView and assigns it to the Links field.
func (o *LinkIngestResp) SetLinks(v []LinkLinkView) {
o.Links = v
}
// GetStored returns the Stored field value if set, zero value otherwise.
func (o *LinkIngestResp) GetStored() bool {
if o == nil || IsNil(o.Stored) {
var ret bool
return ret
}
return *o.Stored
}
// GetStoredOk returns a tuple with the Stored field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkIngestResp) GetStoredOk() (*bool, bool) {
if o == nil || IsNil(o.Stored) {
return nil, false
}
return o.Stored, true
}
// HasStored returns a boolean if a field has been set.
func (o *LinkIngestResp) HasStored() bool {
if o != nil && !IsNil(o.Stored) {
return true
}
return false
}
// SetStored gets a reference to the given bool and assigns it to the Stored field.
func (o *LinkIngestResp) SetStored(v bool) {
o.Stored = &v
}
func (o LinkIngestResp) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LinkIngestResp) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Accepted) {
toSerialize["accepted"] = o.Accepted
}
if !IsNil(o.Links) {
toSerialize["links"] = o.Links
}
if !IsNil(o.Stored) {
toSerialize["stored"] = o.Stored
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LinkIngestResp) UnmarshalJSON(data []byte) (err error) {
varLinkIngestResp := _LinkIngestResp{}
err = json.Unmarshal(data, &varLinkIngestResp)
if err != nil {
return err
}
*o = LinkIngestResp(varLinkIngestResp)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "accepted")
delete(additionalProperties, "links")
delete(additionalProperties, "stored")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLinkIngestResp struct {
value *LinkIngestResp
isSet bool
}
func (v NullableLinkIngestResp) Get() *LinkIngestResp {
return v.value
}
func (v *NullableLinkIngestResp) Set(val *LinkIngestResp) {
v.value = val
v.isSet = true
}
func (v NullableLinkIngestResp) IsSet() bool {
return v.isSet
}
func (v *NullableLinkIngestResp) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLinkIngestResp(val *LinkIngestResp) *NullableLinkIngestResp {
return &NullableLinkIngestResp{value: val, isSet: true}
}
func (v NullableLinkIngestResp) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLinkIngestResp) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}