Class: FacebookAds::AdObject

Inherits:
Object
  • Object
show all
Includes:
Fields, GraphEdges, GraphNodes
Defined in:
lib/facebook_ads/ad_object.rb

Direct Known Subclasses

Ad, AdAccount, AdAccountAaaCompatibleAdObjects, AdAccountAaaSimilarCampaigns, AdAccountAdLimitsInsights, AdAccountAdRulesCountByType, AdAccountAdRulesHistory, AdAccountAdVolume, AdAccountAdsRecommendedAudios, AdAccountAllPaymentMethods, AdAccountAppSetupRequirements, AdAccountAslSchedule, AdAccountBankInfoList, AdAccountBillingDatePreference, AdAccountBusinessConstraints, AdAccountCampaignAttributionOptionInfo, AdAccountCreationRequest, AdAccountCustomAudienceLimits, AdAccountDefaultDestination, AdAccountDefaultObjective, AdAccountDeliveryEstimate, AdAccountDsaRecommendations, AdAccountIosFourteenCampaignLimits, AdAccountLiveVideoAdvertiser, AdAccountMatchedSearchApplicationsEdgeData, AdAccountMaxBid, AdAccountOptimizationGoalsAemv2Eligibility, AdAccountPaymentDetails, AdAccountPaymentOptions, AdAccountPrepayDetails, AdAccountPromotableObjects, AdAccountPromotionProgressBar, AdAccountReachEstimate, AdAccountRecommendations, AdAccountRecommendedCamapaignBudget, AdAccountRelatedIcoStudy, AdAccountSmartSuggestedAds, AdAccountSpendLimit, AdAccountSubscribedApps, AdAccountSubsidyAmountDetails, AdAccountSuggestedTag, AdAccountTargetingUnified, AdAccountTrackingData, AdAccountUrlForAssetExtraction, AdAccountUser, AdAccountUserPermissions, AdAccountUserSettings, AdAccountYouthAdsAdvertiser, AdActivity, AdAssetBody, AdAssetCallToActionType, AdAssetCustomizationRuleCustomizationSpec, AdAssetDescription, AdAssetFeedAdditionalData, AdAssetFeedAdditionalDataPageNudgeMessage, AdAssetFeedSpec, AdAssetFeedSpecAssetCustomizationRule, AdAssetFeedSpecAssetLabel, AdAssetFeedSpecBody, AdAssetFeedSpecCallToAction, AdAssetFeedSpecCaption, AdAssetFeedSpecCarousel, AdAssetFeedSpecCarouselChildAttachment, AdAssetFeedSpecDescription, AdAssetFeedSpecEvents, AdAssetFeedSpecGroupRule, AdAssetFeedSpecImage, AdAssetFeedSpecLinkUrl, AdAssetFeedSpecTitle, AdAssetFeedSpecVideo, AdAssetImage, AdAssetLinkUrl, AdAssetMessageExtensions, AdAssetOnsiteDestinations, AdAssetTargetRuleTargeting, AdAssetTitle, AdAssetVideo, AdAsyncRequest, AdAsyncRequestSet, AdAsyncRequestSetNotificationResult, AdBidAdjustments, AdCampaignBidConstraint, AdCampaignConversionValueExpressionSpec, AdCampaignDeliveryEstimate, AdCampaignDeliveryStats, AdCampaignDeliveryStatsUnsupportedReasons, AdCampaignFrequencyControlSpecs, AdCampaignGroupIncrementalConversionOptimizationConfig, AdCampaignGroupMetricsMetadata, AdCampaignGroupStats, AdCampaignGroupStructureTree, AdCampaignIssuesInfo, AdCampaignLearningStageInfo, AdCampaignMetricsMetadata, AdCampaignMultiAds, AdCampaignOptimizationEvent, AdCampaignPacedBidInfo, AdCampaignStats, AdColumnSizes, AdContract, AdConversionValues, AdConversions, AdCreationPackageConfig, AdCreative, AdCreativeAdDisclaimer, AdCreativeAssetGroupsSpec, AdCreativeBrandedContentAds, AdCreativeBrandedContentAdsPartners, AdCreativeCollectionThumbnailInfo, AdCreativeContextualMultiAds, AdCreativeDegreesOfFreedomSpec, AdCreativeDestinationSpec, AdCreativeFacebookBrandedContent, AdCreativeFeatureActionMetadata, AdCreativeFeatureCustomizations, AdCreativeFeatureDetails, AdCreativeFeaturesSpec, AdCreativeGenerativeAssetSpec, AdCreativeHouseShopsAdsSellerContent, AdCreativeImageDataMediaElements, AdCreativeInsights, AdCreativeInstagramBrandedContent, AdCreativeInteractiveComponentsSpec, AdCreativeLinkData, AdCreativeLinkDataAppLinkSpec, AdCreativeLinkDataCallToAction, AdCreativeLinkDataCallToActionValue, AdCreativeLinkDataChildAttachment, AdCreativeLinkDataCustomOverlaySpec, AdCreativeLinkDataImageLayerSpec, AdCreativeLinkDataImageOverlaySpec, AdCreativeLinkDataMoment, AdCreativeLinkDataSponsorshipInfoSpec, AdCreativeLinkDataTemplateVideoSpec, AdCreativeMarketingMessageStructuredSpec, AdCreativeObjectStorySpec, AdCreativeOmnichannelLinkSpec, AdCreativePhotoData, AdCreativePhotoDataMediaElements, AdCreativePlaceData, AdCreativePlatformCustomization, AdCreativePortraitCustomizations, AdCreativePostClickConfiguration, AdCreativeProductData, AdCreativePromotionMetadataSpec, AdCreativeRecommenderSettings, AdCreativeRegionalRegulationDisclaimer, AdCreativeRewardInfo, AdCreativeShopSpec, AdCreativeSiteLinksSpec, AdCreativeSourcingSpec, AdCreativeStaticFallbackSpec, AdCreativeTemplateUrlSpec, AdCreativeTextData, AdCreativeVideoData, AdCreativeVideoDataCustomOverlaySpec, AdCreativeVideoDataMediaElements, AdCreativeWhatsAppChannelSpec, AdCustomDerivedMetrics, AdCustomizationRuleSpec, AdDefaultValues, AdDraft, AdDynamicCreative, AdEntityTargetSpend, AdExportPreset, AdImage, AdKeywordStats, AdKeywords, AdKpiShift, AdLabel, AdLightAdgroup, AdLightCampaign, AdLightCampaignGroup, AdLimitSetting, AdLimitsEnforcementData, AdMonetizationProperty, AdNetworkAnalyticsAsyncQueryExport, AdNetworkAnalyticsAsyncQueryResult, AdNetworkAnalyticsSyncQueryResult, AdPlacePageSet, AdPlacePageSetMetadata, AdPlacement, AdPreview, AdPromotedObject, AdProposal, AdRecommendation, AdRecommendationData, AdReportRun, AdRule, AdRuleEvaluationSpec, AdRuleExecutionOptions, AdRuleExecutionSpec, AdRuleFilters, AdRuleHistory, AdRuleHistoryResult, AdRuleHistoryResultAction, AdRuleSchedule, AdRuleScheduleSpec, AdRuleTrigger, AdSavedKeywords, AdSavedLocation, AdSavedReport, AdSet, AdStudy, AdStudyCell, AdStudyObjective, AdStudyObjectiveId, AdStudyObjectiveOffsiteDatasets, AdTopline, AdToplineDetail, AdVideo, AdVolume, AdgroupFacebookFeedback, AdgroupIssuesInfo, AdgroupMetadata, AdgroupPlacementSpecificReviewFeedback, AdgroupReviewFeedback, AdjacentContentDeliveryReport, AdsActionStats, AdsAnomalyDetection, AdsConversionGoal, AdsCreationSavedState, AdsCustomPivotsPreview, AdsDataPartner, AdsDataset, AdsGuidanceQeExposure, AdsHistogramStats, AdsImageCrops, AdsInsights, AdsNamingTemplate, AdsOptimalDeliveryGrowthOpportunity, AdsPaymentCycle, AdsPivotRules, AdsPixel, AdsPixelCapabilityOverride, AdsPixelCapiSetupQuality, AdsPixelDeliveryRecommendations, AdsPixelDomainControlRule, AdsPixelDomainLastFiredTime, AdsPixelEventLastFiredTime, AdsPixelEventPrediction, AdsPixelEventSuggestionRule, AdsPixelItemPrice, AdsPixelMicrodataStats, AdsPixelRawFiresResult, AdsPixelRealTimeEventLogResult, AdsPixelRecentEventsResult, AdsPixelSignalsIwlFeedbackNux, AdsPixelSignalsIwlNux, AdsPixelStats, AdsPixelStatsResult, AdsQuickViews, AdsReportBuilder, AdsReportBuilderExportCore, AdsReportBuilderMmmReport, AdsReportBuilderMmmReportScheduler, AdsReportBuilderSavedReport, AdsSegments, AdsSignalDiagnosticIssue, AdsStartYourDayWidget, AdsTabular, AdsTargetingInsights, AdsTextSuggestions, AdsUserSettings, AdsValueAdjustmentRule, AdsValueAdjustmentRuleCollection, AdvAInstance, AdvertiserVerificationStatus, AgeRange, AgencyClientDeclaration, Album, AlmAdAccountInfo, AlmEndAdvertiserInfo, AlmEvent, AlmGuidance, AlmGuidanceMetrics, AmOneshopSettings, AnBlockedBiCategory, AnalyticsConfig, AnalyticsEntityUserConfig, AnalyticsFunnelQueryResult, AnalyticsPlatformMetricsConfig, AnalyticsQueryResult, AnalyticsSegment, AnalyticsUserConfig, AndroidAppLink, AppEventConfig, AppLinks, AppOptimizedCustomEvents, AppPublisher, AppRequest, AppRequestFormerRecipient, Application, ArAdsDataContainer, ArEffect, AssignedUser, AsyncRequest, AsyncSession, AttributionSpec, AudienceFunnel, AudienceOverlap, AudiencePermission, AudiencePermissionForActions, AudienceSharingAccountValid, AudienceSharingRecipientAccounts, AudioAsset, AudioCopyright, AudioIsrc, AudioRelease, AudioVisualReferenceMatch, AuthLink, AutomotiveModel, Avatar, AvatarProfilePicture, BapiDomain, BcpCampaign, BespokePartnerGuidanceLaser, BidSchedule, BizInboxOffsiteEmailAccount, BlindPig, BlockedUserInfo, BrandRequest, BrandSafetyBlockListUsage, BrandSafetyCampaignConfig, BrandSafetyDownloadable, BrandedContentAdError, BrandedContentEligibleSponsorIDs, BrandedContentShadowIgMediaId, BrandedContentShadowIgUserId, BroadTargetingCategories, Business, BusinessAdAccountRequest, BusinessAdsReportingReportSpecs, BusinessAdvertisableApplicationsResult, BusinessAgreement, BusinessApplicationRequest, BusinessAssetGroup, BusinessAssetSharingAgreement, BusinessCreative, BusinessCreativeFolder, BusinessCreativeInsights, BusinessFranchiseConfig, BusinessImage, BusinessImageTBusinessFolderPathItem, BusinessManagedPartnerEligibility, BusinessMediaAdPlacementValidationResult, BusinessObject, BusinessObjectTransferOwnershipAgreement, BusinessOwnedObjectOnBehalfOfRequest, BusinessPageRequest, BusinessPartnerPremiumOptions, BusinessProductCatalogTos, BusinessProject, BusinessRequest, BusinessRoleRequest, BusinessSettingLogsData, BusinessTag, BusinessTrafficAnalysisReport, BusinessUser, BusinessVideo, BusinessVideoTBusinessFolderPathItem, CalibratorExistingRule, CallAdsPhoneData, Campaign, CampaignActionsData, CampaignGroupBrandConfiguration, CampaignGroupCollaborativeAdsPartnerInfo, Canvas, CanvasAdSettings, CanvasBodyElement, CanvasCollectionThumbnail, CanvasDynamicSetting, CanvasPreview, CanvasTemplate, CassSetupOfflineEventSetProgress, CatalogAdvertiserInsight, CatalogBasedTargeting, CatalogItemAppLinks, CatalogItemChannelsToIntegrityStatus, CatalogItemOverride, CatalogItemRejectionReasons, CatalogItemValidationErrorList, CatalogSmartPixelSettings, CatalogSubVerticalList, CatalogWebsiteOnboardingSettings, CatalogWebsiteSettings, ChatPlugin, CheckBatchRequestStatus, ChildEvent, ChinaBusinessOnboardingVettingRequest, CloudGame, CloudbridgeDatasetStatus, CollaborativeAdsPartnerBusinesses, CollaborativeAdsPartnerInfoListItem, CollaborativeAdsShareSettings, ColumnSuggestions, Comment, CommerceMerchantSettings, CommerceMerchantSettingsSetupStatus, CommerceOrder, CommerceOrderTransactionDetail, CommercePayout, CommerceSettings, ConnectionsTargeting, ContactsMessengerSyncConfig, ContentBlockList, ContentDeliveryReport, ContentPublishingLimitResponse, ContextualBundlingSpec, ConversionActionQuery, ConversionHealthKpi, CopyrightAttributionInsights, CopyrightAudioAsset, CopyrightMediaMisuse, CopyrightReferenceContainer, CoverPhoto, CpasAdCreationTemplate, CpasAdvertiserPartnershipRecommendation, CpasBusinessSetupConfig, CpasCollaborationRequest, CpasLsbImageBank, CpasMerchantConfig, CpasParentCatalogSettings, CpasSetup, CpasSetupPageStructureProgress, CreativeAssetTag, CreativeHistory, CreatorAssetCreative, CreditCard, CreditPartitionActionOptions, CrmAddress, CtwaWhatsAppNumbersInfo, CtxOptimizationEligibility, CtxPartnerAppWelcomeMessageFlow, Currency, CurrencyAmount, CustomAudience, CustomAudienceAdAccount, CustomAudienceCapabilities, CustomAudienceDataSource, CustomAudienceGroup, CustomAudienceSalts, CustomAudienceSession, CustomAudienceSharedAccountCampaignInfo, CustomAudienceSharingStatus, CustomAudienceStatus, CustomAudiencesTos, CustomAudiencesharedAccountInfo, CustomConversion, CustomConversionActivities, CustomConversionStatsResult, CustomUserSettings, DaCheck, Dataset, DayPart, DeliveryCheck, DeliveryCheckExtraInfo, DeliveryInfo, DeliveryStatus, DeliveryWindow, Destination, DirectDebit, Domain, DraftPost, DynamicArMetadata, DynamicContentSet, DynamicItemDisplayBundle, DynamicItemDisplayBundleFolder, DynamicPostChildAttachment, DynamicPriceConfigByDate, DynamicVideoMetadata, EducationExperience, EmailImport, EndStudyCriteria, Engagement, EntWithSponsor, EntityAtTextRange, Event, EventExternalTicketInfo, EventRegistrationSetting, EventSourceGroup, EventTicketSetting, EventTicketTier, EventTour, Experience, ExtendedCredit, ExtendedCreditAllocationConfig, ExtendedCreditApplication, ExtendedCreditEmail, ExtendedCreditInfo, ExtendedCreditInvoiceGroup, ExternalEventSource, ExternalEventSourceCpasEventsDebugging, ExternalEventSourceCpasEventsDebuggingInfo, ExternalMerchantSettings, FameKumo, FantasyGame, FavoriteCatalog, FbImageCopyrightMatch, FbLiteToNtTransitions, FbPageAndInstagramAccount, FbPayButtonLogin, FinanceObject, FlexibleTargeting, Flight, FranchiseProgram, FranchiseProgramMember, FundingSourceDetails, FundingSourceDetailsCoupon, FundraiserPersonToCharity, GeoGatingPolicy, Group, HasLeadAccess, HighDemandPeriod, HighDemandPeriodTimeSuggestionWeeklySegment, HomeListing, Hotel, HotelRoom, Hours, IdName, IgAccessTokenForIgOnlyApi, IgBoostMediaAd, IgComment, IgCommentFromUser, IgMedia, IgMediaBoostEligibilityInfo, IgMediaForIgOnlyApi, IgProductTaggingInvalidationError, IgRefreshAccessTokenForIgOnlyApi, IgResumableVideoUploadStatus, IgShoppingProductAppeal, IgShoppingReviewStatus, IgShoppingReviewStatusOnsiteEligibility, IgShoppingReviewStatusReasonWithHelpMessage, IgUpcomingEvent, IgUser, IgUserExportForCam, IgUserForIgOnlyApi, IgUserSubscribedAppsData, IgVideoCopyrightCheckMatchesInformation, IgVideoCopyrightCheckStatus, IgbcAdsPermission, ImageCopyright, ImageCopyrightDispute, ImageReferenceMatch, InsightsResult, InsightsValue, InstagramBoostableMediaForAccessToken, InstagramCarousel, InstagramComment, InstagramInsightsResult, InstagramInsightsValue, InstagramMedia, InstagramRelatedProductTags, InstagramShoppingMerchantReviewMessage, InstagramUser, InstagramVideoMetadata, InstantArticleInsightsQueryResult, IosAppLink, IpObject, JobOpening, KeyValue, KeywordDeliveryReport, Lead, LeadGenAppointmentBookingInfo, LeadGenAppointmentSlotsByDay, LeadGenAppointmentTimeSlot, LeadGenConditionalQuestionsGroupChoices, LeadGenConditionalQuestionsGroupQuestions, LeadGenContextCard, LeadGenCustomDisclaimer, LeadGenCustomDisclaimerBody, LeadGenDataDraft, LeadGenDirectCrmIntegrationConfig, LeadGenDraftQuestion, LeadGenFormPreviewDetails, LeadGenLegalContent, LeadGenLegalContentCheckbox, LeadGenPostSubmissionCheckResult, LeadGenPrivacyPolicy, LeadGenQuestion, LeadGenQuestionOption, LeadGenThankYouPage, LeadGenThankYouPageGatedFile, LeadGenThankYouPageGatedPromo, LeadGenUrlEntityAtRanges, LeadgenForm, LifeEvent, Link, LinkedInstagramAccountData, LiveVideo, LiveVideoAdBreakConfig, LiveVideoAdCampaignConfig, LiveVideoError, LiveVideoInputStream, LiveVideoRecommendedEncoderSettings, LiveVideoTargeting, LocalServiceBusiness, Location, LookalikeSpec, LoomConfig, MailingAddress, ManagedPartnerBusiness, ManagedPartnerExtendedCredit, MarketingMessageTargeting, McExperienceConfigForApi, McomInvoiceBankAccount, McomInvoiceDetails, McomInvoiceLists, McomInvoiceStatus, McomOnboardingStatus, McomPayouts, MeasurementReport, MediaCopyrightAttribution, MediaCopyrightUpdateRecord, MediaFingerprint, MediaTitle, MerchantCompliance, MerchantReport, MessageDeliveryEstimate, MessagingAppsInfo, MessagingFeatureReview, MessagingFeatureStatus, MessengerAdsPartialAutomatedStepList, MessengerBusinessTemplate, MessengerCallSettings, MessengerDestinationPageWelcomeMessage, MessengerProfile, MinimumBudget, MixInsightsResult, MusicVideoCopyright, MusicWorkCopyright, NegativeKeywordList, NullNode, OfflineConversionDataSet, OfflineConversionDataSetActivities, OfflineConversionDataSetOptimizationStatus, OfflineConversionDataSetPermissions, OfflineConversionDataSetUpload, OfflineConversionDataSetUsage, OfflineProductItem, OfflineTermsOfService, OffsitePixel, OffsiteSignalContainerBusinessObject, OmegaCustomerTrx, OpenBridgeConfiguration, OpenGraphContext, OrderIdAttributions, Organization, OutcomePredictionPoint, OverrideDetails, OwnedDomain, P2mInvoicePayments, Page, PageAboutStoryComposedBlock, PageAboutStoryComposedBlockEntityRanges, PageAboutStoryComposedBlockInlineStyle, PageAppWithLeadsAccess, PageBroadcast, PageCallToAction, PageCategory, PageChangeProposal, PageCrmsWithLeadsAccess, PageCtsTopic, PageCtxBudgetSimilarAdvertiserBudgetRecommendation, PageCtxDefaultGreetingText, PageCtxMessagingFeatureLimit, PageDirectIntegrationCrmWithLeadsAccess, PageGameBotQuotaInformation, PageGetStartedNullstate, PageInsightsAsyncExportRun, PageLeadsAccessConfig, PageLocationsBreakdown, PageMessageResponsivenessMetrics, PageParking, PagePartnerWithLeadsAccess, PagePaymentOptions, PagePost, PagePostExperiment, PagePublisher, PageRestaurantServices, PageRestaurantSpecialties, PageSettings, PageStartInfo, PageThreadOwner, PageUpcomingChange, PageUserMessageThreadLabel, PageUserPermissions, PageUserWithLeadsAccess, ParentCatalogReport, PartnerAccountLinking, PartnerCategory, PartnerIntegrationLinked, PartnerStudy, PartnershipAdContentSearchMedia, PartnershipAdsIdentity, PaymentEnginePayment, PaymentPricepoints, PaymentRequestDetails, PaymentSubscription, Permission, Persona, PersonalAdsPersona, Photo, PhotoMetadata, Place, PlaceTag, PlaceTopic, Placement, PlatformImageSource, PlatformSessionKey, PlayableContent, Post, PreapprovalReview, PremiumMusicVideo, Privacy, PrivacyOption, PrivateComputationEnvironment, PrivateLiftStudyInstance, ProductCatalog, ProductCatalogCategory, ProductCatalogDataSource, ProductCatalogDiagnosticGroup, ProductCatalogFacets, ProductCatalogHotelRoomsBatch, ProductCatalogImageSettings, ProductCatalogImageSettingsInternal, ProductCatalogImageSettingsOperation, ProductCatalogLocalizationSettings, ProductCatalogPricingVariablesBatch, ProductCatalogProductSetsBatch, ProductCatalogUserActions, ProductCatalogUserPermissions, ProductCatalogUserTasks, ProductDaEventSamplesBatch, ProductDeliveryPreference, ProductEventStat, ProductFeed, ProductFeedRule, ProductFeedRulePreviewSample, ProductFeedRuleSuggestion, ProductFeedSchedule, ProductFeedUpload, ProductFeedUploadError, ProductFeedUploadErrorReport, ProductFeedUploadErrorSample, ProductFeedUploadProgress, ProductGroup, ProductImage, ProductItem, ProductItemCommerceInsights, ProductItemError, ProductItemImporterAddress, ProductItemInsights, ProductItemInvalidationError, ProductItemLandingPageData, ProductItemLocalInfo, ProductItemLocalInfoLatLongShape, ProductItemOffer, ProductItemShipping, ProductItemSubscriptionInfo, ProductItemUnitPrice, ProductSet, ProductSetMetadata, ProductSetTaxonCategory, ProductSetUsage, ProductVariant, ProductVisualVariant, Profile, ProfilePictureSource, PublisherBlockList, PublisherDeliveryReport, PublisherWhiteList, RawCustomAudience, ReachFrequencyActivity, ReachFrequencyAdFormat, ReachFrequencyCurveLowerConfidenceRange, ReachFrequencyCurveUpperConfidenceRange, ReachFrequencyDayPart, ReachFrequencyEstimatesCurve, ReachFrequencyEstimatesPlacementBreakdown, ReachFrequencyPrediction, ReachFrequencySpec, Recommendation, RecommendedIgMedia, RecommendedPagePost, RegionalRegulationIdentities, ReportingAudience, ResearchPollStudy, ResellerGuidance, RevSharePolicy, RichMediaElement, RightsManagerDataExport, RightsManagerInsights, Robot, RtbDynamicPost, SalesRightsInventoryManagement, SavedAudience, SavedMessageResponse, ScheduledPost, ScimCompanyUserPhoneNumber, SecuritySettings, ShadowIgHashtag, ShadowIgMediaBoostedInsightsResult, ShadowIgMediaBuilder, ShadowIgMediaCollaborators, ShadowIgMediaProductTags, ShadowIgUserCatalogProductSearch, ShadowIgUserCatalogProductVariant, ShadowIgUserPartnershipAdsMediaErrors, Shop, SignalsIwlExtractor, SingleOwnerAdditionalProfile, SiteLink, SlicedEventSourceGroup, SmartPixelInsights, SocialWifiSite, SplitTestConfig, SplitTestWinner, Status, StoreCatalogSettings, Stories, StreamFilter, SystemUser, Tab, TaggableSubject, Targeting, TargetingAutomation, TargetingDynamicRule, TargetingGeoLocation, TargetingGeoLocationCity, TargetingGeoLocationCustomLocation, TargetingGeoLocationElectoralDistrict, TargetingGeoLocationGeoEntities, TargetingGeoLocationLocationCluster, TargetingGeoLocationLocationExpansion, TargetingGeoLocationMarket, TargetingGeoLocationPlace, TargetingGeoLocationPoliticalDistrict, TargetingGeoLocationRegion, TargetingGeoLocationZip, TargetingMarketingMessageChannels, TargetingProductAudienceSpec, TargetingProductAudienceSubSpec, TargetingProspectingAudience, TargetingRelaxation, TargetingSentenceLine, TextWithEntities, ThirdPartyMeasurementReportDataset, ThirdPartyPartnerLiftRequest, ThirdPartyPartnerPanelRequest, ThirdPartyPartnerPanelScheduled, ThirdPartyPartnerViewabilityRequest, TimeSuggestion, TimezoneOffset, TrackingAndConversionWithDefaults, TransactableItem, Transaction, UnifiedThread, UniqueAdCreative, Url, User, UserAvailableCatalogs, UserContext, UserCoverPhoto, UserDevice, UserIdForApp, UserIdForPage, UserLeadGenDisclaimerResponse, UserLeadGenFieldData, UserMobileConfig, UserNotificationSeenStateData, UserPageOneTimeOptInTokenSettings, UserPaymentMethodsInfo, UserPaymentMobilePricepoints, UserPaymentModulesOptions, ValueBasedEligibleSource, Vehicle, VehicleOffer, VideoCopyright, VideoCopyrightCheckStatus, VideoCopyrightConditionGroup, VideoCopyrightGeoGate, VideoCopyrightMatch, VideoCopyrightRule, VideoCopyrightSegment, VideoGroup, VideoList, VideoMetricsReport, VideoPoll, VideoStats, VideoStatus, VideoStatusError, VideoStatusProcessingPhase, VideoStatusPublishingPhase, VideoStatusUploadingPhase, VideoTextQuestion, VideoThumbnail, VideoUploadLimits, VoipInfo, WearableDevicePublicKey, WebAppLink, WebPublisher, WebsiteCreativeAssetSource, WebsiteCreativeAssetSuggestions, WhatsAppBusinessAccount, WhatsAppBusinessHealthStatus, WhatsAppBusinessHealthStatusForMessageSend, WhatsAppBusinessPartnerClientVerificationSubmission, WhatsAppBusinessPreVerifiedPhoneNumber, WhatsAppBusinessProfile, WhatsAppPaymentCapabilities, WhatsappSubscribedAppsInfo, WhitehatFbdlRun, WifiInformation, WindowsAppLink, WindowsPhoneAppLink, WitUser, WithAsset3d, WoodhengePurchasedPaygReceipt, WoodhengeSupporter, WorkAccessCode, WorkExperience, WorkSkill, WorkUserBadges, WorkUserFrontline

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from GraphEdges

included

Methods included from GraphNodes

included

Methods included from Fields

included

Constructor Details

#initialize(attributes, *args) ⇒ AdObject

Returns a new instance of AdObject.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/facebook_ads/ad_object.rb', line 23

def initialize(attributes, *args)
  if attributes.empty?
    raise InvalidParameterError, 'Invalid attributes. Must include at least one attribute'
  end

  update_attributes(attributes)
  # assume object with only id in the attributes as not loaded

  # is next arg a list of fields?
  fields = (args[0].is_a?(Array) || args[0].is_a?(String)) ? args.shift : []
  fields = fields.split(',') if fields.is_a?(String)
  session = args.shift

  self.__all_fields = fields + attributes.keys
  self.session = session
end

Instance Attribute Details

#__all_fieldsObject

Returns the value of attribute __all_fields.



15
16
17
# File 'lib/facebook_ads/ad_object.rb', line 15

def __all_fields
  @__all_fields
end

#attributesObject (readonly)

Returns the value of attribute attributes.



15
16
17
# File 'lib/facebook_ads/ad_object.rb', line 15

def attributes
  @attributes
end

#deserializerObject

Returns the value of attribute deserializer.



16
17
18
# File 'lib/facebook_ads/ad_object.rb', line 16

def deserializer
  @deserializer
end

#last_api_responseObject (readonly)

Returns the value of attribute last_api_response.



15
16
17
# File 'lib/facebook_ads/ad_object.rb', line 15

def last_api_response
  @last_api_response
end

#last_destroyedObject

Returns the value of attribute last_destroyed.



17
18
19
# File 'lib/facebook_ads/ad_object.rb', line 17

def last_destroyed
  @last_destroyed
end

#last_savedObject

Returns the value of attribute last_saved.



17
18
19
# File 'lib/facebook_ads/ad_object.rb', line 17

def last_saved
  @last_saved
end

Class Method Details

.get(id, *args) {|obj| ... } ⇒ Object

Yields:

  • (obj)


40
41
42
43
44
# File 'lib/facebook_ads/ad_object.rb', line 40

def self.get(id, *args)
  obj = new({id: id}, *args)
  yield obj if block_given?
  obj
end

Instance Method Details

#[](attr_name) ⇒ Object



60
61
62
# File 'lib/facebook_ads/ad_object.rb', line 60

def [](attr_name)
  @attributes[attr_name.to_sym]
end

#as_json(*opts) ⇒ Object



68
69
70
# File 'lib/facebook_ads/ad_object.rb', line 68

def as_json(*opts)
  to_hash
end

#changesObject



141
142
143
# File 'lib/facebook_ads/ad_object.rb', line 141

def changes
  @changes ||= {}
end

#destroy(params = {}) ⇒ Object



135
136
137
138
139
# File 'lib/facebook_ads/ad_object.rb', line 135

def destroy(params = {})
  delete(params) do |attrs|
    self.last_destroyed = Time.now if attrs['success']
  end
end

#fields_as_stringObject



80
81
82
# File 'lib/facebook_ads/ad_object.rb', line 80

def fields_as_string
  @__all_fields.to_a.join(',')
end

#graph_paramsObject

TODO refactor this to somewhere



104
105
106
# File 'lib/facebook_ads/ad_object.rb', line 104

def graph_params
  {fields: fields_as_string}
end

#idObject



46
47
48
# File 'lib/facebook_ads/ad_object.rb', line 46

def id
  self[:id]
end

#inspectObject



76
77
78
# File 'lib/facebook_ads/ad_object.rb', line 76

def inspect
  "#<#{self.class.name} #{to_hash.inspect}>"
end

#load!Object



92
93
94
95
96
# File 'lib/facebook_ads/ad_object.rb', line 92

def load!
  get(graph_params) do |attrs|
    update_attributes(attrs)
  end
end

#loaded?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/facebook_ads/ad_object.rb', line 88

def loaded?
  (@__all_fields - attributes.keys).empty?
end

#reload!Object



98
99
100
101
# File 'lib/facebook_ads/ad_object.rb', line 98

def reload!
  # delete all attribute except id
  @attributes = @attributes.keep_if { |k,_| k == :id }
end

#save(params = {}) ⇒ Object



127
128
129
130
131
132
133
# File 'lib/facebook_ads/ad_object.rb', line 127

def save(params = {})
  post(graph_params.merge(changes).merge(params)) do |attrs|
    update_attributes(attrs)
    @changes = {}
    self.last_saved = Time.now
  end
end

#sessionObject



145
146
147
# File 'lib/facebook_ads/ad_object.rb', line 145

def session
  @session || Session.default_session
end

#session=(session) ⇒ Object



149
150
151
# File 'lib/facebook_ads/ad_object.rb', line 149

def session=(session)
  @session = session.is_a?(Hash) ? Session.new(session) : session
end

#to_hashObject



64
65
66
# File 'lib/facebook_ads/ad_object.rb', line 64

def to_hash
  @attributes.merge(changes)
end

#to_json(*a) ⇒ Object



72
73
74
# File 'lib/facebook_ads/ad_object.rb', line 72

def to_json(*a)
  as_json.to_json(*a)
end

#update_attributes(attrs) ⇒ Object



50
51
52
53
54
55
56
57
58
# File 'lib/facebook_ads/ad_object.rb', line 50

def update_attributes(attrs)
  @attributes ||= {}
  @attributes.merge!(
    self.class.deserializer ?
      self.class.deserializer.deserialize(symbolize_keys_shallow(attrs)) :
      symbolize_keys_shallow(attrs)
  )
  self
end