facebookbusiness 0.9.0.1 → 0.11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/facebook_ads/ad_objects/ad.rb +4 -1
- data/lib/facebook_ads/ad_objects/ad_account.rb +26 -55
- data/lib/facebook_ads/ad_objects/ad_account_delivery_estimate.rb +1 -0
- data/lib/facebook_ads/ad_objects/{user_payment_modules_options.rb → ad_account_ios_fourteen_campaign_limits.rb} +4 -5
- data/lib/facebook_ads/ad_objects/ad_account_matched_search_applications_edge_data.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_account_targeting_unified.rb +3 -1
- data/lib/facebook_ads/ad_objects/ad_asset_feed_spec.rb +3 -0
- data/lib/facebook_ads/ad_objects/ad_campaign_activity.rb +6 -2
- data/lib/facebook_ads/ad_objects/ad_campaign_delivery_estimate.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative.rb +9 -7
- data/lib/facebook_ads/ad_objects/ad_creative_link_data.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_creative_link_data_call_to_action.rb +2 -0
- data/lib/facebook_ads/ad_objects/{read_only_analytics_user_property_config.rb → ad_creative_omnichannel_link_spec.rb} +5 -3
- data/lib/facebook_ads/ad_objects/ad_creative_portrait_customizations.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_preview.rb +5 -0
- data/lib/facebook_ads/ad_objects/ad_report_run.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_rule.rb +1 -0
- data/lib/facebook_ads/ad_objects/ad_rule_evaluation_spec.rb +1 -2
- data/lib/facebook_ads/ad_objects/ad_rule_execution_spec.rb +1 -2
- data/lib/facebook_ads/ad_objects/ad_set.rb +6 -2
- data/lib/facebook_ads/ad_objects/ad_study.rb +7 -11
- data/lib/facebook_ads/ad_objects/ad_study_objective.rb +3 -4
- data/lib/facebook_ads/ad_objects/ad_video.rb +26 -18
- data/lib/facebook_ads/ad_objects/adgroup_activity.rb +0 -2
- data/lib/facebook_ads/ad_objects/adgroup_placement_specific_review_feedback.rb +2 -0
- data/lib/facebook_ads/ad_objects/adoptable_pet.rb +22 -0
- data/lib/facebook_ads/ad_objects/ads_action_stats.rb +2 -0
- data/lib/facebook_ads/ad_objects/ads_insights.rb +5 -4
- data/lib/facebook_ads/ad_objects/ads_pixel.rb +5 -0
- data/lib/facebook_ads/ad_objects/album.rb +0 -10
- data/lib/facebook_ads/ad_objects/application.rb +29 -14
- data/lib/facebook_ads/ad_objects/atlas_campaign.rb +0 -8
- data/lib/facebook_ads/ad_objects/audio_copyright.rb +4 -0
- data/lib/facebook_ads/ad_objects/automotive_model.rb +47 -0
- data/lib/facebook_ads/ad_objects/business.rb +46 -7
- data/lib/facebook_ads/ad_objects/business_asset_group.rb +3 -0
- data/lib/facebook_ads/ad_objects/campaign.rb +5 -4
- data/lib/facebook_ads/ad_objects/canvas.rb +2 -0
- data/lib/facebook_ads/ad_objects/{event_tour.rb → canvas_template.rb} +12 -20
- data/lib/facebook_ads/ad_objects/catalog_item_channels_to_integrity_status.rb +38 -0
- data/lib/facebook_ads/ad_objects/catalog_sub_vertical_list.rb +3 -1
- data/lib/facebook_ads/ad_objects/comment.rb +3 -1
- data/lib/facebook_ads/ad_objects/commerce_merchant_settings.rb +33 -0
- data/lib/facebook_ads/ad_objects/commerce_order.rb +14 -13
- data/lib/facebook_ads/ad_objects/content_delivery_report.rb +4 -0
- data/lib/facebook_ads/ad_objects/{offline_terms_of_service.rb → contextual_bundling_spec.rb} +4 -4
- data/lib/facebook_ads/ad_objects/custom_audience.rb +9 -12
- data/lib/facebook_ads/ad_objects/custom_audience_data_source.rb +1 -0
- data/lib/facebook_ads/ad_objects/delivery_window.rb +287 -0
- data/lib/facebook_ads/ad_objects/destination.rb +22 -0
- data/lib/facebook_ads/ad_objects/event.rb +4 -0
- data/lib/facebook_ads/ad_objects/flight.rb +22 -0
- data/lib/facebook_ads/ad_objects/group.rb +21 -22
- data/lib/facebook_ads/ad_objects/home_listing.rb +22 -0
- data/lib/facebook_ads/ad_objects/hotel.rb +22 -0
- data/lib/facebook_ads/ad_objects/ig_media.rb +2 -1
- data/lib/facebook_ads/ad_objects/ig_user.rb +10 -2
- data/lib/facebook_ads/ad_objects/image_copyright.rb +302 -0
- data/lib/facebook_ads/ad_objects/insights_result.rb +1 -1
- data/lib/facebook_ads/ad_objects/instagram_user.rb +0 -3
- data/lib/facebook_ads/ad_objects/link.rb +0 -10
- data/lib/facebook_ads/ad_objects/live_video.rb +20 -13
- data/lib/facebook_ads/ad_objects/messenger_profile.rb +1 -0
- data/lib/facebook_ads/ad_objects/omega_customer_trx.rb +64 -0
- data/lib/facebook_ads/ad_objects/oracle_transaction.rb +0 -5
- data/lib/facebook_ads/ad_objects/page.rb +85 -13
- data/lib/facebook_ads/ad_objects/page_call_to_action.rb +6 -0
- data/lib/facebook_ads/ad_objects/page_commerce_eligibility.rb +38 -0
- data/lib/facebook_ads/ad_objects/page_post.rb +0 -10
- data/lib/facebook_ads/ad_objects/payment_engine_payment.rb +73 -0
- data/lib/facebook_ads/ad_objects/payment_subscription.rb +3 -3
- data/lib/facebook_ads/ad_objects/photo.rb +0 -10
- data/lib/facebook_ads/ad_objects/post.rb +12 -40
- data/lib/facebook_ads/ad_objects/{cpas_parent_catalog_settings.rb → private_lift_study_instance.rb} +11 -12
- data/lib/facebook_ads/ad_objects/product_catalog.rb +51 -4
- data/lib/facebook_ads/ad_objects/{ad_account_roas.rb → product_catalog_diagnostic_group.rb} +55 -30
- data/lib/facebook_ads/ad_objects/product_feed.rb +17 -1
- data/lib/facebook_ads/ad_objects/product_feed_schedule.rb +2 -0
- data/lib/facebook_ads/ad_objects/product_group.rb +8 -6
- data/lib/facebook_ads/ad_objects/product_item.rb +25 -1
- data/lib/facebook_ads/ad_objects/{user_payment_methods_info.rb → product_item_ar_data.rb} +24 -8
- data/lib/facebook_ads/ad_objects/product_set.rb +7 -0
- data/lib/facebook_ads/ad_objects/saved_audience.rb +3 -0
- data/lib/facebook_ads/ad_objects/server_side/user_data.rb +290 -96
- data/lib/facebook_ads/ad_objects/server_side/util.rb +16 -1
- data/lib/facebook_ads/ad_objects/system_user.rb +20 -0
- data/lib/facebook_ads/ad_objects/targeting.rb +0 -2
- data/lib/facebook_ads/ad_objects/unified_thread.rb +5 -1
- data/lib/facebook_ads/ad_objects/user.rb +18 -13
- data/lib/facebook_ads/ad_objects/vehicle.rb +22 -0
- data/lib/facebook_ads/ad_objects/vehicle_offer.rb +22 -0
- data/lib/facebook_ads/ad_objects/video_copyright.rb +4 -0
- data/lib/facebook_ads/ad_objects/whats_app_business_account.rb +3 -0
- data/lib/facebook_ads/ad_objects/{friend_list.rb → whats_app_business_profile.rb} +3 -5
- data/lib/facebook_ads/edge.rb +2 -1
- data/lib/facebook_ads/version.rb +2 -2
- metadata +21 -17
- data/lib/facebook_ads/ad_objects/ad_account_creation_request.rb +0 -71
@@ -25,37 +25,62 @@ module FacebookAds
|
|
25
25
|
# on github and we'll fix in our codegen framework. We'll not be able to accept
|
26
26
|
# pull request for this class.
|
27
27
|
|
28
|
-
class
|
28
|
+
class ProductCatalogDiagnosticGroup < AdObject
|
29
|
+
AFFECTED_CHANNELS = [
|
30
|
+
"business_inbox_in_messenger",
|
31
|
+
"shops",
|
32
|
+
"test_capability",
|
33
|
+
"universal_checkout",
|
34
|
+
"us_marketplace",
|
35
|
+
]
|
29
36
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
37
|
+
AFFECTED_FEATURES = [
|
38
|
+
"augmented_reality",
|
39
|
+
"checkout",
|
40
|
+
]
|
41
|
+
|
42
|
+
SEVERITY = [
|
43
|
+
"MUST_FIX",
|
44
|
+
"OPPORTUNITY",
|
45
|
+
]
|
46
|
+
|
47
|
+
TYPE = [
|
48
|
+
"ATTRIBUTES_INVALID",
|
49
|
+
"ATTRIBUTES_MISSING",
|
50
|
+
"CATEGORY",
|
51
|
+
"CHECKOUT",
|
52
|
+
"IMAGE_QUALITY",
|
53
|
+
"LOW_QUALITY_TITLE_AND_DESCRIPTION",
|
54
|
+
"POLICY_VIOLATION",
|
55
|
+
"SHOPS_VISIBILITY_ISSUES",
|
56
|
+
]
|
57
|
+
|
58
|
+
SEVERITIES = [
|
59
|
+
"MUST_FIX",
|
60
|
+
"OPPORTUNITY",
|
61
|
+
]
|
62
|
+
|
63
|
+
TYPES = [
|
64
|
+
"ATTRIBUTES_INVALID",
|
65
|
+
"ATTRIBUTES_MISSING",
|
66
|
+
"CATEGORY",
|
67
|
+
"CHECKOUT",
|
68
|
+
"IMAGE_QUALITY",
|
69
|
+
"LOW_QUALITY_TITLE_AND_DESCRIPTION",
|
70
|
+
"POLICY_VIOLATION",
|
71
|
+
"SHOPS_VISIBILITY_ISSUES",
|
72
|
+
]
|
73
|
+
|
74
|
+
|
75
|
+
field :affected_channels, { list: { enum: -> { AFFECTED_CHANNELS }} }
|
76
|
+
field :affected_features, { list: { enum: -> { AFFECTED_FEATURES }} }
|
77
|
+
field :diagnostics, { list: 'object' }
|
78
|
+
field :error_code, 'int'
|
79
|
+
field :number_of_affected_items, 'int'
|
80
|
+
field :severity, { enum: -> { SEVERITY }}
|
81
|
+
field :subtitle, 'string'
|
82
|
+
field :title, 'string'
|
83
|
+
field :type, { enum: -> { TYPE }}
|
59
84
|
has_no_id
|
60
85
|
has_no_get
|
61
86
|
has_no_post
|
@@ -53,6 +53,7 @@ module FacebookAds
|
|
53
53
|
|
54
54
|
FEED_TYPE = [
|
55
55
|
"AUTO",
|
56
|
+
"AUTOMOTIVE_MODEL",
|
56
57
|
"DESTINATION",
|
57
58
|
"FLIGHT",
|
58
59
|
"HOME_LISTING",
|
@@ -126,7 +127,11 @@ module FacebookAds
|
|
126
127
|
field :feed_type, { enum: -> { FEED_TYPE }}
|
127
128
|
field :override_value, 'string'
|
128
129
|
field :rules, { list: 'string' }
|
129
|
-
field :
|
130
|
+
field :selected_override_fields, { list: 'string' }
|
131
|
+
|
132
|
+
has_edge :auto_markets do |edge|
|
133
|
+
edge.get
|
134
|
+
end
|
130
135
|
|
131
136
|
has_edge :automotive_models do |edge|
|
132
137
|
edge.get 'AutomotiveModel' do |api|
|
@@ -135,6 +140,10 @@ module FacebookAds
|
|
135
140
|
end
|
136
141
|
end
|
137
142
|
|
143
|
+
has_edge :autos do |edge|
|
144
|
+
edge.get
|
145
|
+
end
|
146
|
+
|
138
147
|
has_edge :destinations do |edge|
|
139
148
|
edge.get 'Destination' do |api|
|
140
149
|
api.has_param :bulk_pagination, 'bool'
|
@@ -163,6 +172,13 @@ module FacebookAds
|
|
163
172
|
end
|
164
173
|
end
|
165
174
|
|
175
|
+
has_edge :media_titles do |edge|
|
176
|
+
edge.get do |api|
|
177
|
+
api.has_param :bulk_pagination, 'bool'
|
178
|
+
api.has_param :filter, 'object'
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
166
182
|
has_edge :products do |edge|
|
167
183
|
edge.get 'ProductItem' do |api|
|
168
184
|
api.has_param :bulk_pagination, 'bool'
|
@@ -34,20 +34,20 @@ module FacebookAds
|
|
34
34
|
|
35
35
|
has_edge :products do |edge|
|
36
36
|
edge.get 'ProductItem'
|
37
|
-
edge.post
|
37
|
+
edge.post do |api|
|
38
38
|
api.has_param :additional_image_urls, { list: 'string' }
|
39
39
|
api.has_param :additional_variant_attributes, 'hash'
|
40
40
|
api.has_param :android_app_name, 'string'
|
41
41
|
api.has_param :android_class, 'string'
|
42
42
|
api.has_param :android_package, 'string'
|
43
43
|
api.has_param :android_url, 'string'
|
44
|
-
api.has_param :availability, { enum:
|
44
|
+
api.has_param :availability, { enum: %w{available for order discontinued in stock out of stock pending preorder }}
|
45
45
|
api.has_param :brand, 'string'
|
46
46
|
api.has_param :category, 'string'
|
47
47
|
api.has_param :checkout_url, 'string'
|
48
48
|
api.has_param :color, 'string'
|
49
|
-
api.has_param :commerce_tax_category, { enum:
|
50
|
-
api.has_param :condition, { enum:
|
49
|
+
api.has_param :commerce_tax_category, { enum: %w{FB_ANIMAL FB_ANIMAL_SUPP FB_APRL FB_APRL_ACCESSORIES FB_APRL_ATHL_UNIF FB_APRL_CASES FB_APRL_CLOTHING FB_APRL_COSTUME FB_APRL_CSTM FB_APRL_FORMAL FB_APRL_HANDBAG FB_APRL_JEWELRY FB_APRL_SHOE FB_APRL_SHOE_ACC FB_APRL_SWIM FB_APRL_SWIM_CHIL FB_APRL_SWIM_CVR FB_ARTS FB_ARTS_HOBBY FB_ARTS_PARTY FB_ARTS_PARTY_GIFT_CARD FB_ARTS_TICKET FB_BABY FB_BABY_BATH FB_BABY_BLANKET FB_BABY_DIAPER FB_BABY_GIFT_SET FB_BABY_HEALTH FB_BABY_NURSING FB_BABY_POTTY_TRN FB_BABY_SAFE FB_BABY_TOYS FB_BABY_TRANSPORT FB_BABY_TRANSPORT_ACC FB_BAGS FB_BAGS_BKPK FB_BAGS_BOXES FB_BAGS_BRFCS FB_BAGS_CSMT_BAG FB_BAGS_DFFL FB_BAGS_DIPR FB_BAGS_FNNY FB_BAGS_GRMT FB_BAGS_LUGG FB_BAGS_LUG_ACC FB_BAGS_MSGR FB_BAGS_TOTE FB_BAGS_TRN_CAS FB_BLDG FB_BLDG_ACC FB_BLDG_CNSMB FB_BLDG_FENCE FB_BLDG_FUEL_TNK FB_BLDG_HT_VNT FB_BLDG_LOCK FB_BLDG_MATRL FB_BLDG_PLMB FB_BLDG_PUMP FB_BLDG_PWRS FB_BLDG_STR_TANK FB_BLDG_S_ENG FB_BLDG_TL_ACC FB_BLDG_TOOL FB_BUSIND FB_BUSIND_ADVERTISING FB_BUSIND_AGRICULTURE FB_BUSIND_AUTOMATION FB_BUSIND_HEAVY_MACH FB_BUSIND_LAB FB_BUSIND_MEDICAL FB_BUSIND_RETAIL FB_BUSIND_SANITARY_CT FB_BUSIND_SIGN FB_BUSIND_STORAGE FB_BUSIND_STORAGE_ACC FB_BUSIND_WORK_GEAR FB_CAMERA_ACC FB_CAMERA_CAMERA FB_CAMERA_OPTIC FB_CAMERA_OPTICS FB_CAMERA_PHOTO FB_ELEC FB_ELEC_ACC FB_ELEC_ARCDADE FB_ELEC_AUDIO FB_ELEC_CIRCUIT FB_ELEC_COMM FB_ELEC_COMPUTER FB_ELEC_GPS_ACC FB_ELEC_GPS_NAV FB_ELEC_GPS_TRK FB_ELEC_MARINE FB_ELEC_NETWORK FB_ELEC_PART FB_ELEC_PRINT FB_ELEC_RADAR FB_ELEC_SPEED_RDR FB_ELEC_TOLL FB_ELEC_VIDEO FB_ELEC_VID_GM_ACC FB_ELEC_VID_GM_CNSL FB_FOOD FB_FURN FB_FURN_BABY FB_FURN_BENCH FB_FURN_CART FB_FURN_CHAIR FB_FURN_CHAIR_ACC FB_FURN_DIVIDE FB_FURN_DIVIDE_ACC FB_FURN_ENT_CTR FB_FURN_FUTN FB_FURN_FUTN_PAD FB_FURN_OFFICE FB_FURN_OFFICE_ACC FB_FURN_OTTO FB_FURN_OUTDOOR FB_FURN_OUTDOOR_ACC FB_FURN_SETS FB_FURN_SHELVE_ACC FB_FURN_SHLF FB_FURN_SOFA FB_FURN_SOFA_ACC FB_FURN_STORAGE FB_FURN_TABL FB_FURN_TABL_ACC FB_GENERIC_TAXABLE FB_HLTH FB_HLTH_HLTH FB_HLTH_JWL_CR FB_HLTH_LILP_BLM FB_HLTH_LTN_SPF FB_HLTH_PRSL_CR FB_HLTH_SKN_CR FB_HMGN FB_HMGN_BATH FB_HMGN_DCOR FB_HMGN_EMGY FB_HMGN_FPLC FB_HMGN_FPLC_ACC FB_HMGN_GS_SFT FB_HMGN_HS_ACC FB_HMGN_HS_APP FB_HMGN_HS_SPL FB_HMGN_KTCN FB_HMGN_LAWN FB_HMGN_LGHT FB_HMGN_LINN FB_HMGN_LT_ACC FB_HMGN_OTDR FB_HMGN_POOL FB_HMGN_SCTY FB_HMGN_SMK_ACC FB_HMGN_UMBR FB_HMGN_UMBR_ACC FB_MDIA FB_MDIA_BOOK FB_MDIA_DVDS FB_MDIA_MAG FB_MDIA_MANL FB_MDIA_MUSC FB_MDIA_PRJ_PLN FB_MDIA_SHT_MUS FB_OFFC FB_OFFC_BKAC FB_OFFC_CRTS FB_OFFC_DSKP FB_OFFC_EQIP FB_OFFC_FLNG FB_OFFC_GNRL FB_OFFC_INSTM FB_OFFC_LP_DSK FB_OFFC_MATS FB_OFFC_NM_PLT FB_OFFC_PPR_HNDL FB_OFFC_PRSNT_SPL FB_OFFC_SEALR FB_OFFC_SHIP_SPL FB_RLGN FB_RLGN_CMNY FB_RLGN_ITEM FB_RLGN_WEDD FB_SFTWR FB_SFWR_CMPTR FB_SFWR_DGTL_GD FB_SFWR_GAME FB_SHIPPING FB_SPOR FB_SPORT_ATHL FB_SPORT_ATHL_CLTH FB_SPORT_ATHL_SHOE FB_SPORT_ATHL_SPRT FB_SPORT_EXRCS FB_SPORT_INDR_GM FB_SPORT_OTDR_GM FB_TOYS FB_TOYS_EQIP FB_TOYS_GAME FB_TOYS_PZZL FB_TOYS_TMRS FB_TOYS_TOYS FB_VEHI FB_VEHI_PART }}
|
50
|
+
api.has_param :condition, { enum: %w{cpo new open_box_new refurbished used used_fair used_good used_like_new }}
|
51
51
|
api.has_param :currency, 'string'
|
52
52
|
api.has_param :custom_data, 'hash'
|
53
53
|
api.has_param :custom_label_0, 'string'
|
@@ -58,7 +58,7 @@ module FacebookAds
|
|
58
58
|
api.has_param :description, 'string'
|
59
59
|
api.has_param :expiration_date, 'string'
|
60
60
|
api.has_param :fb_product_category, 'string'
|
61
|
-
api.has_param :gender, { enum:
|
61
|
+
api.has_param :gender, { enum: %w{female male unisex }}
|
62
62
|
api.has_param :gtin, 'string'
|
63
63
|
api.has_param :image_url, 'string'
|
64
64
|
api.has_param :inventory, 'int'
|
@@ -73,6 +73,7 @@ module FacebookAds
|
|
73
73
|
api.has_param :iphone_url, 'string'
|
74
74
|
api.has_param :launch_date, 'string'
|
75
75
|
api.has_param :manufacturer_part_number, 'string'
|
76
|
+
api.has_param :marked_for_product_launch, { enum: %w{default marked not_marked }}
|
76
77
|
api.has_param :material, 'string'
|
77
78
|
api.has_param :mobile_link, 'string'
|
78
79
|
api.has_param :name, 'string'
|
@@ -83,6 +84,7 @@ module FacebookAds
|
|
83
84
|
api.has_param :pattern, 'string'
|
84
85
|
api.has_param :price, 'int'
|
85
86
|
api.has_param :product_type, 'string'
|
87
|
+
api.has_param :quantity_to_sell_on_facebook, 'int'
|
86
88
|
api.has_param :retailer_id, 'string'
|
87
89
|
api.has_param :return_policy_days, 'int'
|
88
90
|
api.has_param :sale_price, 'int'
|
@@ -92,7 +94,7 @@ module FacebookAds
|
|
92
94
|
api.has_param :size, 'string'
|
93
95
|
api.has_param :start_date, 'string'
|
94
96
|
api.has_param :url, 'string'
|
95
|
-
api.has_param :visibility, { enum:
|
97
|
+
api.has_param :visibility, { enum: %w{published staging }}
|
96
98
|
api.has_param :windows_phone_app_id, 'string'
|
97
99
|
api.has_param :windows_phone_app_name, 'string'
|
98
100
|
api.has_param :windows_phone_url, 'string'
|
@@ -62,6 +62,15 @@ module FacebookAds
|
|
62
62
|
"unisex",
|
63
63
|
]
|
64
64
|
|
65
|
+
IMAGE_FETCH_STATUS = [
|
66
|
+
"DIRECT_UPLOAD",
|
67
|
+
"FETCHED",
|
68
|
+
"FETCH_FAILED",
|
69
|
+
"NO_STATUS",
|
70
|
+
"OUTDATED",
|
71
|
+
"PARTIAL_FETCH",
|
72
|
+
]
|
73
|
+
|
65
74
|
REVIEW_STATUS = [
|
66
75
|
"",
|
67
76
|
"approved",
|
@@ -92,6 +101,7 @@ module FacebookAds
|
|
92
101
|
"FB_APRL_CLOTHING",
|
93
102
|
"FB_APRL_COSTUME",
|
94
103
|
"FB_APRL_CSTM",
|
104
|
+
"FB_APRL_FORMAL",
|
95
105
|
"FB_APRL_HANDBAG",
|
96
106
|
"FB_APRL_JEWELRY",
|
97
107
|
"FB_APRL_SHOE",
|
@@ -287,12 +297,19 @@ module FacebookAds
|
|
287
297
|
"FB_VEHI_PART",
|
288
298
|
]
|
289
299
|
|
300
|
+
MARKED_FOR_PRODUCT_LAUNCH = [
|
301
|
+
"default",
|
302
|
+
"marked",
|
303
|
+
"not_marked",
|
304
|
+
]
|
305
|
+
|
290
306
|
|
291
307
|
field :additional_image_cdn_urls, { list: 'hash' }
|
292
308
|
field :additional_image_urls, { list: 'string' }
|
293
309
|
field :additional_variant_attributes, 'hash'
|
294
310
|
field :age_group, { enum: -> { AGE_GROUP }}
|
295
311
|
field :applinks, 'CatalogItemAppLinks'
|
312
|
+
field :ar_data, 'ProductItemArData'
|
296
313
|
field :availability, { enum: -> { AVAILABILITY }}
|
297
314
|
field :brand, 'string'
|
298
315
|
field :capability_to_review_status, 'hash'
|
@@ -315,20 +332,24 @@ module FacebookAds
|
|
315
332
|
field :gtin, 'string'
|
316
333
|
field :id, 'string'
|
317
334
|
field :image_cdn_urls, 'hash'
|
335
|
+
field :image_fetch_status, { enum: -> { IMAGE_FETCH_STATUS }}
|
318
336
|
field :image_url, 'string'
|
319
337
|
field :images, { list: 'string' }
|
320
338
|
field :inventory, 'int'
|
321
339
|
field :manufacturer_part_number, 'string'
|
340
|
+
field :marked_for_product_launch, 'string'
|
322
341
|
field :material, 'string'
|
323
342
|
field :mobile_link, 'string'
|
324
343
|
field :name, 'string'
|
325
344
|
field :ordering_index, 'int'
|
345
|
+
field :parent_product_id, 'string'
|
326
346
|
field :pattern, 'string'
|
327
347
|
field :price, 'string'
|
328
348
|
field :product_catalog, 'ProductCatalog'
|
329
349
|
field :product_feed, 'ProductFeed'
|
330
350
|
field :product_group, 'ProductGroup'
|
331
351
|
field :product_type, 'string'
|
352
|
+
field :quantity_to_sell_on_facebook, 'int'
|
332
353
|
field :retailer_id, 'string'
|
333
354
|
field :retailer_product_group_id, 'string'
|
334
355
|
field :review_rejection_reasons, { list: 'string' }
|
@@ -343,7 +364,6 @@ module FacebookAds
|
|
343
364
|
field :start_date, 'string'
|
344
365
|
field :url, 'string'
|
345
366
|
field :visibility, { enum: -> { VISIBILITY }}
|
346
|
-
field :additional_image_files, { list: 'file' }
|
347
367
|
field :additional_uploaded_image_ids, { list: 'string' }
|
348
368
|
field :android_app_name, 'string'
|
349
369
|
field :android_class, 'string'
|
@@ -369,6 +389,10 @@ module FacebookAds
|
|
369
389
|
field :windows_phone_app_name, 'string'
|
370
390
|
field :windows_phone_url, 'string'
|
371
391
|
|
392
|
+
has_edge :channels_to_integrity_status do |edge|
|
393
|
+
edge.get 'CatalogItemChannelsToIntegrityStatus'
|
394
|
+
end
|
395
|
+
|
372
396
|
has_edge :product_sets do |edge|
|
373
397
|
edge.get 'ProductSet'
|
374
398
|
end
|
@@ -25,15 +25,31 @@ module FacebookAds
|
|
25
25
|
# on github and we'll fix in our codegen framework. We'll not be able to accept
|
26
26
|
# pull request for this class.
|
27
27
|
|
28
|
-
class
|
28
|
+
class ProductItemArData < AdObject
|
29
|
+
SURFACES = [
|
30
|
+
"B2C_MARKETPLACE",
|
31
|
+
"C2C_MARKETPLACE",
|
32
|
+
"DA",
|
33
|
+
"DAILY_DEALS",
|
34
|
+
"DAILY_DEALS_LEGACY",
|
35
|
+
"IG_PRODUCT_TAGGING",
|
36
|
+
"MARKETPLACE",
|
37
|
+
"MARKETPLACE_ADS_DEPRECATED",
|
38
|
+
"MARKETPLACE_SHOPS",
|
39
|
+
"OFFLINE_CONVERSIONS",
|
40
|
+
"SHOPS",
|
41
|
+
"UNIVERSAL_CHECKOUT",
|
42
|
+
"WHATSAPP",
|
43
|
+
]
|
29
44
|
|
30
|
-
|
31
|
-
field :
|
32
|
-
field :
|
33
|
-
field :
|
34
|
-
field :
|
35
|
-
field :
|
36
|
-
field :
|
45
|
+
|
46
|
+
field :container_effect, 'string'
|
47
|
+
field :effect_icon, 'string'
|
48
|
+
field :effect_parameters, 'object'
|
49
|
+
field :picker_icon, 'string'
|
50
|
+
field :product_ar_link, 'object'
|
51
|
+
field :state, 'string'
|
52
|
+
field :surfaces, { list: { enum: -> { SURFACES }} }
|
37
53
|
has_no_id
|
38
54
|
has_no_get
|
39
55
|
has_no_post
|
@@ -73,6 +73,13 @@ module FacebookAds
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
has_edge :media_titles do |edge|
|
77
|
+
edge.get do |api|
|
78
|
+
api.has_param :bulk_pagination, 'bool'
|
79
|
+
api.has_param :filter, 'object'
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
76
83
|
has_edge :products do |edge|
|
77
84
|
edge.get 'ProductItem' do |api|
|
78
85
|
api.has_param :bulk_pagination, 'bool'
|
@@ -29,10 +29,13 @@ module FacebookAds
|
|
29
29
|
|
30
30
|
field :account, 'AdAccount'
|
31
31
|
field :approximate_count, 'int'
|
32
|
+
field :approximate_count_64bit, 'int'
|
33
|
+
field :delete_time, 'int'
|
32
34
|
field :description, 'string'
|
33
35
|
field :extra_info, 'string'
|
34
36
|
field :id, 'string'
|
35
37
|
field :name, 'string'
|
38
|
+
field :operation_status, 'CustomAudienceStatus'
|
36
39
|
field :permission_for_actions, 'AudiencePermissionForActions'
|
37
40
|
field :run_status, 'string'
|
38
41
|
field :sentence_lines, { list: 'string' }
|
@@ -22,53 +22,157 @@ module FacebookAds
|
|
22
22
|
# UserData is a set of identifiers Facebook can use for targeted attribution
|
23
23
|
class UserData
|
24
24
|
|
25
|
+
# A list of email addresses, in lowercase.
|
26
|
+
# Example: ['joe@eg.com']
|
27
|
+
attr_accessor :emails
|
28
|
+
|
25
29
|
# An email address, in lowercase.
|
26
30
|
# Example: joe@eg.com
|
27
|
-
|
31
|
+
def email
|
32
|
+
@emails ? @emails[0] : nil
|
33
|
+
end
|
34
|
+
def email=(email)
|
35
|
+
@emails = [email]
|
36
|
+
end
|
37
|
+
|
38
|
+
# A list of phone numbers. Include only digits with country code, area code, and number.
|
39
|
+
# Example: ['16505551212']
|
40
|
+
attr_accessor :phones
|
28
41
|
|
29
42
|
# A phone number. Include only digits with country code, area code, and number.
|
30
43
|
# Example: 16505551212
|
31
|
-
|
44
|
+
def phone
|
45
|
+
@phones ? @phones[0] : nil
|
46
|
+
end
|
47
|
+
def phone=(phone)
|
48
|
+
@phones = [phone]
|
49
|
+
end
|
50
|
+
|
51
|
+
# A list of genders, in lowercase.
|
52
|
+
# Example: ['f']
|
53
|
+
attr_accessor :genders
|
32
54
|
|
33
55
|
# Gender, in lowercase. Either f or m.
|
34
|
-
|
56
|
+
def gender
|
57
|
+
@genders ? @genders[0] : nil
|
58
|
+
end
|
59
|
+
def gender=(gender)
|
60
|
+
@genders = [gender]
|
61
|
+
end
|
62
|
+
|
63
|
+
# A list of dates of birth given as year, month, and day.
|
64
|
+
# Format should be 'YYYYMMDD'
|
65
|
+
# Example: ['19971226'] for December 26, 1997.
|
66
|
+
attr_accessor :dates_of_birth
|
35
67
|
|
36
68
|
# A date of birth given as year, month, and day.
|
37
69
|
# Format should be 'YYYYMMDD'
|
38
70
|
# Example: 19971226 for December 26, 1997.
|
39
|
-
|
71
|
+
def date_of_birth
|
72
|
+
@dates_of_birth ? @dates_of_birth[0] : nil
|
73
|
+
end
|
74
|
+
def date_of_birth=(date_of_birth)
|
75
|
+
@dates_of_birth = [date_of_birth]
|
76
|
+
end
|
77
|
+
|
78
|
+
# A list of last names in lowercase.
|
79
|
+
# Example: ['smith']
|
80
|
+
attr_accessor :last_names
|
40
81
|
|
41
82
|
# A last name in lowercase.
|
42
83
|
# Example: smith
|
43
|
-
|
84
|
+
def last_name
|
85
|
+
@last_names ? @last_names[0] : nil
|
86
|
+
end
|
87
|
+
def last_name=(last_name)
|
88
|
+
@last_names = [last_name]
|
89
|
+
end
|
90
|
+
|
91
|
+
# A list of first names in lowercase.
|
92
|
+
# Example: ['joe']
|
93
|
+
attr_accessor :first_names
|
44
94
|
|
45
95
|
# A first name in lowercase.
|
46
96
|
# Example: joe
|
47
|
-
|
97
|
+
def first_name
|
98
|
+
@first_names ? @first_names[0] : nil
|
99
|
+
end
|
100
|
+
def first_name=(first_name)
|
101
|
+
@first_names = [first_name]
|
102
|
+
end
|
103
|
+
|
104
|
+
# A list of cities in lower-case without spaces or punctuation.
|
105
|
+
# Example: ['menlopark']
|
106
|
+
attr_accessor :cities
|
48
107
|
|
49
108
|
# A city in lower-case without spaces or punctuation.
|
50
109
|
# Example: menlopark
|
51
|
-
|
110
|
+
def city
|
111
|
+
@cities ? @cities[0] : nil
|
112
|
+
end
|
113
|
+
def city=(city)
|
114
|
+
@cities = [city]
|
115
|
+
end
|
116
|
+
|
117
|
+
# A list of two-letter country codes in lowercase.
|
118
|
+
# Example: ['us']
|
119
|
+
attr_accessor :country_codes
|
52
120
|
|
53
121
|
# A two-letter country code in lowercase.
|
54
122
|
# Example: us
|
55
|
-
|
123
|
+
def country_code
|
124
|
+
@country_codes ? @country_codes[0] : nil
|
125
|
+
end
|
126
|
+
def country_code=(country_code)
|
127
|
+
@country_codes = [country_code]
|
128
|
+
end
|
129
|
+
|
130
|
+
# A list of two-letter state codes in lowercase.
|
131
|
+
# Example: ['ca']
|
132
|
+
attr_accessor :states
|
56
133
|
|
57
134
|
# A two-letter state code in lowercase.
|
58
135
|
# Example: ca
|
59
|
-
|
136
|
+
def state
|
137
|
+
@states ? @states[0] : nil
|
138
|
+
end
|
139
|
+
def state=(state)
|
140
|
+
@states = [state]
|
141
|
+
end
|
142
|
+
|
143
|
+
# A list of five-digit zip codes for United States.
|
144
|
+
# For other locations, follow each country's standards.
|
145
|
+
# Example: ['94035'] (for United States)
|
146
|
+
attr_accessor :zip_codes
|
60
147
|
|
61
148
|
# A five-digit zip code for United States.
|
62
149
|
# For other locations, follow each country's standards.
|
63
150
|
# Example: 94035 (for United States)
|
64
|
-
|
151
|
+
def zip_code
|
152
|
+
@zip_codes ? @zip_codes[0] : nil
|
153
|
+
end
|
154
|
+
def zip_code=(zip_code)
|
155
|
+
@zip_codes = [zip_code]
|
156
|
+
end
|
157
|
+
|
158
|
+
# A list of unique IDs from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.
|
159
|
+
# In the Offline Conversions API (https://www.facebook.com/business/help/104039186799009),
|
160
|
+
# this is known as extern_id. For more information, see Offline Conversions, Providing External IDs.
|
161
|
+
# If External ID is being sent via other channels, then it should be sent in the same format
|
162
|
+
# via the Conversions API.
|
163
|
+
attr_accessor :external_ids
|
65
164
|
|
66
165
|
# Any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.
|
67
166
|
# In the Offline Conversions API (https://www.facebook.com/business/help/104039186799009),
|
68
167
|
# this is known as extern_id. For more information, see Offline Conversions, Providing External IDs.
|
69
168
|
# If External ID is being sent via other channels, then it should be sent in the same format
|
70
|
-
# via the
|
71
|
-
|
169
|
+
# via the Conversions API.
|
170
|
+
def external_id
|
171
|
+
@external_ids ? @external_ids[0] : nil
|
172
|
+
end
|
173
|
+
def external_id=(external_id)
|
174
|
+
@external_ids = [external_id]
|
175
|
+
end
|
72
176
|
|
73
177
|
# The IP address of the browser corresponding to the event.
|
74
178
|
attr_accessor :client_ip_address
|
@@ -78,13 +182,13 @@ module FacebookAds
|
|
78
182
|
|
79
183
|
# The Facebook click ID value stored in the _fbc browser cookie under your domain.
|
80
184
|
# See Managing fbc and fbp Parameters for how to get this value
|
81
|
-
# (https://developers.facebook.com/docs/marketing-api/facebook-pixel/
|
185
|
+
# (https://developers.facebook.com/docs/marketing-api/facebook-pixel/conversions-api/parameters#fbc),
|
82
186
|
# or generate this value from a fbclid query parameter.
|
83
187
|
attr_accessor :fbc
|
84
188
|
|
85
189
|
# The Facebook browser ID value stored in the _fbp browser cookie under your domain.
|
86
190
|
# See Managing fbc and fbp Parameters for how to get this value
|
87
|
-
# (https://developers.facebook.com/docs/marketing-api/facebook-pixel/
|
191
|
+
# (https://developers.facebook.com/docs/marketing-api/facebook-pixel/conversions-api/parameters#fbc),
|
88
192
|
# or generate this value from a fbclid query parameter.
|
89
193
|
attr_accessor :fbp
|
90
194
|
|
@@ -109,21 +213,32 @@ module FacebookAds
|
|
109
213
|
# The date of birth month.
|
110
214
|
attr_accessor :dobm
|
111
215
|
|
112
|
-
#
|
216
|
+
# The date of birth year.
|
113
217
|
attr_accessor :doby
|
114
218
|
|
115
219
|
#UserData is a set of identifiers Facebook can use for targeted attribution
|
116
220
|
# @param [String] email
|
221
|
+
# @param [Array<String>] emails
|
117
222
|
# @param [String] phone
|
223
|
+
# @param [Array<String>] phones
|
118
224
|
# @param [String] gender
|
225
|
+
# @param [Array<String>] genders
|
119
226
|
# @param [String] date_of_birth
|
227
|
+
# @param [Array<String>] dates_of_births
|
120
228
|
# @param [String] last_name
|
229
|
+
# @param [Array<String>] last_names
|
121
230
|
# @param [String] first_name
|
231
|
+
# @param [Array<String>] first_names
|
122
232
|
# @param [String] city
|
233
|
+
# @param [Array<String>] cities
|
123
234
|
# @param [String] state
|
235
|
+
# @param [Array<String>] states
|
124
236
|
# @param [String] country_code
|
237
|
+
# @param [Array<String>] country_codes
|
125
238
|
# @param [String] zip_code
|
239
|
+
# @param [Array<String>] zip_codes
|
126
240
|
# @param [String] external_id
|
241
|
+
# @param [Array<String>] external_ids
|
127
242
|
# @param [String] client_ip_address
|
128
243
|
# @param [String] client_user_agent
|
129
244
|
# @param [String] fbc
|
@@ -136,44 +251,91 @@ module FacebookAds
|
|
136
251
|
# @param [String] dobd
|
137
252
|
# @param [String] dobm
|
138
253
|
# @param [String] doby
|
139
|
-
def initialize(email: nil, phone: nil, gender: nil,
|
140
|
-
|
141
|
-
|
254
|
+
def initialize(email: nil, emails: nil, phone: nil, phones: nil, gender: nil, genders: nil,
|
255
|
+
date_of_birth: nil, dates_of_birth: nil, last_name: nil, last_names: nil,
|
256
|
+
first_name: nil, first_names: nil, city: nil, cities: nil, state: nil, states: nil,
|
257
|
+
country_code: nil, country_codes: nil, zip_code: nil, zip_codes: nil,
|
258
|
+
external_id: nil, external_ids: nil, client_ip_address: nil,
|
142
259
|
client_user_agent: nil, fbc: nil, fbp: nil, subscription_id: nil, lead_id: nil,
|
143
260
|
f5first: nil, f5last: nil, fi: nil, dobd: nil, dobm: nil, doby: nil)
|
261
|
+
validate_constructor_values(emails, email, 'emails', 'email')
|
262
|
+
validate_constructor_values(phones, phone, 'phones', 'phone')
|
263
|
+
validate_constructor_values(genders, gender, 'genders', 'gender')
|
264
|
+
validate_constructor_values(dates_of_birth, date_of_birth, 'dates_of_birth', 'date_of_birth')
|
265
|
+
validate_constructor_values(first_names, first_name, 'first_names', 'first_name')
|
266
|
+
validate_constructor_values(last_names, last_name, 'last_names', 'last_name')
|
267
|
+
validate_constructor_values(cities, city, 'cities', 'city')
|
268
|
+
validate_constructor_values(country_codes, country_code, 'country_codes', 'country_code')
|
269
|
+
validate_constructor_values(states, state, 'states', 'state')
|
270
|
+
validate_constructor_values(zip_codes, zip_code, 'zip_codes', 'zip_code')
|
271
|
+
validate_constructor_values(external_ids, external_id, 'external_ids', 'external_id')
|
272
|
+
|
144
273
|
unless email.nil?
|
145
274
|
self.email = email
|
146
275
|
end
|
276
|
+
unless emails.nil?
|
277
|
+
self.emails = emails
|
278
|
+
end
|
147
279
|
unless phone.nil?
|
148
280
|
self.phone = phone
|
149
281
|
end
|
282
|
+
unless phones.nil?
|
283
|
+
self.phones = phones
|
284
|
+
end
|
150
285
|
unless gender.nil?
|
151
286
|
self.gender = gender
|
152
287
|
end
|
288
|
+
unless genders.nil?
|
289
|
+
self.genders = genders
|
290
|
+
end
|
153
291
|
unless date_of_birth.nil?
|
154
292
|
self.date_of_birth = date_of_birth
|
155
293
|
end
|
294
|
+
unless dates_of_birth.nil?
|
295
|
+
self.dates_of_birth = dates_of_birth
|
296
|
+
end
|
156
297
|
unless last_name.nil?
|
157
298
|
self.last_name = last_name
|
158
299
|
end
|
300
|
+
unless last_names.nil?
|
301
|
+
self.last_names = last_names
|
302
|
+
end
|
159
303
|
unless first_name.nil?
|
160
304
|
self.first_name = first_name
|
161
305
|
end
|
306
|
+
unless first_names.nil?
|
307
|
+
self.first_names = first_names
|
308
|
+
end
|
162
309
|
unless city.nil?
|
163
310
|
self.city = city
|
164
311
|
end
|
312
|
+
unless cities.nil?
|
313
|
+
self.cities = cities
|
314
|
+
end
|
165
315
|
unless state.nil?
|
166
316
|
self.state = state
|
167
317
|
end
|
318
|
+
unless states.nil?
|
319
|
+
self.states = states
|
320
|
+
end
|
168
321
|
unless country_code.nil?
|
169
322
|
self.country_code = country_code
|
170
323
|
end
|
324
|
+
unless country_codes.nil?
|
325
|
+
self.country_codes = country_codes
|
326
|
+
end
|
171
327
|
unless zip_code.nil?
|
172
328
|
self.zip_code = zip_code
|
173
329
|
end
|
330
|
+
unless zip_codes.nil?
|
331
|
+
self.zip_codes = zip_codes
|
332
|
+
end
|
174
333
|
unless external_id.nil?
|
175
334
|
self.external_id = external_id
|
176
335
|
end
|
336
|
+
unless external_ids.nil?
|
337
|
+
self.external_ids = external_ids
|
338
|
+
end
|
177
339
|
unless client_ip_address.nil?
|
178
340
|
self.client_ip_address = client_ip_address
|
179
341
|
end
|
@@ -220,48 +382,70 @@ module FacebookAds
|
|
220
382
|
# convert string to symbol for hash key
|
221
383
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
222
384
|
|
223
|
-
if attributes.has_key?(:'
|
224
|
-
self.
|
385
|
+
if attributes.has_key?(:'emails')
|
386
|
+
self.emails = attributes[:'emails']
|
387
|
+
elsif attributes.has_key?(:'email')
|
388
|
+
self.emails = [attributes[:'email']]
|
225
389
|
end
|
226
390
|
|
227
|
-
if attributes.has_key?(:'
|
228
|
-
self.
|
391
|
+
if attributes.has_key?(:'phones')
|
392
|
+
self.phones = attributes[:'phones']
|
393
|
+
elsif attributes.has_key?(:'phone')
|
394
|
+
self.phones = [attributes[:'phone']]
|
229
395
|
end
|
230
396
|
|
231
|
-
if attributes.has_key?(:'
|
232
|
-
self.
|
397
|
+
if attributes.has_key?(:'genders')
|
398
|
+
self.genders = attributes[:'genders']
|
399
|
+
elsif attributes.has_key?(:'gender')
|
400
|
+
self.genders = [attributes[:'gender']]
|
233
401
|
end
|
234
402
|
|
235
|
-
if attributes.has_key?(:'
|
236
|
-
self.
|
403
|
+
if attributes.has_key?(:'dates_of_birth')
|
404
|
+
self.dates_of_birth = attributes[:'dates_of_birth']
|
405
|
+
elsif attributes.has_key?(:'date_of_birth')
|
406
|
+
self.dates_of_birth = [attributes[:'date_of_birth']]
|
237
407
|
end
|
238
408
|
|
239
|
-
if attributes.has_key?(:'
|
240
|
-
self.
|
409
|
+
if attributes.has_key?(:'last_names')
|
410
|
+
self.last_names = attributes[:'last_names']
|
411
|
+
elsif attributes.has_key?(:'last_name')
|
412
|
+
self.last_names = [attributes[:'last_name']]
|
241
413
|
end
|
242
414
|
|
243
|
-
if attributes.has_key?(:'
|
244
|
-
self.
|
415
|
+
if attributes.has_key?(:'first_names')
|
416
|
+
self.first_names = attributes[:'first_names']
|
417
|
+
elsif attributes.has_key?(:'first_name')
|
418
|
+
self.first_names = [attributes[:'first_name']]
|
245
419
|
end
|
246
420
|
|
247
|
-
if attributes.has_key?(:'
|
248
|
-
self.
|
421
|
+
if attributes.has_key?(:'cities')
|
422
|
+
self.cities = attributes[:'cities']
|
423
|
+
elsif attributes.has_key?(:'city')
|
424
|
+
self.cities = [attributes[:'city']]
|
249
425
|
end
|
250
426
|
|
251
|
-
if attributes.has_key?(:'
|
252
|
-
self.
|
427
|
+
if attributes.has_key?(:'country_codes')
|
428
|
+
self.country_codes = attributes[:'country_codes']
|
429
|
+
elsif attributes.has_key?(:'country_code')
|
430
|
+
self.country_codes = [attributes[:'country_code']]
|
253
431
|
end
|
254
432
|
|
255
|
-
if attributes.has_key?(:'
|
256
|
-
self.
|
433
|
+
if attributes.has_key?(:'states')
|
434
|
+
self.states = attributes[:'states']
|
435
|
+
elsif attributes.has_key?(:'state')
|
436
|
+
self.states = [attributes[:'state']]
|
257
437
|
end
|
258
438
|
|
259
|
-
if attributes.has_key?(:'
|
260
|
-
self.
|
439
|
+
if attributes.has_key?(:'zip_codes')
|
440
|
+
self.zip_codes = attributes[:'zip_codes']
|
441
|
+
elsif attributes.has_key?(:'zip_code')
|
442
|
+
self.zip_codes = [attributes[:'zip_code']]
|
261
443
|
end
|
262
444
|
|
263
|
-
if attributes.has_key?(:'
|
264
|
-
self.
|
445
|
+
if attributes.has_key?(:'external_ids')
|
446
|
+
self.external_ids = attributes[:'external_ids']
|
447
|
+
elsif attributes.has_key?(:'external_id')
|
448
|
+
self.external_ids = [attributes[:'external_id']]
|
265
449
|
end
|
266
450
|
|
267
451
|
if attributes.has_key?(:'client_ip_address')
|
@@ -313,17 +497,17 @@ module FacebookAds
|
|
313
497
|
def ==(o)
|
314
498
|
return true if self.equal?(o)
|
315
499
|
self.class == o.class &&
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
500
|
+
emails == o.emails &&
|
501
|
+
phones == o.phones &&
|
502
|
+
genders == o.genders &&
|
503
|
+
dates_of_birth == o.dates_of_birth &&
|
504
|
+
last_names == o.last_names &&
|
505
|
+
first_names == o.first_names &&
|
506
|
+
cities == o.cities &&
|
507
|
+
country_codes == o.country_codes &&
|
508
|
+
states == o.states &&
|
509
|
+
zip_codes == o.zip_codes &&
|
510
|
+
external_ids == o.external_ids &&
|
327
511
|
client_ip_address == o.client_ip_address &&
|
328
512
|
client_user_agent == o.client_user_agent &&
|
329
513
|
fbc == o.fbc &&
|
@@ -347,17 +531,17 @@ module FacebookAds
|
|
347
531
|
# @return [Fixnum] Hash code
|
348
532
|
def hash
|
349
533
|
[
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
534
|
+
emails,
|
535
|
+
phones,
|
536
|
+
genders,
|
537
|
+
dates_of_birth,
|
538
|
+
last_names,
|
539
|
+
first_names,
|
540
|
+
cities,
|
541
|
+
country_codes,
|
542
|
+
states,
|
543
|
+
zip_codes,
|
544
|
+
external_ids,
|
361
545
|
client_ip_address,
|
362
546
|
client_user_agent,
|
363
547
|
fbc,
|
@@ -378,38 +562,38 @@ module FacebookAds
|
|
378
562
|
# @return [String] String presentation of the object
|
379
563
|
def to_s
|
380
564
|
hash = {}
|
381
|
-
unless
|
382
|
-
hash['
|
565
|
+
unless emails.nil?
|
566
|
+
hash['emails'] = emails
|
383
567
|
end
|
384
|
-
unless
|
385
|
-
hash['
|
568
|
+
unless phones.nil?
|
569
|
+
hash['phones'] = phones
|
386
570
|
end
|
387
|
-
unless
|
388
|
-
hash['
|
571
|
+
unless genders.nil?
|
572
|
+
hash['genders'] = genders
|
389
573
|
end
|
390
|
-
unless
|
391
|
-
hash['
|
574
|
+
unless dates_of_birth.nil?
|
575
|
+
hash['dates_of_birth'] = dates_of_birth
|
392
576
|
end
|
393
|
-
unless
|
394
|
-
hash['
|
577
|
+
unless last_names.nil?
|
578
|
+
hash['last_names'] = last_names
|
395
579
|
end
|
396
|
-
unless
|
397
|
-
hash['
|
580
|
+
unless first_names.nil?
|
581
|
+
hash['first_names'] = first_names
|
398
582
|
end
|
399
|
-
unless
|
400
|
-
hash['
|
583
|
+
unless cities.nil?
|
584
|
+
hash['cities'] = cities
|
401
585
|
end
|
402
|
-
unless
|
403
|
-
hash['
|
586
|
+
unless country_codes.nil?
|
587
|
+
hash['country_codes'] = country_codes
|
404
588
|
end
|
405
|
-
unless
|
406
|
-
hash['
|
589
|
+
unless states.nil?
|
590
|
+
hash['states'] = states
|
407
591
|
end
|
408
|
-
unless
|
409
|
-
hash['
|
592
|
+
unless zip_codes.nil?
|
593
|
+
hash['zip_codes'] = zip_codes
|
410
594
|
end
|
411
|
-
unless
|
412
|
-
hash['
|
595
|
+
unless external_ids.nil?
|
596
|
+
hash['external_ids'] = external_ids
|
413
597
|
end
|
414
598
|
unless client_ip_address.nil?
|
415
599
|
hash['client_ip_address'] = client_ip_address
|
@@ -455,37 +639,37 @@ module FacebookAds
|
|
455
639
|
def normalize
|
456
640
|
hash = {}
|
457
641
|
unless email.nil?
|
458
|
-
hash['em'] = FacebookAds::ServerSide::Util.
|
642
|
+
hash['em'] = FacebookAds::ServerSide::Util.normalize_array(emails, 'em')
|
459
643
|
end
|
460
644
|
unless phone.nil?
|
461
|
-
hash['ph'] = FacebookAds::ServerSide::Util.
|
645
|
+
hash['ph'] = FacebookAds::ServerSide::Util.normalize_array(phones, 'ph')
|
462
646
|
end
|
463
647
|
unless gender.nil?
|
464
|
-
hash['ge'] = FacebookAds::ServerSide::Util.
|
648
|
+
hash['ge'] = FacebookAds::ServerSide::Util.normalize_array(genders, 'ge')
|
465
649
|
end
|
466
650
|
unless date_of_birth.nil?
|
467
|
-
hash['db'] = FacebookAds::ServerSide::Util.
|
651
|
+
hash['db'] = FacebookAds::ServerSide::Util.normalize_array(dates_of_birth, 'db')
|
468
652
|
end
|
469
653
|
unless last_name.nil?
|
470
|
-
hash['ln'] = FacebookAds::ServerSide::Util.
|
654
|
+
hash['ln'] = FacebookAds::ServerSide::Util.normalize_array(last_names, 'ln')
|
471
655
|
end
|
472
656
|
unless first_name.nil?
|
473
|
-
hash['fn'] = FacebookAds::ServerSide::Util.
|
657
|
+
hash['fn'] = FacebookAds::ServerSide::Util.normalize_array(first_names, 'fn')
|
474
658
|
end
|
475
659
|
unless city.nil?
|
476
|
-
hash['ct'] = FacebookAds::ServerSide::Util.
|
660
|
+
hash['ct'] = FacebookAds::ServerSide::Util.normalize_array(cities, 'ct')
|
477
661
|
end
|
478
662
|
unless country_code.nil?
|
479
|
-
hash['country'] = FacebookAds::ServerSide::Util.
|
663
|
+
hash['country'] = FacebookAds::ServerSide::Util.normalize_array(country_codes, 'country')
|
480
664
|
end
|
481
665
|
unless state.nil?
|
482
|
-
hash['st'] = FacebookAds::ServerSide::Util.
|
666
|
+
hash['st'] = FacebookAds::ServerSide::Util.normalize_array(states, 'st')
|
483
667
|
end
|
484
668
|
unless zip_code.nil?
|
485
|
-
hash['zp'] = FacebookAds::ServerSide::Util.
|
669
|
+
hash['zp'] = FacebookAds::ServerSide::Util.normalize_array(zip_codes, 'zp')
|
486
670
|
end
|
487
671
|
unless external_id.nil?
|
488
|
-
hash['external_id'] =
|
672
|
+
hash['external_id'] = external_ids
|
489
673
|
end
|
490
674
|
unless client_ip_address.nil?
|
491
675
|
hash['client_ip_address'] = client_ip_address
|
@@ -523,7 +707,17 @@ module FacebookAds
|
|
523
707
|
unless doby.nil?
|
524
708
|
hash['doby'] = FacebookAds::ServerSide::Util.normalize(doby, 'doby')
|
525
709
|
end
|
526
|
-
hash
|
710
|
+
hash.select{|k, v| !v.nil?}
|
711
|
+
end
|
712
|
+
|
713
|
+
def validate_constructor_values(multi_value, single_value, multi_string, single_string)
|
714
|
+
if !multi_value.nil? && !single_value.nil?
|
715
|
+
raise ArgumentError.new(
|
716
|
+
'Cannot set both %s and %s parameters via constructor. ' % [
|
717
|
+
multi_string, single_string
|
718
|
+
] + 'Please set either the multi or single parameter, not both.'
|
719
|
+
)
|
720
|
+
end
|
527
721
|
end
|
528
722
|
end
|
529
723
|
end
|