logos-sdk 0.0.25.dev16__tar.gz → 0.0.25.dev18__tar.gz

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.
Files changed (26) hide show
  1. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/PKG-INFO +1 -1
  2. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/Facebook.py +37 -0
  3. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/MerchantCenter.py +98 -0
  4. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/MicrosoftAdvertising.py +8 -3
  5. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk.egg-info/PKG-INFO +1 -1
  6. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/LICENSE +0 -0
  7. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/README.md +0 -0
  8. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/__init__.py +0 -0
  9. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/big_query/BigQuery.py +0 -0
  10. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/big_query/__init__.py +0 -0
  11. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/logging/LogosLogger.py +0 -0
  12. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/logging/__init__.py +0 -0
  13. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/CampaignManager.py +0 -0
  14. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/Collabim.py +0 -0
  15. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/DV360.py +0 -0
  16. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/GoogleAds.py +0 -0
  17. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/GoogleSheets.py +0 -0
  18. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/MarketMiner.py +0 -0
  19. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/Sklik.py +0 -0
  20. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk/services/__init__.py +0 -0
  21. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk.egg-info/SOURCES.txt +0 -0
  22. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk.egg-info/dependency_links.txt +0 -0
  23. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk.egg-info/requires.txt +0 -0
  24. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/logos_sdk.egg-info/top_level.txt +0 -0
  25. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/setup.cfg +0 -0
  26. {logos_sdk-0.0.25.dev16 → logos_sdk-0.0.25.dev18}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logos-sdk
3
- Version: 0.0.25.dev16
3
+ Version: 0.0.25.dev18
4
4
  Summary: SDK for Logos platform
5
5
  Home-page: https://bitbucket.org/databy/logos-sdk-pip/src/master/
6
6
  Author: Databy.io
@@ -28,6 +28,7 @@ class FacebookService:
28
28
  self._FEED_ERRORS_REPORT_STATUS = self._URL + "/feed-errors-report-status"
29
29
  self._FEED_ERRORS_REPORT = self._URL + "/feed-errors-report"
30
30
  self._GET_ACCOUNT_ACCESSIBILITY = self._URL + "/get-account-accessibility"
31
+ self._ACCOUNT_ACTIVITIES = self._URL + "/account-activities-report"
31
32
 
32
33
  def get_accessible_accounts(
33
34
  self, secret_id: str, timeout: int = None
@@ -438,3 +439,39 @@ class FacebookService:
438
439
  time.sleep((2**attempt) + randint(1, 20))
439
440
 
440
441
  return False
442
+
443
+ def get_account_activities(
444
+ self,
445
+ secret_id: str,
446
+ account_id: str,
447
+ date_from: str,
448
+ date_to: str
449
+ ) -> Dict:
450
+ """
451
+ Gets account activities
452
+ :param secret_id: The ID of the secret in secret manager
453
+ :param account_id: The ID of the account
454
+ :param date_from: Start date for the activities
455
+ :param date_to: End date for the activities
456
+ :return Bool
457
+ """
458
+ body = {
459
+ "secret_id": secret_id,
460
+ "account_id": account_id,
461
+ "date_from": date_from,
462
+ "date_to": date_to
463
+ }
464
+
465
+ header = get_headers(self._ACCOUNT_ACTIVITIES)
466
+ response = self.session.request(
467
+ "post",
468
+ url=self._ACCOUNT_ACTIVITIES,
469
+ json=body,
470
+ headers=header,
471
+ )
472
+
473
+ if response.status_code == HTTPStatus.OK:
474
+ service_response = response.json()
475
+ return service_response["data"]
476
+ else:
477
+ raise FacebookServiceException(response.content)
@@ -20,6 +20,7 @@ class MerchantCenterService:
20
20
  self._LIST_PRODUCTS = self._URL + "/product-service/products"
21
21
  self._LIST_PRODUCT_STATUSES = self._URL + "/product-service/product-statuses"
22
22
  self._REPORTS_SEARCH = self._URL + "/reports-search"
23
+ self._GET_SUPPLEMENTAL_FEEDS = self._URL + "/feed-service/supplemental-feeds"
23
24
 
24
25
  def list_accounts(self, merchant_account_id: str, secret_id: str):
25
26
  """
@@ -224,3 +225,100 @@ class MerchantCenterService:
224
225
  return service_response["data"]
225
226
  else:
226
227
  raise MerchantServiceException(response.content)
228
+
229
+ def get_supplemental_feeds(self, secret_id: str, merchant_account_id: str) -> bool:
230
+ """
231
+ Gets list of supplemental feeds
232
+ :param secret_id: The ID of the secret in secret manager
233
+ :param merchant_account_id: The ID of the account in Microsoft Advertising
234
+ :return: List of supplemental feeds
235
+ """
236
+ body = {"secret_id": secret_id, "merchant_account_id": merchant_account_id}
237
+ header = get_headers(self._GET_SUPPLEMENTAL_FEEDS)
238
+ response = self.session.request(
239
+ "post", url=self._GET_SUPPLEMENTAL_FEEDS, json=body, headers=header
240
+ )
241
+
242
+ if response.status_code == HTTPStatus.OK:
243
+ service_response = response.json()
244
+ return service_response["data"]
245
+ else:
246
+ raise MerchantServiceException(response.content)
247
+
248
+ def create_supplemental_feed(
249
+ self, secret_id: str, merchant_account_id: str, display_name: str
250
+ ) -> bool:
251
+ """
252
+ Creates a supplemental feed
253
+ :param secret_id: The ID of the secret in secret manager
254
+ :param merchant_account_id: The ID of the account in Microsoft Advertising
255
+ :param display_name: The display name of the feed to be created
256
+ :return: The newly created supplemental feed
257
+ """
258
+ body = {
259
+ "secret_id": secret_id,
260
+ "merchant_account_id": merchant_account_id,
261
+ "display_name": display_name,
262
+ }
263
+ header = get_headers(self._GET_SUPPLEMENTAL_FEEDS)
264
+ response = self.session.request(
265
+ "post", url=self._GET_SUPPLEMENTAL_FEEDS, json=body, headers=header
266
+ )
267
+
268
+ if response.status_code == HTTPStatus.OK:
269
+ service_response = response.json()
270
+ return service_response["data"]
271
+ else:
272
+ raise MerchantServiceException(response.content)
273
+
274
+ def delete_supplemental_feed(
275
+ self, secret_id: str, merchant_account_id: str, feed_id: str
276
+ ) -> bool:
277
+ """
278
+ Deletes a supplemental feed by it id
279
+ :param secret_id: The ID of the secret in secret manager
280
+ :param merchant_account_id: The ID of the account in Microsoft Advertising
281
+ :param feed_id: The ID of the supplemental feed to be deleted
282
+ :return: Status of the operation
283
+ """
284
+ body = {
285
+ "secret_id": secret_id,
286
+ "merchant_account_id": merchant_account_id,
287
+ "feed_id": feed_id,
288
+ }
289
+ header = get_headers(self._GET_SUPPLEMENTAL_FEEDS)
290
+ response = self.session.request(
291
+ "delete", url=self._GET_SUPPLEMENTAL_FEEDS, json=body, headers=header
292
+ )
293
+
294
+ if response.status_code == HTTPStatus.OK:
295
+ service_response = response.json()
296
+ return service_response["data"]
297
+ else:
298
+ raise MerchantServiceException(response.content)
299
+
300
+ def batch_update_products_in_supplemental_feeds(
301
+ self, secret_id: str, merchant_account_id: str, products
302
+ ) -> bool:
303
+ """
304
+ Creates a batch for update of products via supplemental feeds
305
+ :param secret_id: The ID of the secret in secret manager
306
+ :param merchant_account_id: The ID of the account in Microsoft Advertising
307
+ :param products: The products to be updated
308
+ :return: The result of each batch operation
309
+ """
310
+ body = {
311
+ "secret_id": secret_id,
312
+ "merchant_account_id": merchant_account_id,
313
+ "products": products,
314
+ }
315
+ header = get_headers(self._GET_SUPPLEMENTAL_FEEDS)
316
+ response = self.session.request(
317
+ "put", url=self._GET_SUPPLEMENTAL_FEEDS, json=body, headers=header
318
+ )
319
+
320
+ if response.status_code == HTTPStatus.OK:
321
+ service_response = response.json()
322
+ return service_response["data"]
323
+ else:
324
+ raise MerchantServiceException(response.content)
@@ -39,7 +39,9 @@ class MicrosoftAdvertising:
39
39
  )
40
40
  self._GET_BUDGET_SUMMARY_REPORT = self._URL + "/budget-summary-report"
41
41
  self._GET_SHARE_OF_VOICE_REPORT = self._URL + "/share-of-voice-report"
42
- self._GET_SEARCH_CAMPAIGNS_CHANGE_HISTORY_REPORT = self._URL + "/search-campaigns-change-history-report"
42
+ self._GET_SEARCH_CAMPAIGNS_CHANGE_HISTORY_REPORT = (
43
+ self._URL + "/search-campaigns-change-history-report"
44
+ )
43
45
 
44
46
  def get_destination_url_report(
45
47
  self,
@@ -285,7 +287,7 @@ class MicrosoftAdvertising:
285
287
  secret_id: str,
286
288
  date_from: str,
287
289
  date_to: str,
288
- report_columns: List[str]
290
+ report_columns: List[str],
289
291
  ):
290
292
  """
291
293
  Calls endpoint for getting search campaigns change history
@@ -307,7 +309,10 @@ class MicrosoftAdvertising:
307
309
 
308
310
  header = get_headers(self._GET_SEARCH_CAMPAIGNS_CHANGE_HISTORY_REPORT)
309
311
  response = self.session.request(
310
- "post", url=self._GET_SEARCH_CAMPAIGNS_CHANGE_HISTORY_REPORT, json=body, headers=header
312
+ "post",
313
+ url=self._GET_SEARCH_CAMPAIGNS_CHANGE_HISTORY_REPORT,
314
+ json=body,
315
+ headers=header,
311
316
  )
312
317
 
313
318
  if response.status_code == HTTPStatus.OK:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logos-sdk
3
- Version: 0.0.25.dev16
3
+ Version: 0.0.25.dev18
4
4
  Summary: SDK for Logos platform
5
5
  Home-page: https://bitbucket.org/databy/logos-sdk-pip/src/master/
6
6
  Author: Databy.io