Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rgajula/deng 2902 add reports api #2

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
686 changes: 686 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tool.poetry]
name = "tap-amazon-sp"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
requests = "^2.31.0"
python-amazon-sp-api = "^1.5.0"
singer-python = "^6.0.1"


[tool.poetry.group.dev.dependencies]
pytest = "^8.1.1"
black = "^24.4.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
install_requires=[
'backoff==1.8.0',
'singer-python==5.12.2',
'python-amazon-sp-api==0.12.4'
'python-amazon-sp-api==1.5.0'
],
entry_points="""
[console_scripts]
Expand Down
6 changes: 3 additions & 3 deletions tap_amazon_sp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"refresh_token",
"client_id",
"client_secret",
"aws_access_key",
"aws_secret_key",
"role_arn",
# "aws_access_key",
# "aws_secret_key",
# "role_arn",
"start_date",
]
LOGGER = singer.get_logger()
Expand Down
22 changes: 22 additions & 0 deletions tap_amazon_sp/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from enum import Enum

class ReportPeriod(Enum):
DAY = "DAY"
WEEK = "WEEK"
MONTH = "MONTH"
QUARTER = "QUARTER"
YEAR = "YEAR"

class DistributorView(Enum):
MANUFACTURING = "MANUFACTURING"
SOURCING = "SOURCING"

class SellingProgram(Enum):
RETAIL = "RETAIL"
BUSINESS = "BUSINESS"
FRESH = "FRESH"

class ReportOptions(Enum):
reportPeriod = ReportPeriod
distributorView = DistributorView
sellingProgram = SellingProgram
6 changes: 6 additions & 0 deletions tap_amazon_sp/schemas/create_report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": { "reportId": { "type": "string" } },
"required": ["reportId"]
}
59 changes: 59 additions & 0 deletions tap_amazon_sp/schemas/get_report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"type": "object",
"properties": {
"marketplaceIds": {
"type": "array",
"items": {
"type": "string"
},
"optional": true
},
"reportId": {
"type": "string",
"required": true
},
"reportType": {
"type": "string",
"required": true
},
"dataStartTime": {
"type": "string",
"format": "date-time",
"optional": true
},
"dataEndTime": {
"type": "string",
"format": "date-time",
"optional": true
},
"reportScheduleId": {
"type": "string",
"optional": true
},
"createdTime": {
"type": "string",
"format": "date-time",
"required": true
},
"processingStatus": {
"type": "string",
"enum": ["CANCELLED", "DONE", "FATAL", "IN_PROGRESS", "IN_QUEUE"],
"required": true
},
"processingStartTime": {
"type": "string",
"format": "date-time",
"optional": true
},
"processingEndTime": {
"type": "string",
"format": "date-time",
"optional": true
},
"reportDocumentId": {
"type": "string",
"optional": true
}
}
}

Loading