Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ This tap:

[Spaces](https://apidocs.teamwork.com/docs/spaces/v1/spaces/get-v1-spaces-json)

[Tags](https://apidocs.teamwork.com/docs/spaces/v1/tags/get-v1-tags-json)
[ProjectTags](https://apidocs.teamwork.com/docs/teamwork/v3/tags/get-projects-api-v3-tags-json)

[SpaceTags](https://apidocs.teamwork.com/docs/spaces/v1/tags/get-v1-tags-json)

[Tasks](https://apidocs.teamwork.com/docs/teamwork/v3/tasks/get-projects-api-v3-projects-project-id-tasks-json)

Expand Down Expand Up @@ -108,11 +110,16 @@ This tap:
- Primary keys: ['id']
- Replication strategy: **INCREMENTAL**

**[tags](https://apidocs.teamwork.com/docs/spaces/v1/tags/get-v1-tags-json)**
**[project_tags](https://apidocs.teamwork.com/docs/teamwork/v3/tags/get-projects-api-v3-tags-json)**
- Data Key: tags
- Primary keys: ['id']
- Replication strategy: **FULL_TABLE**

**[space_tags](https://apidocs.teamwork.com/docs/spaces/v1/tags/get-v1-tags-json)**
- Data Key: tags
- Primary keys: ['id']
- Replication strategy: **INCREMENTAL**

**[tasks](https://apidocs.teamwork.com/docs/teamwork/v3/tasks/get-projects-api-v3-projects-project-id-tasks-json)**
- Data Key: tasks
- Primary keys: ['id']
Expand Down
13 changes: 10 additions & 3 deletions spike/singer_tap_generator_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,19 @@
"doc_link": "https://apidocs.teamwork.com/docs/spaces/v1/pages/get-v1-spaces-space-id-homepage-json"
},
{
"name": "tags",
"path": "spaces/api/v1/spaces/{spaceId}/tags.json",
"name": "project_tags",
"path": "projects/api/v3/tags.json",
"data_key": "tags",
"replication_method": "FULL_TABLE",
"key_properties": ["id"],
"parent": "spaces",
"doc_link": "https://apidocs.teamwork.com/docs/teamwork/v3/tags/get-projects-api-v3-tags-json"
},
{
"name": "space_tags",
"path": "spaces/api/v1/tags.json",
"data_key": "tags",
"replication_method": "INCREMENTAL",
"key_properties": ["id"],
"doc_link": "https://apidocs.teamwork.com/docs/spaces/v1/tags/get-v1-tags-json"
},
{
Expand Down
55 changes: 55 additions & 0 deletions tap_teamwork/schemas/project_tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"type": "object",
"properties": {
"color": {
"type": [
"string",
"null"
]
},
"count": {
"type": [
"integer",
"null"
]
},
"id": {
"type": [
"integer",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"project": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": [
"integer",
"null"
]
},
"type": {
"type": [
"string",
"null"
]
}
}
},
"projectId": {
"type": [
"integer",
"null"
]
}
}
}
File renamed without changes.
4 changes: 4 additions & 0 deletions tap_teamwork/streams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from tap_teamwork.streams.collaborators import Collaborators
from tap_teamwork.streams.ticket_search import TicketSearch
from tap_teamwork.streams.ticket_priorities import TicketPriorities
from tap_teamwork.streams.project_tags import ProjectTags
from tap_teamwork.streams.space_tags import SpaceTags

# Dictionary mapping stream names to their classes
STREAMS = {
Expand All @@ -41,4 +43,6 @@
"collaborators": Collaborators,
"ticket_search": TicketSearch,
"ticket_priorities": TicketPriorities,
"project_tags": ProjectTags,
"space_tags": SpaceTags
}
19 changes: 19 additions & 0 deletions tap_teamwork/streams/project_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from typing import List, Optional, Dict, Any
from singer import get_logger
from tap_teamwork.streams.abstracts import FullTableStream

LOGGER = get_logger()


class ProjectTags(FullTableStream):
tap_stream_id = "project_tags"
key_properties = ["id"]
replication_method = "FULL_TABLE"
replication_keys = []
data_key = "tags"
path = "projects/api/v3/tags.json"

def get_child_context(
self, record: Dict[str, Any], context: Optional[Dict[str, Any]]
) -> Optional[Dict[str, Any]]:
return None
14 changes: 14 additions & 0 deletions tap_teamwork/streams/space_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from typing import List
from singer import get_logger
from tap_teamwork.streams.abstracts import IncrementalStream

LOGGER = get_logger()


class SpaceTags(IncrementalStream):
tap_stream_id = "space_tags"
key_properties = ["id"]
replication_method = "INCREMENTAL"
replication_keys = ["updatedAt"]
data_key = "tags"
path = "spaces/api/v1/tags.json"
32 changes: 0 additions & 32 deletions tap_teamwork/streams/tags.py

This file was deleted.