1
0
mirror of synced 2025-12-25 02:09:19 -05:00

🎉 New Source: Amazon Ads (initial version) (#5023)

* 3772: Amazon Ads source, initial version


Co-authored-by: Dmytro Rezchykov <dmitry.rezchykov@zazmic.com>
Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
This commit is contained in:
Dmytro
2021-08-26 11:15:38 +03:00
committed by GitHub
parent 46a4e89ff3
commit 3630cdeded
66 changed files with 3956 additions and 22 deletions

View File

@@ -0,0 +1,36 @@
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
import pytest
pytest_plugins = ("source_acceptance_test.plugin",)
@pytest.fixture(scope="session", autouse=True)
def connector_setup():
""" This fixture is a placeholder for external resources that acceptance test might require."""
# TODO: setup test dependencies if needed. otherwise remove the TODO comments
yield
# TODO: clean up test dependencies

View File

@@ -0,0 +1,124 @@
{
"streams": [
{
"stream": {
"name": "profiles",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_brands_report_stream",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_campaigns",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_ad_groups",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_product_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_targetings",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_campaigns",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_ad_groups",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_keywords",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_negative_keywords",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_targetings",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
}
]
}

View File

@@ -0,0 +1,24 @@
{
"streams": [
{
"stream": {
"name": "profiles",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_brands_report_stream",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
}
]
}

View File

@@ -0,0 +1,54 @@
{
"streams": [
{
"stream": {
"name": "profiles",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_campaigns",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_ad_groups",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_product_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_targetings",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
}
]
}

View File

@@ -0,0 +1,114 @@
{
"streams": [
{
"stream": {
"name": "profiles",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_campaigns",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_ad_groups",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_product_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_targetings",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_campaigns",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_ad_groups",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_keywords",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_negative_keywords",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_targetings",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
}
]
}

View File

@@ -0,0 +1,15 @@
{
"streams": [
{
"stream": {
"name": "sponsored_products_report_stream",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"default_cursor_field": ["reportDate"]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite",
"source_defined_cursor": true
}
]
}

View File

@@ -0,0 +1,74 @@
{
"streams": [
{
"stream": {
"name": "profiles",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_campaigns",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_ad_groups",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_keywords",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_negative_keywords",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_product_targetings",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
}
]
}

View File

@@ -0,0 +1 @@
{"stream": "profiles", "data": {"profileId": 3893573341008362, "countryCode": "US", "currencyCode": "USD", "dailyBudget": 0.0, "timezone": "America/Los_Angeles", "accountInfo": {"marketplaceStringId": "ATVPDKIKX0DER", "id": "A3LUQZ2NBMFGO4", "type": "seller"}}, "emitted_at": 1627977383000}

View File

@@ -0,0 +1,6 @@
{"stream": "profiles", "data": {"profileId": 3893573341008362, "countryCode": "US", "currencyCode": "USD", "dailyBudget": 0.0, "timezone": "America/Los_Angeles", "accountInfo": {"marketplaceStringId": "ATVPDKIKX0DER", "id": "A3LUQZ2NBMFGO4", "type": "seller"}}, "emitted_at": 1627975186000}
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 37387403419888, "name": "sswdd", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 59249214322256, "name": "My test camp", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 16117299922278, "name": "ssw", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 202914386115504, "name": "ssdf", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
{"stream": "sponsored_display_ad_groups", "data": {"adGroupId": 154135351589329, "campaignId": 59249214322256, "defaultBid": 0.02, "name": "string", "state": "enabled", "bidOptimization": "clicks", "tactic": "T00020"}, "emitted_at": 1627975187000}

View File

@@ -0,0 +1,7 @@
{"stream": "profiles", "data": {"profileId": 3893573341008362, "countryCode": "US", "currencyCode": "USD", "dailyBudget": 0.0, "timezone": "America/Los_Angeles", "accountInfo": {"marketplaceStringId": "ATVPDKIKX0DER", "id": "A3LUQZ2NBMFGO4", "type": "seller"}}, "emitted_at": 1627974510000}
{"stream": "sponsored_product_campaigns", "data": {"campaignId": 68543584424555, "name": "string", "campaignType": "sponsoredProducts", "targetingType": "manual", "premiumBidAdjustment": true, "dailyBudget": 1.0, "startDate": "20221111", "endDate": "20231111", "state": "enabled", "bidding": {"strategy": "legacyForSales", "adjustments": [{"predicate": "placementTop", "percentage": 50}]}, "portfolioId": 83018499803606, "tags": {"PONumber": "examplePONumber", "accountManager": "exampleAccountManager"}}, "emitted_at": 1627974510000}
{"stream": "sponsored_product_campaigns", "data": {"campaignId": 268265378730407, "name": "Test campaging", "campaignType": "sponsoredProducts", "targetingType": "manual", "premiumBidAdjustment": true, "dailyBudget": 1.0, "startDate": "20221111", "endDate": "20231111", "state": "enabled", "bidding": {"strategy": "legacyForSales", "adjustments": [{"predicate": "placementTop", "percentage": 50}]}, "portfolioId": 83018499803606, "tags": {"PONumber": "examplePONumber", "accountManager": "exampleAccountManager"}}, "emitted_at": 1627974510000}
{"stream": "sponsored_product_ad_groups", "data": {"adGroupId": 250306604505843, "name": "My AdGroup for Campaign 1234567890", "campaignId": 68543584424555, "defaultBid": 1.0, "state": "enabled"}, "emitted_at": 1627974511000}
{"stream": "sponsored_product_ad_groups", "data": {"adGroupId": 4145876168099, "name": "string", "campaignId": 68543584424555, "defaultBid": 2.0, "state": "enabled"}, "emitted_at": 1627974511000}
{"stream": "sponsored_product_keywords", "data": {"keywordId": 256986162448099, "adGroupId": 250306604505843, "campaignId": 68543584424555, "keywordText": "alalal", "matchType": "exact", "state": "enabled", "bid": 1.0}, "emitted_at": 1627974512000}
{"stream": "sponsored_product_keywords", "data": {"keywordId": 116579490197540, "adGroupId": 250306604505843, "campaignId": 68543584424555, "keywordText": "string", "matchType": "exact", "state": "enabled", "bid": 1.0}, "emitted_at": 1627974512000}

View File

@@ -0,0 +1,12 @@
{"stream": "profiles", "data": {"profileId": 3893573341008362, "countryCode": "US", "currencyCode": "USD", "dailyBudget": 0.0, "timezone": "America/Los_Angeles", "accountInfo": {"marketplaceStringId": "ATVPDKIKX0DER", "id": "A3LUQZ2NBMFGO4", "type": "seller"}}, "emitted_at": 1627977383000}
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 37387403419888, "name": "sswdd", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 59249214322256, "name": "My test camp", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 16117299922278, "name": "ssw", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 202914386115504, "name": "ssdf", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
{"stream": "sponsored_display_ad_groups", "data": {"adGroupId": 154135351589329, "campaignId": 59249214322256, "defaultBid": 0.02, "name": "string", "state": "enabled", "bidOptimization": "clicks", "tactic": "T00020"}, "emitted_at": 1627975187000}
{"stream": "sponsored_product_campaigns", "data": {"campaignId": 68543584424555, "name": "string", "campaignType": "sponsoredProducts", "targetingType": "manual", "premiumBidAdjustment": true, "dailyBudget": 1.0, "startDate": "20221111", "endDate": "20231111", "state": "enabled", "bidding": {"strategy": "legacyForSales", "adjustments": [{"predicate": "placementTop", "percentage": 50}]}, "portfolioId": 83018499803606, "tags": {"PONumber": "examplePONumber", "accountManager": "exampleAccountManager"}}, "emitted_at": 1627974510000}
{"stream": "sponsored_product_campaigns", "data": {"campaignId": 268265378730407, "name": "Test campaging", "campaignType": "sponsoredProducts", "targetingType": "manual", "premiumBidAdjustment": true, "dailyBudget": 1.0, "startDate": "20221111", "endDate": "20231111", "state": "enabled", "bidding": {"strategy": "legacyForSales", "adjustments": [{"predicate": "placementTop", "percentage": 50}]}, "portfolioId": 83018499803606, "tags": {"PONumber": "examplePONumber", "accountManager": "exampleAccountManager"}}, "emitted_at": 1627974510000}
{"stream": "sponsored_product_ad_groups", "data": {"adGroupId": 250306604505843, "name": "My AdGroup for Campaign 1234567890", "campaignId": 68543584424555, "defaultBid": 1.0, "state": "enabled"}, "emitted_at": 1627974511000}
{"stream": "sponsored_product_ad_groups", "data": {"adGroupId": 4145876168099, "name": "string", "campaignId": 68543584424555, "defaultBid": 2.0, "state": "enabled"}, "emitted_at": 1627974511000}
{"stream": "sponsored_product_keywords", "data": {"keywordId": 256986162448099, "adGroupId": 250306604505843, "campaignId": 68543584424555, "keywordText": "alalal", "matchType": "exact", "state": "enabled", "bid": 1.0}, "emitted_at": 1627974512000}
{"stream": "sponsored_product_keywords", "data": {"keywordId": 116579490197540, "adGroupId": 250306604505843, "campaignId": 68543584424555, "keywordText": "string", "matchType": "exact", "state": "enabled", "bid": 1.0}, "emitted_at": 1627974512000}

View File

@@ -0,0 +1 @@
{ "sponsored_products_report_stream": { "reportDate": "66660804" } }

View File

@@ -0,0 +1,6 @@
{
"client_id": "client_id fake",
"client_secret": " client_secret fake",
"refresh_token": "refresh_token fake",
"scope": "scope"
}

View File

@@ -0,0 +1,44 @@
{
"streams": [
{
"stream": {
"name": "sponsored_display_campaigns",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_ad_groups",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_product_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
},
{
"stream": {
"name": "sponsored_display_targetings",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"source_defined_cursor": false
}
]
}

View File

@@ -0,0 +1,6 @@
{
"client_id": "<user's_client_id>",
"client_secret": "<user's_client_secret>",
"refresh_token": "<user's_ refresh_token>",
"scope": "<user's_scopes>"
}

View File

@@ -0,0 +1 @@
{ "display_report_stream": { "reportDate": "20210804" } }

View File

@@ -0,0 +1,45 @@
{
"documentationUrl": "https://docs.airbyte.io/integrations/sources/amazon-ads",
"connectionSpecification": {
"title": "Amazon Ads Spec",
"type": "object",
"properties": {
"client_id": {
"title": "Client Id",
"description": "Oauth client id <a href=\"https://advertising.amazon.com/API/docs/en-us/setting-up/step-1-create-lwa-app\">How to create your Login with Amazon</a>",
"name": "Client ID",
"type": "string"
},
"client_secret": {
"title": "Client Secret",
"description": "Oauth client secret <a href=\"https://advertising.amazon.com/API/docs/en-us/setting-up/step-1-create-lwa-app\">How to create your Login with Amazon</a>",
"name": "Client secret",
"airbyte_secret": true,
"type": "string"
},
"scope": {
"title": "Scope",
"description": "By default its advertising::campaign_management, but customers may need to set scope to cpc_advertising:campaign_management.",
"default": "advertising::campaign_management",
"name": "Client scope",
"examples": ["cpc_advertising:campaign_management"],
"type": "string"
},
"refresh_token": {
"title": "Refresh Token",
"description": "Oauth 2.0 refresh_token, <a href=\"https://developer.amazon.com/docs/login-with-amazon/conceptual-overview.html\">read details here</a>",
"name": "Oauth refresh token",
"airbyte_secret": true,
"type": "string"
},
"start_date": {
"title": "Start Date",
"description": "Start date for collectiong reports, should not be more than 60 days in past. In YYYY-MM-DD format",
"name": "Start date",
"examples": ["2022-10-10", "2022-10-22"],
"type": "string"
}
},
"required": ["client_id", "client_secret", "refresh_token"]
}
}