Skip to content

Commit

Permalink
add talk API phone numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-schick committed Jun 29, 2022
1 parent a35f199 commit f2e8f52
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 0 deletions.
163 changes: 163 additions & 0 deletions tap_zendesk/schemas/talk_phone_numbers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"type": [
"null",
"object"
],
"properties": {
"capabilities": {
"type": [
"null",
"object"
],
"properties": {
"sms": {
"type": [
"null",
"boolean"
]
},
"mms": {
"type": [
"null",
"boolean"
]
},
"voice": {
"type": [
"null",
"boolean"
]
}
}
},
"categorised_greetings": {
"properties": { },
"type": [
"null",
"object"
]
},
"categorised_greetings_with_sub_settings": {
"properties": { },
"type": [
"null",
"object"
]
},
"country_code": {
"type": [
"null",
"string"
]
},
"created_at": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"default_greeting_ids": {
"type": ["null", "array"],
"items": {
"type": [
"string"
]
}
},
"default_group_id": {
"type": [
"null",
"integer"
]
},
"display_number": {
"type": [
"null",
"string"
]
},
"external": {
"type": [
"null",
"boolean"
]
},
"greeting_ids": {
"type": ["null", "array"],
"items": {
"type": [
"integer"
]
}
},
"group_ids": {
"type": ["null", "array"],
"items": {
"type": [
"integer"
]
}
},
"id": {
"type": [
"null",
"integer"
]
},
"location": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"nickname": {
"type": [
"null",
"string"
]
},
"number": {
"type": [
"null",
"string"
]
},
"recorded": {
"type": [
"null",
"boolean"
]
},
"sms_group_id": {
"type": [
"null",
"integer"
]
},
"token": {
"type": [
"null",
"string"
]
},
"toll_free": {
"type": [
"null",
"boolean"
]
},
"transcription": {
"type": [
"null",
"boolean"
]
}
}
}
9 changes: 9 additions & 0 deletions tap_zendesk/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,14 @@ def check_access(self):
'''
self.client.sla_policies()

class TalkPhoneNumbers(Stream):
name = 'talk_phone_numbers'
replication_method = "FULL_TABLE"

def sync(self, state): # pylint: disable=unused-argument
for phone_number in self.client.talk.phone_numbers():
yield (self.stream, phone_number)

STREAMS = {
"tickets": Tickets,
"groups": Groups,
Expand All @@ -654,4 +662,5 @@ def check_access(self):
"tags": Tags,
"ticket_metrics": TicketMetrics,
"sla_policies": SLAPolicies,
"talk_phone_numbers": TalkPhoneNumbers,
}

0 comments on commit f2e8f52

Please sign in to comment.