first version
This commit is contained in:
275
model_schema_user_ranking_simple_info.go
Normal file
275
model_schema_user_ranking_simple_info.go
Normal file
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
answer
|
||||
|
||||
answer api
|
||||
|
||||
API version: v0.0.1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package openapi
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the SchemaUserRankingSimpleInfo type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &SchemaUserRankingSimpleInfo{}
|
||||
|
||||
// SchemaUserRankingSimpleInfo struct for SchemaUserRankingSimpleInfo
|
||||
type SchemaUserRankingSimpleInfo struct {
|
||||
// avatar
|
||||
Avatar *string `json:"avatar,omitempty"`
|
||||
// display name
|
||||
DisplayName *string `json:"display_name,omitempty"`
|
||||
// rank
|
||||
Rank *int32 `json:"rank,omitempty"`
|
||||
// username
|
||||
Username *string `json:"username,omitempty"`
|
||||
// vote
|
||||
VoteCount *int32 `json:"vote_count,omitempty"`
|
||||
}
|
||||
|
||||
// NewSchemaUserRankingSimpleInfo instantiates a new SchemaUserRankingSimpleInfo 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 NewSchemaUserRankingSimpleInfo() *SchemaUserRankingSimpleInfo {
|
||||
this := SchemaUserRankingSimpleInfo{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewSchemaUserRankingSimpleInfoWithDefaults instantiates a new SchemaUserRankingSimpleInfo 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 NewSchemaUserRankingSimpleInfoWithDefaults() *SchemaUserRankingSimpleInfo {
|
||||
this := SchemaUserRankingSimpleInfo{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAvatar returns the Avatar field value if set, zero value otherwise.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetAvatar() string {
|
||||
if o == nil || IsNil(o.Avatar) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Avatar
|
||||
}
|
||||
|
||||
// GetAvatarOk returns a tuple with the Avatar field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetAvatarOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Avatar) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Avatar, true
|
||||
}
|
||||
|
||||
// HasAvatar returns a boolean if a field has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) HasAvatar() bool {
|
||||
if o != nil && !IsNil(o.Avatar) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAvatar gets a reference to the given string and assigns it to the Avatar field.
|
||||
func (o *SchemaUserRankingSimpleInfo) SetAvatar(v string) {
|
||||
o.Avatar = &v
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetDisplayName() string {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DisplayName
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DisplayName, true
|
||||
}
|
||||
|
||||
// HasDisplayName returns a boolean if a field has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) HasDisplayName() bool {
|
||||
if o != nil && !IsNil(o.DisplayName) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
|
||||
func (o *SchemaUserRankingSimpleInfo) SetDisplayName(v string) {
|
||||
o.DisplayName = &v
|
||||
}
|
||||
|
||||
// GetRank returns the Rank field value if set, zero value otherwise.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetRank() int32 {
|
||||
if o == nil || IsNil(o.Rank) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Rank
|
||||
}
|
||||
|
||||
// GetRankOk returns a tuple with the Rank field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetRankOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Rank) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Rank, true
|
||||
}
|
||||
|
||||
// HasRank returns a boolean if a field has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) HasRank() bool {
|
||||
if o != nil && !IsNil(o.Rank) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRank gets a reference to the given int32 and assigns it to the Rank field.
|
||||
func (o *SchemaUserRankingSimpleInfo) SetRank(v int32) {
|
||||
o.Rank = &v
|
||||
}
|
||||
|
||||
// GetUsername returns the Username field value if set, zero value otherwise.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetUsername() string {
|
||||
if o == nil || IsNil(o.Username) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Username
|
||||
}
|
||||
|
||||
// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetUsernameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Username) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Username, true
|
||||
}
|
||||
|
||||
// HasUsername returns a boolean if a field has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) HasUsername() bool {
|
||||
if o != nil && !IsNil(o.Username) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetUsername gets a reference to the given string and assigns it to the Username field.
|
||||
func (o *SchemaUserRankingSimpleInfo) SetUsername(v string) {
|
||||
o.Username = &v
|
||||
}
|
||||
|
||||
// GetVoteCount returns the VoteCount field value if set, zero value otherwise.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetVoteCount() int32 {
|
||||
if o == nil || IsNil(o.VoteCount) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.VoteCount
|
||||
}
|
||||
|
||||
// GetVoteCountOk returns a tuple with the VoteCount field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) GetVoteCountOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.VoteCount) {
|
||||
return nil, false
|
||||
}
|
||||
return o.VoteCount, true
|
||||
}
|
||||
|
||||
// HasVoteCount returns a boolean if a field has been set.
|
||||
func (o *SchemaUserRankingSimpleInfo) HasVoteCount() bool {
|
||||
if o != nil && !IsNil(o.VoteCount) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetVoteCount gets a reference to the given int32 and assigns it to the VoteCount field.
|
||||
func (o *SchemaUserRankingSimpleInfo) SetVoteCount(v int32) {
|
||||
o.VoteCount = &v
|
||||
}
|
||||
|
||||
func (o SchemaUserRankingSimpleInfo) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o SchemaUserRankingSimpleInfo) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Avatar) {
|
||||
toSerialize["avatar"] = o.Avatar
|
||||
}
|
||||
if !IsNil(o.DisplayName) {
|
||||
toSerialize["display_name"] = o.DisplayName
|
||||
}
|
||||
if !IsNil(o.Rank) {
|
||||
toSerialize["rank"] = o.Rank
|
||||
}
|
||||
if !IsNil(o.Username) {
|
||||
toSerialize["username"] = o.Username
|
||||
}
|
||||
if !IsNil(o.VoteCount) {
|
||||
toSerialize["vote_count"] = o.VoteCount
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableSchemaUserRankingSimpleInfo struct {
|
||||
value *SchemaUserRankingSimpleInfo
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableSchemaUserRankingSimpleInfo) Get() *SchemaUserRankingSimpleInfo {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableSchemaUserRankingSimpleInfo) Set(val *SchemaUserRankingSimpleInfo) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableSchemaUserRankingSimpleInfo) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableSchemaUserRankingSimpleInfo) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableSchemaUserRankingSimpleInfo(val *SchemaUserRankingSimpleInfo) *NullableSchemaUserRankingSimpleInfo {
|
||||
return &NullableSchemaUserRankingSimpleInfo{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableSchemaUserRankingSimpleInfo) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableSchemaUserRankingSimpleInfo) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user