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.
-
#ai_disclosure ⇒ Object
Meta only.
-
#asset_group ⇒ Object
Returns the value of attribute asset_group.
-
#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.
-
#bodies ⇒ Object
Meta 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.
-
#budget_level ⇒ Object
Meta only.
-
#budget_type ⇒ Object
Required on legacy, multi-creative and Performance Max 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_attribution ⇒ Object
Meta ad-set attribution.
-
#campaign_name ⇒ Object
Meta only.
-
#campaign_negative_keywords ⇒ Object
Google Search only; other platforms return 400.
-
#campaign_status ⇒ Object
Meta and Google.
-
#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']).
-
#country_groups ⇒ Object
Meta only.
-
#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).
-
#descriptions ⇒ Object
Meta only.
-
#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, Google Ads, LinkedIn and TikTok.
-
#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). -
#headlines ⇒ Object
Meta only.
-
#identity_id ⇒ Object
TikTok: the identity the ad runs as, from GET /v1/ads/tiktok-identities.
-
#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.
-
#is_skadnetwork_attribution ⇒ Object
Meta app promotion only.
-
#keywords ⇒ Object
Google Search only.
-
#languages ⇒ Object
e.g.
-
#lead_gen_form_id ⇒ Object
Lead Gen form ID to attach to the ad's creative.
-
#link_url ⇒ Object
Required on legacy + attach shapes (skip for multi-creative).
-
#long_headline ⇒ Object
Google Display only.
-
#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, or TikTok with goal video_views (ENGAGED_VIEW, the 6-second default, or ENGAGED_VIEW_FIFTEEN; both bill per view).
-
#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.
-
#portfolio_bid_strategy_id ⇒ Object
Google Search and Display only.
-
#promoted_object ⇒ Object
Returns the value of attribute promoted_object.
-
#promotion ⇒ Object
Not supported.
-
#raw_targeting ⇒ Object
Meta only.
-
#regional_regulated_categories ⇒ Object
Meta only.
-
#regional_regulation_identities ⇒ 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
Google Performance Max accepts PAUSED only and always creates a paused campaign.
-
#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.
-
#user_device ⇒ Object
Meta only.
-
#user_os ⇒ Object
Meta only.
-
#validate_only ⇒ Object
Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence.
-
#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.
-
#work_employers ⇒ Object
Meta only.
-
#work_industries ⇒ Object
Meta only.
-
#work_positions ⇒ Object
Meta only.
-
#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
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 922 923 924 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 1059 1060 1061 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 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 591 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'] else self. = 'AUCTION' end if attributes.key?(:'rf_prediction_id') self.rf_prediction_id = attributes[:'rf_prediction_id'] end if attributes.key?(:'promotion') self.promotion = attributes[:'promotion'] 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?(:'ai_disclosure') self.ai_disclosure = attributes[:'ai_disclosure'] 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?(:'bodies') if (value = attributes[:'bodies']).is_a?(Array) self.bodies = value end end if attributes.key?(:'headlines') if (value = attributes[:'headlines']).is_a?(Array) self.headlines = value end end if attributes.key?(:'descriptions') if (value = attributes[:'descriptions']).is_a?(Array) self.descriptions = value end 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?(:'country_groups') if (value = attributes[:'country_groups']).is_a?(Array) self.country_groups = 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?(:'work_positions') if (value = attributes[:'work_positions']).is_a?(Array) self.work_positions = value end end if attributes.key?(:'work_employers') if (value = attributes[:'work_employers']).is_a?(Array) self.work_employers = value end end if attributes.key?(:'work_industries') if (value = attributes[:'work_industries']).is_a?(Array) self.work_industries = 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?(:'regional_regulated_categories') if (value = attributes[:'regional_regulated_categories']).is_a?(Array) self.regional_regulated_categories = value end end if attributes.key?(:'regional_regulation_identities') if (value = attributes[:'regional_regulation_identities']).is_a?(Hash) self.regional_regulation_identities = 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?(:'asset_group') self.asset_group = attributes[:'asset_group'] 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?(:'campaign_negative_keywords') if (value = attributes[:'campaign_negative_keywords']).is_a?(Array) self.campaign_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?(:'portfolio_bid_strategy_id') self.portfolio_bid_strategy_id = attributes[:'portfolio_bid_strategy_id'] 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_id') self.identity_id = attributes[:'identity_id'] 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?(:'user_os') if (value = attributes[:'user_os']).is_a?(Array) self.user_os = value end end if attributes.key?(:'user_device') if (value = attributes[:'user_device']).is_a?(Array) self.user_device = value end end if attributes.key?(:'is_skadnetwork_attribution') self.is_skadnetwork_attribution = attributes[:'is_skadnetwork_attribution'] end if attributes.key?(:'campaign_attribution') self.campaign_attribution = attributes[:'campaign_attribution'] 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, and 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[]. dynamicCreative returns 400 in attach mode: create a new dynamic ad set by omitting adSetId instead. 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), Google Ads, 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). On Google Ads the adSetId is the AD GROUP id. goal is still REQUIRED even though budget and targeting are inherited from the ad group. Send campaignType: \"search\" to attach into a Search ad group, including one created by POST /v1/ads/ad-sets (always SEARCH_STANDARD): without it the request is treated as Display and requires images.landscape + images.square + businessName, and the resulting display creative does not match a Search ad group. budgetAmount/budgetType and bidding fields (bidStrategy, bidAmount, portfolioBidStrategyId) return 400 on this shape; the ad group already owns them.
124 125 126 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 124 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 text assets as strings or objects with text and optional pinnedField. Existing string input remains supported. The effective create lists, including primary text and deduplication, must contain 3-15 headlines and 2-4 descriptions; excess entries return 400.
253 254 255 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 253 def additional_descriptions @additional_descriptions end |
#additional_headlines ⇒ Object
Google Search RSA only. Extra text assets as strings or objects with text and optional pinnedField. Existing string input remains supported. The effective create lists, including primary text and deduplication, must contain 3-15 headlines and 2-4 descriptions; excess entries return 400.
250 251 252 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 250 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.
265 266 267 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 265 def advantage_audience @advantage_audience end |
#age_max ⇒ Object
Returns the value of attribute age_max.
158 159 160 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 158 def age_max @age_max end |
#age_min ⇒ Object
Returns the value of attribute age_min.
156 157 158 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 156 def age_min @age_min end |
#ai_disclosure ⇒ Object
Meta only. Meta's "Ad includes media created or edited with AI" disclosure, the checkbox in Ads Manager, stored on the creative as generative_asset_spec.transparency_metadata.self_disclosure. OPT_IN checks it, OPT_OUT explicitly declares no AI media, omitted leaves Meta's default. Applied to each new creative, including standalone, creatives and attach shapes, and preserved when a creative is rebuilt. This sets the disclosure on the ad; whether and when the viewer-facing label renders is Meta's decision.
60 61 62 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 60 def ai_disclosure @ai_disclosure end |
#asset_group ⇒ Object
Returns the value of attribute asset_group.
238 239 240 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 238 def asset_group @asset_group end |
#attribution_spec ⇒ Object
Meta only. Conversion attribution window for the ad set, mapping 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 }]
268 269 270 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 268 def attribution_spec @attribution_spec end |
#audience_id ⇒ Object
Custom audience ID for targeting
233 234 235 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 233 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.
173 174 175 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 173 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.
277 278 279 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 277 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. Google (not deprecated there, this shared flat field is Google's only shape): applied to the campaign this call creates. On Google: LOWEST_COST_WITHOUT_CAP = Maximize Conversions, COST_CAP + bidAmount = Target CPA, LOWEST_COST_WITH_MIN_ROAS + roasAverageFloor = Target ROAS, LOWEST_COST_WITH_BID_CAP + bidAmount = Maximize Clicks with a CPC ceiling; portfolioBidStrategyId attaches a portfolio strategy instead. Omitted, the campaign falls back to a goal-based default.
274 275 276 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 274 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).
136 137 138 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 136 def board_id @board_id end |
#bodies ⇒ Object
Meta only. Multiple Text Options (Advantage+ Flexible Format): supply 1-5 primary-text variations and Meta optimises delivery across them, WITHOUT enabling full Dynamic Creative (dynamicCreative). Uses optimization_type: DEGREES_OF_FREEDOM on the asset feed, so multiple ads per ad set are allowed (unlike dynamicCreative which is limited to one). Requires imageUrl or video, linkUrl, and callToAction. When set, the top-level body field is used as the object_story_spec.link_data.message (the preview text) and headlines must also be present. On a video creative the copy lands in video_data.message / video_data.title instead of link_data. Mutually exclusive with dynamicCreative, placementAssets, carouselCards, and creatives[]. For placement-specific copy, use the singular placementAssets.rules[].body and headline fields instead.
96 97 98 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 96 def bodies @bodies end |
#body ⇒ Object
Required on legacy + attach shapes. For X 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.
90 91 92 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 90 def body @body end |
#brand_identity ⇒ Object
Returns the value of attribute brand_identity.
299 300 301 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 299 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 and Performance Max shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
66 67 68 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 66 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. The returned ad stores the applied budgetLevel and budget in campaignBudget for CBO or adSetBudget for ABO. Edit CBO budgets with PUT /v1/ads/campaigns/{campaignId} and ABO budgets with PUT /v1/ads/ad-sets/{adSetId}. 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.
78 79 80 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 78 def budget_level @budget_level end |
#budget_type ⇒ Object
Required on legacy, multi-creative and Performance Max 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.
69 70 71 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 69 def budget_type @budget_type end |
#business_name ⇒ Object
Google Display only
133 134 135 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 133 def business_name @business_name end |
#buying_type ⇒ Object
Meta only. Defaults to AUCTION and is explicitly sent on new campaigns, including validateOnly. Reusing existingCampaignId does not change the campaign. 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 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.
105 106 107 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 105 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.
259 260 261 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 259 def callouts @callouts end |
#campaign_attribution ⇒ Object
Meta ad-set attribution. Required as SKADNETWORK for iOS 14+ app promotion or a SKAdNetwork campaign. Requires AUCTION buying. Standalone Meta ad-set creation is not supported; use this field on /v1/ads/create.
320 321 322 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 320 def campaign_attribution @campaign_attribution 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_negative_keywords ⇒ Object
Google Search only; other platforms return 400. Campaign-level negative keywords (campaign_criterion.negative), created alongside the ad group. Editable later via PUT /v1/ads/campaigns/campaignId/negative-keywords.
247 248 249 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 247 def campaign_negative_keywords @campaign_negative_keywords end |
#campaign_status ⇒ Object
Meta and Google. 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.
75 76 77 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 75 def campaign_status @campaign_status end |
#campaign_type ⇒ Object
Google only. Performance Max requires assetGroup and is always created PAUSED.
236 237 238 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 236 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 and callToAction; linkUrl is also required UNLESS leadGenFormId is set. 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 and goal catalog_sales. Combines with leadGenFormId to build a carousel Instant-Form lead ad: linkUrl and per-card linkUrl become OPTIONAL and, when sent, are forwarded as the real card and top-level destinations; when omitted, the destination falls back to Meta's lead-form link.
222 223 224 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 222 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.
151 152 153 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 151 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.)
145 146 147 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 145 def countries @countries end |
#country_groups ⇒ Object
Meta only. Continents and trade blocs (geo_locations.country_groups), for targeting a whole region without listing its countries. Combines with countries rather than replacing it. Discoverable via GET /v1/ads/targeting/search?dimension=geo&geoType=country_group.
148 149 150 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 148 def country_groups @country_groups end |
#creative_features ⇒ Object
Meta only. Applied to each new creative, including standalone and attach shapes. With creatives, these are defaults; an item replaces the whole feature map, including an empty map. auto_promotion_tag is an Advantage+ enhancement, not the Ads Manager Promotion setting.
54 55 56 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 54 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.
121 122 123 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 121 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).
81 82 83 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 81 def currency @currency end |
#custom_locations ⇒ Object
Point-radius (lat/lng) geo targeting. Meta only (custom_locations). Rejected on platforms without radius support.
170 171 172 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 170 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.
225 226 227 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 225 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 descriptions (array) instead.
93 94 95 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 93 def description @description end |
#descriptions ⇒ Object
Meta only. Optional description variations for Multiple Text Options. Sent alongside bodies and headlines.
102 103 104 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 102 def descriptions @descriptions 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.
294 295 296 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 294 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.
297 298 299 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 297 def dsa_payor @dsa_payor end |
#dynamic_creative ⇒ Object
Returns the value of attribute dynamic_creative.
219 220 221 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 219 def dynamic_creative @dynamic_creative end |
#end_date ⇒ Object
Required for lifetime budgets
211 212 213 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 211 def end_date @end_date end |
#existing_campaign_id ⇒ Object
Meta, Google Ads, LinkedIn and TikTok. On TikTok: creates the ad group and the ad under this existing campaign; the campaign is neither created nor activated and its objective must fit goal; not with smartPlus. 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, since 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 Google Ads: create a new ad group under this EXISTING campaign; the new ad group inherits the campaign's budget, so omit budgetAmount/budgetType (and any bidding field), or the request returns 400. 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[].
127 128 129 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 127 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.
130 131 132 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 130 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.
271 272 273 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 271 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. - lead_generation: requires leadGenFormId (an adForm ID from POST /v1/ads/lead-forms). The campaign objective is set to MAX_LEAD and the creative's leadgenCallToAction destination is set to urn:li:adForm:{id}. - job_applicants requires a platformSpecificData.jobs creative. - For 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. 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.
84 85 86 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 84 def headline @headline end |
#headlines ⇒ Object
Meta only. Headline variations for Multiple Text Options. Must be sent alongside bodies. The top-level headline field is used as the object_story_spec.link_data.name (video_data.title on a video creative).
99 100 101 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 99 def headlines @headlines end |
#identity_id ⇒ Object
TikTok: the identity the ad runs as, from GET /v1/ads/tiktok-identities. Overrides the connected account's own identity; must be authorized on the advertiser.
302 303 304 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 302 def identity_id @identity_id 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, because TikTok requires the original organic post's author identity for Spark.
305 306 307 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 305 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. 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).
114 115 116 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 114 def image_url @image_url end |
#images ⇒ Object
Returns the value of attribute images.
116 117 118 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 116 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.
185 186 187 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 185 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.
217 218 219 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 217 def instagram_account_id @instagram_account_id end |
#interests ⇒ Object
Interest objects from /v1/ads/interests. Each must include id and name.
161 162 163 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 161 def interests @interests end |
#is_skadnetwork_attribution ⇒ Object
Meta app promotion only. Immutable campaign flag. Set true for iOS 14+ SKAdNetwork campaigns and supply promotedObject.applicationId plus promotedObject.objectStoreUrl. The campaign receives promotedObject only when this flag is true. Cannot be changed on an existing campaign.
317 318 319 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 317 def is_skadnetwork_attribution @is_skadnetwork_attribution end |
#keywords ⇒ Object
Google Search only. Keywords on the new ad group; entries are strings (BROAD) or { text, matchType }. Editable later via PUT /v1/ads/adId targeting.keywords.
241 242 243 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 241 def keywords @keywords end |
#languages ⇒ Object
e.g. ["en","es"]. Google: campaign language targeting (language_constant) using Google's language codes (ISO 639-1, plus variants such as zh_CN); unknown codes return 400. On Meta, 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.
188 189 190 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 188 def languages @languages end |
#lead_gen_form_id ⇒ Object
Lead Gen form ID to attach to the ad's creative. REQUIRED when goal is lead_generation. Create one via POST /v1/ads/lead-forms. On Meta (facebook/instagram) this is the leadgen_forms ID; the ad set's promoted_object.page_id + LEAD_GENERATION optimization + destination_type ON_AD are derived automatically from the goal. On LinkedIn this is the adForm ID; the creative's leadgenCallToAction.destination is set to urn:li:adForm:{id} and the campaign objective is set to MAX_LEAD. Forms must be owned by the sponsoredAccount (not the organization) for the URN to resolve. Also required on every Meta ATTACH (adSetId) call that targets a lead ad set (the form attaches per-ad; Meta rejects a formless ad in a lead ad set). placementAssets, dynamicCreative and carouselCards (Meta multi-card Instant-Form lead ad; linkUrl and per-card linkUrl are optional and forwarded as real destinations when sent, falling back to Meta's lead-form link when omitted) ARE supported on Meta instant-form lead ads.
111 112 113 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 111 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).
108 109 110 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 108 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.
87 88 89 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 87 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).
167 168 169 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 167 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, and Meta rejects it there.
57 58 59 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 57 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. Ad-group-level negative keywords on the new ad group. Editable later via PUT /v1/ads/adId targeting.negativeKeywords.
244 245 246 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 244 def negative_keywords @negative_keywords end |
#optimization_goal ⇒ Object
Meta, or TikTok with goal video_views (ENGAGED_VIEW, the 6-second default, or ENGAGED_VIEW_FIFTEEN; both bill per view). Meta: 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.
139 140 141 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 139 def organization_id @organization_id end |
#placement_assets ⇒ Object
Returns the value of attribute placement_assets.
230 231 232 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 230 def placement_assets @placement_assets end |
#placements ⇒ Object
Returns the value of attribute placements.
190 191 192 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 190 def placements @placements end |
#platform_specific_data ⇒ Object
Returns the value of attribute platform_specific_data.
291 292 293 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 291 def platform_specific_data @platform_specific_data end |
#portfolio_bid_strategy_id ⇒ Object
Google Search and Display only. Performance Max rejects portfolio bidding. Attach an existing portfolio bid strategy (numeric id from GET /v1/ads/bid-strategies) to the new campaign instead of a standard one. Exclusive with bidStrategy.
283 284 285 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 283 def portfolio_bid_strategy_id @portfolio_bid_strategy_id end |
#promoted_object ⇒ Object
Returns the value of attribute promoted_object.
322 323 324 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 322 def promoted_object @promoted_object end |
#promotion ⇒ Object
Not supported. Meta validates creative_sourcing_spec.promotion_metadata_spec on the create call and then discards it, so a Promotion set through the Marketing API never reaches the creative. Any object is rejected with 400 invalid_field_value. Send null or omit the field, and set the Promotion on the ad in Ads Manager. Verified on 2026-09-11 across Graph v19.0 to v25.0 and every write path.
51 52 53 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 51 def promotion @promotion 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).
196 197 198 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 196 def raw_targeting @raw_targeting end |
#regional_regulated_categories ⇒ Object
Meta only. Regional regulation categories required when the ad set targets certain countries. Known values: BRAZIL_REGULATION, SINGAPORE_UNIVERSAL, TAIWAN_UNIVERSAL, THAILAND_UNIVERSAL, AUSTRALIA_FINSERV, INDIA_FINSERV, TAIWAN_FINSERV. Meta rejects the ad set without this when the targeting geo includes the corresponding country.
205 206 207 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 205 def regional_regulated_categories @regional_regulated_categories end |
#regional_regulation_identities ⇒ Object
Meta only. Beneficiary/payer entity IDs for regionalRegulatedCategories. Values are numeric IDs from Meta verification. Keys vary by category (e.g. universal_beneficiary / universal_payer for BRAZIL_REGULATION and THAILAND_UNIVERSAL). If omitted, Meta uses Ads Manager defaults when configured.
208 209 210 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 208 def regional_regulation_identities @regional_regulation_identities 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>.
154 155 156 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 154 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, so 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.
280 281 282 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 280 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.
193 194 195 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 193 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.
256 257 258 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 256 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.
308 309 310 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 308 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.
199 200 201 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 199 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).
202 203 204 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 202 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.)
214 215 216 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 214 def start_date @start_date end |
#status ⇒ Object
Google Performance Max accepts PAUSED only and always creates a paused campaign. Google Search and Display, Meta, TikTok, and LinkedIn: 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. Google Search and Display follow the same rule, and because Google keeps an independent switch at campaign, ad group and ad level, a PAUSED create leaves the campaign it creates PAUSED at Google. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
72 73 74 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 72 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.
262 263 264 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 262 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.
142 143 144 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 142 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. 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.
228 229 230 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 228 def translations @translations end |
#user_device ⇒ Object
Meta only. Device models such as iPhone. Emitted as user_device. May also be supplied inside targeting.
314 315 316 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 314 def user_device @user_device end |
#user_os ⇒ Object
Meta only. Operating systems and version ranges, such as iOS_ver_14.0_and_above or Android. Emitted as user_os. May also be supplied inside targeting.
311 312 313 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 311 def user_os @user_os end |
#validate_only ⇒ Object
Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence. Google validation still downloads image URLs and consumes quota. On Meta, validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, all-image placementAssets with per-rule copy, existing video.id or existingCreativeId; other media pools, new video uploads, creatives, adSetId and RESERVED buying return 400. Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error.
63 64 65 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 63 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.
286 287 288 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 286 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}.
289 290 291 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 289 def value_rules_applied @value_rules_applied end |
#video ⇒ Object
Returns the value of attribute video.
118 119 120 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 118 def video @video end |
#work_employers ⇒ Object
Meta only. Employer entities from /v1/ads/targeting/search?dimension=workEmployer. Each must include id.
179 180 181 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 179 def work_employers @work_employers end |
#work_industries ⇒ Object
Meta only. Work-industry entities from /v1/ads/targeting/search?dimension=workIndustry. Each must include id. Rejected on other platforms (use LinkedIn's industries there).
182 183 184 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 182 def work_industries @work_industries end |
#work_positions ⇒ Object
Meta only. Job title entities from /v1/ads/targeting/search?dimension=workPosition. Each must include id. Rejected on other platforms (use LinkedIn's jobTitles there).
176 177 178 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 176 def work_positions @work_positions 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.
164 165 166 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 164 def zips @zips end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
460 461 462 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 460 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
465 466 467 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 465 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 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 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 347 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', :'promotion' => :'promotion', :'creative_features' => :'creativeFeatures', :'multi_advertiser' => :'multiAdvertiser', :'ai_disclosure' => :'aiDisclosure', :'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', :'bodies' => :'bodies', :'headlines' => :'headlines', :'descriptions' => :'descriptions', :'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', :'country_groups' => :'countryGroups', :'cities' => :'cities', :'regions' => :'regions', :'age_min' => :'ageMin', :'age_max' => :'ageMax', :'interests' => :'interests', :'zips' => :'zips', :'metros' => :'metros', :'custom_locations' => :'customLocations', :'behaviors' => :'behaviors', :'work_positions' => :'workPositions', :'work_employers' => :'workEmployers', :'work_industries' => :'workIndustries', :'income_tier' => :'incomeTier', :'languages' => :'languages', :'placements' => :'placements', :'saved_targeting_id' => :'savedTargetingId', :'raw_targeting' => :'rawTargeting', :'special_ad_categories' => :'specialAdCategories', :'special_ad_category_country' => :'specialAdCategoryCountry', :'regional_regulated_categories' => :'regionalRegulatedCategories', :'regional_regulation_identities' => :'regionalRegulationIdentities', :'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', :'asset_group' => :'assetGroup', :'keywords' => :'keywords', :'negative_keywords' => :'negativeKeywords', :'campaign_negative_keywords' => :'campaignNegativeKeywords', :'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', :'portfolio_bid_strategy_id' => :'portfolioBidStrategyId', :'value_rule_set_id' => :'valueRuleSetId', :'value_rules_applied' => :'valueRulesApplied', :'platform_specific_data' => :'platformSpecificData', :'dsa_beneficiary' => :'dsaBeneficiary', :'dsa_payor' => :'dsaPayor', :'brand_identity' => :'brandIdentity', :'identity_id' => :'identityId', :'identity_type' => :'identityType', :'smart_plus' => :'smartPlus', :'user_os' => :'userOs', :'user_device' => :'userDevice', :'is_skadnetwork_attribution' => :'isSkadnetworkAttribution', :'campaign_attribution' => :'campaignAttribution', :'promoted_object' => :'promotedObject' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 2142 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
583 584 585 586 587 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 583 def self.openapi_nullable Set.new([ :'promotion', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 470 def self.openapi_types { :'account_id' => :'String', :'ad_account_id' => :'String', :'name' => :'String', :'campaign_name' => :'String', :'ad_set_name' => :'String', :'ad_name' => :'String', :'tracking' => :'AdTracking', :'goal' => :'String', :'optimization_goal' => :'String', :'billing_event' => :'String', :'buying_type' => :'String', :'rf_prediction_id' => :'String', :'promotion' => :'Object', :'creative_features' => :'Hash<String, String>', :'multi_advertiser' => :'String', :'ai_disclosure' => :'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', :'bodies' => :'Array<String>', :'headlines' => :'Array<String>', :'descriptions' => :'Array<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>', :'country_groups' => :'Array<String>', :'cities' => :'Array<CreateStandaloneAdRequestCitiesInner>', :'regions' => :'Array<CreateStandaloneAdRequestRegionsInner>', :'age_min' => :'Integer', :'age_max' => :'Integer', :'interests' => :'Array<UpdateAdRequestTargetingInterestsInner>', :'zips' => :'Array<UpdateCampaignTargetingRequestTargetingLocationsOneOfRegionsInner>', :'metros' => :'Array<UpdateCampaignTargetingRequestTargetingLocationsOneOfRegionsInner>', :'custom_locations' => :'Array<CreateStandaloneAdRequestCustomLocationsInner>', :'behaviors' => :'Array<CreateStandaloneAdRequestBehaviorsInner>', :'work_positions' => :'Array<CreateStandaloneAdRequestBehaviorsInner>', :'work_employers' => :'Array<CreateStandaloneAdRequestBehaviorsInner>', :'work_industries' => :'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>', :'regional_regulated_categories' => :'Array<String>', :'regional_regulation_identities' => :'Hash<String, Integer>', :'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', :'asset_group' => :'GooglePmaxAssetGroupInput', :'keywords' => :'Array<KeywordEntry>', :'negative_keywords' => :'Array<KeywordEntry>', :'campaign_negative_keywords' => :'Array<KeywordEntry>', :'additional_headlines' => :'Array<CreateStandaloneAdRequestAdditionalHeadlinesInner>', :'additional_descriptions' => :'Array<CreateStandaloneAdRequestAdditionalDescriptionsInner>', :'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', :'portfolio_bid_strategy_id' => :'String', :'value_rule_set_id' => :'String', :'value_rules_applied' => :'Boolean', :'platform_specific_data' => :'CreateStandaloneAdRequestPlatformSpecificData', :'dsa_beneficiary' => :'String', :'dsa_payor' => :'String', :'brand_identity' => :'CreateStandaloneAdRequestBrandIdentity', :'identity_id' => :'String', :'identity_type' => :'String', :'smart_plus' => :'Boolean', :'user_os' => :'Array<String>', :'user_device' => :'Array<String>', :'is_skadnetwork_attribution' => :'Boolean', :'campaign_attribution' => :'String', :'promoted_object' => :'AdPromotedObject' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 2015 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 && promotion == o.promotion && creative_features == o.creative_features && multi_advertiser == o.multi_advertiser && ai_disclosure == o.ai_disclosure && 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 && bodies == o.bodies && headlines == o.headlines && descriptions == o.descriptions && 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 && country_groups == o.country_groups && 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 && work_positions == o.work_positions && work_employers == o.work_employers && work_industries == o.work_industries && 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 && regional_regulated_categories == o.regional_regulated_categories && regional_regulation_identities == o.regional_regulation_identities && 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 && asset_group == o.asset_group && keywords == o.keywords && negative_keywords == o.negative_keywords && campaign_negative_keywords == o.campaign_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 && portfolio_bid_strategy_id == o.portfolio_bid_strategy_id && 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_id == o.identity_id && identity_type == o.identity_type && smart_plus == o.smart_plus && user_os == o.user_os && user_device == o.user_device && is_skadnetwork_attribution == o.is_skadnetwork_attribution && campaign_attribution == o.campaign_attribution && promoted_object == o.promoted_object end |
#eql?(o) ⇒ Boolean
2129 2130 2131 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 2129 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
2135 2136 2137 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 2135 def hash [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, , rf_prediction_id, promotion, creative_features, multi_advertiser, ai_disclosure, validate_only, budget_amount, budget_type, status, campaign_status, budget_level, currency, headline, long_headline, body, description, bodies, headlines, descriptions, 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, country_groups, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, work_positions, work_employers, work_industries, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, asset_group, keywords, negative_keywords, campaign_negative_keywords, additional_headlines, additional_descriptions, sitelinks, callouts, structured_snippets, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, portfolio_bid_strategy_id, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_id, identity_type, smart_plus, user_os, user_device, is_skadnetwork_attribution, campaign_attribution, promoted_object].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 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 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1122 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 !@bodies.nil? && @bodies.length > 5 invalid_properties.push('invalid value for "bodies", number of items must be less than or equal to 5.') end if !@bodies.nil? && @bodies.length < 1 invalid_properties.push('invalid value for "bodies", number of items must be greater than or equal to 1.') end if !@headlines.nil? && @headlines.length > 5 invalid_properties.push('invalid value for "headlines", number of items must be less than or equal to 5.') end if !@headlines.nil? && @headlines.length < 1 invalid_properties.push('invalid value for "headlines", number of items must be greater than or equal to 1.') end if !@descriptions.nil? && @descriptions.length > 5 invalid_properties.push('invalid value for "descriptions", number of items must be less than or equal to 5.') end if !@descriptions.nil? && @descriptions.length < 1 invalid_properties.push('invalid value for "descriptions", number of items must be greater than or equal to 1.') 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 !@keywords.nil? && @keywords.length > 1000 invalid_properties.push('invalid value for "keywords", number of items must be less than or equal to 1000.') end if !@negative_keywords.nil? && @negative_keywords.length > 1000 invalid_properties.push('invalid value for "negative_keywords", number of items must be less than or equal to 1000.') end if !@campaign_negative_keywords.nil? && @campaign_negative_keywords.length > 1000 invalid_properties.push('invalid value for "campaign_negative_keywords", number of items must be less than or equal to 1000.') 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 !@portfolio_bid_strategy_id.nil? && @portfolio_bid_strategy_id !~ pattern invalid_properties.push("invalid value for \"portfolio_bid_strategy_id\", must conform to the pattern #{pattern}.") 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 if !@user_os.nil? && @user_os.length < 1 invalid_properties.push('invalid value for "user_os", number of items must be greater than or equal to 1.') end if !@user_device.nil? && @user_device.length < 1 invalid_properties.push('invalid value for "user_device", number of items must be greater than or equal to 1.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 2164 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
1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 |
# File 'lib/zernio-sdk/models/create_standalone_ad_request.rb', line 1308 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?() multi_advertiser_validator = EnumAttributeValidator.new('String', ["OPT_IN", "OPT_OUT"]) return false unless multi_advertiser_validator.valid?(@multi_advertiser) ai_disclosure_validator = EnumAttributeValidator.new('String', ["OPT_IN", "OPT_OUT"]) return false unless ai_disclosure_validator.valid?(@ai_disclosure) 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 return false if !@bodies.nil? && @bodies.length > 5 return false if !@bodies.nil? && @bodies.length < 1 return false if !@headlines.nil? && @headlines.length > 5 return false if !@headlines.nil? && @headlines.length < 1 return false if !@descriptions.nil? && @descriptions.length > 5 return false if !@descriptions.nil? && @descriptions.length < 1 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", "pmax"]) return false unless campaign_type_validator.valid?(@campaign_type) return false if !@keywords.nil? && @keywords.length > 1000 return false if !@negative_keywords.nil? && @negative_keywords.length > 1000 return false if !@campaign_negative_keywords.nil? && @campaign_negative_keywords.length > 1000 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 !@portfolio_bid_strategy_id.nil? && @portfolio_bid_strategy_id !~ Regexp.new(/^\d+$/) 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", "BC_AUTH_TT"]) return false unless identity_type_validator.valid?(@identity_type) return false if !@user_os.nil? && @user_os.length < 1 return false if !@user_device.nil? && @user_device.length < 1 campaign_attribution_validator = EnumAttributeValidator.new('String', ["AEM", "SKADNETWORK"]) return false unless campaign_attribution_validator.valid?(@campaign_attribution) true end |