mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
493 lines
13 KiB
Go
493 lines
13 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"
|
|
"time"
|
|
)
|
|
|
|
// checks if the RewardPostView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &RewardPostView{}
|
|
|
|
// RewardPostView struct for RewardPostView
|
|
type RewardPostView struct {
|
|
// Checks is every look at the post, oldest first.
|
|
Checks []RewardCheck `json:"checks,omitempty"`
|
|
CountsAt *time.Time `json:"countsAt,omitempty"`
|
|
DaysLeft *int64 `json:"daysLeft,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Network *string `json:"network,omitempty"`
|
|
// Note says why a post was removed.
|
|
Note *string `json:"note,omitempty"`
|
|
// Since is when the post's week began; CountsAt when it counts, and DaysLeft the days until then. Both are absent unless the post is pending.
|
|
Since *time.Time `json:"since,omitempty"`
|
|
// Status is pending (held for its week, counts for nothing), verified (it stayed up and was put to staff), removed (it earns nothing) or review (staff decide it by hand).
|
|
Status *string `json:"status,omitempty"`
|
|
Url *string `json:"url,omitempty"`
|
|
// Week is the ISO week the post was published in; a post in a later week can earn again.
|
|
Week *string `json:"week,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _RewardPostView RewardPostView
|
|
|
|
// NewRewardPostView instantiates a new RewardPostView 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 NewRewardPostView() *RewardPostView {
|
|
this := RewardPostView{}
|
|
return &this
|
|
}
|
|
|
|
// NewRewardPostViewWithDefaults instantiates a new RewardPostView 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 NewRewardPostViewWithDefaults() *RewardPostView {
|
|
this := RewardPostView{}
|
|
return &this
|
|
}
|
|
|
|
// GetChecks returns the Checks field value if set, zero value otherwise.
|
|
func (o *RewardPostView) GetChecks() []RewardCheck {
|
|
if o == nil || IsNil(o.Checks) {
|
|
var ret []RewardCheck
|
|
return ret
|
|
}
|
|
return o.Checks
|
|
}
|
|
|
|
// GetChecksOk returns a tuple with the Checks field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RewardPostView) GetChecksOk() ([]RewardCheck, bool) {
|
|
if o == nil || IsNil(o.Checks) {
|
|
return nil, false
|
|
}
|
|
return o.Checks, true
|
|
}
|
|
|
|
// HasChecks returns a boolean if a field has been set.
|
|
func (o *RewardPostView) HasChecks() bool {
|
|
if o != nil && !IsNil(o.Checks) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetChecks gets a reference to the given []RewardCheck and assigns it to the Checks field.
|
|
func (o *RewardPostView) SetChecks(v []RewardCheck) {
|
|
o.Checks = v
|
|
}
|
|
|
|
// GetCountsAt returns the CountsAt field value if set, zero value otherwise.
|
|
func (o *RewardPostView) GetCountsAt() time.Time {
|
|
if o == nil || IsNil(o.CountsAt) {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
return *o.CountsAt
|
|
}
|
|
|
|
// GetCountsAtOk returns a tuple with the CountsAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RewardPostView) GetCountsAtOk() (*time.Time, bool) {
|
|
if o == nil || IsNil(o.CountsAt) {
|
|
return nil, false
|
|
}
|
|
return o.CountsAt, true
|
|
}
|
|
|
|
// HasCountsAt returns a boolean if a field has been set.
|
|
func (o *RewardPostView) HasCountsAt() bool {
|
|
if o != nil && !IsNil(o.CountsAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCountsAt gets a reference to the given time.Time and assigns it to the CountsAt field.
|
|
func (o *RewardPostView) SetCountsAt(v time.Time) {
|
|
o.CountsAt = &v
|
|
}
|
|
|
|
// GetDaysLeft returns the DaysLeft field value if set, zero value otherwise.
|
|
func (o *RewardPostView) GetDaysLeft() int64 {
|
|
if o == nil || IsNil(o.DaysLeft) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.DaysLeft
|
|
}
|
|
|
|
// GetDaysLeftOk returns a tuple with the DaysLeft field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RewardPostView) GetDaysLeftOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.DaysLeft) {
|
|
return nil, false
|
|
}
|
|
return o.DaysLeft, true
|
|
}
|
|
|
|
// HasDaysLeft returns a boolean if a field has been set.
|
|
func (o *RewardPostView) HasDaysLeft() bool {
|
|
if o != nil && !IsNil(o.DaysLeft) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDaysLeft gets a reference to the given int64 and assigns it to the DaysLeft field.
|
|
func (o *RewardPostView) SetDaysLeft(v int64) {
|
|
o.DaysLeft = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *RewardPostView) 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 *RewardPostView) 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 *RewardPostView) 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 *RewardPostView) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetNetwork returns the Network field value if set, zero value otherwise.
|
|
func (o *RewardPostView) GetNetwork() string {
|
|
if o == nil || IsNil(o.Network) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Network
|
|
}
|
|
|
|
// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RewardPostView) GetNetworkOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Network) {
|
|
return nil, false
|
|
}
|
|
return o.Network, true
|
|
}
|
|
|
|
// HasNetwork returns a boolean if a field has been set.
|
|
func (o *RewardPostView) HasNetwork() bool {
|
|
if o != nil && !IsNil(o.Network) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNetwork gets a reference to the given string and assigns it to the Network field.
|
|
func (o *RewardPostView) SetNetwork(v string) {
|
|
o.Network = &v
|
|
}
|
|
|
|
// GetNote returns the Note field value if set, zero value otherwise.
|
|
func (o *RewardPostView) 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 *RewardPostView) 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 *RewardPostView) 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 *RewardPostView) SetNote(v string) {
|
|
o.Note = &v
|
|
}
|
|
|
|
// GetSince returns the Since field value if set, zero value otherwise.
|
|
func (o *RewardPostView) GetSince() time.Time {
|
|
if o == nil || IsNil(o.Since) {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
return *o.Since
|
|
}
|
|
|
|
// GetSinceOk returns a tuple with the Since field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RewardPostView) GetSinceOk() (*time.Time, bool) {
|
|
if o == nil || IsNil(o.Since) {
|
|
return nil, false
|
|
}
|
|
return o.Since, true
|
|
}
|
|
|
|
// HasSince returns a boolean if a field has been set.
|
|
func (o *RewardPostView) HasSince() bool {
|
|
if o != nil && !IsNil(o.Since) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSince gets a reference to the given time.Time and assigns it to the Since field.
|
|
func (o *RewardPostView) SetSince(v time.Time) {
|
|
o.Since = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *RewardPostView) GetStatus() string {
|
|
if o == nil || IsNil(o.Status) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Status
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RewardPostView) GetStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Status) {
|
|
return nil, false
|
|
}
|
|
return o.Status, true
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *RewardPostView) HasStatus() bool {
|
|
if o != nil && !IsNil(o.Status) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *RewardPostView) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *RewardPostView) GetUrl() string {
|
|
if o == nil || IsNil(o.Url) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Url
|
|
}
|
|
|
|
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RewardPostView) GetUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Url) {
|
|
return nil, false
|
|
}
|
|
return o.Url, true
|
|
}
|
|
|
|
// HasUrl returns a boolean if a field has been set.
|
|
func (o *RewardPostView) HasUrl() bool {
|
|
if o != nil && !IsNil(o.Url) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUrl gets a reference to the given string and assigns it to the Url field.
|
|
func (o *RewardPostView) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
// GetWeek returns the Week field value if set, zero value otherwise.
|
|
func (o *RewardPostView) GetWeek() string {
|
|
if o == nil || IsNil(o.Week) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Week
|
|
}
|
|
|
|
// GetWeekOk returns a tuple with the Week field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RewardPostView) GetWeekOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Week) {
|
|
return nil, false
|
|
}
|
|
return o.Week, true
|
|
}
|
|
|
|
// HasWeek returns a boolean if a field has been set.
|
|
func (o *RewardPostView) HasWeek() bool {
|
|
if o != nil && !IsNil(o.Week) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWeek gets a reference to the given string and assigns it to the Week field.
|
|
func (o *RewardPostView) SetWeek(v string) {
|
|
o.Week = &v
|
|
}
|
|
|
|
func (o RewardPostView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o RewardPostView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Checks) {
|
|
toSerialize["checks"] = o.Checks
|
|
}
|
|
if !IsNil(o.CountsAt) {
|
|
toSerialize["countsAt"] = o.CountsAt
|
|
}
|
|
if !IsNil(o.DaysLeft) {
|
|
toSerialize["daysLeft"] = o.DaysLeft
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Network) {
|
|
toSerialize["network"] = o.Network
|
|
}
|
|
if !IsNil(o.Note) {
|
|
toSerialize["note"] = o.Note
|
|
}
|
|
if !IsNil(o.Since) {
|
|
toSerialize["since"] = o.Since
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
if !IsNil(o.Url) {
|
|
toSerialize["url"] = o.Url
|
|
}
|
|
if !IsNil(o.Week) {
|
|
toSerialize["week"] = o.Week
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *RewardPostView) UnmarshalJSON(data []byte) (err error) {
|
|
varRewardPostView := _RewardPostView{}
|
|
|
|
err = json.Unmarshal(data, &varRewardPostView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = RewardPostView(varRewardPostView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "checks")
|
|
delete(additionalProperties, "countsAt")
|
|
delete(additionalProperties, "daysLeft")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "network")
|
|
delete(additionalProperties, "note")
|
|
delete(additionalProperties, "since")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "url")
|
|
delete(additionalProperties, "week")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableRewardPostView struct {
|
|
value *RewardPostView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableRewardPostView) Get() *RewardPostView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableRewardPostView) Set(val *RewardPostView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableRewardPostView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableRewardPostView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableRewardPostView(val *RewardPostView) *NullableRewardPostView {
|
|
return &NullableRewardPostView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableRewardPostView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableRewardPostView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|