Files
sdk/model_marketing_beta_answer.go

231 lines
6.1 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 MarketingBetaAnswer type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MarketingBetaAnswer{}
// MarketingBetaAnswer struct for MarketingBetaAnswer
type MarketingBetaAnswer struct {
// Answer is what the person answered: one entry for a typed answer or a single choice, one entry per option for several.
Answer []string `json:"answer,omitempty"`
// ID is the question's id on the form, such as \"builds\".
Id *string `json:"id,omitempty"`
// Question is the question as the form asked it.
Question *string `json:"question,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MarketingBetaAnswer MarketingBetaAnswer
// NewMarketingBetaAnswer instantiates a new MarketingBetaAnswer 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 NewMarketingBetaAnswer() *MarketingBetaAnswer {
this := MarketingBetaAnswer{}
return &this
}
// NewMarketingBetaAnswerWithDefaults instantiates a new MarketingBetaAnswer 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 NewMarketingBetaAnswerWithDefaults() *MarketingBetaAnswer {
this := MarketingBetaAnswer{}
return &this
}
// GetAnswer returns the Answer field value if set, zero value otherwise.
func (o *MarketingBetaAnswer) 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 *MarketingBetaAnswer) 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 *MarketingBetaAnswer) 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 *MarketingBetaAnswer) SetAnswer(v []string) {
o.Answer = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *MarketingBetaAnswer) 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 *MarketingBetaAnswer) 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 *MarketingBetaAnswer) 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 *MarketingBetaAnswer) SetId(v string) {
o.Id = &v
}
// GetQuestion returns the Question field value if set, zero value otherwise.
func (o *MarketingBetaAnswer) 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 *MarketingBetaAnswer) 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 *MarketingBetaAnswer) 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 *MarketingBetaAnswer) SetQuestion(v string) {
o.Question = &v
}
func (o MarketingBetaAnswer) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MarketingBetaAnswer) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Answer) {
toSerialize["answer"] = o.Answer
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Question) {
toSerialize["question"] = o.Question
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MarketingBetaAnswer) UnmarshalJSON(data []byte) (err error) {
varMarketingBetaAnswer := _MarketingBetaAnswer{}
err = json.Unmarshal(data, &varMarketingBetaAnswer)
if err != nil {
return err
}
*o = MarketingBetaAnswer(varMarketingBetaAnswer)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "answer")
delete(additionalProperties, "id")
delete(additionalProperties, "question")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMarketingBetaAnswer struct {
value *MarketingBetaAnswer
isSet bool
}
func (v NullableMarketingBetaAnswer) Get() *MarketingBetaAnswer {
return v.value
}
func (v *NullableMarketingBetaAnswer) Set(val *MarketingBetaAnswer) {
v.value = val
v.isSet = true
}
func (v NullableMarketingBetaAnswer) IsSet() bool {
return v.isSet
}
func (v *NullableMarketingBetaAnswer) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMarketingBetaAnswer(val *MarketingBetaAnswer) *NullableMarketingBetaAnswer {
return &NullableMarketingBetaAnswer{value: val, isSet: true}
}
func (v NullableMarketingBetaAnswer) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMarketingBetaAnswer) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}