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
When present, switches to the attach shape: adds one new ad to this existing ad set without creating a new campaign.
-
#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
Deprecated: send it inside
platformSpecificDatainstead (Meta today; TikTok's nested shape is planned). -
#bid_strategy ⇒ Object
Deprecated: send it inside
platformSpecificDatainstead (Meta today; TikTok's nested shape is planned). -
#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
Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents — Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up.
-
#budget_level ⇒ Object
Meta only.
-
#budget_type ⇒ Object
Required on legacy + multi-creative shapes.
-
#business_name ⇒ Object
Google Display only.
-
#buying_type ⇒ Object
Meta only.
-
#call_to_action ⇒ Object
Required on legacy + attach shapes for Meta.
-
#callouts ⇒ Object
Google Search only.
-
#campaign_name ⇒ Object
Meta only.
-
#campaign_status ⇒ Object
Meta only.
-
#campaign_type ⇒ Object
Google only.
-
#carousel_cards ⇒ Object
Meta only.
-
#cities ⇒ Object
City-level geo targeting (Meta and TikTok).
-
#countries ⇒ Object
ISO 3166-1 alpha-2 country codes (e.g. ['NL']).
-
#creative_features ⇒ Object
Meta only.
-
#creatives ⇒ Object
Meta-only.
-
#currency ⇒ Object
ISO 4217 currency code matching the ad account's currency (e.g.
USD). -
#custom_locations ⇒ Object
Point-radius (lat/lng) geo targeting.
-
#default_locale ⇒ Object
Meta only.
-
#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
Restrict the audience by gender.
-
#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, LinkedIn, and OpenAI Ads 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 (Meta and TikTok).
-
#multi_advertiser ⇒ Object
Meta only.
-
#name ⇒ Object
Returns the value of attribute name.
-
#negative_keywords ⇒ Object
Google Search only; other platforms return 400.
-
#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
Region-level (state/province) geo targeting (Meta and TikTok).
-
#rf_prediction_id ⇒ Object
Meta only.
-
#roas_average_floor ⇒ Object
Deprecated: send it inside
platformSpecificDatainstead (Meta today; TikTok's nested shape is planned). -
#saved_targeting_id ⇒ Object
ID of a
saved_targetingaudience (created via POST /v1/ads/audiences). -
#sitelinks ⇒ Object
Google Search only.
-
#smart_plus ⇒ Object
TikTok only.
-
#special_ad_categories ⇒ Object
Meta only.
-
#special_ad_category_country ⇒ Object
Meta (metaads) only.
-
#start_date ⇒ Object
Meta only.
-
#status ⇒ Object
Meta and TikTok.
-
#structured_snippets ⇒ Object
Google Search 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.
-
#translations ⇒ Object
Meta only.
-
#validate_only ⇒ Object
Meta only, single standalone shape only (no creatives, adSetId, or RESERVED).
-
#value_rule_set_id ⇒ Object
Meta only (facebook, instagram; other platforms return 400).
-
#value_rules_applied ⇒ Object
Meta only (facebook, instagram; other platforms return 400).
-
#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
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 752 753 754 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 836 837 838 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 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 496 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?(:'buying_type') self. = attributes[:'buying_type'] end if attributes.key?(:'rf_prediction_id') self.rf_prediction_id = attributes[:'rf_prediction_id'] end if attributes.key?(:'creative_features') if (value = attributes[:'creative_features']).is_a?(Hash) self.creative_features = value end end if attributes.key?(:'multi_advertiser') self.multi_advertiser = attributes[:'multi_advertiser'] end if attributes.key?(:'validate_only') self.validate_only = attributes[:'validate_only'] 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?(:'campaign_status') self.campaign_status = attributes[:'campaign_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?(:'special_ad_category_country') if (value = attributes[:'special_ad_category_country']).is_a?(Array) self.special_ad_category_country = 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?(:'carousel_cards') if (value = attributes[:'carousel_cards']).is_a?(Array) self.carousel_cards = value end end if attributes.key?(:'default_locale') self.default_locale = attributes[:'default_locale'] end if attributes.key?(:'translations') if (value = attributes[:'translations']).is_a?(Array) self.translations = value end 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?(:'negative_keywords') if (value = attributes[:'negative_keywords']).is_a?(Array) self.negative_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?(:'sitelinks') if (value = attributes[:'sitelinks']).is_a?(Array) self.sitelinks = value end end if attributes.key?(:'callouts') if (value = attributes[:'callouts']).is_a?(Array) self.callouts = value end end if attributes.key?(:'structured_snippets') if (value = attributes[:'structured_snippets']).is_a?(Array) self.structured_snippets = 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?(:'value_rule_set_id') self.value_rule_set_id = attributes[:'value_rule_set_id'] end if attributes.key?(:'value_rules_applied') self.value_rules_applied = attributes[:'value_rules_applied'] 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?(:'smart_plus') self.smart_plus = attributes[:'smart_plus'] 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
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) OR translations/defaultLocale (its own per-locale asset feed, Meta only), 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).
109 110 111 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 109 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.
215 216 217 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 215 def additional_descriptions @additional_descriptions end |
#additional_headlines ⇒ Object
Google Search RSA only. Extra headlines.
212 213 214 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 212 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.
227 228 229 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 227 def advantage_audience @advantage_audience end |
#age_max ⇒ Object
Returns the value of attribute age_max.
140 141 142 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 140 def age_max @age_max end |
#age_min ⇒ Object
Returns the value of attribute age_min.
138 139 140 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 138 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 }]
230 231 232 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 230 def attribution_spec @attribution_spec end |
#audience_id ⇒ Object
Custom audience ID for targeting
200 201 202 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 200 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.
155 156 157 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 155 def behaviors @behaviors end |
#bid_amount ⇒ Object
Deprecated: send it inside platformSpecificData instead (Meta today; TikTok's nested shape is planned). The flat field keeps working during the deprecation window; sending both shapes returns a 400. 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. Meta only: sending bidAmount WITHOUT bidStrategy requires existingCampaignId (400 otherwise), and sets the new ad set's cap under the joined campaign's COST_CAP / LOWEST_COST_WITH_BID_CAP parent. The strategy itself is inherited from the campaign. Restating bidStrategy here is accepted but has no effect on the ad set. Rejected with 400 in adSetId attach mode: that shape inherits its cap from the platform. Use PUT /v1/ads/ad-sets/{adSetId} there instead.
239 240 241 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 239 def bid_amount @bid_amount end |
#bid_strategy ⇒ Object
Deprecated: send it inside platformSpecificData instead (Meta today; TikTok's nested shape is planned). The flat field keeps working during the deprecation window; sending both shapes returns a 400. Meta bid strategy applied to the ad set. OpenAI Ads: required on every ad group via this flat field, the only channel it supports (platformSpecificData is Meta/LinkedIn-only and returns 400 for OpenAI). No auto-bid option exists; send LOWEST_COST_WITH_BID_CAP or COST_CAP together with bidAmount, omitting it returns 400.
236 237 238 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 236 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).
121 122 123 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 121 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). On OpenAI Ads this is the chat card's body text. Max: Google=90, Pinterest=500, OpenAI=100.
84 85 86 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 84 def body @body end |
#brand_identity ⇒ Object
Returns the value of attribute brand_identity.
258 259 260 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 258 def brand_identity @brand_identity end |
#budget_amount ⇒ Object
Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents — Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
60 61 62 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 60 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.
72 73 74 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 72 def budget_level @budget_level end |
#budget_type ⇒ Object
Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads accepts lifetime only (no daily-budget concept on the platform); sending daily returns 422. OpenAI Ads lifetime budgets require endDate to give the lifetime cap a spend window.
63 64 65 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 63 def budget_type @budget_type end |
#business_name ⇒ Object
Google Display only
118 119 120 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 118 def business_name @business_name end |
#buying_type ⇒ Object
Meta only. RESERVED = Reach & Frequency: requires rfPredictionId (a RESERVED prediction from /v1/ads/rf-predictions + /reserve). Budget, schedule and pricing come from the reservation, so budgetAmount/budgetType are not required and bid fields are ignored. Only the plain single-ad shape (no creatives, adSetId, existingCampaignId or dynamicCreative).
45 46 47 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 45 def @buying_type 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.
90 91 92 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 90 def call_to_action @call_to_action end |
#callouts ⇒ Object
Google Search only. Short callout texts (max 25 chars each) that appear as non-clickable annotations under the ad, e.g. "Free shipping", "24/7 support". Each becomes one Asset (callout_asset) plus a CampaignAsset link with field_type CALLOUT. Response's creative.callouts echoes each input plus its Google resourceName.
221 222 223 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 221 def callouts @callouts 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_status ⇒ Object
Meta only. Overrides status for the campaign level alone, so you can create a live campaign whose ad set and ad stay paused, or the reverse. Omitted, it follows status.
69 70 71 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 69 def campaign_status @campaign_status end |
#campaign_type ⇒ Object
Google only
203 204 205 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 203 def campaign_type @campaign_type end |
#carousel_cards ⇒ Object
Meta only. Hand-built carousel: 2-10 authored cards in DETERMINISTIC order, mapped to the creative's link_data.child_attachments. Unlike dynamicCreative, you control the card order and per-card copy/link. Requires top-level body, linkUrl and callToAction. Those become the ad's own Destination and button (link_data.link / link_data.call_to_action), and double as the per-card fallback when a card omits its own. Mutually exclusive with imageUrl/video, creatives[], dynamicCreative, placementAssets, existingCreativeId, adSetId, leadGenFormId and goal catalog_sales.
189 190 191 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 189 def carousel_cards @carousel_cards end |
#cities ⇒ Object
City-level geo targeting (Meta and TikTok). Each city is targeted by the platform's opaque key (the city ID) which can be looked up via GET /v1/ads/targeting/search?dimension=geo&q=<name>&countryCode=<ISO>. Optional radius + distance_unit (Meta only) 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). On Meta, 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. On TikTok, keys are numeric location ids and can be sent without countries.
133 134 135 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 133 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 and OpenAI Ads currently honour country-level targeting only; any other targeting field returns 400 for OpenAI Ads.)
130 131 132 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 130 def countries @countries end |
#creative_features ⇒ Object
Meta only. Advantage+ creative enhancements: a partial map of Meta creative feature keys (snake_case, e.g. enhance_cta, image_brightness_and_contrast, text_optimizations) to enroll status, forwarded as degrees_of_freedom_spec.creative_features_spec. Meta validates the keys; unspecified features default to OPT_OUT. The legacy standard_enhancements bundle is deprecated by Meta and rejected.
51 52 53 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 51 def creative_features @creative_features 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.
106 107 108 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 106 def creatives @creatives end |
#currency ⇒ Object
ISO 4217 currency code matching the ad account's currency (e.g. USD). Meta only. Optional: Zernio resolves it from the ad account when omitted. The value selects the minor-unit exponent Zernio converts budget/bid amounts by before calling Meta (most currencies are cents; zero-decimal currencies like JPY/KRW are sent as-is).
75 76 77 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 75 def currency @currency end |
#custom_locations ⇒ Object
Point-radius (lat/lng) geo targeting. Meta only (custom_locations). Rejected on platforms without radius support.
152 153 154 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 152 def custom_locations @custom_locations end |
#default_locale ⇒ Object
Meta only. Language the top-level copy is written in (e.g. en, pt_BR), used by the translations default rule. Defaults to en. Meta rejects a language asset feed whose default rule carries no locales of its own. Must NOT also appear as an entry in translations.
192 193 194 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 192 def default_locale @default_locale 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.
87 88 89 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 87 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.
253 254 255 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 253 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.
256 257 258 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 256 def dsa_payor @dsa_payor end |
#dynamic_creative ⇒ Object
Returns the value of attribute dynamic_creative.
186 187 188 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 186 def dynamic_creative @dynamic_creative end |
#end_date ⇒ Object
Required for lifetime budgets
178 179 180 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 178 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[].
112 113 114 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 112 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.
115 116 117 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 115 def existing_creative_id @existing_creative_id end |
#gender ⇒ Object
Restrict the audience by gender. 'male' targets men only, 'female' targets women only, 'all' (default) targets everyone. Applied on Meta, TikTok and Pinterest. Ignored on Google, LinkedIn and X.
233 234 235 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 233 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, or promotedObject.customConversionId to optimise against a Custom Conversion, or customEventType: OTHER + customEventStr to optimise against a pixel custom event. - 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 (or promotedObject.customConversionId to optimise against a Custom Conversion instead). 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. - page_likes: Page Likes conversion location under OUTCOME_ENGAGEMENT (destination_type ON_PAGE, optimization PAGE_LIKES). promotedObject.pageId is optional and auto-filled from the connected Page. The creative CTA is fixed to LIKE_PAGE targeting that Page; headline / body / linkUrl / callToAction / imageUrl / video are all optional (Meta derives the link and the Like button from the Page). 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. OpenAI Ads - Only traffic, awareness, and conversions are supported (other goals return 400). Maps to OpenAI's bidding_type (clicks, impressions, conversions respectively). conversions requires an active conversion event setting on the account; create a tracking tag with defaultEventType via the tracking-tags API (POST /v1/accounts/{accountId}/tracking-tags), or configure a conversion event in OpenAI Ads Manager, or the request returns 422.
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, LinkedIn, and OpenAI Ads 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, OpenAI=50 (min 3). On LinkedIn this is the ad's headline (the bold text on the creative); for traffic ads it's the link card title. On OpenAI Ads this is the chat card's title.
78 79 80 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 78 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.
261 262 263 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 261 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). Required for OpenAI Ads (uploaded as the chat card's image; OpenAI has no video ad format).
99 100 101 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 99 def image_url @image_url end |
#images ⇒ Object
Returns the value of attribute images.
101 102 103 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 101 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.
158 159 160 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 158 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 use the Instagram actor Meta already runs the Page's other ads as, falling back to the Page's page-backed Instagram account. Useful when a Page has more than one eligible IG account.
184 185 186 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 184 def instagram_account_id @instagram_account_id end |
#interests ⇒ Object
Interest objects from /v1/ads/interests. Each must include id and name.
143 144 145 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 143 def interests @interests end |
#keywords ⇒ Object
Google Search only. BROAD-match keywords on the new ad group (first 20).
206 207 208 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 206 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.
161 162 163 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 161 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 (or videoUrls) entry plus your text variations to get Meta's "Multiple Text Options" behavior on a lead ad.
96 97 98 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 96 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. Required for OpenAI Ads (the chat card's target_url).
93 94 95 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 93 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.
81 82 83 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 81 def long_headline @long_headline end |
#metros ⇒ Object
DMA / metro-area geo targeting (Meta and TikTok). key is the platform's metro ID from /v1/ads/targeting/search?dimension=geo&geoType=metro (TikTok metros appear as type metro, e.g. the New York DMA).
149 150 151 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 149 def metros @metros end |
#multi_advertiser ⇒ Object
Meta only. Multi-advertiser ads: whether Meta may show this ad alongside other advertisers' in one unit. Meta auto-enrols since Aug 2024, so send OPT_OUT to leave. It is a top-level creative field, NOT a creativeFeatures key — Meta rejects it there.
54 55 56 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 54 def multi_advertiser @multi_advertiser 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 |
#negative_keywords ⇒ Object
Google Search only; other platforms return 400. BROAD-match negative keywords on the new ad group. Editable later via PUT /v1/ads/adId targeting.negativeKeywords.
209 210 211 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 209 def negative_keywords @negative_keywords 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.
124 125 126 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 124 def organization_id @organization_id end |
#placement_assets ⇒ Object
Returns the value of attribute placement_assets.
197 198 199 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 197 def placement_assets @placement_assets end |
#placements ⇒ Object
Returns the value of attribute placements.
163 164 165 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 163 def placements @placements end |
#platform_specific_data ⇒ Object
Returns the value of attribute platform_specific_data.
250 251 252 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 250 def platform_specific_data @platform_specific_data end |
#promoted_object ⇒ Object
Returns the value of attribute promoted_object.
266 267 268 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 266 def promoted_object @promoted_object end |
#raw_targeting ⇒ Object
Meta only. A raw Meta-native targeting spec (snake_case: geo_locations, age_min, excluded_custom_audiences, flexible_spec, targeting_automation, user_os, wireless_carrier, business places, etc.) — exactly the shape GET /v1/ads/{adId} returns for external ads. Sent alone it reaches the ad set VERBATIM (the clone-a-campaign's-targeting-exactly path). Meta validates and surfaces any errors. Can be combined with the camelCase targeting fields (countries/regions/cities/interests/ageMin/..., targeting, savedTargetingId, audienceId): rawTargeting is the BASE layer and the built camelCase spec is merged on top, key by key, with the camelCase side winning on collision (the camelCase precedence chain stays savedTargetingId < targeting < flat fields). The merge goes one level deep inside geo_locations and excluded_geo_locations: built sub-keys win, raw-only sub-keys such as location_types survive alongside built countries. Array values (flexible_spec, ...) are replaced as a WHOLE key when the camelCase spec builds them, never element-merged. When rawTargeting is present the defaults the camelCase builder normally injects (US geo, targeting_automation.advantage_audience: 0) are suppressed, so raw's values are not clobbered — include targeting_automation in the raw spec (or send advantageAudience) as Meta requires it on create. If cloning an EU campaign, also pass dsaBeneficiary / dsaPayor (those are separate fields, not part of targeting).
169 170 171 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 169 def raw_targeting @raw_targeting end |
#regions ⇒ Object
Region-level (state/province) geo targeting (Meta and TikTok). Each region is targeted by the platform's opaque key (the region ID) which can be looked up via GET /v1/ads/targeting/search?dimension=geo&q=<name>&countryCode=<ISO>.
136 137 138 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 136 def regions @regions end |
#rf_prediction_id ⇒ Object
Meta only. The RESERVED prediction id the R&F ad set runs on (reserving mints a new id — pass that one). Requires buyingType RESERVED.
48 49 50 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 48 def rf_prediction_id @rf_prediction_id end |
#roas_average_floor ⇒ Object
Deprecated: send it inside platformSpecificData instead (Meta today; TikTok's nested shape is planned). The flat field keeps working during the deprecation window; sending both shapes returns a 400. Minimum ROAS as a decimal multiplier (e.g. 2.0 = 2.0x ROAS). Required when bidStrategy is LOWEST_COST_WITH_MIN_ROAS. Sending it without bidStrategy is a 400. Sent to Meta as bid_constraints.roas_average_floor × 10000. Known gap: a CBO campaign's ROAS floor lives on the campaign only (set via POST /v1/ads/campaigns); there is no supported way to set it while joining a CBO campaign here.
242 243 244 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 242 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.
166 167 168 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 166 def saved_targeting_id @saved_targeting_id end |
#sitelinks ⇒ Object
Google Search only. Sitelink assets to create and attach at the campaign level. Each entry becomes an Asset (with sitelink_asset + Asset.final_urls) plus a CampaignAsset link (field_type SITELINK). Approval is async — Google reviews assets after creation; poll asset.policy_summary later to read the verdict. Google requires at least two sitelinks to surface them on an ad; four or more is Google's own recommendation for maximum visibility. The response's creative.sitelinks echoes each input plus its Google resourceName.
218 219 220 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 218 def sitelinks @sitelinks end |
#smart_plus ⇒ Object
TikTok only. Creates the ad as a TikTok Upgraded Smart+ campaign: TikTok automates targeting, bidding and delivery. Supports goals conversions (Smart+ Web Conversions), lead_generation (Smart+ Lead Generation with a website form on linkUrl; TikTok Instant Forms not supported) and app_promotion (Smart+ App installs; the ad's destination is the app store, so linkUrl is not used). The web goals require promotedObject.pixelId AND promotedObject.customEventType; app_promotion requires promotedObject.applicationId instead. Targeting works like on any TikTok ad (defaults to countries: [\"US\"] when omitted); TikTok automates delivery within it. The budget lives on the Smart+ campaign (Campaign Budget Optimization); a lifetime budget additionally requires endDate. Cannot be combined with adSetId.
264 265 266 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 264 def smart_plus @smart_plus 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.
172 173 174 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 172 def special_ad_categories @special_ad_categories end |
#special_ad_category_country ⇒ Object
Meta (metaads) only. 2-letter ISO country codes the special ad category applies to. Requires specialAdCategories to be set (400 otherwise). Ignored when joining an existing campaign via existingCampaignId (the existing campaign's category/country already governs it).
175 176 177 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 175 def special_ad_category_country @special_ad_category_country 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.)
181 182 183 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 181 def start_date @start_date end |
#status ⇒ Object
Meta and TikTok. Publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/campaignId/status with active brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: existingCampaignId (that campaign may be running and is never touched) or campaignStatus: ACTIVE. On TikTok the whole campaign > ad group > ad hierarchy stays paused.
66 67 68 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 66 def status @status end |
#structured_snippets ⇒ Object
Google Search only. Structured snippets — one header from Google's predefined list plus 3-10 values (max 25 chars each). Each becomes one Asset (structured_snippet_asset) plus a CampaignAsset link with field_type STRUCTURED_SNIPPET.
224 225 226 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 224 def structured_snippets @structured_snippets 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.
127 128 129 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 127 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 |
#translations ⇒ Object
Meta only. Multi-language ads (Dynamic Language Optimization): ONE ad carrying per-locale copy and, optionally, per-locale media — the "Languages" toggle in Ads Manager. Keeps social proof (likes/comments/shares) on a SINGLE post instead of splitting it across one ad per language. The ad's top-level copy is the DEFAULT shown to every locale you do NOT list, and it counts as one of the language variants. IMPORTANT, and the opposite of what you might expect: text does NOT inherit. Every entry must carry its own headline, body AND description, and all of them must be DISTINCT from each other and from the ad's top-level copy. Meta deduplicates identical strings inside the asset feed, so two locales sharing a string collapse into one asset and the create fails with a misleading "Too few ... texts provided in asset creation" (subcode 1885817) that names a field which is actually present. We validate this before calling Meta and return a 400 naming the offending locale and field. description is therefore effectively required on the ad whenever translations is present, even though it is optional otherwise. Do NOT list defaultLocale inside translations: Meta rejects the duplicate with "The language asset feed includes an unsupported targeting field" (subcode 1885985). Media DOES inherit and is uploaded once when shared, and linkUrl inherits too: each locale may name its own landing page and unlisted locales fall back to the ad's top-level linkUrl. Note that Meta enforces Dynamic Creative image dimensions on language feeds, so an imageUrl that works on a normal ad may be rejected with "The following images have invalid dimensions for Dynamic Creative" (subcode 1885558). Video is not affected. Mutually exclusive with dynamicCreative, placementAssets, carouselCards, existingCreativeId and creatives[]. Meta allows one asset_feed_spec shape per creative.
195 196 197 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 195 def translations @translations end |
#validate_only ⇒ Object
Meta only, single standalone shape only (no creatives, adSetId, or RESERVED). Dry-run: each node runs Meta's execution_options validate_only and NOTHING is created or persisted. Children need real parents, so a fresh tree validates the campaign + creative (the ad set needs its campaign to exist — pass existingCampaignId to validate it too; the ad itself is never validatable pre-create). A Meta validation failure returns the 400 verbatim; success returns 200 with per-node results instead of an ad.
57 58 59 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 57 def validate_only @validate_only end |
#value_rule_set_id ⇒ Object
Meta only (facebook, instagram; other platforms return 400). Value rule set to attach to the new ad set, from /v1/ads/value-rule-sets. Attachment is driven by this id, so valueRulesApplied is optional alongside it. Rejected with 400 in adSetId attach mode: that shape inherits the existing ad set's attachment, so the field would be silently ignored. Use PUT /v1/ads/ad-sets/{adSetId} there instead. Ignored (stripped before the ad-set create) when buyingType is RESERVED: value rules only apply to auction ad sets on LOWEST_COST_WITHOUT_CAP or COST_CAP, and a Reach & Frequency reservation has no auction bid strategy. Read back with GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id; the attachment is not mirrored onto Zernio's ad documents.
245 246 247 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 245 def value_rule_set_id @value_rule_set_id end |
#value_rules_applied ⇒ Object
Meta only (facebook, instagram; other platforms return 400). Optional when attaching, and requires valueRuleSetId. false is REJECTED here with 400: a newly created ad set has nothing to detach, so detaching lives on PUT /v1/ads/ad-sets/{adSetId}.
248 249 250 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 248 def value_rules_applied @value_rules_applied end |
#video ⇒ Object
Returns the value of attribute video.
103 104 105 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 103 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.
146 147 148 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 146 def zips @zips end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
385 386 387 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 385 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
390 391 392 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 390 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 374 375 376 377 378 379 380 381 382 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 291 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', :'buying_type' => :'buyingType', :'rf_prediction_id' => :'rfPredictionId', :'creative_features' => :'creativeFeatures', :'multi_advertiser' => :'multiAdvertiser', :'validate_only' => :'validateOnly', :'budget_amount' => :'budgetAmount', :'budget_type' => :'budgetType', :'status' => :'status', :'campaign_status' => :'campaignStatus', :'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', :'special_ad_category_country' => :'specialAdCategoryCountry', :'end_date' => :'endDate', :'start_date' => :'startDate', :'instagram_account_id' => :'instagramAccountId', :'dynamic_creative' => :'dynamicCreative', :'carousel_cards' => :'carouselCards', :'default_locale' => :'defaultLocale', :'translations' => :'translations', :'placement_assets' => :'placementAssets', :'audience_id' => :'audienceId', :'campaign_type' => :'campaignType', :'keywords' => :'keywords', :'negative_keywords' => :'negativeKeywords', :'additional_headlines' => :'additionalHeadlines', :'additional_descriptions' => :'additionalDescriptions', :'sitelinks' => :'sitelinks', :'callouts' => :'callouts', :'structured_snippets' => :'structuredSnippets', :'advantage_audience' => :'advantageAudience', :'attribution_spec' => :'attributionSpec', :'gender' => :'gender', :'bid_strategy' => :'bidStrategy', :'bid_amount' => :'bidAmount', :'roas_average_floor' => :'roasAverageFloor', :'value_rule_set_id' => :'valueRuleSetId', :'value_rules_applied' => :'valueRulesApplied', :'platform_specific_data' => :'platformSpecificData', :'dsa_beneficiary' => :'dsaBeneficiary', :'dsa_payor' => :'dsaPayor', :'brand_identity' => :'brandIdentity', :'identity_type' => :'identityType', :'smart_plus' => :'smartPlus', :'promoted_object' => :'promotedObject' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1702 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
489 490 491 492 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 489 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 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 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 395 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', :'buying_type' => :'String', :'rf_prediction_id' => :'String', :'creative_features' => :'Hash<String, String>', :'multi_advertiser' => :'String', :'validate_only' => :'Boolean', :'budget_amount' => :'Float', :'budget_type' => :'String', :'status' => :'String', :'campaign_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>', :'special_ad_category_country' => :'Array<String>', :'end_date' => :'Time', :'start_date' => :'Time', :'instagram_account_id' => :'String', :'dynamic_creative' => :'CreateStandaloneAdRequestDynamicCreative', :'carousel_cards' => :'Array<CreateStandaloneAdRequestCarouselCardsInner>', :'default_locale' => :'String', :'translations' => :'Array<CreateStandaloneAdRequestTranslationsInner>', :'placement_assets' => :'CreateStandaloneAdRequestPlacementAssets', :'audience_id' => :'String', :'campaign_type' => :'String', :'keywords' => :'Array<String>', :'negative_keywords' => :'Array<String>', :'additional_headlines' => :'Array<String>', :'additional_descriptions' => :'Array<String>', :'sitelinks' => :'Array<CreateStandaloneAdRequestSitelinksInner>', :'callouts' => :'Array<String>', :'structured_snippets' => :'Array<CreateStandaloneAdRequestStructuredSnippetsInner>', :'advantage_audience' => :'Integer', :'attribution_spec' => :'Array<CreateStandaloneAdRequestAttributionSpecInner>', :'gender' => :'String', :'bid_strategy' => :'BidStrategy', :'bid_amount' => :'Float', :'roas_average_floor' => :'Float', :'value_rule_set_id' => :'String', :'value_rules_applied' => :'Boolean', :'platform_specific_data' => :'CreateStandaloneAdRequestPlatformSpecificData', :'dsa_beneficiary' => :'String', :'dsa_payor' => :'String', :'brand_identity' => :'CreateStandaloneAdRequestBrandIdentity', :'identity_type' => :'String', :'smart_plus' => :'Boolean', :'promoted_object' => :'CreateStandaloneAdRequestPromotedObject' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1594 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 && == o. && rf_prediction_id == o.rf_prediction_id && creative_features == o.creative_features && multi_advertiser == o.multi_advertiser && validate_only == o.validate_only && budget_amount == o.budget_amount && budget_type == o.budget_type && status == o.status && campaign_status == o.campaign_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 && special_ad_category_country == o.special_ad_category_country && end_date == o.end_date && start_date == o.start_date && instagram_account_id == o.instagram_account_id && dynamic_creative == o.dynamic_creative && carousel_cards == o.carousel_cards && default_locale == o.default_locale && translations == o.translations && placement_assets == o.placement_assets && audience_id == o.audience_id && campaign_type == o.campaign_type && keywords == o.keywords && negative_keywords == o.negative_keywords && additional_headlines == o.additional_headlines && additional_descriptions == o.additional_descriptions && sitelinks == o.sitelinks && callouts == o.callouts && structured_snippets == o.structured_snippets && 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 && value_rule_set_id == o.value_rule_set_id && value_rules_applied == o.value_rules_applied && 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 && smart_plus == o.smart_plus && promoted_object == o.promoted_object end |
#eql?(o) ⇒ Boolean
1689 1690 1691 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1689 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
1695 1696 1697 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1695 def hash [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, , rf_prediction_id, creative_features, multi_advertiser, validate_only, budget_amount, budget_type, status, campaign_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, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, negative_keywords, additional_headlines, additional_descriptions, sitelinks, callouts, structured_snippets, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, smart_plus, promoted_object].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 925 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 !@currency.nil? && @currency.to_s.length > 3 invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.') end if !@currency.nil? && @currency.to_s.length < 3 invalid_properties.push('invalid value for "currency", the character length must be greater than or equal to 3.') 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 !@carousel_cards.nil? && @carousel_cards.length > 10 invalid_properties.push('invalid value for "carousel_cards", number of items must be less than or equal to 10.') end if !@carousel_cards.nil? && @carousel_cards.length < 2 invalid_properties.push('invalid value for "carousel_cards", number of items must be greater than or equal to 2.') end if !@translations.nil? && @translations.length > 10 invalid_properties.push('invalid value for "translations", number of items must be less than or equal to 10.') end if !@translations.nil? && @translations.length < 1 invalid_properties.push('invalid value for "translations", number of items must be greater than or equal to 1.') end if !@sitelinks.nil? && @sitelinks.length > 20 invalid_properties.push('invalid value for "sitelinks", number of items must be less than or equal to 20.') end if !@sitelinks.nil? && @sitelinks.length < 2 invalid_properties.push('invalid value for "sitelinks", number of items must be greater than or equal to 2.') end if !@callouts.nil? && @callouts.length > 20 invalid_properties.push('invalid value for "callouts", number of items must be less than or equal to 20.') end if !@callouts.nil? && @callouts.length < 1 invalid_properties.push('invalid value for "callouts", number of items must be greater than or equal to 1.') end if !@structured_snippets.nil? && @structured_snippets.length > 20 invalid_properties.push('invalid value for "structured_snippets", number of items must be less than or equal to 20.') end if !@structured_snippets.nil? && @structured_snippets.length < 1 invalid_properties.push('invalid value for "structured_snippets", number of items must be greater than or equal to 1.') 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 pattern = Regexp.new(/^\d+$/) if !@value_rule_set_id.nil? && @value_rule_set_id !~ pattern invalid_properties.push("invalid value for \"value_rule_set_id\", must conform to the pattern #{pattern}.") 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
1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1724 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
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1062 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", "page_likes", "job_applicants"]) return false unless goal_validator.valid?(@goal) = EnumAttributeValidator.new('String', ["AUCTION", "RESERVED"]) return false unless .valid?(@buying_type) multi_advertiser_validator = EnumAttributeValidator.new('String', ["OPT_IN", "OPT_OUT"]) return false unless multi_advertiser_validator.valid?(@multi_advertiser) 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) campaign_status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"]) return false unless campaign_status_validator.valid?(@campaign_status) budget_level_validator = EnumAttributeValidator.new('String', ["adset", "campaign"]) return false unless budget_level_validator.valid?(@budget_level) return false if !@currency.nil? && @currency.to_s.length > 3 return false if !@currency.nil? && @currency.to_s.length < 3 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", "ADD_TO_CART", "APPLY_NOW", "BOOK_NOW", "BUY_TICKETS", "DONATE", "DONATE_NOW", "GET_DIRECTIONS", "GET_SHOWTIMES", "LISTEN_NOW", "ORDER_NOW", "PLAY_GAME", "REQUEST_TIME", "SEE_MENU", "START_ORDER", "INSTALL_MOBILE_APP", "USE_APP", "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) return false if !@carousel_cards.nil? && @carousel_cards.length > 10 return false if !@carousel_cards.nil? && @carousel_cards.length < 2 return false if !@translations.nil? && @translations.length > 10 return false if !@translations.nil? && @translations.length < 1 campaign_type_validator = EnumAttributeValidator.new('String', ["display", "search"]) return false unless campaign_type_validator.valid?(@campaign_type) return false if !@sitelinks.nil? && @sitelinks.length > 20 return false if !@sitelinks.nil? && @sitelinks.length < 2 return false if !@callouts.nil? && @callouts.length > 20 return false if !@callouts.nil? && @callouts.length < 1 return false if !@structured_snippets.nil? && @structured_snippets.length > 20 return false if !@structured_snippets.nil? && @structured_snippets.length < 1 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 !@value_rule_set_id.nil? && @value_rule_set_id !~ Regexp.new(/^\d+$/) 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 |