Skip to content

Commit

Permalink
Feat.zendesk chat conversion department evets (#19)
Browse files Browse the repository at this point in the history
* feat: new spurces for zendesk chat connector

* feat: new sources for zendesk chat connector
  • Loading branch information
am6010 committed Nov 11, 2022
1 parent 61931e6 commit 5d634e0
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"id": {
"type": ["string"]
},
"timestamp": {
"format": "date-time",
"type": ["null", "string"]
},
"goal_id": {
"type": ["null", "integer"]
},
"goal_name": {
"type": ["null", "string"]
},
"attribution": {
"properties": {
"agent_id": {
"type": ["null", "integer"]
},
"department_id": {
"type": ["null", "integer"]
},
"chat_id": {
"type": ["null", "string"]
},
"chat_timestamp": {
"format": "date-time",
"type": ["null", "string"]
}
},
"type": ["null", "object"],
"additionalProperties": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"department_id": {
"type": ["null", "integer"]
},
"timestamp": {
"format": "date-time",
"type": ["null", "string"]
},
"id": {
"type": ["string"]
},
"field_name": {
"type": ["null", "string"]
},
"value": {
"type": ["null", "object"],
"additionalProperties": true
},
"previous_value": {
"type": ["null", "object"],
"additionalProperties": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http.requests_native_auth import TokenAuthenticator

from .streams import Accounts, Agents, AgentTimelines, Bans, Chats, Departments, Goals, Roles, RoutingSettings, Shortcuts, Skills, Triggers
from .streams import Accounts, Agents, AgentTimelines, Bans, Chats, Conversions, Departments, DepartmentEvents, Goals, Roles, RoutingSettings, Shortcuts, Skills, Triggers


class ZendeskAuthentication:
Expand Down Expand Up @@ -49,7 +49,9 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
Agents(authenticator=authenticator),
Bans(authenticator=authenticator),
Chats(authenticator=authenticator, start_date=config["start_date"]),
Conversions(authenticator=authenticator, start_date=config["start_date"]),
Departments(authenticator=authenticator),
DepartmentEvents(authenticator=authenticator, start_date=config["start_date"]),
Goals(authenticator=authenticator),
Roles(authenticator=authenticator),
RoutingSettings(authenticator=authenticator),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,20 @@ def path(
next_page_token: Mapping[str, Any] = None,
) -> str:
return "routing_settings/account"

class DepartmentEvents(TimeIncrementalStream):
"""
Chats Stream: https://developer.zendesk.com/api-reference/live-chat/chat-api/incremental_export/#incremental-department-events-export
"""
cursor_field = "timestamp"
data_field = "department_events"
limit = 1000


class Conversions(TimeIncrementalStream):
"""
Chats Stream: https://developer.zendesk.com/api-reference/live-chat/chat-api/incremental_export/#incremental-conversions-export
"""
cursor_field = "timestamp"
data_field = "conversions"
limit = 1000

0 comments on commit 5d634e0

Please sign in to comment.