Files
sdk/model_block.go

302 lines
6.9 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the Block type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Block{}
// Block struct for Block
type Block struct {
Prompt *string `json:"prompt,omitempty"`
State *string `json:"state,omitempty"`
Text *string `json:"text,omitempty"`
TextEn *string `json:"textEn,omitempty"`
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Block Block
// NewBlock instantiates a new Block 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 NewBlock() *Block {
this := Block{}
return &this
}
// NewBlockWithDefaults instantiates a new Block 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 NewBlockWithDefaults() *Block {
this := Block{}
return &this
}
// GetPrompt returns the Prompt field value if set, zero value otherwise.
func (o *Block) GetPrompt() string {
if o == nil || IsNil(o.Prompt) {
var ret string
return ret
}
return *o.Prompt
}
// GetPromptOk returns a tuple with the Prompt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Block) GetPromptOk() (*string, bool) {
if o == nil || IsNil(o.Prompt) {
return nil, false
}
return o.Prompt, true
}
// HasPrompt returns a boolean if a field has been set.
func (o *Block) HasPrompt() bool {
if o != nil && !IsNil(o.Prompt) {
return true
}
return false
}
// SetPrompt gets a reference to the given string and assigns it to the Prompt field.
func (o *Block) SetPrompt(v string) {
o.Prompt = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *Block) GetState() string {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Block) GetStateOk() (*string, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *Block) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *Block) SetState(v string) {
o.State = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *Block) GetText() string {
if o == nil || IsNil(o.Text) {
var ret string
return ret
}
return *o.Text
}
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Block) GetTextOk() (*string, bool) {
if o == nil || IsNil(o.Text) {
return nil, false
}
return o.Text, true
}
// HasText returns a boolean if a field has been set.
func (o *Block) HasText() bool {
if o != nil && !IsNil(o.Text) {
return true
}
return false
}
// SetText gets a reference to the given string and assigns it to the Text field.
func (o *Block) SetText(v string) {
o.Text = &v
}
// GetTextEn returns the TextEn field value if set, zero value otherwise.
func (o *Block) GetTextEn() string {
if o == nil || IsNil(o.TextEn) {
var ret string
return ret
}
return *o.TextEn
}
// GetTextEnOk returns a tuple with the TextEn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Block) GetTextEnOk() (*string, bool) {
if o == nil || IsNil(o.TextEn) {
return nil, false
}
return o.TextEn, true
}
// HasTextEn returns a boolean if a field has been set.
func (o *Block) HasTextEn() bool {
if o != nil && !IsNil(o.TextEn) {
return true
}
return false
}
// SetTextEn gets a reference to the given string and assigns it to the TextEn field.
func (o *Block) SetTextEn(v string) {
o.TextEn = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *Block) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Block) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *Block) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *Block) SetType(v string) {
o.Type = &v
}
func (o Block) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Block) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Prompt) {
toSerialize["prompt"] = o.Prompt
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.TextEn) {
toSerialize["textEn"] = o.TextEn
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Block) UnmarshalJSON(data []byte) (err error) {
varBlock := _Block{}
err = json.Unmarshal(data, &varBlock)
if err != nil {
return err
}
*o = Block(varBlock)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "prompt")
delete(additionalProperties, "state")
delete(additionalProperties, "text")
delete(additionalProperties, "textEn")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBlock struct {
value *Block
isSet bool
}
func (v NullableBlock) Get() *Block {
return v.value
}
func (v *NullableBlock) Set(val *Block) {
v.value = val
v.isSet = true
}
func (v NullableBlock) IsSet() bool {
return v.isSet
}
func (v *NullableBlock) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBlock(val *Block) *NullableBlock {
return &NullableBlock{value: val, isSet: true}
}
func (v NullableBlock) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBlock) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}