Skip to content

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

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

// CreatePromptHandoffDto struct for CreatePromptHandoffDto
type CreatePromptHandoffDto struct {
	RequestId string `json:"requestId"`
	Text string `json:"text"`
	AdditionalProperties map[string]interface{}
}

type _CreatePromptHandoffDto CreatePromptHandoffDto

// NewCreatePromptHandoffDto instantiates a new CreatePromptHandoffDto 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 NewCreatePromptHandoffDto(requestId string, text string) *CreatePromptHandoffDto {
	this := CreatePromptHandoffDto{}
	this.RequestId = requestId
	this.Text = text
	return &this
}

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

// GetRequestId returns the RequestId field value
func (o *CreatePromptHandoffDto) GetRequestId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.RequestId
}

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

// SetRequestId sets field value
func (o *CreatePromptHandoffDto) SetRequestId(v string) {
	o.RequestId = v
}

// GetText returns the Text field value
func (o *CreatePromptHandoffDto) GetText() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Text
}

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

// SetText sets field value
func (o *CreatePromptHandoffDto) SetText(v string) {
	o.Text = v
}

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

func (o CreatePromptHandoffDto) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["requestId"] = o.RequestId
	toSerialize["text"] = o.Text

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

	return toSerialize, nil
}

func (o *CreatePromptHandoffDto) 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{
		"requestId",
		"text",
	}

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

	varCreatePromptHandoffDto := _CreatePromptHandoffDto{}

	err = json.Unmarshal(data, &varCreatePromptHandoffDto)

	if err != nil {
		return err
	}

	*o = CreatePromptHandoffDto(varCreatePromptHandoffDto)

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

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

	return err
}

type NullableCreatePromptHandoffDto struct {
	value *CreatePromptHandoffDto
	isSet bool
}

func (v NullableCreatePromptHandoffDto) Get() *CreatePromptHandoffDto {
	return v.value
}

func (v *NullableCreatePromptHandoffDto) Set(val *CreatePromptHandoffDto) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCreatePromptHandoffDto(val *CreatePromptHandoffDto) *NullableCreatePromptHandoffDto {
	return &NullableCreatePromptHandoffDto{value: val, isSet: true}
}

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

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