Class: Zernio::Ad
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::Ad
- Defined in:
- lib/zernio-sdk/models/ad.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#_id ⇒ Object
Returns the value of attribute _id.
-
#ad_set_name ⇒ Object
Returns the value of attribute ad_set_name.
-
#ad_type ⇒ Object
Returns the value of attribute ad_type.
-
#bid_amount ⇒ Object
Bid amount in WHOLE currency units of the ad account (USD: 5 = $5.00; JPY: 100 = ¥100).
-
#bid_strategy ⇒ Object
Returns the value of attribute bid_strategy.
-
#budget ⇒ Object
Returns the value of attribute budget.
-
#campaign_name ⇒ Object
Returns the value of attribute campaign_name.
-
#configured_status ⇒ Object
The ad's own on/off toggle as configured on the platform (Meta
configured_status: ACTIVE / PAUSED), unaffected by ancestor (ad set / campaign) pauses. -
#cost_type ⇒ Object
LinkedIn only.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#creative ⇒ Object
Returns the value of attribute creative.
-
#goal ⇒ Object
Available goals vary by platform.
-
#is_external ⇒ Object
True for ads synced from platform ad managers.
-
#metrics ⇒ Object
Returns the value of attribute metrics.
-
#name ⇒ Object
Returns the value of attribute name.
-
#optimization_goal ⇒ Object
What the delivery system optimizes for, at ad-set level.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#platform_ad_account_id ⇒ Object
Returns the value of attribute platform_ad_account_id.
-
#platform_ad_account_name ⇒ Object
Human-readable advertiser/account name (Meta
AdAccount.name, TikTokadvertiser_name, LinkedIn / X / Pinterest equivalents). -
#platform_ad_id ⇒ Object
Returns the value of attribute platform_ad_id.
-
#platform_ad_set_id ⇒ Object
Returns the value of attribute platform_ad_set_id.
-
#platform_campaign_id ⇒ Object
Returns the value of attribute platform_campaign_id.
-
#platform_created_at ⇒ Object
Platform-reported creation timestamp (Meta
created_time, TikTokcreate_time). -
#platform_objective ⇒ Object
Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC).
-
#promoted_object ⇒ Object
Returns the value of attribute promoted_object.
-
#rejection_reason ⇒ Object
Returns the value of attribute rejection_reason.
-
#review_status ⇒ Object
Platform review state of this ad, independent of delivery
status/configuredStatus. -
#roas_average_floor ⇒ Object
Minimum ROAS as a decimal multiplier (2.0 = 2.0x ROAS).
-
#schedule ⇒ Object
Returns the value of attribute schedule.
-
#serving_statuses ⇒ Object
LinkedIn only.
-
#status ⇒ Object
Delivery status.
-
#targeting ⇒ Object
The ad set's targeting (age, gender, geo, interests, placements, audience inclusions/exclusions).
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
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 = {}) ⇒ Ad
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 = {}) ⇒ Ad
Initializes the object
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/zernio-sdk/models/ad.rb', line 226 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::Ad` 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 `Zernio::Ad`. 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?(:'_id') self._id = attributes[:'_id'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'platform') self.platform = attributes[:'platform'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'configured_status') self.configured_status = attributes[:'configured_status'] end if attributes.key?(:'review_status') self.review_status = attributes[:'review_status'] end if attributes.key?(:'ad_type') self.ad_type = attributes[:'ad_type'] end if attributes.key?(:'goal') self.goal = attributes[:'goal'] end if attributes.key?(:'is_external') self.is_external = attributes[:'is_external'] end if attributes.key?(:'budget') self.budget = attributes[:'budget'] end if attributes.key?(:'metrics') self.metrics = attributes[:'metrics'] end if attributes.key?(:'platform_ad_id') self.platform_ad_id = attributes[:'platform_ad_id'] end if attributes.key?(:'platform_ad_account_id') self.platform_ad_account_id = attributes[:'platform_ad_account_id'] end if attributes.key?(:'platform_campaign_id') self.platform_campaign_id = attributes[:'platform_campaign_id'] end if attributes.key?(:'platform_ad_set_id') self.platform_ad_set_id = attributes[:'platform_ad_set_id'] end if attributes.key?(:'campaign_name') self.campaign_name = attributes[:'campaign_name'] end if attributes.key?(:'ad_set_name') self.ad_set_name = attributes[:'ad_set_name'] end if attributes.key?(:'platform_objective') self.platform_objective = attributes[:'platform_objective'] end if attributes.key?(:'optimization_goal') self.optimization_goal = attributes[:'optimization_goal'] end if attributes.key?(:'cost_type') self.cost_type = attributes[:'cost_type'] end if attributes.key?(:'serving_statuses') if (value = attributes[:'serving_statuses']).is_a?(Array) self.serving_statuses = value end end if attributes.key?(:'platform_ad_account_name') self.platform_ad_account_name = attributes[:'platform_ad_account_name'] end if attributes.key?(:'platform_created_at') self.platform_created_at = attributes[:'platform_created_at'] end if attributes.key?(:'bid_strategy') self.bid_strategy = attributes[:'bid_strategy'] end if attributes.key?(:'bid_amount') self.bid_amount = attributes[:'bid_amount'] end if attributes.key?(:'roas_average_floor') self.roas_average_floor = attributes[:'roas_average_floor'] end if attributes.key?(:'promoted_object') self.promoted_object = attributes[:'promoted_object'] end if attributes.key?(:'creative') self.creative = attributes[:'creative'] end if attributes.key?(:'targeting') self.targeting = attributes[:'targeting'] end if attributes.key?(:'schedule') self.schedule = attributes[:'schedule'] end if attributes.key?(:'rejection_reason') self.rejection_reason = attributes[:'rejection_reason'] end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end end |
Instance Attribute Details
#_id ⇒ Object
Returns the value of attribute _id.
18 19 20 |
# File 'lib/zernio-sdk/models/ad.rb', line 18 def _id @_id end |
#ad_set_name ⇒ Object
Returns the value of attribute ad_set_name.
55 56 57 |
# File 'lib/zernio-sdk/models/ad.rb', line 55 def ad_set_name @ad_set_name end |
#ad_type ⇒ Object
Returns the value of attribute ad_type.
33 34 35 |
# File 'lib/zernio-sdk/models/ad.rb', line 33 def ad_type @ad_type end |
#bid_amount ⇒ Object
Bid amount in WHOLE currency units of the ad account (USD: 5 = $5.00; JPY: 100 = ¥100). - Meta source: bid_amount on the ad set (smallest-denomination int, decoded here). Populated when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP; null for auto-bid (LOWEST_COST_WITHOUT_CAP). - TikTok source: priority order bid_price -> conversion_bid_price -> deep_cpa_bid (whichever is set on the ad group). TikTok stores all three in whole currency units. - LinkedIn source: the campaign's EFFECTIVE unitCost, refreshed on every sync rather than echoing what was passed on create. Its meaning depends on the bidding mode implied by optimizationGoal: bid amount (manual), target cost, or cost cap. It pairs with costType, NOT with bidStrategy, which LinkedIn does not have. A value of 0 is a real, delivery- stopping configuration and not "unset", so do not gate this field on bidStrategy for LinkedIn ads. Source: facebook-business-sdk-codegen api_specs/specs/AdSet.json (bid_amount).
78 79 80 |
# File 'lib/zernio-sdk/models/ad.rb', line 78 def bid_amount @bid_amount end |
#bid_strategy ⇒ Object
Returns the value of attribute bid_strategy.
75 76 77 |
# File 'lib/zernio-sdk/models/ad.rb', line 75 def bid_strategy @bid_strategy end |
#budget ⇒ Object
Returns the value of attribute budget.
41 42 43 |
# File 'lib/zernio-sdk/models/ad.rb', line 41 def budget @budget end |
#campaign_name ⇒ Object
Returns the value of attribute campaign_name.
53 54 55 |
# File 'lib/zernio-sdk/models/ad.rb', line 53 def campaign_name @campaign_name end |
#configured_status ⇒ Object
The ad's own on/off toggle as configured on the platform (Meta configured_status: ACTIVE / PAUSED), unaffected by ancestor (ad set / campaign) pauses. Distinct from status, which is the ancestor-cascaded delivery status. Only present for Meta ads synced after this field was added.
28 29 30 |
# File 'lib/zernio-sdk/models/ad.rb', line 28 def configured_status @configured_status end |
#cost_type ⇒ Object
LinkedIn only. The campaign's EFFECTIVE cost model (billing event) as applied by LinkedIn, refreshed on every sync rather than echoing what was passed on create. One of CPM (cost per thousand impressions), CPC (cost per click) or CPV (cost per video view). On LinkedIn this is the axis that pairs with bidAmount; there is no bidStrategy. For campaign type SPONSORED_INMAILS, CPM bills as cost-per-send x 1000. null for non-LinkedIn ads.
64 65 66 |
# File 'lib/zernio-sdk/models/ad.rb', line 64 def cost_type @cost_type end |
#created_at ⇒ Object
Returns the value of attribute created_at.
94 95 96 |
# File 'lib/zernio-sdk/models/ad.rb', line 94 def created_at @created_at end |
#creative ⇒ Object
Returns the value of attribute creative.
85 86 87 |
# File 'lib/zernio-sdk/models/ad.rb', line 85 def creative @creative end |
#goal ⇒ Object
Available goals vary by platform. Meta (Facebook/Instagram) supports all 9 (incl. lead_conversion = website pixel lead optimization and catalog_sales = Advantage+ catalog ads). TikTok supports the 7 non-lead_conversion goals. LinkedIn supports all except app_promotion / lead_conversion. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views.
36 37 38 |
# File 'lib/zernio-sdk/models/ad.rb', line 36 def goal @goal end |
#is_external ⇒ Object
True for ads synced from platform ad managers
39 40 41 |
# File 'lib/zernio-sdk/models/ad.rb', line 39 def is_external @is_external end |
#metrics ⇒ Object
Returns the value of attribute metrics.
43 44 45 |
# File 'lib/zernio-sdk/models/ad.rb', line 43 def metrics @metrics end |
#name ⇒ Object
Returns the value of attribute name.
20 21 22 |
# File 'lib/zernio-sdk/models/ad.rb', line 20 def name @name end |
#optimization_goal ⇒ Object
What the delivery system optimizes for, at ad-set level. The value space depends on platform: - Meta: ad set optimization_goal (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION, LINK_CLICKS). - LinkedIn: the campaign's EFFECTIVE optimizationTargetType, refreshed from LinkedIn on every sync rather than echoing what was passed on create. NONE means manual bidding, and it is a real value, not missing data. Auto-bid values are MAX_IMPRESSION / MAX_CLICK / MAX_CONVERSION / MAX_VIDEO_VIEW / MAX_LEAD / MAX_REACH; target-cost values are TARGET_COST_PER_CLICK / TARGET_COST_PER_IMPRESSION / TARGET_COST_PER_VIDEO_VIEW; cost-cap values are the CAP_COST_AND_MAXIMIZE_* family.
61 62 63 |
# File 'lib/zernio-sdk/models/ad.rb', line 61 def optimization_goal @optimization_goal end |
#platform ⇒ Object
Returns the value of attribute platform.
22 23 24 |
# File 'lib/zernio-sdk/models/ad.rb', line 22 def platform @platform end |
#platform_ad_account_id ⇒ Object
Returns the value of attribute platform_ad_account_id.
47 48 49 |
# File 'lib/zernio-sdk/models/ad.rb', line 47 def platform_ad_account_id @platform_ad_account_id end |
#platform_ad_account_name ⇒ Object
Human-readable advertiser/account name (Meta AdAccount.name, TikTok advertiser_name, LinkedIn / X / Pinterest equivalents). Refreshed every sync so platform-side renames propagate within one cycle. null when the platform doesn't return a name or the sync hasn't run yet.
70 71 72 |
# File 'lib/zernio-sdk/models/ad.rb', line 70 def platform_ad_account_name @platform_ad_account_name end |
#platform_ad_id ⇒ Object
Returns the value of attribute platform_ad_id.
45 46 47 |
# File 'lib/zernio-sdk/models/ad.rb', line 45 def platform_ad_id @platform_ad_id end |
#platform_ad_set_id ⇒ Object
Returns the value of attribute platform_ad_set_id.
51 52 53 |
# File 'lib/zernio-sdk/models/ad.rb', line 51 def platform_ad_set_id @platform_ad_set_id end |
#platform_campaign_id ⇒ Object
Returns the value of attribute platform_campaign_id.
49 50 51 |
# File 'lib/zernio-sdk/models/ad.rb', line 49 def platform_campaign_id @platform_campaign_id end |
#platform_created_at ⇒ Object
Platform-reported creation timestamp (Meta created_time, TikTok create_time). Distinct from createdAt which reflects when Zernio first synced the doc — for sort/filter by "when the ad was actually created on the platform", read this field. null for legacy ads synced before this field was added; aggregations fall back to createdAt in that case.
73 74 75 |
# File 'lib/zernio-sdk/models/ad.rb', line 73 def platform_created_at @platform_created_at end |
#platform_objective ⇒ Object
Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC). Only present for Meta ads.
58 59 60 |
# File 'lib/zernio-sdk/models/ad.rb', line 58 def platform_objective @platform_objective end |
#promoted_object ⇒ Object
Returns the value of attribute promoted_object.
83 84 85 |
# File 'lib/zernio-sdk/models/ad.rb', line 83 def promoted_object @promoted_object end |
#rejection_reason ⇒ Object
Returns the value of attribute rejection_reason.
92 93 94 |
# File 'lib/zernio-sdk/models/ad.rb', line 92 def rejection_reason @rejection_reason end |
#review_status ⇒ Object
Platform review state of this ad, independent of delivery status / configuredStatus. Absent when the platform reports no review signal.
31 32 33 |
# File 'lib/zernio-sdk/models/ad.rb', line 31 def review_status @review_status end |
#roas_average_floor ⇒ Object
Minimum ROAS as a decimal multiplier (2.0 = 2.0x ROAS). Populated when bidStrategy is LOWEST_COST_WITH_MIN_ROAS. - Meta source: decoded from bid_constraints.roas_average_floor (Meta stores as fixed-point int × 10000; we return the decimal). - TikTok source: roas_bid on the ad group (already a decimal). Source: facebook-business-sdk-codegen api_specs/specs/AdCampaignBidConstraint.json.
81 82 83 |
# File 'lib/zernio-sdk/models/ad.rb', line 81 def roas_average_floor @roas_average_floor end |
#schedule ⇒ Object
Returns the value of attribute schedule.
90 91 92 |
# File 'lib/zernio-sdk/models/ad.rb', line 90 def schedule @schedule end |
#serving_statuses ⇒ Object
LinkedIn only. Why the parent campaign is (or is not) delivering, verbatim from LinkedIn. A campaign can report status: ACTIVE and still serve nothing; this array is what says so. - [] means no serving data: a non-LinkedIn ad, or a LinkedIn ad not yet re-synced. - [\"RUNNABLE\"] means the campaign is eligible to serve. - Anything else is a hold. Known values include ACCOUNT_SERVING_HOLD, ACCOUNT_TOTAL_BUDGET_HOLD, ACCOUNT_END_DATE_HOLD, CAMPAIGN_START_DATE_HOLD, CAMPAIGN_END_DATE_HOLD, CAMPAIGN_TOTAL_BUDGET_HOLD, CAMPAIGN_AUDIENCE_COUNT_HOLD, CAMPAIGN_GROUP_START_DATE_HOLD, CAMPAIGN_GROUP_END_DATE_HOLD, CAMPAIGN_GROUP_TOTAL_BUDGET_HOLD, CAMPAIGN_GROUP_STATUS_HOLD and STOPPED. The list is open on purpose, so treat unrecognized values as holds rather than errors. The end-date and total-budget holds are terminal and surface as status: completed; the rest surface as status: paused. Note that a hold is not the only cause of zero delivery: with manual, target-cost or cost-cap bidding, a bidAmount of 0 stops delivery while servingStatuses still reads [\"RUNNABLE\"]. Check costType / bidAmount / optimizationGoal as well.
67 68 69 |
# File 'lib/zernio-sdk/models/ad.rb', line 67 def serving_statuses @serving_statuses end |
#status ⇒ Object
Delivery status. Derived from the platform effective_status, so it inherits ancestor pauses (an ACTIVE ad under a PAUSED campaign reads paused). For the ad's own on/off toggle use configuredStatus; for the review state use reviewStatus.
25 26 27 |
# File 'lib/zernio-sdk/models/ad.rb', line 25 def status @status end |
#targeting ⇒ Object
The ad set's targeting (age, gender, geo, interests, placements, audience inclusions/exclusions). For ads created through Zernio this is the spec you supplied. For external ads (synced from Meta Ads Manager, isExternal: true) targeting lives at the ad set and isn't stored at ingest, so on the first GET /v1/ads/{adId} Zernio resolves it live from Meta and caches it on the ad; the value is then Meta's raw targeting shape (snake_case, e.g. geo_locations, age_min), the same object Ads Manager shows. May be absent if the ad set exposes no targeting or the lookup fails.
88 89 90 |
# File 'lib/zernio-sdk/models/ad.rb', line 88 def targeting @targeting end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
96 97 98 |
# File 'lib/zernio-sdk/models/ad.rb', line 96 def updated_at @updated_at end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
160 161 162 |
# File 'lib/zernio-sdk/models/ad.rb', line 160 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
165 166 167 |
# File 'lib/zernio-sdk/models/ad.rb', line 165 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
121 122 123 124 125 126 127 128 129 130 131 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 |
# File 'lib/zernio-sdk/models/ad.rb', line 121 def self.attribute_map { :'_id' => :'_id', :'name' => :'name', :'platform' => :'platform', :'status' => :'status', :'configured_status' => :'configuredStatus', :'review_status' => :'reviewStatus', :'ad_type' => :'adType', :'goal' => :'goal', :'is_external' => :'isExternal', :'budget' => :'budget', :'metrics' => :'metrics', :'platform_ad_id' => :'platformAdId', :'platform_ad_account_id' => :'platformAdAccountId', :'platform_campaign_id' => :'platformCampaignId', :'platform_ad_set_id' => :'platformAdSetId', :'campaign_name' => :'campaignName', :'ad_set_name' => :'adSetName', :'platform_objective' => :'platformObjective', :'optimization_goal' => :'optimizationGoal', :'cost_type' => :'costType', :'serving_statuses' => :'servingStatuses', :'platform_ad_account_name' => :'platformAdAccountName', :'platform_created_at' => :'platformCreatedAt', :'bid_strategy' => :'bidStrategy', :'bid_amount' => :'bidAmount', :'roas_average_floor' => :'roasAverageFloor', :'promoted_object' => :'promotedObject', :'creative' => :'creative', :'targeting' => :'targeting', :'schedule' => :'schedule', :'rejection_reason' => :'rejectionReason', :'created_at' => :'createdAt', :'updated_at' => :'updatedAt' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
# File 'lib/zernio-sdk/models/ad.rb', line 481 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
209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/zernio-sdk/models/ad.rb', line 209 def self.openapi_nullable Set.new([ :'configured_status', :'metrics', :'platform_objective', :'optimization_goal', :'cost_type', :'platform_ad_account_name', :'platform_created_at', :'bid_strategy', :'bid_amount', :'roas_average_floor', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/zernio-sdk/models/ad.rb', line 170 def self.openapi_types { :'_id' => :'String', :'name' => :'String', :'platform' => :'String', :'status' => :'AdStatus', :'configured_status' => :'String', :'review_status' => :'AdReviewStatus', :'ad_type' => :'String', :'goal' => :'String', :'is_external' => :'Boolean', :'budget' => :'AdBudget', :'metrics' => :'AdMetrics', :'platform_ad_id' => :'String', :'platform_ad_account_id' => :'String', :'platform_campaign_id' => :'String', :'platform_ad_set_id' => :'String', :'campaign_name' => :'String', :'ad_set_name' => :'String', :'platform_objective' => :'String', :'optimization_goal' => :'String', :'cost_type' => :'String', :'serving_statuses' => :'Array<String>', :'platform_ad_account_name' => :'String', :'platform_created_at' => :'Time', :'bid_strategy' => :'BidStrategy', :'bid_amount' => :'Float', :'roas_average_floor' => :'Float', :'promoted_object' => :'AdPromotedObject', :'creative' => :'AdCreative', :'targeting' => :'Object', :'schedule' => :'AdSchedule', :'rejection_reason' => :'String', :'created_at' => :'Time', :'updated_at' => :'Time' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/zernio-sdk/models/ad.rb', line 428 def ==(o) return true if self.equal?(o) self.class == o.class && _id == o._id && name == o.name && platform == o.platform && status == o.status && configured_status == o.configured_status && review_status == o.review_status && ad_type == o.ad_type && goal == o.goal && is_external == o.is_external && budget == o.budget && metrics == o.metrics && platform_ad_id == o.platform_ad_id && platform_ad_account_id == o.platform_ad_account_id && platform_campaign_id == o.platform_campaign_id && platform_ad_set_id == o.platform_ad_set_id && campaign_name == o.campaign_name && ad_set_name == o.ad_set_name && platform_objective == o.platform_objective && optimization_goal == o.optimization_goal && cost_type == o.cost_type && serving_statuses == o.serving_statuses && platform_ad_account_name == o.platform_ad_account_name && platform_created_at == o.platform_created_at && bid_strategy == o.bid_strategy && bid_amount == o.bid_amount && roas_average_floor == o.roas_average_floor && promoted_object == o.promoted_object && creative == o.creative && targeting == o.targeting && schedule == o.schedule && rejection_reason == o.rejection_reason && created_at == o.created_at && updated_at == o.updated_at end |
#eql?(o) ⇒ Boolean
468 469 470 |
# File 'lib/zernio-sdk/models/ad.rb', line 468 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
474 475 476 |
# File 'lib/zernio-sdk/models/ad.rb', line 474 def hash [_id, name, platform, status, configured_status, review_status, ad_type, goal, is_external, budget, metrics, platform_ad_id, platform_ad_account_id, platform_campaign_id, platform_ad_set_id, campaign_name, ad_set_name, platform_objective, optimization_goal, cost_type, serving_statuses, platform_ad_account_name, platform_created_at, bid_strategy, bid_amount, roas_average_floor, promoted_object, creative, targeting, schedule, rejection_reason, created_at, updated_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
377 378 379 380 381 |
# File 'lib/zernio-sdk/models/ad.rb', line 377 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
503 504 505 506 507 508 509 510 511 512 513 514 515 |
# File 'lib/zernio-sdk/models/ad.rb', line 503 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
385 386 387 388 389 390 391 392 393 394 |
# File 'lib/zernio-sdk/models/ad.rb', line 385 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' platform_validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter", "openai"]) return false unless platform_validator.valid?(@platform) ad_type_validator = EnumAttributeValidator.new('String', ["boost", "standalone"]) return false unless ad_type_validator.valid?(@ad_type) goal_validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views", "lead_generation", "lead_conversion", "conversions", "app_promotion", "catalog_sales", "job_applicants"]) return false unless goal_validator.valid?(@goal) true end |