Files
openapi-go-answer/model_schema_vote_resp.go
2023-09-26 16:20:01 +08:00

233 lines
5.9 KiB
Go

/*
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package answer_sdk
import (
"encoding/json"
)
// checks if the SchemaVoteResp type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SchemaVoteResp{}
// SchemaVoteResp struct for SchemaVoteResp
type SchemaVoteResp struct {
DownVotes *int32 `json:"down_votes,omitempty"`
UpVotes *int32 `json:"up_votes,omitempty"`
VoteStatus *string `json:"vote_status,omitempty"`
Votes *int32 `json:"votes,omitempty"`
}
// NewSchemaVoteResp instantiates a new SchemaVoteResp 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 NewSchemaVoteResp() *SchemaVoteResp {
this := SchemaVoteResp{}
return &this
}
// NewSchemaVoteRespWithDefaults instantiates a new SchemaVoteResp 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 NewSchemaVoteRespWithDefaults() *SchemaVoteResp {
this := SchemaVoteResp{}
return &this
}
// GetDownVotes returns the DownVotes field value if set, zero value otherwise.
func (o *SchemaVoteResp) GetDownVotes() int32 {
if o == nil || IsNil(o.DownVotes) {
var ret int32
return ret
}
return *o.DownVotes
}
// GetDownVotesOk returns a tuple with the DownVotes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SchemaVoteResp) GetDownVotesOk() (*int32, bool) {
if o == nil || IsNil(o.DownVotes) {
return nil, false
}
return o.DownVotes, true
}
// HasDownVotes returns a boolean if a field has been set.
func (o *SchemaVoteResp) HasDownVotes() bool {
if o != nil && !IsNil(o.DownVotes) {
return true
}
return false
}
// SetDownVotes gets a reference to the given int32 and assigns it to the DownVotes field.
func (o *SchemaVoteResp) SetDownVotes(v int32) {
o.DownVotes = &v
}
// GetUpVotes returns the UpVotes field value if set, zero value otherwise.
func (o *SchemaVoteResp) GetUpVotes() int32 {
if o == nil || IsNil(o.UpVotes) {
var ret int32
return ret
}
return *o.UpVotes
}
// GetUpVotesOk returns a tuple with the UpVotes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SchemaVoteResp) GetUpVotesOk() (*int32, bool) {
if o == nil || IsNil(o.UpVotes) {
return nil, false
}
return o.UpVotes, true
}
// HasUpVotes returns a boolean if a field has been set.
func (o *SchemaVoteResp) HasUpVotes() bool {
if o != nil && !IsNil(o.UpVotes) {
return true
}
return false
}
// SetUpVotes gets a reference to the given int32 and assigns it to the UpVotes field.
func (o *SchemaVoteResp) SetUpVotes(v int32) {
o.UpVotes = &v
}
// GetVoteStatus returns the VoteStatus field value if set, zero value otherwise.
func (o *SchemaVoteResp) GetVoteStatus() string {
if o == nil || IsNil(o.VoteStatus) {
var ret string
return ret
}
return *o.VoteStatus
}
// GetVoteStatusOk returns a tuple with the VoteStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SchemaVoteResp) GetVoteStatusOk() (*string, bool) {
if o == nil || IsNil(o.VoteStatus) {
return nil, false
}
return o.VoteStatus, true
}
// HasVoteStatus returns a boolean if a field has been set.
func (o *SchemaVoteResp) HasVoteStatus() bool {
if o != nil && !IsNil(o.VoteStatus) {
return true
}
return false
}
// SetVoteStatus gets a reference to the given string and assigns it to the VoteStatus field.
func (o *SchemaVoteResp) SetVoteStatus(v string) {
o.VoteStatus = &v
}
// GetVotes returns the Votes field value if set, zero value otherwise.
func (o *SchemaVoteResp) GetVotes() int32 {
if o == nil || IsNil(o.Votes) {
var ret int32
return ret
}
return *o.Votes
}
// GetVotesOk returns a tuple with the Votes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SchemaVoteResp) GetVotesOk() (*int32, bool) {
if o == nil || IsNil(o.Votes) {
return nil, false
}
return o.Votes, true
}
// HasVotes returns a boolean if a field has been set.
func (o *SchemaVoteResp) HasVotes() bool {
if o != nil && !IsNil(o.Votes) {
return true
}
return false
}
// SetVotes gets a reference to the given int32 and assigns it to the Votes field.
func (o *SchemaVoteResp) SetVotes(v int32) {
o.Votes = &v
}
func (o SchemaVoteResp) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SchemaVoteResp) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.DownVotes) {
toSerialize["down_votes"] = o.DownVotes
}
if !IsNil(o.UpVotes) {
toSerialize["up_votes"] = o.UpVotes
}
if !IsNil(o.VoteStatus) {
toSerialize["vote_status"] = o.VoteStatus
}
if !IsNil(o.Votes) {
toSerialize["votes"] = o.Votes
}
return toSerialize, nil
}
type NullableSchemaVoteResp struct {
value *SchemaVoteResp
isSet bool
}
func (v NullableSchemaVoteResp) Get() *SchemaVoteResp {
return v.value
}
func (v *NullableSchemaVoteResp) Set(val *SchemaVoteResp) {
v.value = val
v.isSet = true
}
func (v NullableSchemaVoteResp) IsSet() bool {
return v.isSet
}
func (v *NullableSchemaVoteResp) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSchemaVoteResp(val *SchemaVoteResp) *NullableSchemaVoteResp {
return &NullableSchemaVoteResp{value: val, isSet: true}
}
func (v NullableSchemaVoteResp) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSchemaVoteResp) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}