Class: Zernio::CreateStandaloneAdRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::CreateStandaloneAdRequest
- Defined in:
- lib/zernio-sdk/models/create_standalone_ad_request.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#ad_account_id ⇒ Object
Returns the value of attribute ad_account_id.
-
#ad_name ⇒ Object
Meta only.
-
#ad_set_id ⇒ Object
Meta-only.
-
#ad_set_name ⇒ Object
Meta only.
-
#additional_descriptions ⇒ Object
Google Search RSA only.
-
#additional_headlines ⇒ Object
Google Search RSA only.
-
#advantage_audience ⇒ Object
Meta only.
-
#age_max ⇒ Object
Returns the value of attribute age_max.
-
#age_min ⇒ Object
Returns the value of attribute age_min.
-
#attribution_spec ⇒ Object
Meta only.
-
#audience_id ⇒ Object
Custom audience ID for targeting.
-
#behaviors ⇒ Object
Behaviour entities from /v1/ads/targeting/search?dimension=behavior.
-
#bid_amount ⇒ Object
Bid cap in WHOLE currency units (USD: 5 = $5.00; JPY: 100 = ¥100).
-
#bid_strategy ⇒ Object
Meta bid strategy applied to the ad set.
-
#billing_event ⇒ Object
Meta only.
-
#board_id ⇒ Object
Pinterest only.
-
#body ⇒ Object
Required on legacy + attach shapes.
-
#brand_identity ⇒ Object
Returns the value of attribute brand_identity.
-
#budget_amount ⇒ Object
Required on legacy + multi-creative shapes.
-
#budget_level ⇒ Object
Meta only.
-
#budget_type ⇒ Object
Required on legacy + multi-creative shapes.
-
#business_name ⇒ Object
Google Display only.
-
#call_to_action ⇒ Object
Required on legacy + attach shapes for Meta.
-
#campaign_name ⇒ Object
Meta only.
-
#campaign_type ⇒ Object
Google only.
-
#cities ⇒ Object
Meta-only.
-
#countries ⇒ Object
ISO 3166-1 alpha-2 country codes (e.g. ['NL']).
-
#creatives ⇒ Object
Meta-only.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#custom_locations ⇒ Object
Point-radius (lat/lng) geo targeting.
-
#description ⇒ Object
Meta only (facebook/instagram).
-
#dsa_beneficiary ⇒ Object
Legal entity that benefits from the ad.
-
#dsa_payor ⇒ Object
Legal entity that pays for the ad.
-
#dynamic_creative ⇒ Object
Returns the value of attribute dynamic_creative.
-
#end_date ⇒ Object
Required for lifetime budgets.
-
#existing_campaign_id ⇒ Object
Meta + LinkedIn.
-
#existing_creative_id ⇒ Object
Meta only.
-
#gender ⇒ Object
Meta only.
-
#goal ⇒ Object
Required on legacy and multi-creative shapes; the attach shape inherits it from the ad set.
-
#headline ⇒ Object
Required for Meta, Google, Pinterest, and LinkedIn on legacy + attach shapes (skip for multi-creative — use
creatives[].headline). -
#identity_type ⇒ Object
TikTok only.
-
#image_url ⇒ Object
Image creative for Meta/Google/Pinterest/LinkedIn on legacy + attach shapes (mutually exclusive with
video). -
#images ⇒ Object
Returns the value of attribute images.
-
#income_tier ⇒ Object
Normalized household-income tier.
-
#instagram_account_id ⇒ Object
Meta only.
-
#interests ⇒ Object
Interest objects from /v1/ads/interests.
-
#keywords ⇒ Object
Google Search only.
-
#languages ⇒ Object
Language codes restricting the audience by language.
-
#lead_gen_form_id ⇒ Object
Meta Lead Gen forms only (facebook/instagram).
-
#link_url ⇒ Object
Required on legacy + attach shapes (skip for multi-creative).
-
#long_headline ⇒ Object
Google Display only — defaults to
headlineif omitted. -
#metros ⇒ Object
DMA / metro-area geo targeting.
-
#name ⇒ Object
Returns the value of attribute name.
-
#optimization_goal ⇒ Object
Meta only.
-
#organization_id ⇒ Object
LinkedIn only.
-
#placement_assets ⇒ Object
Returns the value of attribute placement_assets.
-
#placements ⇒ Object
Returns the value of attribute placements.
-
#platform_specific_data ⇒ Object
Returns the value of attribute platform_specific_data.
-
#promoted_object ⇒ Object
Returns the value of attribute promoted_object.
-
#raw_targeting ⇒ Object
Meta only.
-
#regions ⇒ Object
Meta-only.
-
#roas_average_floor ⇒ Object
Minimum ROAS as a decimal multiplier (e.g. 2.0 = 2.0x ROAS).
-
#saved_targeting_id ⇒ Object
ID of a
saved_targetingaudience (created via POST /v1/ads/audiences). -
#special_ad_categories ⇒ Object
Meta only.
-
#start_date ⇒ Object
Meta only.
-
#status ⇒ Object
Meta only.
-
#targeting ⇒ Object
Nested targeting object — the same TargetingSpec shape as
POST /v1/ads/boost,POST /v1/ads/targeting/reach-estimate, andsaved_targetingaudiences. -
#tracking ⇒ Object
Returns the value of attribute tracking.
-
#video ⇒ Object
Returns the value of attribute video.
-
#zips ⇒ Object
Postal/ZIP geo targeting.
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 = {}) ⇒ CreateStandaloneAdRequest
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 = {}) ⇒ CreateStandaloneAdRequest
Initializes the object
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 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 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 410 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateStandaloneAdRequest` 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::CreateStandaloneAdRequest`. 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?(:'account_id') self.account_id = attributes[:'account_id'] else self.account_id = nil end if attributes.key?(:'ad_account_id') self.ad_account_id = attributes[:'ad_account_id'] else self.ad_account_id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil 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?(:'ad_name') self.ad_name = attributes[:'ad_name'] end if attributes.key?(:'tracking') self.tracking = attributes[:'tracking'] end if attributes.key?(:'goal') self.goal = attributes[:'goal'] end if attributes.key?(:'optimization_goal') self.optimization_goal = attributes[:'optimization_goal'] end if attributes.key?(:'billing_event') self.billing_event = attributes[:'billing_event'] end if attributes.key?(:'budget_amount') self.budget_amount = attributes[:'budget_amount'] end if attributes.key?(:'budget_type') self.budget_type = attributes[:'budget_type'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'budget_level') self.budget_level = attributes[:'budget_level'] else self.budget_level = 'adset' end if attributes.key?(:'currency') self.currency = attributes[:'currency'] end if attributes.key?(:'headline') self.headline = attributes[:'headline'] end if attributes.key?(:'long_headline') self.long_headline = attributes[:'long_headline'] end if attributes.key?(:'body') self.body = attributes[:'body'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'call_to_action') self.call_to_action = attributes[:'call_to_action'] end if attributes.key?(:'link_url') self.link_url = attributes[:'link_url'] end if attributes.key?(:'lead_gen_form_id') self.lead_gen_form_id = attributes[:'lead_gen_form_id'] end if attributes.key?(:'image_url') self.image_url = attributes[:'image_url'] end if attributes.key?(:'images') self.images = attributes[:'images'] end if attributes.key?(:'video') self.video = attributes[:'video'] end if attributes.key?(:'creatives') if (value = attributes[:'creatives']).is_a?(Array) self.creatives = value end end if attributes.key?(:'ad_set_id') self.ad_set_id = attributes[:'ad_set_id'] end if attributes.key?(:'existing_campaign_id') self.existing_campaign_id = attributes[:'existing_campaign_id'] end if attributes.key?(:'existing_creative_id') self.existing_creative_id = attributes[:'existing_creative_id'] end if attributes.key?(:'business_name') self.business_name = attributes[:'business_name'] end if attributes.key?(:'board_id') self.board_id = attributes[:'board_id'] end if attributes.key?(:'organization_id') self.organization_id = attributes[:'organization_id'] end if attributes.key?(:'targeting') self.targeting = attributes[:'targeting'] end if attributes.key?(:'countries') if (value = attributes[:'countries']).is_a?(Array) self.countries = value end end if attributes.key?(:'cities') if (value = attributes[:'cities']).is_a?(Array) self.cities = value end end if attributes.key?(:'regions') if (value = attributes[:'regions']).is_a?(Array) self.regions = value end end if attributes.key?(:'age_min') self.age_min = attributes[:'age_min'] end if attributes.key?(:'age_max') self.age_max = attributes[:'age_max'] end if attributes.key?(:'interests') if (value = attributes[:'interests']).is_a?(Array) self.interests = value end end if attributes.key?(:'zips') if (value = attributes[:'zips']).is_a?(Array) self.zips = value end end if attributes.key?(:'metros') if (value = attributes[:'metros']).is_a?(Array) self.metros = value end end if attributes.key?(:'custom_locations') if (value = attributes[:'custom_locations']).is_a?(Array) self.custom_locations = value end end if attributes.key?(:'behaviors') if (value = attributes[:'behaviors']).is_a?(Array) self.behaviors = value end end if attributes.key?(:'income_tier') self.income_tier = attributes[:'income_tier'] end if attributes.key?(:'languages') if (value = attributes[:'languages']).is_a?(Array) self.languages = value end end if attributes.key?(:'placements') self.placements = attributes[:'placements'] end if attributes.key?(:'saved_targeting_id') self.saved_targeting_id = attributes[:'saved_targeting_id'] end if attributes.key?(:'raw_targeting') if (value = attributes[:'raw_targeting']).is_a?(Hash) self.raw_targeting = value end end if attributes.key?(:'special_ad_categories') if (value = attributes[:'special_ad_categories']).is_a?(Array) self.special_ad_categories = value end end if attributes.key?(:'end_date') self.end_date = attributes[:'end_date'] end if attributes.key?(:'start_date') self.start_date = attributes[:'start_date'] end if attributes.key?(:'instagram_account_id') self.instagram_account_id = attributes[:'instagram_account_id'] end if attributes.key?(:'dynamic_creative') self.dynamic_creative = attributes[:'dynamic_creative'] end if attributes.key?(:'placement_assets') self.placement_assets = attributes[:'placement_assets'] end if attributes.key?(:'audience_id') self.audience_id = attributes[:'audience_id'] end if attributes.key?(:'campaign_type') self.campaign_type = attributes[:'campaign_type'] else self.campaign_type = 'display' end if attributes.key?(:'keywords') if (value = attributes[:'keywords']).is_a?(Array) self.keywords = value end end if attributes.key?(:'additional_headlines') if (value = attributes[:'additional_headlines']).is_a?(Array) self.additional_headlines = value end end if attributes.key?(:'additional_descriptions') if (value = attributes[:'additional_descriptions']).is_a?(Array) self.additional_descriptions = value end end if attributes.key?(:'advantage_audience') self.advantage_audience = attributes[:'advantage_audience'] end if attributes.key?(:'attribution_spec') if (value = attributes[:'attribution_spec']).is_a?(Array) self.attribution_spec = value end end if attributes.key?(:'gender') self.gender = attributes[:'gender'] else self.gender = 'all' 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?(:'platform_specific_data') self.platform_specific_data = attributes[:'platform_specific_data'] end if attributes.key?(:'dsa_beneficiary') self.dsa_beneficiary = attributes[:'dsa_beneficiary'] end if attributes.key?(:'dsa_payor') self.dsa_payor = attributes[:'dsa_payor'] end if attributes.key?(:'brand_identity') self.brand_identity = attributes[:'brand_identity'] end if attributes.key?(:'identity_type') self.identity_type = attributes[:'identity_type'] end if attributes.key?(:'promoted_object') self.promoted_object = attributes[:'promoted_object'] end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
18 19 20 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 18 def account_id @account_id end |
#ad_account_id ⇒ Object
Returns the value of attribute ad_account_id.
20 21 22 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 20 def ad_account_id @ad_account_id end |
#ad_name ⇒ Object
Meta only. Exact ad name (the single-creative ad object's name). Overrides the default, which is name. (For per-ad names on the multi-creative shape, set name on each creatives[] entry instead.)
31 32 33 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 31 def ad_name @ad_name end |
#ad_set_id ⇒ Object
Meta-only. When present, switches to the attach shape: adds one new ad to this existing ad set without creating a new campaign. Budget, targeting, goal, schedule, AND bid strategy are inherited from the ad set on Meta — passing bidStrategy in attach mode returns 400. To change an existing ad set's bid, use PUT /v1/ads/ad-sets/{adSetId}. Mutually exclusive with creatives[]. The attached ad takes the full single-creative surface: headline/body/description/callToAction plus either imageUrl/video OR placementAssets (its own per-placement Feed/Story assets), and leadGenFormId when the target is a lead ad set (the parent must be ON_AD — true for ad sets created via goal lead_generation; Meta rejects a formless ad there, so pass the form on EVERY attached ad). This is the way to build N full ads sharing one ad set: create the first ad via the normal shape, then attach the rest one call each. Supported on Meta (facebook, instagram), TikTok, and LinkedIn. On TikTok the adSetId is the ad group ID; the new ad inherits the ad group's bid + budget + targeting. On LinkedIn the adSetId is the LinkedIn Campaign ID (numeric); we attach a new Creative to that Campaign, so the Campaign's platformSpecificData bidding, targeting, budget and schedule are inherited (passing those fields returns 400).
90 91 92 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 90 def ad_set_id @ad_set_id end |
#ad_set_name ⇒ Object
Meta only. Exact ad set name. Overrides the default <name> - Ad Set. (For per-ad names on the multi-creative shape, set name on each creatives[] entry.)
28 29 30 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 28 def ad_set_name @ad_set_name end |
#additional_descriptions ⇒ Object
Google Search RSA only. Extra descriptions.
181 182 183 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 181 def additional_descriptions @additional_descriptions end |
#additional_headlines ⇒ Object
Google Search RSA only. Extra headlines.
178 179 180 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 178 def additional_headlines @additional_headlines end |
#advantage_audience ⇒ Object
Meta only. Controls the Advantage audience feature (targeting_automation). 0 = disabled (default), 1 = enabled. Meta Marketing API requires this field on all ad set creation requests.
184 185 186 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 184 def advantage_audience @advantage_audience end |
#age_max ⇒ Object
Returns the value of attribute age_max.
121 122 123 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 121 def age_max @age_max end |
#age_min ⇒ Object
Returns the value of attribute age_min.
119 120 121 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 119 def age_min @age_min end |
#attribution_spec ⇒ Object
Meta only. Conversion attribution window for the ad set — maps 1:1 to Meta's ad-set attribution_spec. Only honored for conversion goals (conversions, lead_generation, app_promotion); ignored for awareness/traffic/engagement. Omit to use Meta's default (7-day click + 1-day view). Meta enforces the valid combinations: VIEW_THROUGH only allows windowDays: 1 (7d/28d view windows were removed Jan 2026); ENGAGED_VIDEO_VIEW only 1 and only alongside VIEW_THROUGH: 1; CLICK_THROUGH: 28 only on certain objectives. Invalid combos surface as a Meta 400. Example: [{ \"eventType\": \"CLICK_THROUGH\", \"windowDays\": 7 }, { \"eventType\": \"VIEW_THROUGH\", \"windowDays\": 1 }]
187 188 189 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 187 def attribution_spec @attribution_spec end |
#audience_id ⇒ Object
Custom audience ID for targeting
169 170 171 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 169 def audience_id @audience_id end |
#behaviors ⇒ Object
Behaviour entities from /v1/ads/targeting/search?dimension=behavior. Supported on Meta and TikTok. Each must include id.
136 137 138 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 136 def behaviors @behaviors end |
#bid_amount ⇒ Object
Bid cap in WHOLE currency units (USD: 5 = $5.00; JPY: 100 = ¥100). Required when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP.
196 197 198 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 196 def bid_amount @bid_amount end |
#bid_strategy ⇒ Object
Meta bid strategy applied to the ad set.
193 194 195 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 193 def bid_strategy @bid_strategy end |
#billing_event ⇒ Object
Meta only. Explicit ad-set billing_event. Defaults to IMPRESSIONS. Forwarded verbatim to Meta, which validates compatibility with the optimization goal.
42 43 44 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 42 def billing_event @billing_event end |
#board_id ⇒ Object
Pinterest only. Board ID (auto-creates if not provided).
102 103 104 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 102 def board_id @board_id end |
#body ⇒ Object
Required on legacy + attach shapes. For X/Twitter this is the tweet text (max 280 chars including a ~24-char URL when linkUrl is set). On LinkedIn this is the post commentary (the intro text shown above the ad). Max: Google=90, Pinterest=500.
65 66 67 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 65 def body @body end |
#brand_identity ⇒ Object
Returns the value of attribute brand_identity.
209 210 211 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 209 def brand_identity @brand_identity end |
#budget_amount ⇒ Object
Required on legacy + multi-creative shapes. Inherited on attach.
45 46 47 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 45 def budget_amount @budget_amount end |
#budget_level ⇒ Object
Meta only. Where the budget lives, which selects the Meta budget model: - adset (default): ABO (Ad-set Budget Optimization). The budget is set on the ad set. This is the back-compatible behaviour — omit this field to keep it. - campaign: CBO (Campaign Budget Optimization / Advantage Campaign Budget). The budget AND bidStrategy are set on the CAMPAIGN, and Meta distributes spend across ad sets automatically. Meta requires the budget at exactly one level, never both. Non-Meta platforms ignore this field. Ignored on the attach shape (adSetId), which inherits the existing budget.
54 55 56 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 54 def budget_level @budget_level end |
#budget_type ⇒ Object
Required on legacy + multi-creative shapes. Inherited on attach.
48 49 50 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 48 def budget_type @budget_type end |
#business_name ⇒ Object
Google Display only
99 100 101 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 99 def business_name @business_name end |
#call_to_action ⇒ Object
Required on legacy + attach shapes for Meta. Honoured on TikTok (passes through to the Spark Ad creative's call_to_action) and on LinkedIn (the CTA button on the ad; defaults to LEARN_MORE when linkUrl is set). LinkedIn accepts: LEARN_MORE, SIGN_UP, DOWNLOAD, SUBSCRIBE, REGISTER, JOIN, ATTEND, REQUEST_DEMO, VIEW_QUOTE, APPLY, SEE_MORE, SHOP_NOW, BUY_NOW. Ignored by Google, Pinterest, and X/Twitter.
71 72 73 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 71 def call_to_action @call_to_action end |
#campaign_name ⇒ Object
Meta only. Exact campaign name. Overrides the default <name> - Campaign.
25 26 27 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 25 def campaign_name @campaign_name end |
#campaign_type ⇒ Object
Google only
172 173 174 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 172 def campaign_type @campaign_type end |
#cities ⇒ Object
Meta-only. City-level geo targeting. Each city is targeted by Meta's opaque key (the city ID) which can be looked up via GET /v1/ads/targeting/search?type=city&q=<name>&country_code=<ISO>. Optional radius + distance_unit extend the targeting beyond the city limits (e.g. radius 25 km around the city center). Both must be set together, or both omitted (Meta defaults to ~16 km when omitted). Cannot overlap with the same country in countries (Meta returns a "locations overlap" error). Either drop the country or scope it to a different country.
114 115 116 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 114 def cities @cities end |
#countries ⇒ Object
ISO 3166-1 alpha-2 country codes (e.g. ['NL']). Defaults to ['US'] when no other geo targeting (flat or nested targeting) is provided. (LinkedIn currently honours country-level targeting only.)
111 112 113 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 111 def countries @countries end |
#creatives ⇒ Object
Meta-only. When present, switches to the multi-creative shape: creates 1 campaign + 1 ad set + N ads (one per entry here). Top-level headline / body / imageUrl / linkUrl / callToAction are ignored in this mode. Mutually exclusive with adSetId.
87 88 89 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 87 def creatives @creatives end |
#currency ⇒ Object
Returns the value of attribute currency.
56 57 58 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 56 def currency @currency end |
#custom_locations ⇒ Object
Point-radius (lat/lng) geo targeting. Meta only (custom_locations). Rejected on platforms without radius support.
133 134 135 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 133 def custom_locations @custom_locations end |
#description ⇒ Object
Meta only (facebook/instagram). Link description — the secondary text shown below the headline (Meta's link_data.description; on video creatives mapped to video_data.link_description). When omitted, Meta auto-pulls the destination URL's OpenGraph description. Applies on legacy, attach, and placementAssets shapes; for multi-creative use creatives.description (this field is the shared fallback). For multi-text variations use dynamicCreative.descriptions instead.
68 69 70 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 68 def description @description end |
#dsa_beneficiary ⇒ Object
Legal entity that benefits from the ad. Required when targeting EU users (EU DSA, Article 26). Optional if the ad account has a default beneficiary: set it once via PATCH /v1/ads/accounts or in Meta Ads Manager, and Meta fills it in whenever the field is omitted.
204 205 206 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 204 def dsa_beneficiary @dsa_beneficiary end |
#dsa_payor ⇒ Object
Legal entity that pays for the ad. Can differ from dsaBeneficiary (for example, an agency paying for a client's ads). Same rules as dsaBeneficiary: required for EU targeting unless the ad account has a default payor.
207 208 209 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 207 def dsa_payor @dsa_payor end |
#dynamic_creative ⇒ Object
Returns the value of attribute dynamic_creative.
164 165 166 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 164 def dynamic_creative @dynamic_creative end |
#end_date ⇒ Object
Required for lifetime budgets
156 157 158 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 156 def end_date @end_date end |
#existing_campaign_id ⇒ Object
Meta + LinkedIn. On Meta: add the new ad set under this EXISTING campaign instead of creating a new one (multi-ad-set audience testing). The new ad set's budget is matched to the campaign's mode automatically: for a CBO campaign (campaign-level budget) omit budgetAmount/budgetType — the campaign owns the budget; for an ABO campaign pass them (they go on the new ad set). On LinkedIn: create a new Campaign (and its Creative) under this EXISTING CampaignGroup. On failure only the entities we authored are cleaned up; the pre-existing parent is left untouched and is never (re)activated. Mutually exclusive with adSetId and creatives[].
93 94 95 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 93 def existing_campaign_id @existing_campaign_id end |
#existing_creative_id ⇒ Object
Meta only. Reuse an EXISTING ad creative by id instead of building a new one from the copy/media fields (which are then ignored). Combine with existingCampaignId to build a multi-ad-set campaign that shares one creative. Mutually exclusive with creatives[], dynamicCreative, and placementAssets. The creative id used is returned as creativeId on the create response.
96 97 98 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 96 def existing_creative_id @existing_creative_id end |
#gender ⇒ Object
Meta only. Restrict the audience by gender. 'male' targets men only, 'female' targets women only, 'all' (default) targets everyone. Ignored by non-Meta platforms.
190 191 192 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 190 def gender @gender end |
#goal ⇒ Object
Required on legacy and multi-creative shapes; the attach shape inherits it from the ad set. Available goals vary by platform. Meta - conversions: OUTCOME_SALES. Requires promotedObject.pixelId and promotedObject.customEventType with a commerce event such as PURCHASE or START_TRIAL. - lead_conversion: OUTCOME_LEADS optimizing website pixel leads. Same pixel and event fields, but with a leads-class event such as LEAD, SUBMIT_APPLICATION, SCHEDULE or CONTACT. Meta gates conversion events by objective, so leads-class events are rejected under conversions. - lead_generation: OUTCOME_LEADS with instant forms. Requires leadGenFormId. promotedObject.pageId is optional and auto-filled from the connected Page. - app_promotion: requires promotedObject.applicationId and promotedObject.objectStoreUrl. - catalog_sales: Advantage+ catalog ads, for example vehicle inventory. Requires promotedObject.productSetId, promotedObject.pixelId and promotedObject.customEventType. Builds a catalog TEMPLATE creative from the copy fields, which may carry template tags like Zernio::CreateStandaloneAdRequest.{product{product.name} or Zernio::CreateStandaloneAdRequest.{vehicle{vehicle.make}. No imageUrl or video is sent; Meta renders the visuals per catalog item. Discover catalogs via GET /v1/ads/catalogs and product sets via GET /v1/ads/catalogs/catalogId/product-sets. Single shape only, no creatives, adSetId, dynamicCreative or placementAssets. TikTok - conversions: website-conversion ad group. Requires promotedObject.pixelId, your TikTok Pixel ID. Accepts an optional promotedObject.customEventType with a TikTok optimization_event code your pixel tracks (newer pixels use e.g. SHOPPING for purchase events; legacy pixels use ON_WEB_ORDER, INITIATE_ORDER, ON_WEB_REGISTER or FORM). To inherit pixel and event from an existing ad group, pass adSetId instead. LinkedIn - engagement, traffic, awareness and video_views create standalone Direct Sponsored Content ads. traffic requires linkUrl; video_views requires video. - job_applicants requires a platformSpecificData.jobs creative. - For lead_generation or conversions on LinkedIn, or to promote an existing post, use POST /v1/ads/boost.
36 37 38 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 36 def goal @goal end |
#headline ⇒ Object
Required for Meta, Google, Pinterest, and LinkedIn on legacy + attach shapes (skip for multi-creative — use creatives[].headline). Ignored for TikTok and X/Twitter. Max: Meta=255, Google=30, Pinterest=100, LinkedIn=400. On LinkedIn this is the ad's headline (the bold text on the creative); for traffic ads it's the link card title.
59 60 61 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 59 def headline @headline end |
#identity_type ⇒ Object
TikTok only. Forces the identity attribution on the ad: - TT_USER: the posting account's open_id (real @username branding). Requires a connected TikTok posting account on the same profile. - CUSTOMIZED_USER: synthetic Brand Identity (display name + avatar). Requires a configured Brand Identity (cached on the tiktokads SocialAccount via PATCH /v1/connect/tiktok-ads) or an inline brandIdentity to create one on the fly. When omitted, defaults to TT_USER if a posting account is connected on this profile, else CUSTOMIZED_USER. Spark Ads (POST /v1/ads/boost) always use TT_USER regardless of this field — TikTok requires the original organic post's author identity for Spark.
212 213 214 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 212 def identity_type @identity_type end |
#image_url ⇒ Object
Image creative for Meta/Google/Pinterest/LinkedIn on legacy + attach shapes (mutually exclusive with video). Required for LinkedIn ads unless video is set. Not required for Google Search campaigns. For TikTok, this field carries the VIDEO URL (the TikTok ads endpoint is video-only; the field retains the imageUrl name for cross-platform consistency). Ignored for X/Twitter. For Google Display, treated as the landscape image (alias of images.landscape); supply images.square alongside or the request is rejected. For LinkedIn the image is uploaded to LinkedIn under the authoring Company Page (see organizationId); recommended ratio 1.91:1 (e.g. 1200×627).
80 81 82 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 80 def image_url @image_url end |
#images ⇒ Object
Returns the value of attribute images.
82 83 84 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 82 def images @images end |
#income_tier ⇒ Object
Normalized household-income tier. Meta and TikTok express all four; Google maps only top_10; rejected on LinkedIn, X, and Pinterest. On Meta, income targeting is incompatible with housing/employment/credit specialAdCategories.
139 140 141 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 139 def income_tier @income_tier end |
#instagram_account_id ⇒ Object
Meta only. Override the Instagram account the ad is delivered as — pass an Instagram Business Account ID (e.g. 17841...), mapped to the creative's instagram_user_id. When omitted we auto-resolve the IG account linked to the connected Facebook Page (the existing default). Useful when a Page has more than one eligible IG account.
162 163 164 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 162 def instagram_account_id @instagram_account_id end |
#interests ⇒ Object
Interest objects from /v1/ads/interests. Each must include id and name.
124 125 126 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 124 def interests @interests end |
#keywords ⇒ Object
Google Search only
175 176 177 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 175 def keywords @keywords end |
#languages ⇒ Object
Language codes restricting the audience by language. On Meta, ISO 639-1 codes (e.g. ['en'], ['de']); a bare code targets all regional variants ("en" = all English), or use a region-qualified code for a specific one ("en_GB", "pt_BR", "zh_TW"). Unknown codes are rejected. Other ad platforms use their own language-code systems.
142 143 144 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 142 def languages @languages end |
#lead_gen_form_id ⇒ Object
Meta Lead Gen forms only (facebook/instagram). The leadgen_forms ID to attach to the ad's creative — create one via POST /v1/ads/lead-forms. REQUIRED when goal is lead_generation, and on every ATTACH (adSetId) call that targets a lead ad set (the form attaches per-ad; Meta rejects a formless ad in a lead ad set). Ignored otherwise. The ad set's promoted_object.page_id + LEAD_GENERATION optimization + destination_type ON_AD are derived automatically from the goal. Both placementAssets (per-placement creative) and dynamicCreative (multi-text / multi-asset pool, e.g. multiple headlines and primary texts) ARE supported on instant-form lead ads — the form is attached for you, and for dynamicCreative the ad set is created as a Dynamic Creative ad set automatically (Meta requires that for any multi-text feed; there is no non-DCO multi-text path). Send a single imageUrls entry plus your text variations to get Meta's "Multiple Text Options" behavior on a lead ad.
77 78 79 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 77 def lead_gen_form_id @lead_gen_form_id end |
#link_url ⇒ Object
Required on legacy + attach shapes (skip for multi-creative). On LinkedIn it's the ad's destination URL; required for traffic ads, optional for engagement / awareness. NOT required when goal is lead_generation (the ad opens a Lead Gen form instead of a destination). On LinkedIn, imageUrl + linkUrl publishes an ARTICLE-content creative; this is LinkedIn's article ad format, with the image as thumbnail and longHeadline as description.
74 75 76 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 74 def link_url @link_url end |
#long_headline ⇒ Object
Google Display only — defaults to headline if omitted. On LinkedIn, reused as the optional secondary description text on traffic (link) ads; omitted if not provided.
62 63 64 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 62 def long_headline @long_headline end |
#metros ⇒ Object
DMA / metro-area geo targeting. key is the platform's metro ID from /v1/ads/targeting/search?dimension=geo&geoType=metro.
130 131 132 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 130 def metros @metros end |
#name ⇒ Object
Returns the value of attribute name.
22 23 24 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 22 def name @name end |
#optimization_goal ⇒ Object
Meta only. Explicit ad-set optimization_goal (e.g. LANDING_PAGE_VIEWS, LINK_CLICKS, REACH, IMPRESSIONS, OFFSITE_CONVERSIONS, THRUPLAY, LEAD_GENERATION). Overrides the default derived from goal (e.g. traffic defaults to LINK_CLICKS). Forwarded verbatim to Meta, which validates compatibility with the campaign objective and rejects incompatible combinations.
39 40 41 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 39 def optimization_goal @optimization_goal end |
#organization_id ⇒ Object
LinkedIn only. The Company Page that authors the Direct Sponsored Content ("dark") post backing the ad — accepts a numeric organization ID or a full urn:li:organization:N URN. Required unless the resolved accountId is a connected LinkedIn Company-Page account (defaults to that page) or the LinkedIn ad account is org-owned (defaults to the account's owning organization). The authenticated member must be an ADMINISTRATOR or DIRECT_SPONSORED_CONTENT_POSTER of this page (and the page must be associated with the ad account), or LinkedIn returns 403. Ignored by every other platform.
105 106 107 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 105 def organization_id @organization_id end |
#placement_assets ⇒ Object
Returns the value of attribute placement_assets.
166 167 168 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 166 def placement_assets @placement_assets end |
#placements ⇒ Object
Returns the value of attribute placements.
144 145 146 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 144 def placements @placements end |
#platform_specific_data ⇒ Object
Returns the value of attribute platform_specific_data.
201 202 203 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 201 def platform_specific_data @platform_specific_data end |
#promoted_object ⇒ Object
Returns the value of attribute promoted_object.
214 215 216 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 214 def promoted_object @promoted_object end |
#raw_targeting ⇒ Object
Meta only. A raw Meta-native targeting spec passed to the ad set VERBATIM (snake_case: geo_locations, age_min, excluded_custom_audiences, flexible_spec, targeting_automation, business places, etc.) — exactly the shape GET /v1/ads/{adId} returns for external ads. Use it to clone a campaign's targeting EXACTLY, preserving advanced fields the camelCase targeting fields can't model. Mutually exclusive with the camelCase targeting fields (countries/regions/cities/interests/ ageMin/...), audienceId, and savedTargetingId (sending both → 422). Sent as-is; Meta validates and surfaces any errors. If cloning an EU campaign, also pass dsaBeneficiary / dsaPayor (those are separate fields, not part of targeting).
150 151 152 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 150 def raw_targeting @raw_targeting end |
#regions ⇒ Object
Meta-only. Region-level (state/province) geo targeting. Each region is targeted by Meta's opaque key (the region ID) which can be looked up via GET /v1/ads/targeting/search?type=region&q=<name>&country_code=<ISO>.
117 118 119 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 117 def regions @regions end |
#roas_average_floor ⇒ Object
Minimum ROAS as a decimal multiplier (e.g. 2.0 = 2.0x ROAS). Required when bidStrategy is LOWEST_COST_WITH_MIN_ROAS. Sent to Meta as bid_constraints.roas_average_floor × 10000.
199 200 201 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 199 def roas_average_floor @roas_average_floor end |
#saved_targeting_id ⇒ Object
ID of a saved_targeting audience (created via POST /v1/ads/audiences). When set, its stored TargetingSpec is expanded as the base targeting; inline fields on this body merge on top. Lets you reuse a named targeting preset without re-sending every field.
147 148 149 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 147 def saved_targeting_id @saved_targeting_id end |
#special_ad_categories ⇒ Object
Meta only. Declares the ad's special category, required for housing, employment, credit, or political/social-issue ads (Meta enforces restricted targeting for these). Note: setting a special category disables income/zip targeting on Meta.
153 154 155 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 153 def special_ad_categories @special_ad_categories end |
#start_date ⇒ Object
Meta only. Ad-set start time (ISO 8601, e.g. "2026-06-10T09:00:00Z"), mapped to the ad set's start_time. When omitted the ad starts delivering immediately. For lifetime budgets Meta also requires endDate. (Same schedule.startDate semantics already available on POST /v1/ads/boost.)
159 160 161 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 159 def start_date @start_date end |
#status ⇒ Object
Meta only. Publish state of the created ad set + ad. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused and skips activation, so you can review before they spend.
51 52 53 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 51 def status @status end |
#targeting ⇒ Object
Nested targeting object — the same TargetingSpec shape as POST /v1/ads/boost, POST /v1/ads/targeting/reach-estimate, and saved_targeting audiences. Merged UNDER the flat inline targeting fields below: savedTargetingId < targeting < flat fields (a flat field present on the body replaces the nested value entirely). Both forms are equivalent; use whichever your integration already builds.
108 109 110 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 108 def targeting @targeting end |
#tracking ⇒ Object
Returns the value of attribute tracking.
33 34 35 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 33 def tracking @tracking end |
#video ⇒ Object
Returns the value of attribute video.
84 85 86 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 84 def video @video end |
#zips ⇒ Object
Postal/ZIP geo targeting. key is the platform's postal location ID from /v1/ads/targeting/search?dimension=geo&geoType=zip. Supported on Meta, Google, TikTok, Pinterest, X.
127 128 129 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 127 def zips @zips end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
316 317 318 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 316 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
321 322 323 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 321 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 239 def self.attribute_map { :'account_id' => :'accountId', :'ad_account_id' => :'adAccountId', :'name' => :'name', :'campaign_name' => :'campaignName', :'ad_set_name' => :'adSetName', :'ad_name' => :'adName', :'tracking' => :'tracking', :'goal' => :'goal', :'optimization_goal' => :'optimizationGoal', :'billing_event' => :'billingEvent', :'budget_amount' => :'budgetAmount', :'budget_type' => :'budgetType', :'status' => :'status', :'budget_level' => :'budgetLevel', :'currency' => :'currency', :'headline' => :'headline', :'long_headline' => :'longHeadline', :'body' => :'body', :'description' => :'description', :'call_to_action' => :'callToAction', :'link_url' => :'linkUrl', :'lead_gen_form_id' => :'leadGenFormId', :'image_url' => :'imageUrl', :'images' => :'images', :'video' => :'video', :'creatives' => :'creatives', :'ad_set_id' => :'adSetId', :'existing_campaign_id' => :'existingCampaignId', :'existing_creative_id' => :'existingCreativeId', :'business_name' => :'businessName', :'board_id' => :'boardId', :'organization_id' => :'organizationId', :'targeting' => :'targeting', :'countries' => :'countries', :'cities' => :'cities', :'regions' => :'regions', :'age_min' => :'ageMin', :'age_max' => :'ageMax', :'interests' => :'interests', :'zips' => :'zips', :'metros' => :'metros', :'custom_locations' => :'customLocations', :'behaviors' => :'behaviors', :'income_tier' => :'incomeTier', :'languages' => :'languages', :'placements' => :'placements', :'saved_targeting_id' => :'savedTargetingId', :'raw_targeting' => :'rawTargeting', :'special_ad_categories' => :'specialAdCategories', :'end_date' => :'endDate', :'start_date' => :'startDate', :'instagram_account_id' => :'instagramAccountId', :'dynamic_creative' => :'dynamicCreative', :'placement_assets' => :'placementAssets', :'audience_id' => :'audienceId', :'campaign_type' => :'campaignType', :'keywords' => :'keywords', :'additional_headlines' => :'additionalHeadlines', :'additional_descriptions' => :'additionalDescriptions', :'advantage_audience' => :'advantageAudience', :'attribution_spec' => :'attributionSpec', :'gender' => :'gender', :'bid_strategy' => :'bidStrategy', :'bid_amount' => :'bidAmount', :'roas_average_floor' => :'roasAverageFloor', :'platform_specific_data' => :'platformSpecificData', :'dsa_beneficiary' => :'dsaBeneficiary', :'dsa_payor' => :'dsaPayor', :'brand_identity' => :'brandIdentity', :'identity_type' => :'identityType', :'promoted_object' => :'promotedObject' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1290 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
403 404 405 406 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 403 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 326 def self.openapi_types { :'account_id' => :'String', :'ad_account_id' => :'String', :'name' => :'String', :'campaign_name' => :'String', :'ad_set_name' => :'String', :'ad_name' => :'String', :'tracking' => :'CreateStandaloneAdRequestTracking', :'goal' => :'String', :'optimization_goal' => :'String', :'billing_event' => :'String', :'budget_amount' => :'Float', :'budget_type' => :'String', :'status' => :'String', :'budget_level' => :'String', :'currency' => :'String', :'headline' => :'String', :'long_headline' => :'String', :'body' => :'String', :'description' => :'String', :'call_to_action' => :'String', :'link_url' => :'String', :'lead_gen_form_id' => :'String', :'image_url' => :'String', :'images' => :'CreateStandaloneAdRequestImages', :'video' => :'CreateStandaloneAdRequestVideo', :'creatives' => :'Array<CreateStandaloneAdRequestCreativesInner>', :'ad_set_id' => :'String', :'existing_campaign_id' => :'String', :'existing_creative_id' => :'String', :'business_name' => :'String', :'board_id' => :'String', :'organization_id' => :'String', :'targeting' => :'TargetingSpec', :'countries' => :'Array<String>', :'cities' => :'Array<CreateStandaloneAdRequestCitiesInner>', :'regions' => :'Array<CreateStandaloneAdRequestRegionsInner>', :'age_min' => :'Integer', :'age_max' => :'Integer', :'interests' => :'Array<UpdateAdRequestTargetingInterestsInner>', :'zips' => :'Array<BoostPostRequestTargetingRegionsInner>', :'metros' => :'Array<BoostPostRequestTargetingRegionsInner>', :'custom_locations' => :'Array<CreateStandaloneAdRequestCustomLocationsInner>', :'behaviors' => :'Array<CreateStandaloneAdRequestBehaviorsInner>', :'income_tier' => :'String', :'languages' => :'Array<String>', :'placements' => :'CreateStandaloneAdRequestPlacements', :'saved_targeting_id' => :'String', :'raw_targeting' => :'Hash<String, Object>', :'special_ad_categories' => :'Array<String>', :'end_date' => :'Time', :'start_date' => :'Time', :'instagram_account_id' => :'String', :'dynamic_creative' => :'CreateStandaloneAdRequestDynamicCreative', :'placement_assets' => :'CreateStandaloneAdRequestPlacementAssets', :'audience_id' => :'String', :'campaign_type' => :'String', :'keywords' => :'Array<String>', :'additional_headlines' => :'Array<String>', :'additional_descriptions' => :'Array<String>', :'advantage_audience' => :'Integer', :'attribution_spec' => :'Array<CreateStandaloneAdRequestAttributionSpecInner>', :'gender' => :'String', :'bid_strategy' => :'BidStrategy', :'bid_amount' => :'Float', :'roas_average_floor' => :'Float', :'platform_specific_data' => :'LinkedInAdsPlatformData', :'dsa_beneficiary' => :'String', :'dsa_payor' => :'String', :'brand_identity' => :'CreateStandaloneAdRequestBrandIdentity', :'identity_type' => :'String', :'promoted_object' => :'CreateStandaloneAdRequestPromotedObject' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1199 def ==(o) return true if self.equal?(o) self.class == o.class && account_id == o.account_id && ad_account_id == o.ad_account_id && name == o.name && campaign_name == o.campaign_name && ad_set_name == o.ad_set_name && ad_name == o.ad_name && tracking == o.tracking && goal == o.goal && optimization_goal == o.optimization_goal && billing_event == o.billing_event && budget_amount == o.budget_amount && budget_type == o.budget_type && status == o.status && budget_level == o.budget_level && currency == o.currency && headline == o.headline && long_headline == o.long_headline && body == o.body && description == o.description && call_to_action == o.call_to_action && link_url == o.link_url && lead_gen_form_id == o.lead_gen_form_id && image_url == o.image_url && images == o.images && video == o.video && creatives == o.creatives && ad_set_id == o.ad_set_id && existing_campaign_id == o.existing_campaign_id && existing_creative_id == o.existing_creative_id && business_name == o.business_name && board_id == o.board_id && organization_id == o.organization_id && targeting == o.targeting && countries == o.countries && cities == o.cities && regions == o.regions && age_min == o.age_min && age_max == o.age_max && interests == o.interests && zips == o.zips && metros == o.metros && custom_locations == o.custom_locations && behaviors == o.behaviors && income_tier == o.income_tier && languages == o.languages && placements == o.placements && saved_targeting_id == o.saved_targeting_id && raw_targeting == o.raw_targeting && special_ad_categories == o.special_ad_categories && end_date == o.end_date && start_date == o.start_date && instagram_account_id == o.instagram_account_id && dynamic_creative == o.dynamic_creative && placement_assets == o.placement_assets && audience_id == o.audience_id && campaign_type == o.campaign_type && keywords == o.keywords && additional_headlines == o.additional_headlines && additional_descriptions == o.additional_descriptions && advantage_audience == o.advantage_audience && attribution_spec == o.attribution_spec && gender == o.gender && bid_strategy == o.bid_strategy && bid_amount == o.bid_amount && roas_average_floor == o.roas_average_floor && platform_specific_data == o.platform_specific_data && dsa_beneficiary == o.dsa_beneficiary && dsa_payor == o.dsa_payor && brand_identity == o.brand_identity && identity_type == o.identity_type && promoted_object == o.promoted_object end |
#eql?(o) ⇒ Boolean
1277 1278 1279 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1277 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
1283 1284 1285 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1283 def hash [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, end_date, start_date, instagram_account_id, dynamic_creative, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 755 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @account_id.nil? invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') end if @ad_account_id.nil? invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @name.to_s.length > 255 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if !@campaign_name.nil? && @campaign_name.to_s.length > 255 invalid_properties.push('invalid value for "campaign_name", the character length must be smaller than or equal to 255.') end if !@ad_set_name.nil? && @ad_set_name.to_s.length > 255 invalid_properties.push('invalid value for "ad_set_name", the character length must be smaller than or equal to 255.') end if !@ad_name.nil? && @ad_name.to_s.length > 255 invalid_properties.push('invalid value for "ad_name", the character length must be smaller than or equal to 255.') end if !@long_headline.nil? && @long_headline.to_s.length > 90 invalid_properties.push('invalid value for "long_headline", the character length must be smaller than or equal to 90.') end if !@description.nil? && @description.to_s.length > 255 invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.') end if !@creatives.nil? && @creatives.length < 1 invalid_properties.push('invalid value for "creatives", number of items must be greater than or equal to 1.') end if !@business_name.nil? && @business_name.to_s.length > 25 invalid_properties.push('invalid value for "business_name", the character length must be smaller than or equal to 25.') end if !@age_min.nil? && @age_min > 65 invalid_properties.push('invalid value for "age_min", must be smaller than or equal to 65.') end if !@age_min.nil? && @age_min < 13 invalid_properties.push('invalid value for "age_min", must be greater than or equal to 13.') end if !@age_max.nil? && @age_max > 65 invalid_properties.push('invalid value for "age_max", must be smaller than or equal to 65.') end if !@age_max.nil? && @age_max < 13 invalid_properties.push('invalid value for "age_max", must be greater than or equal to 13.') end if !@attribution_spec.nil? && @attribution_spec.length > 3 invalid_properties.push('invalid value for "attribution_spec", number of items must be less than or equal to 3.') end if !@attribution_spec.nil? && @attribution_spec.length < 1 invalid_properties.push('invalid value for "attribution_spec", number of items must be greater than or equal to 1.') end if !@dsa_beneficiary.nil? && @dsa_beneficiary.to_s.length > 100 invalid_properties.push('invalid value for "dsa_beneficiary", the character length must be smaller than or equal to 100.') end if !@dsa_payor.nil? && @dsa_payor.to_s.length > 100 invalid_properties.push('invalid value for "dsa_payor", the character length must be smaller than or equal to 100.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1312 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
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 839 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @account_id.nil? return false if @ad_account_id.nil? return false if @name.nil? return false if @name.to_s.length > 255 return false if !@campaign_name.nil? && @campaign_name.to_s.length > 255 return false if !@ad_set_name.nil? && @ad_set_name.to_s.length > 255 return false if !@ad_name.nil? && @ad_name.to_s.length > 255 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) budget_type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"]) return false unless budget_type_validator.valid?(@budget_type) status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"]) return false unless status_validator.valid?(@status) budget_level_validator = EnumAttributeValidator.new('String', ["adset", "campaign"]) return false unless budget_level_validator.valid?(@budget_level) return false if !@long_headline.nil? && @long_headline.to_s.length > 90 return false if !@description.nil? && @description.to_s.length > 255 call_to_action_validator = EnumAttributeValidator.new('String', ["LEARN_MORE", "SHOP_NOW", "SIGN_UP", "BOOK_TRAVEL", "CONTACT_US", "DOWNLOAD", "GET_OFFER", "GET_QUOTE", "SUBSCRIBE", "WATCH_MORE", "REGISTER", "JOIN", "ATTEND", "REQUEST_DEMO", "VIEW_QUOTE", "APPLY", "SEE_MORE", "BUY_NOW"]) return false unless call_to_action_validator.valid?(@call_to_action) return false if !@creatives.nil? && @creatives.length < 1 return false if !@business_name.nil? && @business_name.to_s.length > 25 return false if !@age_min.nil? && @age_min > 65 return false if !@age_min.nil? && @age_min < 13 return false if !@age_max.nil? && @age_max > 65 return false if !@age_max.nil? && @age_max < 13 income_tier_validator = EnumAttributeValidator.new('String', ["top_5", "top_10", "top_10_25", "top_25_50"]) return false unless income_tier_validator.valid?(@income_tier) campaign_type_validator = EnumAttributeValidator.new('String', ["display", "search"]) return false unless campaign_type_validator.valid?(@campaign_type) advantage_audience_validator = EnumAttributeValidator.new('Integer', [0, 1]) return false unless advantage_audience_validator.valid?(@advantage_audience) return false if !@attribution_spec.nil? && @attribution_spec.length > 3 return false if !@attribution_spec.nil? && @attribution_spec.length < 1 gender_validator = EnumAttributeValidator.new('String', ["all", "male", "female"]) return false unless gender_validator.valid?(@gender) return false if !@dsa_beneficiary.nil? && @dsa_beneficiary.to_s.length > 100 return false if !@dsa_payor.nil? && @dsa_payor.to_s.length > 100 identity_type_validator = EnumAttributeValidator.new('String', ["TT_USER", "CUSTOMIZED_USER"]) return false unless identity_type_validator.valid?(@identity_type) true end |