mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
383 lines
10 KiB
Go
383 lines
10 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 AdCampaignInput type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AdCampaignInput{}
|
|
|
|
// AdCampaignInput struct for AdCampaignInput
|
|
type AdCampaignInput struct {
|
|
// Account is the provider ad-account this campaign runs on (Meta act_<id>). Optional.
|
|
Account *string `json:"account,omitempty"`
|
|
// Budget is the campaign budget in MINOR units (cents). Negative values clamp to 0.
|
|
Budget *int64 `json:"budget,omitempty"`
|
|
// Name is the campaign's display label. Required; trimmed and bounded to 1024 bytes.
|
|
Name *string `json:"name,omitempty"`
|
|
// Objective is the campaign goal as the provider names it. Optional, bounded to 1024 bytes.
|
|
Objective *string `json:"objective,omitempty"`
|
|
// Platform is the ad network: meta, google, tiktok or x. Empty defaults to meta.
|
|
Platform *string `json:"platform,omitempty"`
|
|
// Spend is the amount spent so far in MINOR units (cents). Negative values clamp to 0.
|
|
Spend *int64 `json:"spend,omitempty"`
|
|
// Status is the lifecycle state: draft, active, paused or completed. Empty defaults to draft.
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AdCampaignInput AdCampaignInput
|
|
|
|
// NewAdCampaignInput instantiates a new AdCampaignInput 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 NewAdCampaignInput() *AdCampaignInput {
|
|
this := AdCampaignInput{}
|
|
return &this
|
|
}
|
|
|
|
// NewAdCampaignInputWithDefaults instantiates a new AdCampaignInput 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 NewAdCampaignInputWithDefaults() *AdCampaignInput {
|
|
this := AdCampaignInput{}
|
|
return &this
|
|
}
|
|
|
|
// GetAccount returns the Account field value if set, zero value otherwise.
|
|
func (o *AdCampaignInput) GetAccount() string {
|
|
if o == nil || IsNil(o.Account) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Account
|
|
}
|
|
|
|
// GetAccountOk returns a tuple with the Account field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AdCampaignInput) GetAccountOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Account) {
|
|
return nil, false
|
|
}
|
|
return o.Account, true
|
|
}
|
|
|
|
// HasAccount returns a boolean if a field has been set.
|
|
func (o *AdCampaignInput) HasAccount() bool {
|
|
if o != nil && !IsNil(o.Account) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAccount gets a reference to the given string and assigns it to the Account field.
|
|
func (o *AdCampaignInput) SetAccount(v string) {
|
|
o.Account = &v
|
|
}
|
|
|
|
// GetBudget returns the Budget field value if set, zero value otherwise.
|
|
func (o *AdCampaignInput) 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 *AdCampaignInput) 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 *AdCampaignInput) 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 *AdCampaignInput) SetBudget(v int64) {
|
|
o.Budget = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *AdCampaignInput) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AdCampaignInput) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *AdCampaignInput) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *AdCampaignInput) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetObjective returns the Objective field value if set, zero value otherwise.
|
|
func (o *AdCampaignInput) GetObjective() string {
|
|
if o == nil || IsNil(o.Objective) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Objective
|
|
}
|
|
|
|
// GetObjectiveOk returns a tuple with the Objective field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AdCampaignInput) GetObjectiveOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Objective) {
|
|
return nil, false
|
|
}
|
|
return o.Objective, true
|
|
}
|
|
|
|
// HasObjective returns a boolean if a field has been set.
|
|
func (o *AdCampaignInput) HasObjective() bool {
|
|
if o != nil && !IsNil(o.Objective) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetObjective gets a reference to the given string and assigns it to the Objective field.
|
|
func (o *AdCampaignInput) SetObjective(v string) {
|
|
o.Objective = &v
|
|
}
|
|
|
|
// GetPlatform returns the Platform field value if set, zero value otherwise.
|
|
func (o *AdCampaignInput) GetPlatform() string {
|
|
if o == nil || IsNil(o.Platform) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Platform
|
|
}
|
|
|
|
// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AdCampaignInput) GetPlatformOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Platform) {
|
|
return nil, false
|
|
}
|
|
return o.Platform, true
|
|
}
|
|
|
|
// HasPlatform returns a boolean if a field has been set.
|
|
func (o *AdCampaignInput) HasPlatform() bool {
|
|
if o != nil && !IsNil(o.Platform) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPlatform gets a reference to the given string and assigns it to the Platform field.
|
|
func (o *AdCampaignInput) SetPlatform(v string) {
|
|
o.Platform = &v
|
|
}
|
|
|
|
// GetSpend returns the Spend field value if set, zero value otherwise.
|
|
func (o *AdCampaignInput) 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 *AdCampaignInput) 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 *AdCampaignInput) 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 *AdCampaignInput) SetSpend(v int64) {
|
|
o.Spend = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *AdCampaignInput) 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 *AdCampaignInput) 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 *AdCampaignInput) 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 *AdCampaignInput) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o AdCampaignInput) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AdCampaignInput) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Account) {
|
|
toSerialize["account"] = o.Account
|
|
}
|
|
if !IsNil(o.Budget) {
|
|
toSerialize["budget"] = o.Budget
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Objective) {
|
|
toSerialize["objective"] = o.Objective
|
|
}
|
|
if !IsNil(o.Platform) {
|
|
toSerialize["platform"] = o.Platform
|
|
}
|
|
if !IsNil(o.Spend) {
|
|
toSerialize["spend"] = o.Spend
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AdCampaignInput) UnmarshalJSON(data []byte) (err error) {
|
|
varAdCampaignInput := _AdCampaignInput{}
|
|
|
|
err = json.Unmarshal(data, &varAdCampaignInput)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AdCampaignInput(varAdCampaignInput)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "account")
|
|
delete(additionalProperties, "budget")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "objective")
|
|
delete(additionalProperties, "platform")
|
|
delete(additionalProperties, "spend")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAdCampaignInput struct {
|
|
value *AdCampaignInput
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAdCampaignInput) Get() *AdCampaignInput {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAdCampaignInput) Set(val *AdCampaignInput) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAdCampaignInput) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAdCampaignInput) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAdCampaignInput(val *AdCampaignInput) *NullableAdCampaignInput {
|
|
return &NullableAdCampaignInput{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAdCampaignInput) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAdCampaignInput) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|