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: stcheng

Differential Revision: D53020110

fbshipit-source-id: 9d871e79de6211759624408c8efafcb53e2ad041
  • Loading branch information
generatedunixname89002005295453 authored and facebook-github-bot committed Jan 23, 2024
1 parent c6231ec commit e761217
Show file tree
Hide file tree
Showing 37 changed files with 196 additions and 71 deletions.
2 changes: 1 addition & 1 deletion examples/PagePostsEdge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
end

page = FacebookAds::Page.get(id)
posts = page.posts({
postss = page.posts({
fields: { },
})
2 changes: 1 addition & 1 deletion examples/PagePostsEdgePagePostCreateCarousel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
end

page = FacebookAds::Page.get(id)
posts = page.posts({
postss = page.posts({
fields: { },
message: 'Browse our latest products',
published: '0',
Expand Down
12 changes: 12 additions & 0 deletions lib/facebook_ads/ad_objects/ad_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ class AdAccount < AdObject
"ZAR",
]

PERMITTED_TASKS = [
"AA_ANALYZE",
"ADVERTISE",
"ANALYZE",
"DRAFT",
"MANAGE",
]

TASKS = [
"AA_ANALYZE",
"ADVERTISE",
Expand Down Expand Up @@ -629,6 +637,10 @@ class AdAccount < AdObject
api.has_param :business, 'string'
end
edge.get 'Business'
edge.post 'AdAccount' do |api|
api.has_param :business, 'string'
api.has_param :permitted_tasks, { list: { enum: -> { AdAccount::PERMITTED_TASKS }} }
end
end

has_edge :applications do |edge|
Expand Down
2 changes: 2 additions & 0 deletions lib/facebook_ads/ad_objects/ad_account_ad_rules_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class AdAccountAdRulesHistory < AdObject
"CHANGED_BUDGET",
"EMAIL",
"ENABLE_ADVANTAGE_PLUS_CREATIVE",
"ENABLE_ADVANTAGE_PLUS_PLACEMENTS",
"ENABLE_AUTOFLOW",
"ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION",
"ENDPOINT_PINGED",
"ERROR",
"FACEBOOK_NOTIFICATION_SENT",
Expand Down
7 changes: 7 additions & 0 deletions lib/facebook_ads/ad_objects/ad_account_ad_volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ class AdAccountAdVolume < AdObject
"ACO_TOGGLE",
"ADS_REPORTING",
"ADVANCED_CAMPAIGN_BUDGET",
"ADVANTAGE_APP_CAMPAIGN",
"ADVANTAGE_CUSTOM_AUDIENCE",
"ADVANTAGE_CUSTOM_AUDIENCE_UPSELL",
"ADVANTAGE_DETAILED_TARGETING",
"ADVANTAGE_LOOKALIKE_AUDIENCE",
"ADVANTAGE_PLUS_AUDIENCE",
"ADVANTAGE_PLUS_AUDIENCE_FRICTION",
"ADVANTAGE_PLUS_AUDIENCE_TOGGLE",
"ADVANTAGE_PLUS_CREATIVE",
"ADVANTAGE_PLUS_CREATIVE_CATALOG",
"ADVANTAGE_PLUS_PLACEMENTS_FRICTION",
"ADVANTAGE_SHOPPING_CAMPAIGN",
"ADVANTAGE_SHOPPING_CAMPAIGN_FRAGMENTATION",
"AD_OBJECTIVE",
Expand Down Expand Up @@ -76,6 +81,7 @@ class AdAccountAdVolume < AdObject
"GUIDANCE_CENTER_CODE_GEN",
"HIGH_COST",
"HISTORICAL_BENCHMARK",
"IG_MULTI_ADS",
"LEARNING_LIMITED",
"LEARNING_PAUSE_FRICTION",
"LEARNING_PHASE_BUDGET_EDITS",
Expand Down Expand Up @@ -107,6 +113,7 @@ class AdAccountAdVolume < AdObject
"SIX_PLUS_MANUAL_PLACEMENTS",
"SPEND_LIMIT",
"SYD_TEST_MODE",
"TAILORED_LEAD_AD_CAMPAIGN",
"TOP_ADSETS_WITH_ADS_UNDER_CAP",
"TOP_CAMPAIGNS_WITH_ADS_UNDER_CAP",
"TWO_P_GUIDANCE_CARD_AAA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ module FacebookAds
class AdAccountBusinessConstraints < AdObject

field :audience_controls, 'object'
field :campaigns_with_error, { list: 'string' }
field :placement_controls, 'object'
field :status, 'string'
has_no_id
has_no_get
has_no_post
Expand Down
1 change: 1 addition & 0 deletions lib/facebook_ads/ad_objects/ad_creative.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class AdCreative < AdObject
AUTHORIZATION_CATEGORY = [
"NONE",
"POLITICAL",
"POLITICAL_WITH_DIGITALLY_CREATED_MEDIA",
]

CATEGORIZATION_CRITERIA = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class AdCreativeBrandedContentAds < AdObject
field :instagram_boost_post_access_token, 'string'
field :is_mca_internal, 'bool'
field :partners, { list: 'AdCreativeBrandedContentAdsPartners' }
field :promoted_page_id, 'string'
field :ui_version, 'int'
has_no_id
has_no_get
Expand Down
2 changes: 2 additions & 0 deletions lib/facebook_ads/ad_objects/ad_promoted_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ class AdPromotedObject < AdObject
field :place_page_set_id, 'string'
field :product_catalog_id, 'string'
field :product_item_id, 'string'
field :product_set, 'ProductSet'
field :product_set_id, 'string'
field :retention_days, 'string'
field :whatsapp_phone_number, 'string'
has_no_id
has_no_get
has_no_post
Expand Down
1 change: 1 addition & 0 deletions lib/facebook_ads/ad_objects/ad_rule_execution_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class AdRuleExecutionSpec < AdObject
"CHANGE_BID",
"CHANGE_BUDGET",
"CHANGE_CAMPAIGN_BUDGET",
"DCO",
"INCREASE_RADIUS",
"NOTIFICATION",
"PAUSE",
Expand Down
2 changes: 2 additions & 0 deletions lib/facebook_ads/ad_objects/ad_rule_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class AdRuleHistory < AdObject
"CHANGED_BUDGET",
"EMAIL",
"ENABLE_ADVANTAGE_PLUS_CREATIVE",
"ENABLE_ADVANTAGE_PLUS_PLACEMENTS",
"ENABLE_AUTOFLOW",
"ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION",
"ENDPOINT_PINGED",
"ERROR",
"FACEBOOK_NOTIFICATION_SENT",
Expand Down
3 changes: 2 additions & 1 deletion lib/facebook_ads/ad_objects/ad_video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AdVideo < AdObject
"CONTAINED_POST_AUDIO_BROADCAST",
"CONTAINED_POST_COPYRIGHT_REFERENCE_BROADCAST",
"COPYRIGHT_REFERENCE_BROADCAST",
"COPYRIGHT_REFERENCE_IG_XPOST_VIDEO",
"COPYRIGHT_REFERENCE_VIDEO",
"CREATION_ML_PRECREATION",
"DCO_AD_ASSET_FEED",
Expand Down Expand Up @@ -330,7 +331,7 @@ class AdVideo < AdObject
field :scheduled_publish_time, 'datetime'
field :source, 'string'
field :spherical, 'bool'
field :status, 'object'
field :status, 'VideoStatus'
field :title, 'string'
field :universal_video_id, 'string'
field :updated_time, 'datetime'
Expand Down
4 changes: 4 additions & 0 deletions lib/facebook_ads/ad_objects/ads_action_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ class AdsActionStats < AdObject
field :interactive_component_sticker_id, 'string'
field :interactive_component_sticker_response, 'string'
field :skan_click, 'string'
field :skan_click_second_postback, 'string'
field :skan_click_third_postback, 'string'
field :skan_view, 'string'
field :skan_view_second_postback, 'string'
field :skan_view_third_postback, 'string'
field :value, 'string'
has_no_id
has_no_get
Expand Down
4 changes: 4 additions & 0 deletions lib/facebook_ads/ad_objects/ads_histogram_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ class AdsHistogramStats < AdObject
field :interactive_component_sticker_id, 'string'
field :interactive_component_sticker_response, 'string'
field :skan_click, { list: 'int' }
field :skan_click_second_postback, { list: 'int' }
field :skan_click_third_postback, { list: 'int' }
field :skan_view, { list: 'int' }
field :skan_view_second_postback, { list: 'int' }
field :skan_view_third_postback, { list: 'int' }
field :value, { list: 'int' }
has_no_id
has_no_get
Expand Down
1 change: 1 addition & 0 deletions lib/facebook_ads/ad_objects/ads_insights.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class AdsInsights < AdObject
"image_asset",
"impression_device",
"is_conversion_id_modeled",
"landing_destination",
"link_url_asset",
"marketing_messages_btn_name",
"mdsa_landing_destination",
Expand Down
1 change: 1 addition & 0 deletions lib/facebook_ads/ad_objects/ads_pixel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class AdsPixel < AdObject
api.has_param :namespace_id, 'string'
api.has_param :partner_agent, 'string'
api.has_param :platforms, { list: 'hash' }
api.has_param :progress, 'object'
api.has_param :test_event_code, 'string'
api.has_param :trace, 'int'
api.has_param :upload_id, 'string'
Expand Down
1 change: 1 addition & 0 deletions lib/facebook_ads/ad_objects/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ class Application < AdObject
api.has_param :click_attr_window, 'int'
api.has_param :custom_events, { list: 'object' }
api.has_param :decline_reason, 'string'
api.has_param :engagement_type, 'string'
api.has_param :event, 'string'
api.has_param :event_reported_time, 'int'
api.has_param :fb_ad_id, 'int'
Expand Down
4 changes: 2 additions & 2 deletions lib/facebook_ads/ad_objects/business.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Business < AdObject
"LUXURY",
"MARKETING",
"NON_PROFIT",
"NOT_SET",
"ORGANIZATIONS_AND_ASSOCIATIONS",
"OTHER",
"PROFESSIONAL_SERVICES",
Expand Down Expand Up @@ -720,7 +721,7 @@ class Business < AdObject
api.has_param :survey_num_assets, 'int'
api.has_param :survey_num_people, 'int'
api.has_param :timezone_id, 'int'
api.has_param :vertical, { enum: %w{ADVERTISING AUTOMOTIVE CONSUMER_PACKAGED_GOODS ECOMMERCE EDUCATION ENERGY_AND_UTILITIES ENTERTAINMENT_AND_MEDIA FINANCIAL_SERVICES GAMING GOVERNMENT_AND_POLITICS HEALTH LUXURY MARKETING NON_PROFIT ORGANIZATIONS_AND_ASSOCIATIONS OTHER PROFESSIONAL_SERVICES RESTAURANT RETAIL TECHNOLOGY TELECOM TRAVEL }}
api.has_param :vertical, { enum: %w{ADVERTISING AUTOMOTIVE CONSUMER_PACKAGED_GOODS ECOMMERCE EDUCATION ENERGY_AND_UTILITIES ENTERTAINMENT_AND_MEDIA FINANCIAL_SERVICES GAMING GOVERNMENT_AND_POLITICS HEALTH LUXURY MARKETING NON_PROFIT NOT_SET ORGANIZATIONS_AND_ASSOCIATIONS OTHER PROFESSIONAL_SERVICES RESTAURANT RETAIL TECHNOLOGY TELECOM TRAVEL }}
end
end

Expand Down Expand Up @@ -885,7 +886,6 @@ class Business < AdObject

has_edge :picture do |edge|
edge.get 'ProfilePictureSource' do |api|
api.has_param :breaking_change, { enum: -> { ProfilePictureSource::BREAKING_CHANGE }}
api.has_param :height, 'int'
api.has_param :redirect, 'bool'
api.has_param :type, { enum: -> { ProfilePictureSource::TYPE }}
Expand Down
4 changes: 4 additions & 0 deletions lib/facebook_ads/ad_objects/canvas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class Canvas < AdObject
field :use_retailer_item_ids, 'bool'
has_no_delete

has_edge :preview do |edge|
edge.get 'CanvasPreview'
end

has_edge :previews do |edge|
edge.get 'TextWithEntities' do |api|
api.has_param :user_ids, { list: 'int' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ module FacebookAds
# on github and we'll fix in our codegen framework. We'll not be able to accept
# pull request for this class.

class DestinationCatalogSettings < AdObject
class CanvasPreview < AdObject

field :generate_items_from_pages, 'bool'
field :id, 'string'
field :body, 'string'
has_no_id
has_no_get
has_no_post
has_no_delete

Expand Down
11 changes: 11 additions & 0 deletions lib/facebook_ads/ad_objects/custom_audience.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,17 @@ class CustomAudience < AdObject
end
end

has_edge :salts do |edge|
edge.get 'CustomAudienceSalts' do |api|
api.has_param :params, { list: 'string' }
end
edge.post 'CustomAudience' do |api|
api.has_param :salt, 'string'
api.has_param :valid_from, 'datetime'
api.has_param :valid_to, 'datetime'
end
end

has_edge :sessions do |edge|
edge.get 'CustomAudienceSession' do |api|
api.has_param :session_id, 'int'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ module FacebookAds
# on github and we'll fix in our codegen framework. We'll not be able to accept
# pull request for this class.

class InstantArticlesStats < AdObject
class CustomAudienceSalts < AdObject

field :error, 'string'
field :metadata, { list: 'hash' }
field :metric, 'object'
field :totals, { list: 'hash' }
field :x_axis_breakdown, { list: { list: 'hash' } }
field :app_id, 'int'
field :public_key, 'string'
has_no_id
has_no_get
has_no_post
Expand Down
1 change: 0 additions & 1 deletion lib/facebook_ads/ad_objects/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ class Group < AdObject

has_edge :picture do |edge|
edge.get 'ProfilePictureSource' do |api|
api.has_param :breaking_change, { enum: -> { ProfilePictureSource::BREAKING_CHANGE }}
api.has_param :height, 'int'
api.has_param :redirect, 'bool'
api.has_param :type, { enum: -> { ProfilePictureSource::TYPE }}
Expand Down
2 changes: 2 additions & 0 deletions lib/facebook_ads/ad_objects/instagram_insights_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ class InstagramInsightsResult < AdObject
"carousel_album_reach",
"carousel_album_saved",
"carousel_album_video_views",
"clips_replays_count",
"comments",
"engagement",
"exits",
"follows",
"ig_reels_aggregated_all_plays_count",
"ig_reels_avg_watch_time",
"ig_reels_video_view_total_time",
"impressions",
Expand Down
10 changes: 0 additions & 10 deletions lib/facebook_ads/ad_objects/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -955,15 +955,6 @@ class Page < AdObject
edge.get 'InstagramUser'
end

has_edge :instant_articles_stats do |edge|
edge.get 'InstantArticlesStats' do |api|
api.has_param :metrics_list, { list: 'hash' }
api.has_param :page_list, { list: 'string' }
api.has_param :since, 'datetime'
api.has_param :until, 'datetime'
end
end

has_edge :leadgen_forms do |edge|
edge.get 'LeadgenForm'
edge.post 'LeadgenForm' do |api|
Expand Down Expand Up @@ -1266,7 +1257,6 @@ class Page < AdObject

has_edge :picture do |edge|
edge.get 'ProfilePictureSource' do |api|
api.has_param :breaking_change, { enum: -> { ProfilePictureSource::BREAKING_CHANGE }}
api.has_param :height, 'int'
api.has_param :redirect, 'bool'
api.has_param :type, { enum: -> { ProfilePictureSource::TYPE }}
Expand Down
3 changes: 3 additions & 0 deletions lib/facebook_ads/ad_objects/product_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ class ProductItem < AdObject
"INVALID_IMAGES",
"INVALID_MONETIZER_RETURN_POLICY",
"INVALID_PRE_ORDER_PARAMS",
"INVALID_SHELTER_PAGE_ID",
"INVALID_SHIPPING_PROFILE_PARAMS",
"INVALID_SUBSCRIPTION_DISABLE_PARAMS",
"INVALID_SUBSCRIPTION_ENABLE_PARAMS",
Expand Down Expand Up @@ -404,6 +405,8 @@ class ProductItem < AdObject
"VIDEO_FETCH_FAILED_LINK_BROKEN",
"VIDEO_FETCH_FAILED_TIMED_OUT",
"VIDEO_NOT_DOWNLOADABLE",
"WHATSAPP_DISABLED_BY_USER",
"WHATSAPP_POLICY_VIOLATION",
]

MARKED_FOR_PRODUCT_LAUNCH = [
Expand Down
1 change: 0 additions & 1 deletion lib/facebook_ads/ad_objects/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class Profile < AdObject

has_edge :picture do |edge|
edge.get 'ProfilePictureSource' do |api|
api.has_param :breaking_change, { enum: -> { ProfilePictureSource::BREAKING_CHANGE }}
api.has_param :height, 'int'
api.has_param :redirect, 'bool'
api.has_param :type, { enum: -> { ProfilePictureSource::TYPE }}
Expand Down
4 changes: 0 additions & 4 deletions lib/facebook_ads/ad_objects/profile_picture_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ class ProfilePictureSource < AdObject
"thumbnail",
]

BREAKING_CHANGE = [
"PROFILE_PICTURE",
]


field :bottom, 'int'
field :cache_key, 'string'
Expand Down
Loading

0 comments on commit e761217

Please sign in to comment.