Skip to content

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

6.8 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 AdminOrganizationMemberPage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AdminOrganizationMemberPage{}

// AdminOrganizationMemberPage struct for AdminOrganizationMemberPage
type AdminOrganizationMemberPage struct {
	// Opaque cursor for the next page
	NextCursor NullableString `json:"nextCursor,omitempty"`
	Limit float32 `json:"limit"`
	Items []AdminOrganizationMember `json:"items"`
	AdditionalProperties map[string]interface{}
}

type _AdminOrganizationMemberPage AdminOrganizationMemberPage

// NewAdminOrganizationMemberPage instantiates a new AdminOrganizationMemberPage 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 NewAdminOrganizationMemberPage(limit float32, items []AdminOrganizationMember) *AdminOrganizationMemberPage {
	this := AdminOrganizationMemberPage{}
	this.Limit = limit
	this.Items = items
	return &this
}

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

// GetNextCursor returns the NextCursor field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminOrganizationMemberPage) GetNextCursor() string {
	if o == nil || IsNil(o.NextCursor.Get()) {
		var ret string
		return ret
	}
	return *o.NextCursor.Get()
}

// GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminOrganizationMemberPage) GetNextCursorOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.NextCursor.Get(), o.NextCursor.IsSet()
}

// HasNextCursor returns a boolean if a field has been set.
func (o *AdminOrganizationMemberPage) HasNextCursor() bool {
	if o != nil && o.NextCursor.IsSet() {
		return true
	}

	return false
}

// SetNextCursor gets a reference to the given NullableString and assigns it to the NextCursor field.
func (o *AdminOrganizationMemberPage) SetNextCursor(v string) {
	o.NextCursor.Set(&v)
}
// SetNextCursorNil sets the value for NextCursor to be an explicit nil
func (o *AdminOrganizationMemberPage) SetNextCursorNil() {
	o.NextCursor.Set(nil)
}

// UnsetNextCursor ensures that no value is present for NextCursor, not even an explicit nil
func (o *AdminOrganizationMemberPage) UnsetNextCursor() {
	o.NextCursor.Unset()
}

// GetLimit returns the Limit field value
func (o *AdminOrganizationMemberPage) GetLimit() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.Limit
}

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

// SetLimit sets field value
func (o *AdminOrganizationMemberPage) SetLimit(v float32) {
	o.Limit = v
}

// GetItems returns the Items field value
func (o *AdminOrganizationMemberPage) GetItems() []AdminOrganizationMember {
	if o == nil {
		var ret []AdminOrganizationMember
		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 *AdminOrganizationMemberPage) GetItemsOk() ([]AdminOrganizationMember, bool) {
	if o == nil {
		return nil, false
	}
	return o.Items, true
}

// SetItems sets field value
func (o *AdminOrganizationMemberPage) SetItems(v []AdminOrganizationMember) {
	o.Items = v
}

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

func (o AdminOrganizationMemberPage) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.NextCursor.IsSet() {
		toSerialize["nextCursor"] = o.NextCursor.Get()
	}
	toSerialize["limit"] = o.Limit
	toSerialize["items"] = o.Items

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

	return toSerialize, nil
}

func (o *AdminOrganizationMemberPage) 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{
		"limit",
		"items",
	}

	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)
		}
	}

	varAdminOrganizationMemberPage := _AdminOrganizationMemberPage{}

	err = json.Unmarshal(data, &varAdminOrganizationMemberPage)

	if err != nil {
		return err
	}

	*o = AdminOrganizationMemberPage(varAdminOrganizationMemberPage)

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

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

	return err
}

type NullableAdminOrganizationMemberPage struct {
	value *AdminOrganizationMemberPage
	isSet bool
}

func (v NullableAdminOrganizationMemberPage) Get() *AdminOrganizationMemberPage {
	return v.value
}

func (v *NullableAdminOrganizationMemberPage) Set(val *AdminOrganizationMemberPage) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAdminOrganizationMemberPage(val *AdminOrganizationMemberPage) *NullableAdminOrganizationMemberPage {
	return &NullableAdminOrganizationMemberPage{value: val, isSet: true}
}

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

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