Skip to content

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

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

// AdminOrganizationImpact struct for AdminOrganizationImpact
type AdminOrganizationImpact struct {
	State string `json:"state"`
	Evidence []AdminOrganizationImpactEvidence `json:"evidence"`
	AdditionalProperties map[string]interface{}
}

type _AdminOrganizationImpact AdminOrganizationImpact

// NewAdminOrganizationImpact instantiates a new AdminOrganizationImpact 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 NewAdminOrganizationImpact(state string, evidence []AdminOrganizationImpactEvidence) *AdminOrganizationImpact {
	this := AdminOrganizationImpact{}
	this.State = state
	this.Evidence = evidence
	return &this
}

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

// GetState returns the State field value
func (o *AdminOrganizationImpact) GetState() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.State
}

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

// SetState sets field value
func (o *AdminOrganizationImpact) SetState(v string) {
	o.State = v
}

// GetEvidence returns the Evidence field value
func (o *AdminOrganizationImpact) GetEvidence() []AdminOrganizationImpactEvidence {
	if o == nil {
		var ret []AdminOrganizationImpactEvidence
		return ret
	}

	return o.Evidence
}

// GetEvidenceOk returns a tuple with the Evidence field value
// and a boolean to check if the value has been set.
func (o *AdminOrganizationImpact) GetEvidenceOk() ([]AdminOrganizationImpactEvidence, bool) {
	if o == nil {
		return nil, false
	}
	return o.Evidence, true
}

// SetEvidence sets field value
func (o *AdminOrganizationImpact) SetEvidence(v []AdminOrganizationImpactEvidence) {
	o.Evidence = v
}

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

func (o AdminOrganizationImpact) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["state"] = o.State
	toSerialize["evidence"] = o.Evidence

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

	return toSerialize, nil
}

func (o *AdminOrganizationImpact) 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{
		"state",
		"evidence",
	}

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

	varAdminOrganizationImpact := _AdminOrganizationImpact{}

	err = json.Unmarshal(data, &varAdminOrganizationImpact)

	if err != nil {
		return err
	}

	*o = AdminOrganizationImpact(varAdminOrganizationImpact)

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

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

	return err
}

type NullableAdminOrganizationImpact struct {
	value *AdminOrganizationImpact
	isSet bool
}

func (v NullableAdminOrganizationImpact) Get() *AdminOrganizationImpact {
	return v.value
}

func (v *NullableAdminOrganizationImpact) Set(val *AdminOrganizationImpact) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAdminOrganizationImpact(val *AdminOrganizationImpact) *NullableAdminOrganizationImpact {
	return &NullableAdminOrganizationImpact{value: val, isSet: true}
}

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

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