The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.
/*
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 PaginatedBoxes type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PaginatedBoxes{}
// PaginatedBoxes struct for PaginatedBoxes
type PaginatedBoxes struct {
Items []Box `json:"items"`
Total float32 `json:"total"`
Page float32 `json:"page"`
TotalPages float32 `json:"totalPages"`
AdditionalProperties map[string]interface{}
}
type _PaginatedBoxes PaginatedBoxes
// NewPaginatedBoxes instantiates a new PaginatedBoxes 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 NewPaginatedBoxes(items []Box, total float32, page float32, totalPages float32) *PaginatedBoxes {
this := PaginatedBoxes{}
this.Items = items
this.Total = total
this.Page = page
this.TotalPages = totalPages
return &this
}
// NewPaginatedBoxesWithDefaults instantiates a new PaginatedBoxes 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 NewPaginatedBoxesWithDefaults() *PaginatedBoxes {
this := PaginatedBoxes{}
return &this
}
// GetItems returns the Items field value
func (o *PaginatedBoxes) GetItems() []Box {
if o == nil {
var ret []Box
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *PaginatedBoxes) GetItemsOk() ([]Box, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *PaginatedBoxes) SetItems(v []Box) {
o.Items = v
}
// GetTotal returns the Total field value
func (o *PaginatedBoxes) GetTotal() float32 {
if o == nil {
var ret float32
return ret
}
return o.Total
}
// GetTotalOk returns a tuple with the Total field value
// and a boolean to check if the value has been set.
func (o *PaginatedBoxes) GetTotalOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.Total, true
}
// SetTotal sets field value
func (o *PaginatedBoxes) SetTotal(v float32) {
o.Total = v
}
// GetPage returns the Page field value
func (o *PaginatedBoxes) GetPage() float32 {
if o == nil {
var ret float32
return ret
}
return o.Page
}
// GetPageOk returns a tuple with the Page field value
// and a boolean to check if the value has been set.
func (o *PaginatedBoxes) GetPageOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.Page, true
}
// SetPage sets field value
func (o *PaginatedBoxes) SetPage(v float32) {
o.Page = v
}
// GetTotalPages returns the TotalPages field value
func (o *PaginatedBoxes) GetTotalPages() float32 {
if o == nil {
var ret float32
return ret
}
return o.TotalPages
}
// GetTotalPagesOk returns a tuple with the TotalPages field value
// and a boolean to check if the value has been set.
func (o *PaginatedBoxes) GetTotalPagesOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.TotalPages, true
}
// SetTotalPages sets field value
func (o *PaginatedBoxes) SetTotalPages(v float32) {
o.TotalPages = v
}
func (o PaginatedBoxes) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PaginatedBoxes) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["items"] = o.Items
toSerialize["total"] = o.Total
toSerialize["page"] = o.Page
toSerialize["totalPages"] = o.TotalPages
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PaginatedBoxes) 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{
"items",
"total",
"page",
"totalPages",
}
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)
}
}
varPaginatedBoxes := _PaginatedBoxes{}
err = json.Unmarshal(data, &varPaginatedBoxes)
if err != nil {
return err
}
*o = PaginatedBoxes(varPaginatedBoxes)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "items")
delete(additionalProperties, "total")
delete(additionalProperties, "page")
delete(additionalProperties, "totalPages")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePaginatedBoxes struct {
value *PaginatedBoxes
isSet bool
}
func (v NullablePaginatedBoxes) Get() *PaginatedBoxes {
return v.value
}
func (v *NullablePaginatedBoxes) Set(val *PaginatedBoxes) {
v.value = val
v.isSet = true
}
func (v NullablePaginatedBoxes) IsSet() bool {
return v.isSet
}
func (v *NullablePaginatedBoxes) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePaginatedBoxes(val *PaginatedBoxes) *NullablePaginatedBoxes {
return &NullablePaginatedBoxes{value: val, isSet: true}
}
func (v NullablePaginatedBoxes) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePaginatedBoxes) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}