Class: PinterestSdkClient::CampaignCommon
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- PinterestSdkClient::CampaignCommon
- Defined in:
- lib/pinterest_sdk/models/campaign_common.rb
Overview
Campaign Data
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#ad_account_id ⇒ Object
Campaign’s Advertiser ID.
-
#daily_spend_cap ⇒ Object
Campaign daily spending cap.
-
#end_time ⇒ Object
Timestamp in Unix format for scheduling when ads in the campaign stop appearing.
-
#is_automated_campaign ⇒ Object
Specifies whether the campaign was created in the automated campaign flow.
-
#is_flexible_daily_budgets ⇒ Object
Determine if a campaign has setup for flexible daily budgets, also known as \“Pinterest Performance+ budgets\”.
-
#lifetime_spend_cap ⇒ Object
Campaign total spending cap.
-
#name ⇒ Object
Campaign name.
-
#order_line_id ⇒ Object
Order line ID that appears on the invoice.
-
#start_time ⇒ Object
Timestamp in Unix format for scheduling when ads in the campaign start to appear.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tracking_urls ⇒ Object
Returns the value of attribute tracking_urls.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CampaignCommon
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ CampaignCommon
Initializes the object
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 132 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::CampaignCommon` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `PinterestSdkClient::CampaignCommon`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'ad_account_id') self.ad_account_id = attributes[:'ad_account_id'] end if attributes.key?(:'daily_spend_cap') self.daily_spend_cap = attributes[:'daily_spend_cap'] end if attributes.key?(:'end_time') self.end_time = attributes[:'end_time'] end if attributes.key?(:'is_automated_campaign') self.is_automated_campaign = attributes[:'is_automated_campaign'] end if attributes.key?(:'is_flexible_daily_budgets') self.is_flexible_daily_budgets = attributes[:'is_flexible_daily_budgets'] end if attributes.key?(:'lifetime_spend_cap') self.lifetime_spend_cap = attributes[:'lifetime_spend_cap'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'order_line_id') self.order_line_id = attributes[:'order_line_id'] end if attributes.key?(:'start_time') self.start_time = attributes[:'start_time'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'tracking_urls') self.tracking_urls = attributes[:'tracking_urls'] end end |
Instance Attribute Details
#ad_account_id ⇒ Object
Campaign’s Advertiser ID. If you want to create a campaign in a Business Account shared account you need to specify the Business Access advertiser ID in both the query path param as well as the request body schema.
20 21 22 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 20 def ad_account_id @ad_account_id end |
#daily_spend_cap ⇒ Object
Campaign daily spending cap. Required for Campaign Budget Optimization (CBO) campaigns. This and \“lifetime_spend_cap\” cannot be set at the same time.
23 24 25 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 23 def daily_spend_cap @daily_spend_cap end |
#end_time ⇒ Object
Timestamp in Unix format for scheduling when ads in the campaign stop appearing. Must occur after any end times for child ad groups. If end_time is not specified for the campaign, ads run indefinitely unless you update the campaign, changing their status to paused. Learn about <a href=\“/docs/api-features/managing-campaigns/#campaign-scheduling\” target=\“blank\”>scheduling campaigns</a>. Different end times can be set for the campaign’s child ad groups, but they cannot occur after an end_time specified for the campaign. - If your campaign has a child ad group with an end time specified, and if you update that campaign with an end_time that is earlier than that of the ad group, the campaign end_time will supersede the ad group end_time, and the request will not return an error. - In this scenario, if you call <a href=\“/docs/api/v5/campaigns-list\” target=\“blank\”>List campaigns</a> or <a href=\“/docs/api/v5/ad_groups-list\” target=\“blank\”>List ad groups</a>, the returned campaigns or ad groups are listed with the start and end times that you assigned them, regardless of supersedence.
26 27 28 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 26 def end_time @end_time end |
#is_automated_campaign ⇒ Object
Specifies whether the campaign was created in the automated campaign flow
29 30 31 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 29 def is_automated_campaign @is_automated_campaign end |
#is_flexible_daily_budgets ⇒ Object
Determine if a campaign has setup for flexible daily budgets, also known as \“Pinterest Performance+ budgets\”.
32 33 34 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 32 def is_flexible_daily_budgets @is_flexible_daily_budgets end |
#lifetime_spend_cap ⇒ Object
Campaign total spending cap. Required for Campaign Budget Optimization (CBO) campaigns. This and \“daily_spend_cap\” cannot be set at the same time.
35 36 37 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 35 def lifetime_spend_cap @lifetime_spend_cap end |
#name ⇒ Object
Campaign name.
38 39 40 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 38 def name @name end |
#order_line_id ⇒ Object
Order line ID that appears on the invoice.
41 42 43 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 41 def order_line_id @order_line_id end |
#start_time ⇒ Object
Timestamp in Unix format for scheduling when ads in the campaign start to appear. Must precede any start times set for child ad groups. Defaults to current time if no time is specified. Learn about <a href=\“/docs/api-features/managing-campaigns/#campaign-scheduling\” target=\“blank\”>scheduling campaigns</a>. Different start times can be set for the campaign’s child ad groups, but they cannot occur before a start_time specified for the campaign. - If your campaign has a child ad group with a start time specified, and if you update that campaign with a start_time that is later than that of the ad group, the campaign start_time will supersede the ad group start_time, and the request will not return an error. - In this scenario, if you call <a href=\“/docs/api/v5/campaigns-list\” target=\“blank\”>List campaigns</a> or <a href=\“/docs/api/v5/ad_groups-list\” target=\“blank\”>List ad groups</a>, the returned campaigns or ad groups are listed with the start and end times that you assigned them, regardless of supersedence.
44 45 46 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 44 def start_time @start_time end |
#status ⇒ Object
Returns the value of attribute status.
46 47 48 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 46 def status @status end |
#tracking_urls ⇒ Object
Returns the value of attribute tracking_urls.
48 49 50 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 48 def tracking_urls @tracking_urls end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
90 91 92 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 90 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
95 96 97 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 95 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 73 def self.attribute_map { :'ad_account_id' => :'ad_account_id', :'daily_spend_cap' => :'daily_spend_cap', :'end_time' => :'end_time', :'is_automated_campaign' => :'is_automated_campaign', :'is_flexible_daily_budgets' => :'is_flexible_daily_budgets', :'lifetime_spend_cap' => :'lifetime_spend_cap', :'name' => :'name', :'order_line_id' => :'order_line_id', :'start_time' => :'start_time', :'status' => :'status', :'tracking_urls' => :'tracking_urls' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 277 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 117 def self.openapi_nullable Set.new([ :'daily_spend_cap', :'end_time', :'is_automated_campaign', :'is_flexible_daily_budgets', :'lifetime_spend_cap', :'order_line_id', :'start_time', :'tracking_urls' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 100 def self.openapi_types { :'ad_account_id' => :'String', :'daily_spend_cap' => :'Integer', :'end_time' => :'Integer', :'is_automated_campaign' => :'Boolean', :'is_flexible_daily_budgets' => :'Boolean', :'lifetime_spend_cap' => :'Integer', :'name' => :'String', :'order_line_id' => :'String', :'start_time' => :'Integer', :'status' => :'EntityStatus', :'tracking_urls' => :'TrackingUrls' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 246 def ==(o) return true if self.equal?(o) self.class == o.class && ad_account_id == o.ad_account_id && daily_spend_cap == o.daily_spend_cap && end_time == o.end_time && is_automated_campaign == o.is_automated_campaign && is_flexible_daily_budgets == o.is_flexible_daily_budgets && lifetime_spend_cap == o.lifetime_spend_cap && name == o.name && order_line_id == o.order_line_id && start_time == o.start_time && status == o.status && tracking_urls == o.tracking_urls end |
#eql?(o) ⇒ Boolean
264 265 266 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 264 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
270 271 272 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 270 def hash [ad_account_id, daily_spend_cap, end_time, is_automated_campaign, is_flexible_daily_budgets, lifetime_spend_cap, name, order_line_id, start_time, status, tracking_urls].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 193 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new pattern = Regexp.new(/^\d+$/) if !@ad_account_id.nil? && @ad_account_id !~ pattern invalid_properties.push("invalid value for \"ad_account_id\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^\d+$/) if !@order_line_id.nil? && @order_line_id !~ pattern invalid_properties.push("invalid value for \"order_line_id\", must conform to the pattern #{pattern}.") end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 299 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
211 212 213 214 215 216 |
# File 'lib/pinterest_sdk/models/campaign_common.rb', line 211 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@ad_account_id.nil? && @ad_account_id !~ Regexp.new(/^\d+$/) return false if !@order_line_id.nil? && @order_line_id !~ Regexp.new(/^\d+$/) true end |