mik-laj commented on a change in pull request #8008: Custom Facebook Ads 
Operator
URL: https://github.com/apache/airflow/pull/8008#discussion_r402748027
 
 

 ##########
 File path: airflow/providers/facebook/ads/hooks/ads.py
 ##########
 @@ -0,0 +1,152 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""
+This module contains Facebook Ads Reporting hooks
+"""
+import time
+from typing import Any, Dict, List, Optional
+
+from cached_property import cached_property
+from facebook_business.adobjects.adaccount import AdAccount
+from facebook_business.adobjects.adreportrun import AdReportRun
+from facebook_business.adobjects.adsinsights import AdsInsights
+from facebook_business.api import Cursor, FacebookAdsApi
+from facebook_business.exceptions import FacebookError, FacebookRequestError
+
+from airflow.exceptions import AirflowException
+from airflow.hooks.base_hook import BaseHook
+
+JOB_COMPLETED = "Job Completed"
+JOB_FAILED = "Job Failed"
+JOB_SKIPPED = "Job Skipped"
+
+
+class FacebookAdsReportingHook(BaseHook):
+    """
+    Hook for the Facebook Ads API
+
+    .. seealso::
+        For more information on the Facebook Ads API, take a look at the API 
docs:
+        https://developers.facebook.com/docs/marketing-apis/
+
+    :param facebook_ads_conn_id: Airflow Facebook Ads connection ID
+    :type facebook_ads_conn_id: str
+    :param api_version: The version of Facebook API. Default to v6.0
+    :type api_version: str
+
+    """
+
+    def __init__(
+        self,
+        facebook_ads_conn_id: str = "facebook_default",
+        api_version: str = "v6.0",
+    ) -> None:
+        super().__init__()
+        self.facebook_ads_conn_id = facebook_ads_conn_id
+        self.api_version = api_version
+        self.default_params = {
 
 Review comment:
   The exception is a better idea.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to