Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

4.6 KB
Raw Blame
/*
BoxLite

BoxLite AI platform API Docs

API version: 1.0
Contact: [email protected]
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package apiclient

import (
	"encoding/json"
	"fmt"
)

// checks if the NetworkInfo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NetworkInfo{}

// NetworkInfo struct for NetworkInfo
type NetworkInfo struct {
	Outbound OutboundNetworkSpec `json:"outbound"`
	Inbound InboundNetworkSpec `json:"inbound"`
	AdditionalProperties map[string]interface{}
}

type _NetworkInfo NetworkInfo

// NewNetworkInfo instantiates a new NetworkInfo 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 NewNetworkInfo(outbound OutboundNetworkSpec, inbound InboundNetworkSpec) *NetworkInfo {
	this := NetworkInfo{}
	this.Outbound = outbound
	this.Inbound = inbound
	return &this
}

// NewNetworkInfoWithDefaults instantiates a new NetworkInfo 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 NewNetworkInfoWithDefaults() *NetworkInfo {
	this := NetworkInfo{}
	return &this
}

// GetOutbound returns the Outbound field value
func (o *NetworkInfo) GetOutbound() OutboundNetworkSpec {
	if o == nil {
		var ret OutboundNetworkSpec
		return ret
	}

	return o.Outbound
}

// GetOutboundOk returns a tuple with the Outbound field value
// and a boolean to check if the value has been set.
func (o *NetworkInfo) GetOutboundOk() (*OutboundNetworkSpec, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Outbound, true
}

// SetOutbound sets field value
func (o *NetworkInfo) SetOutbound(v OutboundNetworkSpec) {
	o.Outbound = v
}

// GetInbound returns the Inbound field value
func (o *NetworkInfo) GetInbound() InboundNetworkSpec {
	if o == nil {
		var ret InboundNetworkSpec
		return ret
	}

	return o.Inbound
}

// GetInboundOk returns a tuple with the Inbound field value
// and a boolean to check if the value has been set.
func (o *NetworkInfo) GetInboundOk() (*InboundNetworkSpec, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Inbound, true
}

// SetInbound sets field value
func (o *NetworkInfo) SetInbound(v InboundNetworkSpec) {
	o.Inbound = v
}

func (o NetworkInfo) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o NetworkInfo) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["outbound"] = o.Outbound
	toSerialize["inbound"] = o.Inbound

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *NetworkInfo) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"outbound",
		"inbound",
	}

	allProperties := make(map[string]interface{})

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varNetworkInfo := _NetworkInfo{}

	err = json.Unmarshal(data, &varNetworkInfo)

	if err != nil {
		return err
	}

	*o = NetworkInfo(varNetworkInfo)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "outbound")
		delete(additionalProperties, "inbound")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableNetworkInfo struct {
	value *NetworkInfo
	isSet bool
}

func (v NullableNetworkInfo) Get() *NetworkInfo {
	return v.value
}

func (v *NullableNetworkInfo) Set(val *NetworkInfo) {
	v.value = val
	v.isSet = true
}

func (v NullableNetworkInfo) IsSet() bool {
	return v.isSet
}

func (v *NullableNetworkInfo) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableNetworkInfo(val *NetworkInfo) *NullableNetworkInfo {
	return &NullableNetworkInfo{value: val, isSet: true}
}

func (v NullableNetworkInfo) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableNetworkInfo) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}