Files
sdk/model_train_question.go

228 lines
5.5 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 TrainQuestion type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainQuestion{}
// TrainQuestion struct for TrainQuestion
type TrainQuestion struct {
Key *string `json:"key,omitempty"`
Labels []string `json:"labels,omitempty"`
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainQuestion TrainQuestion
// NewTrainQuestion instantiates a new TrainQuestion 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 NewTrainQuestion() *TrainQuestion {
this := TrainQuestion{}
return &this
}
// NewTrainQuestionWithDefaults instantiates a new TrainQuestion 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 NewTrainQuestionWithDefaults() *TrainQuestion {
this := TrainQuestion{}
return &this
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *TrainQuestion) GetKey() string {
if o == nil || IsNil(o.Key) {
var ret string
return ret
}
return *o.Key
}
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainQuestion) GetKeyOk() (*string, bool) {
if o == nil || IsNil(o.Key) {
return nil, false
}
return o.Key, true
}
// HasKey returns a boolean if a field has been set.
func (o *TrainQuestion) HasKey() bool {
if o != nil && !IsNil(o.Key) {
return true
}
return false
}
// SetKey gets a reference to the given string and assigns it to the Key field.
func (o *TrainQuestion) SetKey(v string) {
o.Key = &v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *TrainQuestion) GetLabels() []string {
if o == nil || IsNil(o.Labels) {
var ret []string
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainQuestion) GetLabelsOk() ([]string, bool) {
if o == nil || IsNil(o.Labels) {
return nil, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *TrainQuestion) HasLabels() bool {
if o != nil && !IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given []string and assigns it to the Labels field.
func (o *TrainQuestion) SetLabels(v []string) {
o.Labels = v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *TrainQuestion) 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 *TrainQuestion) 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 *TrainQuestion) 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 *TrainQuestion) SetType(v string) {
o.Type = &v
}
func (o TrainQuestion) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainQuestion) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainQuestion) UnmarshalJSON(data []byte) (err error) {
varTrainQuestion := _TrainQuestion{}
err = json.Unmarshal(data, &varTrainQuestion)
if err != nil {
return err
}
*o = TrainQuestion(varTrainQuestion)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "key")
delete(additionalProperties, "labels")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainQuestion struct {
value *TrainQuestion
isSet bool
}
func (v NullableTrainQuestion) Get() *TrainQuestion {
return v.value
}
func (v *NullableTrainQuestion) Set(val *TrainQuestion) {
v.value = val
v.isSet = true
}
func (v NullableTrainQuestion) IsSet() bool {
return v.isSet
}
func (v *NullableTrainQuestion) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainQuestion(val *TrainQuestion) *NullableTrainQuestion {
return &NullableTrainQuestion{value: val, isSet: true}
}
func (v NullableTrainQuestion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainQuestion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}