Skip to content

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

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

// AdminUsageError struct for AdminUsageError
type AdminUsageError struct {
	StatusCode int32 `json:"statusCode"`
	Code string `json:"code"`
	Message string `json:"message"`
	AdditionalProperties map[string]interface{}
}

type _AdminUsageError AdminUsageError

// NewAdminUsageError instantiates a new AdminUsageError 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 NewAdminUsageError(statusCode int32, code string, message string) *AdminUsageError {
	this := AdminUsageError{}
	this.StatusCode = statusCode
	this.Code = code
	this.Message = message
	return &this
}

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

// GetStatusCode returns the StatusCode field value
func (o *AdminUsageError) GetStatusCode() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.StatusCode
}

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

// SetStatusCode sets field value
func (o *AdminUsageError) SetStatusCode(v int32) {
	o.StatusCode = v
}

// GetCode returns the Code field value
func (o *AdminUsageError) GetCode() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Code
}

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

// SetCode sets field value
func (o *AdminUsageError) SetCode(v string) {
	o.Code = v
}

// GetMessage returns the Message field value
func (o *AdminUsageError) GetMessage() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Message
}

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

// SetMessage sets field value
func (o *AdminUsageError) SetMessage(v string) {
	o.Message = v
}

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

func (o AdminUsageError) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["statusCode"] = o.StatusCode
	toSerialize["code"] = o.Code
	toSerialize["message"] = o.Message

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

	return toSerialize, nil
}

func (o *AdminUsageError) 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{
		"statusCode",
		"code",
		"message",
	}

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

	varAdminUsageError := _AdminUsageError{}

	err = json.Unmarshal(data, &varAdminUsageError)

	if err != nil {
		return err
	}

	*o = AdminUsageError(varAdminUsageError)

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

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

	return err
}

type NullableAdminUsageError struct {
	value *AdminUsageError
	isSet bool
}

func (v NullableAdminUsageError) Get() *AdminUsageError {
	return v.value
}

func (v *NullableAdminUsageError) Set(val *AdminUsageError) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAdminUsageError(val *AdminUsageError) *NullableAdminUsageError {
	return &NullableAdminUsageError{value: val, isSet: true}
}

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

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