Files
sdk/model_form_imports.go

231 lines
5.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 FormImports type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FormImports{}
// FormImports struct for FormImports
type FormImports struct {
// Created counts the responses made new.
Created *int64 `json:"created,omitempty"`
// Existing counts the ones already held: imported before, or the same subscriber.
Existing *int64 `json:"existing,omitempty"`
// Failed are the ones refused, with why.
Failed []FormImportFailure `json:"failed,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FormImports FormImports
// NewFormImports instantiates a new FormImports 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 NewFormImports() *FormImports {
this := FormImports{}
return &this
}
// NewFormImportsWithDefaults instantiates a new FormImports 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 NewFormImportsWithDefaults() *FormImports {
this := FormImports{}
return &this
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *FormImports) GetCreated() int64 {
if o == nil || IsNil(o.Created) {
var ret int64
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormImports) GetCreatedOk() (*int64, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *FormImports) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given int64 and assigns it to the Created field.
func (o *FormImports) SetCreated(v int64) {
o.Created = &v
}
// GetExisting returns the Existing field value if set, zero value otherwise.
func (o *FormImports) GetExisting() int64 {
if o == nil || IsNil(o.Existing) {
var ret int64
return ret
}
return *o.Existing
}
// GetExistingOk returns a tuple with the Existing field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormImports) GetExistingOk() (*int64, bool) {
if o == nil || IsNil(o.Existing) {
return nil, false
}
return o.Existing, true
}
// HasExisting returns a boolean if a field has been set.
func (o *FormImports) HasExisting() bool {
if o != nil && !IsNil(o.Existing) {
return true
}
return false
}
// SetExisting gets a reference to the given int64 and assigns it to the Existing field.
func (o *FormImports) SetExisting(v int64) {
o.Existing = &v
}
// GetFailed returns the Failed field value if set, zero value otherwise.
func (o *FormImports) GetFailed() []FormImportFailure {
if o == nil || IsNil(o.Failed) {
var ret []FormImportFailure
return ret
}
return o.Failed
}
// GetFailedOk returns a tuple with the Failed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormImports) GetFailedOk() ([]FormImportFailure, bool) {
if o == nil || IsNil(o.Failed) {
return nil, false
}
return o.Failed, true
}
// HasFailed returns a boolean if a field has been set.
func (o *FormImports) HasFailed() bool {
if o != nil && !IsNil(o.Failed) {
return true
}
return false
}
// SetFailed gets a reference to the given []FormImportFailure and assigns it to the Failed field.
func (o *FormImports) SetFailed(v []FormImportFailure) {
o.Failed = v
}
func (o FormImports) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FormImports) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Existing) {
toSerialize["existing"] = o.Existing
}
if !IsNil(o.Failed) {
toSerialize["failed"] = o.Failed
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FormImports) UnmarshalJSON(data []byte) (err error) {
varFormImports := _FormImports{}
err = json.Unmarshal(data, &varFormImports)
if err != nil {
return err
}
*o = FormImports(varFormImports)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created")
delete(additionalProperties, "existing")
delete(additionalProperties, "failed")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFormImports struct {
value *FormImports
isSet bool
}
func (v NullableFormImports) Get() *FormImports {
return v.value
}
func (v *NullableFormImports) Set(val *FormImports) {
v.value = val
v.isSet = true
}
func (v NullableFormImports) IsSet() bool {
return v.isSet
}
func (v *NullableFormImports) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFormImports(val *FormImports) *NullableFormImports {
return &NullableFormImports{value: val, isSet: true}
}
func (v NullableFormImports) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFormImports) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}