Files
sdk/model_dataroom_dataroom_link_stats.go

269 lines
7.7 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 DataroomDataroomLinkStats type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DataroomDataroomLinkStats{}
// DataroomDataroomLinkStats struct for DataroomDataroomLinkStats
type DataroomDataroomLinkStats struct {
// LinkId is the link these counts are for.
LinkId *string `json:"linkId,omitempty"`
// Pages is the per-page breakdown, in page order.
Pages []DataroomDataroomPageStat `json:"pages,omitempty"`
// TotalPageViews is how many page views the link received.
TotalPageViews *int64 `json:"totalPageViews,omitempty"`
// TotalViews is how many viewing sessions the link opened.
TotalViews *int64 `json:"totalViews,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DataroomDataroomLinkStats DataroomDataroomLinkStats
// NewDataroomDataroomLinkStats instantiates a new DataroomDataroomLinkStats 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 NewDataroomDataroomLinkStats() *DataroomDataroomLinkStats {
this := DataroomDataroomLinkStats{}
return &this
}
// NewDataroomDataroomLinkStatsWithDefaults instantiates a new DataroomDataroomLinkStats 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 NewDataroomDataroomLinkStatsWithDefaults() *DataroomDataroomLinkStats {
this := DataroomDataroomLinkStats{}
return &this
}
// GetLinkId returns the LinkId field value if set, zero value otherwise.
func (o *DataroomDataroomLinkStats) GetLinkId() string {
if o == nil || IsNil(o.LinkId) {
var ret string
return ret
}
return *o.LinkId
}
// GetLinkIdOk returns a tuple with the LinkId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataroomDataroomLinkStats) GetLinkIdOk() (*string, bool) {
if o == nil || IsNil(o.LinkId) {
return nil, false
}
return o.LinkId, true
}
// HasLinkId returns a boolean if a field has been set.
func (o *DataroomDataroomLinkStats) HasLinkId() bool {
if o != nil && !IsNil(o.LinkId) {
return true
}
return false
}
// SetLinkId gets a reference to the given string and assigns it to the LinkId field.
func (o *DataroomDataroomLinkStats) SetLinkId(v string) {
o.LinkId = &v
}
// GetPages returns the Pages field value if set, zero value otherwise.
func (o *DataroomDataroomLinkStats) GetPages() []DataroomDataroomPageStat {
if o == nil || IsNil(o.Pages) {
var ret []DataroomDataroomPageStat
return ret
}
return o.Pages
}
// GetPagesOk returns a tuple with the Pages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataroomDataroomLinkStats) GetPagesOk() ([]DataroomDataroomPageStat, bool) {
if o == nil || IsNil(o.Pages) {
return nil, false
}
return o.Pages, true
}
// HasPages returns a boolean if a field has been set.
func (o *DataroomDataroomLinkStats) HasPages() bool {
if o != nil && !IsNil(o.Pages) {
return true
}
return false
}
// SetPages gets a reference to the given []DataroomDataroomPageStat and assigns it to the Pages field.
func (o *DataroomDataroomLinkStats) SetPages(v []DataroomDataroomPageStat) {
o.Pages = v
}
// GetTotalPageViews returns the TotalPageViews field value if set, zero value otherwise.
func (o *DataroomDataroomLinkStats) GetTotalPageViews() int64 {
if o == nil || IsNil(o.TotalPageViews) {
var ret int64
return ret
}
return *o.TotalPageViews
}
// GetTotalPageViewsOk returns a tuple with the TotalPageViews field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataroomDataroomLinkStats) GetTotalPageViewsOk() (*int64, bool) {
if o == nil || IsNil(o.TotalPageViews) {
return nil, false
}
return o.TotalPageViews, true
}
// HasTotalPageViews returns a boolean if a field has been set.
func (o *DataroomDataroomLinkStats) HasTotalPageViews() bool {
if o != nil && !IsNil(o.TotalPageViews) {
return true
}
return false
}
// SetTotalPageViews gets a reference to the given int64 and assigns it to the TotalPageViews field.
func (o *DataroomDataroomLinkStats) SetTotalPageViews(v int64) {
o.TotalPageViews = &v
}
// GetTotalViews returns the TotalViews field value if set, zero value otherwise.
func (o *DataroomDataroomLinkStats) GetTotalViews() int64 {
if o == nil || IsNil(o.TotalViews) {
var ret int64
return ret
}
return *o.TotalViews
}
// GetTotalViewsOk returns a tuple with the TotalViews field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DataroomDataroomLinkStats) GetTotalViewsOk() (*int64, bool) {
if o == nil || IsNil(o.TotalViews) {
return nil, false
}
return o.TotalViews, true
}
// HasTotalViews returns a boolean if a field has been set.
func (o *DataroomDataroomLinkStats) HasTotalViews() bool {
if o != nil && !IsNil(o.TotalViews) {
return true
}
return false
}
// SetTotalViews gets a reference to the given int64 and assigns it to the TotalViews field.
func (o *DataroomDataroomLinkStats) SetTotalViews(v int64) {
o.TotalViews = &v
}
func (o DataroomDataroomLinkStats) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DataroomDataroomLinkStats) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.LinkId) {
toSerialize["linkId"] = o.LinkId
}
if !IsNil(o.Pages) {
toSerialize["pages"] = o.Pages
}
if !IsNil(o.TotalPageViews) {
toSerialize["totalPageViews"] = o.TotalPageViews
}
if !IsNil(o.TotalViews) {
toSerialize["totalViews"] = o.TotalViews
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DataroomDataroomLinkStats) UnmarshalJSON(data []byte) (err error) {
varDataroomDataroomLinkStats := _DataroomDataroomLinkStats{}
err = json.Unmarshal(data, &varDataroomDataroomLinkStats)
if err != nil {
return err
}
*o = DataroomDataroomLinkStats(varDataroomDataroomLinkStats)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "linkId")
delete(additionalProperties, "pages")
delete(additionalProperties, "totalPageViews")
delete(additionalProperties, "totalViews")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDataroomDataroomLinkStats struct {
value *DataroomDataroomLinkStats
isSet bool
}
func (v NullableDataroomDataroomLinkStats) Get() *DataroomDataroomLinkStats {
return v.value
}
func (v *NullableDataroomDataroomLinkStats) Set(val *DataroomDataroomLinkStats) {
v.value = val
v.isSet = true
}
func (v NullableDataroomDataroomLinkStats) IsSet() bool {
return v.isSet
}
func (v *NullableDataroomDataroomLinkStats) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDataroomDataroomLinkStats(val *DataroomDataroomLinkStats) *NullableDataroomDataroomLinkStats {
return &NullableDataroomDataroomLinkStats{value: val, isSet: true}
}
func (v NullableDataroomDataroomLinkStats) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDataroomDataroomLinkStats) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}