Files
sdk/model_correct_in.go

307 lines
7.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 CorrectIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CorrectIn{}
// CorrectIn struct for CorrectIn
type CorrectIn struct {
// Answer is the right option label; a score's level may be named by its index.
Answer *string `json:"answer,omitempty"`
// Cohort groups corrections the org files together.
Cohort *string `json:"cohort,omitempty"`
// Decision is the decision's id.
Decision *string `json:"decision,omitempty"`
// Note says why, for the person reading it later.
Note *string `json:"note,omitempty"`
// Question is the question's key.
Question *string `json:"question,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CorrectIn CorrectIn
// NewCorrectIn instantiates a new CorrectIn 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 NewCorrectIn() *CorrectIn {
this := CorrectIn{}
return &this
}
// NewCorrectInWithDefaults instantiates a new CorrectIn 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 NewCorrectInWithDefaults() *CorrectIn {
this := CorrectIn{}
return &this
}
// GetAnswer returns the Answer field value if set, zero value otherwise.
func (o *CorrectIn) GetAnswer() string {
if o == nil || IsNil(o.Answer) {
var ret string
return ret
}
return *o.Answer
}
// GetAnswerOk returns a tuple with the Answer field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CorrectIn) GetAnswerOk() (*string, bool) {
if o == nil || IsNil(o.Answer) {
return nil, false
}
return o.Answer, true
}
// HasAnswer returns a boolean if a field has been set.
func (o *CorrectIn) HasAnswer() bool {
if o != nil && !IsNil(o.Answer) {
return true
}
return false
}
// SetAnswer gets a reference to the given string and assigns it to the Answer field.
func (o *CorrectIn) SetAnswer(v string) {
o.Answer = &v
}
// GetCohort returns the Cohort field value if set, zero value otherwise.
func (o *CorrectIn) GetCohort() string {
if o == nil || IsNil(o.Cohort) {
var ret string
return ret
}
return *o.Cohort
}
// GetCohortOk returns a tuple with the Cohort field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CorrectIn) GetCohortOk() (*string, bool) {
if o == nil || IsNil(o.Cohort) {
return nil, false
}
return o.Cohort, true
}
// HasCohort returns a boolean if a field has been set.
func (o *CorrectIn) HasCohort() bool {
if o != nil && !IsNil(o.Cohort) {
return true
}
return false
}
// SetCohort gets a reference to the given string and assigns it to the Cohort field.
func (o *CorrectIn) SetCohort(v string) {
o.Cohort = &v
}
// GetDecision returns the Decision field value if set, zero value otherwise.
func (o *CorrectIn) GetDecision() string {
if o == nil || IsNil(o.Decision) {
var ret string
return ret
}
return *o.Decision
}
// GetDecisionOk returns a tuple with the Decision field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CorrectIn) GetDecisionOk() (*string, bool) {
if o == nil || IsNil(o.Decision) {
return nil, false
}
return o.Decision, true
}
// HasDecision returns a boolean if a field has been set.
func (o *CorrectIn) HasDecision() bool {
if o != nil && !IsNil(o.Decision) {
return true
}
return false
}
// SetDecision gets a reference to the given string and assigns it to the Decision field.
func (o *CorrectIn) SetDecision(v string) {
o.Decision = &v
}
// GetNote returns the Note field value if set, zero value otherwise.
func (o *CorrectIn) GetNote() string {
if o == nil || IsNil(o.Note) {
var ret string
return ret
}
return *o.Note
}
// GetNoteOk returns a tuple with the Note field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CorrectIn) GetNoteOk() (*string, bool) {
if o == nil || IsNil(o.Note) {
return nil, false
}
return o.Note, true
}
// HasNote returns a boolean if a field has been set.
func (o *CorrectIn) HasNote() bool {
if o != nil && !IsNil(o.Note) {
return true
}
return false
}
// SetNote gets a reference to the given string and assigns it to the Note field.
func (o *CorrectIn) SetNote(v string) {
o.Note = &v
}
// GetQuestion returns the Question field value if set, zero value otherwise.
func (o *CorrectIn) GetQuestion() string {
if o == nil || IsNil(o.Question) {
var ret string
return ret
}
return *o.Question
}
// GetQuestionOk returns a tuple with the Question field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CorrectIn) GetQuestionOk() (*string, bool) {
if o == nil || IsNil(o.Question) {
return nil, false
}
return o.Question, true
}
// HasQuestion returns a boolean if a field has been set.
func (o *CorrectIn) HasQuestion() bool {
if o != nil && !IsNil(o.Question) {
return true
}
return false
}
// SetQuestion gets a reference to the given string and assigns it to the Question field.
func (o *CorrectIn) SetQuestion(v string) {
o.Question = &v
}
func (o CorrectIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CorrectIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Answer) {
toSerialize["answer"] = o.Answer
}
if !IsNil(o.Cohort) {
toSerialize["cohort"] = o.Cohort
}
if !IsNil(o.Decision) {
toSerialize["decision"] = o.Decision
}
if !IsNil(o.Note) {
toSerialize["note"] = o.Note
}
if !IsNil(o.Question) {
toSerialize["question"] = o.Question
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CorrectIn) UnmarshalJSON(data []byte) (err error) {
varCorrectIn := _CorrectIn{}
err = json.Unmarshal(data, &varCorrectIn)
if err != nil {
return err
}
*o = CorrectIn(varCorrectIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "answer")
delete(additionalProperties, "cohort")
delete(additionalProperties, "decision")
delete(additionalProperties, "note")
delete(additionalProperties, "question")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCorrectIn struct {
value *CorrectIn
isSet bool
}
func (v NullableCorrectIn) Get() *CorrectIn {
return v.value
}
func (v *NullableCorrectIn) Set(val *CorrectIn) {
v.value = val
v.isSet = true
}
func (v NullableCorrectIn) IsSet() bool {
return v.isSet
}
func (v *NullableCorrectIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCorrectIn(val *CorrectIn) *NullableCorrectIn {
return &NullableCorrectIn{value: val, isSet: true}
}
func (v NullableCorrectIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCorrectIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}