Skip to content

Commit

Permalink
Auto-generated ruby SDK code update
Browse files Browse the repository at this point in the history
Summary: ignore-conflict-markers

Reviewed By: jingping2015

Differential Revision: D28044972

fbshipit-source-id: b88abe21
  • Loading branch information
Business SDK authored and facebook-github-bot committed Apr 28, 2021
1 parent eff24b6 commit 56da015
Show file tree
Hide file tree
Showing 60 changed files with 756 additions and 77 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.

## Unreleased

## v0.10.0.1


### Added
- Support for sending multiple values for certain UserData parameters to Conversions API.

Expand Down Expand Up @@ -98,3 +101,4 @@ All notable changes to this project will be documented in this file.
## v0.3.3.0
### Changed
- Graph API call upgrade to [v3.3](https://developers.facebook.com/docs/graph-api/changelog/version3.3)

4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostAdSetCreateCpa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
name: 'A CPA Ad Set',
campaign_id: '<adCampaignLinkClicksID>',
daily_budget: '5000',
start_time: '2021-03-03T11:39:24-0800',
end_time: '2021-03-10T11:39:24-0800',
start_time: '2021-04-25T09:42:56-0700',
end_time: '2021-05-02T09:42:56-0700',
billing_event: 'IMPRESSIONS',
optimization_goal: 'REACH',
bid_amount: '1000',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
name: 'A CPA Ad Set optimized for App Events',
campaign_id: '<adCampaignAppInstallsID>',
daily_budget: '300',
start_time: '2021-03-03T11:40:19-0800',
end_time: '2021-03-10T11:40:19-0800',
start_time: '2021-04-25T09:43:53-0700',
end_time: '2021-05-02T09:43:53-0700',
billing_event: 'IMPRESSIONS',
optimization_goal: 'OFFSITE_CONVERSIONS',
bid_amount: '100',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostCreateAdSet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
adsets = ad_account.adsets.create({
name: 'My First AdSet',
lifetime_budget: '20000',
start_time: '2021-03-03T11:38:37-0800',
end_time: '2021-03-10T11:38:37-0800',
start_time: '2021-04-25T09:42:08-0700',
end_time: '2021-05-02T09:42:08-0700',
campaign_id: '<adCampaignLinkClicksID>',
bid_amount: '500',
billing_event: 'IMPRESSIONS',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostDailyBudget20.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
adsets = ad_account.adsets.create({
name: 'My First Adset',
daily_budget: '2000',
start_time: '2021-02-24T11:39:51-0800',
end_time: '2021-03-03T11:39:51-0800',
start_time: '2021-04-18T09:43:24-0700',
end_time: '2021-04-25T09:43:24-0700',
campaign_id: '<adCampaignLinkClicksID>',
bid_amount: '100',
billing_event: 'LINK_CLICKS',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
adsets = ad_account.adsets.create({
name: 'My First Adset',
lifetime_budget: '20000',
start_time: '2021-02-24T11:40:01-0800',
end_time: '2021-03-06T11:40:01-0800',
start_time: '2021-04-18T09:43:34-0700',
end_time: '2021-04-28T09:43:34-0700',
campaign_id: '<adCampaignLinkClicksID>',
bid_amount: '100',
billing_event: 'LINK_CLICKS',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostOfferClaim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
adsets = ad_account.adsets.create({
name: 'My Offer Claim AdSet',
lifetime_budget: '56000',
start_time: '2021-02-24T11:39:42-0800',
end_time: '2021-03-03T11:39:42-0800',
start_time: '2021-04-18T09:43:15-0700',
end_time: '2021-04-25T09:43:15-0700',
campaign_id: '<adCampaignLinkClicksID>',
billing_event: 'LINK_CLICKS',
optimization_goal: 'LINK_CLICKS',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostOptimizePostEngagement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
adsets = ad_account.adsets.create({
name: 'My First Adset',
lifetime_budget: '20000',
start_time: '2021-02-24T11:40:10-0800',
end_time: '2021-03-06T11:40:10-0800',
start_time: '2021-04-18T09:43:43-0700',
end_time: '2021-04-28T09:43:43-0700',
campaign_id: '<adCampaignLinkClicksID>',
bid_amount: '500',
billing_event: 'IMPRESSIONS',
Expand Down
2 changes: 1 addition & 1 deletion examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
ad = FacebookAds::Ad.get(id)
leadss = ad.leads({
fields: { },
filtering: [{'field':'time_created','operator':'GREATER_THAN','value':1613591600}],
filtering: [{'field':'time_created','operator':'GREATER_THAN','value':1618160236}],
})
2 changes: 1 addition & 1 deletion examples/AdsPixelEventsPost.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

ads_pixel = FacebookAds::AdsPixel.get(id)
events = ads_pixel.events.create({
data: [{'event_name':'PageView','event_time':1614195236,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}],
data: [{'event_name':'PageView','event_time':1618763836,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}],
})
7 changes: 7 additions & 0 deletions examples/AdsPixelEventsPostCustom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@
fbp: 'fb.1.1558571054389.1098115397'
)

content = FacebookAds::ServerSide::Content.new(
product_id: 'product123',
quantity: 1,
delivery_category: 'home_delivery'
)

custom_data = FacebookAds::ServerSide::CustomData.new(
contents: [content],
currency: 'usd',
value: 123.45
)
Expand Down
17 changes: 2 additions & 15 deletions lib/facebook_ads/ad_objects/ad_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -640,13 +640,6 @@ class AdAccount < AdObject
end
end

has_edge :audiencereplace do |edge|
edge.post do |api|
api.has_param :payload, 'object'
api.has_param :session, 'object'
end
end

has_edge :block_list_drafts do |edge|
edge.post 'AdAccount' do |api|
api.has_param :publisher_urls_file, 'file'
Expand Down Expand Up @@ -690,7 +683,9 @@ class AdAccount < AdObject
api.has_param :special_ad_categories, { list: { enum: -> { Campaign::SPECIAL_AD_CATEGORIES }} }
api.has_param :special_ad_category_country, { list: { enum: -> { Campaign::SPECIAL_AD_CATEGORY_COUNTRY }} }
api.has_param :spend_cap, 'int'
api.has_param :start_time, 'datetime'
api.has_param :status, { enum: -> { Campaign::STATUS }}
api.has_param :stop_time, 'datetime'
api.has_param :topline_id, 'string'
api.has_param :upstream_events, 'hash'
end
Expand Down Expand Up @@ -748,8 +743,6 @@ class AdAccount < AdObject
api.has_param :event_sources, { list: 'hash' }
api.has_param :exclusions, { list: 'object' }
api.has_param :inclusions, { list: 'object' }
api.has_param :is_household, 'bool'
api.has_param :is_household_exclusion, 'bool'
api.has_param :is_snapshot, 'bool'
api.has_param :is_value_based, 'bool'
api.has_param :list_of_accounts, { list: 'int' }
Expand All @@ -767,9 +760,7 @@ class AdAccount < AdObject
api.has_param :rev_share_policy_id, 'int'
api.has_param :rule, 'string'
api.has_param :rule_aggregation, 'string'
api.has_param :seed_audience, 'int'
api.has_param :subtype, { enum: -> { CustomAudience::SUBTYPE }}
api.has_param :tags, { list: 'string' }
api.has_param :video_group_ids, { list: 'string' }
end
end
Expand Down Expand Up @@ -930,18 +921,14 @@ class AdAccount < AdObject
api.has_param :event_sources, { list: 'hash' }
api.has_param :exclusions, { list: 'object' }
api.has_param :inclusions, { list: 'object' }
api.has_param :is_household, 'bool'
api.has_param :is_household_exclusion, 'bool'
api.has_param :is_snapshot, 'bool'
api.has_param :is_value_based, 'bool'
api.has_param :name, 'string'
api.has_param :opt_out_link, 'string'
api.has_param :parent_audience_id, 'int'
api.has_param :product_set_id, 'string'
api.has_param :rev_share_policy_id, 'int'
api.has_param :seed_audience, 'int'
api.has_param :subtype, { enum: -> { AdAccount::SUBTYPE }}
api.has_param :tags, { list: 'string' }
end
end

Expand Down
2 changes: 2 additions & 0 deletions lib/facebook_ads/ad_objects/ad_account_targeting_unified.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class AdAccountTargetingUnified < AdObject
"effective_facebook_positions",
"effective_instagram_positions",
"effective_messenger_positions",
"effective_oculus_positions",
"effective_publisher_platforms",
"effective_whatsapp_positions",
"engagement_specs",
Expand Down Expand Up @@ -153,6 +154,7 @@ class AdAccountTargetingUnified < AdObject
"mobile_device_model",
"moms",
"net_worth",
"oculus_positions",
"office_type",
"page_types",
"place_page_set_ids",
Expand Down
14 changes: 7 additions & 7 deletions lib/facebook_ads/ad_objects/ad_creative.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ module FacebookAds
# pull request for this class.

class AdCreative < AdObject
APPLINK_TREATMENT = [
"deeplink_with_appstore_fallback",
"deeplink_with_web_fallback",
"web_only",
]

CALL_TO_ACTION_TYPE = [
"ADD_TO_CART",
"APPLY_NOW",
Expand Down Expand Up @@ -123,6 +117,12 @@ class AdCreative < AdObject
"WITH_ISSUES",
]

APPLINK_TREATMENT = [
"deeplink_with_appstore_fallback",
"deeplink_with_web_fallback",
"web_only",
]

AUTHORIZATION_CATEGORY = [
"NONE",
"POLITICAL",
Expand Down Expand Up @@ -160,7 +160,7 @@ class AdCreative < AdObject
field :account_id, 'string'
field :actor_id, 'string'
field :adlabels, { list: 'AdLabel' }
field :applink_treatment, { enum: -> { APPLINK_TREATMENT }}
field :applink_treatment, 'string'
field :asset_feed_spec, 'AdAssetFeedSpec'
field :authorization_category, 'string'
field :auto_update, 'bool'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module FacebookAds

class AdCreativePortraitCustomizations < AdObject

field :carousel_delivery_mode, 'string'
field :specifications, { list: 'object' }
has_no_id
has_no_get
Expand Down
1 change: 1 addition & 0 deletions lib/facebook_ads/ad_objects/ad_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class AdPreview < AdObject
"AUDIENCE_NETWORK_REWARDED_VIDEO",
"DESKTOP_FEED_STANDARD",
"FACEBOOK_STORY_MOBILE",
"FACEBOOK_STORY_STICKER_MOBILE",
"INSTAGRAM_EXPLORE_CONTEXTUAL",
"INSTAGRAM_EXPLORE_IMMERSIVE",
"INSTAGRAM_REELS",
Expand Down
3 changes: 1 addition & 2 deletions lib/facebook_ads/ad_objects/ad_rule_execution_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ class AdRuleExecutionSpec < AdObject

field :execution_options, { list: 'AdRuleExecutionOptions' }
field :execution_type, { enum: -> { EXECUTION_TYPE }}
has_no_id
has_no_get
field :id, 'string'
has_no_post
has_no_delete

Expand Down
8 changes: 8 additions & 0 deletions lib/facebook_ads/ad_objects/ad_study.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class AdStudy < AdObject
field :cooldown_start_time, 'datetime'
field :created_by, 'User'
field :created_time, 'datetime'
field :datasets_information, { list: 'string' }
field :description, 'string'
field :end_time, 'datetime'
field :id, 'string'
Expand All @@ -60,6 +61,13 @@ class AdStudy < AdObject
edge.get 'AdStudyCell'
end

has_edge :instances do |edge|
edge.get 'PrivateLiftStudyInstance'
edge.post 'PrivateLiftStudyInstance' do |api|
api.has_param :breakdown_key, 'hash'
end
end

has_edge :objectives do |edge|
edge.get 'AdStudyObjective'
end
Expand Down
2 changes: 2 additions & 0 deletions lib/facebook_ads/ad_objects/ad_study_objective.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ module FacebookAds

class AdStudyObjective < AdObject
TYPE = [
"AEP_CONVERSION",
"BRAND",
"BRANDLIFT",
"FTL",
"MAE",
"MAI",
"MPC_CONVERSION",
"NONSALES",
"PARTNER",
"SALES",
Expand Down
20 changes: 15 additions & 5 deletions lib/facebook_ads/ad_objects/ad_video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class AdVideo < AdObject
"APP_REVIEW_SCREENCAST",
"ATLAS_VIDEO",
"AUDIO_BROADCAST",
"BELL_POLL",
"BRAND_EQUITY_POLL_VIDEO",
"BROADCAST",
"CANDIDATE_VIDEOS",
"CANVAS",
Expand All @@ -48,6 +46,7 @@ class AdVideo < AdObject
"CONTAINED_POST_ATTACHMENT",
"CONTAINED_POST_AUDIO_BROADCAST",
"CONTAINED_POST_BROADCAST",
"CONTAINED_POST_COPYRIGHT_REFERENCE_BROADCAST",
"COPYRIGHT_REFERENCE_BROADCAST",
"COPYRIGHT_REFERENCE_VIDEO",
"CULTURAL_MOMENT_DEPRECATED",
Expand Down Expand Up @@ -77,9 +76,11 @@ class AdVideo < AdObject
"GOODWILL_VIDEO_SHARE",
"GOODWILL_VIDEO_TOKEN_REQUIRED",
"GROUP_POST",
"HACK_TV",
"HEURISTIC_CLUSTER_VIDEO",
"HEURISTIC_PREVIEW",
"HIGHLIGHT_CLIP_VIDEO",
"HUDDLE_BROADCAST",
"IG_REELS_XPV",
"IG_STORIES_READER",
"INSPIRATION_VIDEO",
Expand All @@ -88,6 +89,7 @@ class AdVideo < AdObject
"INSTANT_ARTICLE",
"INSTANT_GAME_CLIP",
"ISSUE_MODULE",
"JOBS_VISUAL_INTRO_ENTRY",
"JOB_APPLICATION_VIDEO",
"JOB_OPENING_VIDEO",
"KOTOTORO",
Expand All @@ -99,7 +101,6 @@ class AdVideo < AdObject
"LOOK_NOW_DEPRECATED",
"MARKETPLACE_LISTING_VIDEO",
"MARKETPLACE_PRE_RECORDED_VIDEO",
"MOMENTS_VIDEO",
"NEO_ASYNC_GAME_VIDEO",
"NO_STORY",
"NO_STORY_WITH_ENTPOST",
Expand All @@ -109,13 +110,17 @@ class AdVideo < AdObject
"PAGES_COVER_VIDEO",
"PAGE_REVIEW_SCREENCAST",
"PAGE_SLIDESHOW_VIDEO",
"PARTNER_DIRECTORY_BRAND_MEDIA",
"PIXELCLOUD",
"PODCAST_RSS",
"PODCAST_VOICES",
"PREMIERE_SOURCE",
"PREMIUM_MUSIC_VIDEO_NO_NEWSFEED_STORY",
"PREMIUM_MUSIC_VIDEO_WITH_NEWSFEED_STORY",
"PRIVATE_GALLERY_VIDEO",
"PRODUCT_VIDEO",
"PROFILE_COVER_VIDEO",
"PROFILE_INTRO_CARD",
"PROFILE_TO_PAGE_UPLOADED_VIDEO",
"PROFILE_VIDEO",
"PROTON",
"QUICK_PROMOTION",
Expand All @@ -127,7 +132,9 @@ class AdVideo < AdObject
"SLIDESHOW_SHAKR",
"SLIDESHOW_VARIATION_VIDEO",
"SOTTO_CONTENT",
"SOUNDBITES_VIDEO",
"SOUND_PLATFORM_STREAM",
"SRT_ATTACHMENT",
"STORIES_VIDEO",
"STORYLINE",
"STORYLINE_WITH_EXTERNAL_MUSIC",
Expand All @@ -137,7 +144,10 @@ class AdVideo < AdObject
"TAROT_DIGEST",
"TEMP_MULTIMEDIA_POST",
"UNLISTED",
"UNLISTED_HACK_TV",
"UNLISTED_OCULUS",
"VIDEO_COMMENT",
"VIDEO_COMPOSITION_VARIATION",
"VIDEO_CREATIVE_EDITOR_AUTOGEN_AD_VIDEO",
"VIDEO_SUPERRES",
"VU_GENERATED_VIDEO",
Expand Down Expand Up @@ -241,7 +251,7 @@ class AdVideo < AdObject
field :live_audience_count, 'int'
field :live_status, 'string'
field :music_video_copyright, 'MusicVideoCopyright'
field :permalink_url, 'string'
field :permalink_url, 'object'
field :picture, 'string'
field :place, 'Place'
field :premiere_living_room_status, 'string'
Expand Down
Loading

0 comments on commit 56da015

Please sign in to comment.