Files
sdk/model_question.go

339 lines
8.0 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 Question type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Question{}
// Question struct for Question
type Question struct {
Account *string `json:"account,omitempty"`
Amount *string `json:"amount,omitempty"`
Id *string `json:"id,omitempty"`
Kind *string `json:"kind,omitempty"`
PostedAt *string `json:"postedAt,omitempty"`
Text *string `json:"text,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Question Question
// NewQuestion instantiates a new Question 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 NewQuestion() *Question {
this := Question{}
return &this
}
// NewQuestionWithDefaults instantiates a new Question 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 NewQuestionWithDefaults() *Question {
this := Question{}
return &this
}
// GetAccount returns the Account field value if set, zero value otherwise.
func (o *Question) GetAccount() string {
if o == nil || IsNil(o.Account) {
var ret string
return ret
}
return *o.Account
}
// GetAccountOk returns a tuple with the Account field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Question) GetAccountOk() (*string, bool) {
if o == nil || IsNil(o.Account) {
return nil, false
}
return o.Account, true
}
// HasAccount returns a boolean if a field has been set.
func (o *Question) HasAccount() bool {
if o != nil && !IsNil(o.Account) {
return true
}
return false
}
// SetAccount gets a reference to the given string and assigns it to the Account field.
func (o *Question) SetAccount(v string) {
o.Account = &v
}
// GetAmount returns the Amount field value if set, zero value otherwise.
func (o *Question) GetAmount() string {
if o == nil || IsNil(o.Amount) {
var ret string
return ret
}
return *o.Amount
}
// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Question) GetAmountOk() (*string, bool) {
if o == nil || IsNil(o.Amount) {
return nil, false
}
return o.Amount, true
}
// HasAmount returns a boolean if a field has been set.
func (o *Question) HasAmount() bool {
if o != nil && !IsNil(o.Amount) {
return true
}
return false
}
// SetAmount gets a reference to the given string and assigns it to the Amount field.
func (o *Question) SetAmount(v string) {
o.Amount = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Question) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Question) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *Question) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Question) SetId(v string) {
o.Id = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *Question) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Question) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *Question) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *Question) SetKind(v string) {
o.Kind = &v
}
// GetPostedAt returns the PostedAt field value if set, zero value otherwise.
func (o *Question) GetPostedAt() string {
if o == nil || IsNil(o.PostedAt) {
var ret string
return ret
}
return *o.PostedAt
}
// GetPostedAtOk returns a tuple with the PostedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Question) GetPostedAtOk() (*string, bool) {
if o == nil || IsNil(o.PostedAt) {
return nil, false
}
return o.PostedAt, true
}
// HasPostedAt returns a boolean if a field has been set.
func (o *Question) HasPostedAt() bool {
if o != nil && !IsNil(o.PostedAt) {
return true
}
return false
}
// SetPostedAt gets a reference to the given string and assigns it to the PostedAt field.
func (o *Question) SetPostedAt(v string) {
o.PostedAt = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *Question) 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 *Question) 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 *Question) 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 *Question) SetText(v string) {
o.Text = &v
}
func (o Question) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Question) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Account) {
toSerialize["account"] = o.Account
}
if !IsNil(o.Amount) {
toSerialize["amount"] = o.Amount
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.PostedAt) {
toSerialize["postedAt"] = o.PostedAt
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Question) UnmarshalJSON(data []byte) (err error) {
varQuestion := _Question{}
err = json.Unmarshal(data, &varQuestion)
if err != nil {
return err
}
*o = Question(varQuestion)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "account")
delete(additionalProperties, "amount")
delete(additionalProperties, "id")
delete(additionalProperties, "kind")
delete(additionalProperties, "postedAt")
delete(additionalProperties, "text")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableQuestion struct {
value *Question
isSet bool
}
func (v NullableQuestion) Get() *Question {
return v.value
}
func (v *NullableQuestion) Set(val *Question) {
v.value = val
v.isSet = true
}
func (v NullableQuestion) IsSet() bool {
return v.isSet
}
func (v *NullableQuestion) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableQuestion(val *Question) *NullableQuestion {
return &NullableQuestion{value: val, isSet: true}
}
func (v NullableQuestion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableQuestion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}