Files
sdk/model_ad_ad_summary.go

269 lines
6.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 AdAdSummary type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AdAdSummary{}
// AdAdSummary struct for AdAdSummary
type AdAdSummary struct {
// Active is how many of those campaigns are in the active state.
Active *int64 `json:"active,omitempty"`
// Budget is the summed budget of every campaign in the org, in cents.
Budget *int64 `json:"budget,omitempty"`
// Campaigns is how many campaigns the org has, in every state.
Campaigns *int64 `json:"campaigns,omitempty"`
// Spend is the summed spend of every campaign in the org, in cents.
Spend *int64 `json:"spend,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AdAdSummary AdAdSummary
// NewAdAdSummary instantiates a new AdAdSummary 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 NewAdAdSummary() *AdAdSummary {
this := AdAdSummary{}
return &this
}
// NewAdAdSummaryWithDefaults instantiates a new AdAdSummary 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 NewAdAdSummaryWithDefaults() *AdAdSummary {
this := AdAdSummary{}
return &this
}
// GetActive returns the Active field value if set, zero value otherwise.
func (o *AdAdSummary) GetActive() int64 {
if o == nil || IsNil(o.Active) {
var ret int64
return ret
}
return *o.Active
}
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AdAdSummary) GetActiveOk() (*int64, bool) {
if o == nil || IsNil(o.Active) {
return nil, false
}
return o.Active, true
}
// HasActive returns a boolean if a field has been set.
func (o *AdAdSummary) HasActive() bool {
if o != nil && !IsNil(o.Active) {
return true
}
return false
}
// SetActive gets a reference to the given int64 and assigns it to the Active field.
func (o *AdAdSummary) SetActive(v int64) {
o.Active = &v
}
// GetBudget returns the Budget field value if set, zero value otherwise.
func (o *AdAdSummary) GetBudget() int64 {
if o == nil || IsNil(o.Budget) {
var ret int64
return ret
}
return *o.Budget
}
// GetBudgetOk returns a tuple with the Budget field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AdAdSummary) GetBudgetOk() (*int64, bool) {
if o == nil || IsNil(o.Budget) {
return nil, false
}
return o.Budget, true
}
// HasBudget returns a boolean if a field has been set.
func (o *AdAdSummary) HasBudget() bool {
if o != nil && !IsNil(o.Budget) {
return true
}
return false
}
// SetBudget gets a reference to the given int64 and assigns it to the Budget field.
func (o *AdAdSummary) SetBudget(v int64) {
o.Budget = &v
}
// GetCampaigns returns the Campaigns field value if set, zero value otherwise.
func (o *AdAdSummary) GetCampaigns() int64 {
if o == nil || IsNil(o.Campaigns) {
var ret int64
return ret
}
return *o.Campaigns
}
// GetCampaignsOk returns a tuple with the Campaigns field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AdAdSummary) GetCampaignsOk() (*int64, bool) {
if o == nil || IsNil(o.Campaigns) {
return nil, false
}
return o.Campaigns, true
}
// HasCampaigns returns a boolean if a field has been set.
func (o *AdAdSummary) HasCampaigns() bool {
if o != nil && !IsNil(o.Campaigns) {
return true
}
return false
}
// SetCampaigns gets a reference to the given int64 and assigns it to the Campaigns field.
func (o *AdAdSummary) SetCampaigns(v int64) {
o.Campaigns = &v
}
// GetSpend returns the Spend field value if set, zero value otherwise.
func (o *AdAdSummary) GetSpend() int64 {
if o == nil || IsNil(o.Spend) {
var ret int64
return ret
}
return *o.Spend
}
// GetSpendOk returns a tuple with the Spend field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AdAdSummary) GetSpendOk() (*int64, bool) {
if o == nil || IsNil(o.Spend) {
return nil, false
}
return o.Spend, true
}
// HasSpend returns a boolean if a field has been set.
func (o *AdAdSummary) HasSpend() bool {
if o != nil && !IsNil(o.Spend) {
return true
}
return false
}
// SetSpend gets a reference to the given int64 and assigns it to the Spend field.
func (o *AdAdSummary) SetSpend(v int64) {
o.Spend = &v
}
func (o AdAdSummary) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AdAdSummary) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Active) {
toSerialize["active"] = o.Active
}
if !IsNil(o.Budget) {
toSerialize["budget"] = o.Budget
}
if !IsNil(o.Campaigns) {
toSerialize["campaigns"] = o.Campaigns
}
if !IsNil(o.Spend) {
toSerialize["spend"] = o.Spend
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdAdSummary) UnmarshalJSON(data []byte) (err error) {
varAdAdSummary := _AdAdSummary{}
err = json.Unmarshal(data, &varAdAdSummary)
if err != nil {
return err
}
*o = AdAdSummary(varAdAdSummary)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "active")
delete(additionalProperties, "budget")
delete(additionalProperties, "campaigns")
delete(additionalProperties, "spend")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdAdSummary struct {
value *AdAdSummary
isSet bool
}
func (v NullableAdAdSummary) Get() *AdAdSummary {
return v.value
}
func (v *NullableAdAdSummary) Set(val *AdAdSummary) {
v.value = val
v.isSet = true
}
func (v NullableAdAdSummary) IsSet() bool {
return v.isSet
}
func (v *NullableAdAdSummary) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAdAdSummary(val *AdAdSummary) *NullableAdAdSummary {
return &NullableAdAdSummary{value: val, isSet: true}
}
func (v NullableAdAdSummary) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAdAdSummary) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}