diff --git a/airbyte-integrations/connectors/source-zendesk-support/Dockerfile b/airbyte-integrations/connectors/source-zendesk-support/Dockerfile index 69cb8c312ea3..72bc2ab36ba5 100644 --- a/airbyte-integrations/connectors/source-zendesk-support/Dockerfile +++ b/airbyte-integrations/connectors/source-zendesk-support/Dockerfile @@ -25,5 +25,5 @@ COPY source_zendesk_support ./source_zendesk_support ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.2.5 +LABEL io.airbyte.version=0.2.6 LABEL io.airbyte.name=airbyte/source-zendesk-support diff --git a/airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/spec.json b/airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/spec.json index 9d37e224c9e2..ede42b469472 100644 --- a/airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/spec.json +++ b/airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/spec.json @@ -33,8 +33,6 @@ "credentials": { "type": "string", "const": "oauth2.0", - "enum": ["oauth2.0"], - "default": "oauth2.0", "order": 0 }, "access_token": { @@ -54,8 +52,6 @@ "credentials": { "type": "string", "const": "api_token", - "enum": ["api_token"], - "default": "api_token", "order": 0 }, "email": { diff --git a/airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py b/airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py index 965b5e710ce7..3afd4e34356e 100644 --- a/airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py +++ b/airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py @@ -289,8 +289,8 @@ def read_records( class SourceZendeskSupportFullRefreshStream(BaseSourceZendeskSupportStream): """ - # endpoints don't provide the updated_at/created_at fields - # thus we can't implement an incremental logic for them + Endpoints don't provide the updated_at/created_at fields + Thus we can't implement an incremental logic for them """ page_size = 100 @@ -324,7 +324,7 @@ def request_params(self, next_page_token: Mapping[str, Any] = None, **kwargs) -> class SourceZendeskSupportCursorPaginationStream(SourceZendeskSupportFullRefreshStream): """ - # endpoints provide a cursor pagination and sorting mechanism + Endpoints provide a cursor pagination and sorting mechanism """ next_page_field = "next_page" @@ -361,17 +361,17 @@ def request_params( return params -class SourceZendeskTicketExportStream(SourceZendeskSupportCursorPaginationStream): +class SourceZendeskIncrementalExportStream(SourceZendeskSupportCursorPaginationStream): """Incremental Export from Tickets stream: https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/#incremental-ticket-export-time-based - @ param response_list_name: the main nested entity to look at inside of response, defualt = response_list_name + @ param response_list_name: the main nested entity to look at inside of response, default = response_list_name @ param sideload_param : parameter variable to include various information to response more info: https://developer.zendesk.com/documentation/ticketing/using-the-zendesk-api/side_loading/#supported-endpoints """ cursor_field = "updated_at" - response_list_name: str = "tickets" + response_list_name: str = None sideload_param: str = None @staticmethod @@ -410,11 +410,11 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp yield record -class SourceZendeskSupportTicketEventsExportStream(SourceZendeskTicketExportStream): +class SourceZendeskSupportTicketEventsExportStream(SourceZendeskIncrementalExportStream): """Incremental Export from TicketEvents stream: https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/#incremental-ticket-event-export - @ param response_list_name: the main nested entity to look at inside of response, defualt = "ticket_events" + @ param response_list_name: the main nested entity to look at inside of response, default = "ticket_events" @ param response_target_entity: nested property inside of `response_list_name`, default = "child_events" @ param list_entities_from_event : the list of nested child_events entities to include from parent record @ param event_type : specific event_type to check ["Audit", "Change", "Comment", etc] @@ -441,17 +441,21 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp yield event -class Users(SourceZendeskSupportStream): - """Users stream: https://developer.zendesk.com/api-reference/ticketing/users/users/""" +class Users(SourceZendeskIncrementalExportStream): + """Users stream: https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/#incremental-user-export""" + + response_list_name: str = "users" class Organizations(SourceZendeskSupportStream): """Organizations stream: https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/""" -class Tickets(SourceZendeskTicketExportStream): +class Tickets(SourceZendeskIncrementalExportStream): """Tickets stream: https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/#incremental-ticket-export-time-based""" + response_list_name: str = "tickets" + class TicketComments(SourceZendeskSupportTicketEventsExportStream): """ diff --git a/airbyte-integrations/connectors/source-zendesk-support/unit_tests/unit_test.py b/airbyte-integrations/connectors/source-zendesk-support/unit_tests/unit_test.py index 013feab42103..20847fb78f30 100644 --- a/airbyte-integrations/connectors/source-zendesk-support/unit_tests/unit_test.py +++ b/airbyte-integrations/connectors/source-zendesk-support/unit_tests/unit_test.py @@ -15,7 +15,7 @@ DATETIME_FORMAT, END_OF_STREAM_KEY, BaseSourceZendeskSupportStream, - SourceZendeskTicketExportStream, + SourceZendeskIncrementalExportStream, TicketComments, Tickets, ) @@ -90,7 +90,7 @@ def test_str2unixtime(): def test_check_start_time_param(): expected = 1626936955 start_time = calendar.timegm(pendulum.parse(DATETIME_STR).utctimetuple()) - output = SourceZendeskTicketExportStream.check_start_time_param(start_time) + output = SourceZendeskIncrementalExportStream.check_start_time_param(start_time) assert output == expected diff --git a/docs/integrations/sources/zendesk-support.md b/docs/integrations/sources/zendesk-support.md index a4219d945e6a..1376d6c0d07f 100644 --- a/docs/integrations/sources/zendesk-support.md +++ b/docs/integrations/sources/zendesk-support.md @@ -27,7 +27,7 @@ This Source is capable of syncing the following core Streams: * [Ticket Forms](https://developer.zendesk.com/rest_api/docs/support/ticket_forms) * [Ticket Metrics](https://developer.zendesk.com/rest_api/docs/support/ticket_metrics) * [Ticket Metric Events](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_metric_events/) -* [Users](https://developer.zendesk.com/rest_api/docs/support/users) +* [Users](https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/#incremental-user-export) ### Data type mapping @@ -62,7 +62,7 @@ The Zendesk connector should not run into Zendesk API limitations under normal u ### Requirements -* `Subdomain` - this is your Zendesk subdomain that can be found in your account URL. For example, in `https://{MY_SUBDOMAIN}.zendesk.com/`, where `MY_SUBDOMAIN` is the value of your subdomain. +* `Subdomain` - this is your Zendesk subdomain that can be found in your account URL. For example, in `https://{MY_SUBDOMAIN}.zendesk.com/`, where `MY_SUBDOMAIN` is the value of your subdomain. * `Authentication` - Zendesk service provides two authentication methods. Choose between: `OAuth2.0` or `API token`. * Authentication using `OAuth2.0` (Only for Airbyte Cloud) - obtain `access_token` by authorising using your Zendesk Account credentials. Simply proceed by pressing "Authenticate your Zendesk Account" and complete the authentication. * Authentication using `API Token`: @@ -74,6 +74,7 @@ The Zendesk connector should not run into Zendesk API limitations under normal u | Version | Date | Pull Request | Subject | |:---------|:-----------| :----- |:-------------------------------------------------------| +| `0.2.6` | 2022-04-19 | [12122](https://github.com/airbytehq/airbyte/pull/12122) | Fixed the bug when only 100,000 Users are synced [11895](https://github.com/airbytehq/airbyte/issues/11895) and fixed bug when `start_date` is not used on user stream [12059](https://github.com/airbytehq/airbyte/issues/12059). | `0.2.5` | 2022-04-05 | [11727](https://github.com/airbytehq/airbyte/pull/11727) | Fixed the bug when state was not parsed correctly | `0.2.4` | 2022-04-04 | [11688](https://github.com/airbytehq/airbyte/pull/11688) | Small documentation corrections | `0.2.3` | 2022-03-23 | [11349](https://github.com/airbytehq/airbyte/pull/11349) | Fixed the bug when Tickets stream didn't return deleted records