Skip to content

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

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

// AdminUsageCoverage struct for AdminUsageCoverage
type AdminUsageCoverage struct {
	Status string `json:"status"`
	Reason string `json:"reason"`
	AdditionalProperties map[string]interface{}
}

type _AdminUsageCoverage AdminUsageCoverage

// NewAdminUsageCoverage instantiates a new AdminUsageCoverage 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 NewAdminUsageCoverage(status string, reason string) *AdminUsageCoverage {
	this := AdminUsageCoverage{}
	this.Status = status
	this.Reason = reason
	return &this
}

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

// GetStatus returns the Status field value
func (o *AdminUsageCoverage) GetStatus() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Status
}

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

// SetStatus sets field value
func (o *AdminUsageCoverage) SetStatus(v string) {
	o.Status = v
}

// GetReason returns the Reason field value
func (o *AdminUsageCoverage) GetReason() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Reason
}

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

// SetReason sets field value
func (o *AdminUsageCoverage) SetReason(v string) {
	o.Reason = v
}

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

func (o AdminUsageCoverage) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["status"] = o.Status
	toSerialize["reason"] = o.Reason

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

	return toSerialize, nil
}

func (o *AdminUsageCoverage) 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{
		"status",
		"reason",
	}

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

	varAdminUsageCoverage := _AdminUsageCoverage{}

	err = json.Unmarshal(data, &varAdminUsageCoverage)

	if err != nil {
		return err
	}

	*o = AdminUsageCoverage(varAdminUsageCoverage)

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

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

	return err
}

type NullableAdminUsageCoverage struct {
	value *AdminUsageCoverage
	isSet bool
}

func (v NullableAdminUsageCoverage) Get() *AdminUsageCoverage {
	return v.value
}

func (v *NullableAdminUsageCoverage) Set(val *AdminUsageCoverage) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAdminUsageCoverage(val *AdminUsageCoverage) *NullableAdminUsageCoverage {
	return &NullableAdminUsageCoverage{value: val, isSet: true}
}

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

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