Skip to content

Commit

Permalink
Source Zendesk Support: add availability strategy (#22308)
Browse files Browse the repository at this point in the history
* Source Zendesk Support: add availability strategy

* Source Zendesk Support: bump version, update changelog

* Automated Change

* auto-bump connector version

---------

Co-authored-by: roman-yermilov-gl <[email protected]>
Co-authored-by: Octavia Squidington III <[email protected]>
  • Loading branch information
3 people authored Feb 28, 2023
1 parent 6dab22a commit 33eed67
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,7 @@
- name: Zendesk Support
sourceDefinitionId: 79c1aa37-dae3-42ae-b333-d1c105477715
dockerRepository: airbyte/source-zendesk-support
dockerImageTag: 0.2.24
dockerImageTag: 0.2.25
documentationUrl: https://docs.airbyte.com/integrations/sources/zendesk-support
icon: zendesk-support.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16515,7 +16515,7 @@
path_in_connector_config:
- "credentials"
- "client_secret"
- dockerImage: "airbyte/source-zendesk-support:0.2.24"
- dockerImage: "airbyte/source-zendesk-support:0.2.25"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/zendesk-support"
connectionSpecification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.24
LABEL io.airbyte.version=0.2.25
LABEL io.airbyte.name=airbyte/source-zendesk-support
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

import requests
from airbyte_cdk.sources.streams.http.availability_strategy import HttpAvailabilityStrategy


class ZendeskSupportAvailabilityStrategy(HttpAvailabilityStrategy):
def check_availability(self, stream, logger, source):
try:
get_api_records_count = getattr(stream, "get_api_records_count")
get_api_records_count()
except requests.HTTPError as error:
return self.handle_http_error(stream, logger, source, error)
return True, None
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
from airbyte_cdk.sources.streams.availability_strategy import AvailabilityStrategy
from airbyte_cdk.sources.streams.http import HttpStream
from airbyte_cdk.sources.streams.http.auth.core import HttpAuthenticator
from airbyte_cdk.sources.streams.http.availability_strategy import HttpAvailabilityStrategy
from airbyte_cdk.sources.streams.http.exceptions import DefaultBackoffException
from airbyte_cdk.sources.streams.http.rate_limiting import TRANSIENT_EXCEPTIONS
from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer
from requests.auth import AuthBase
from requests_futures.sessions import PICKLE_ERROR, FuturesSession
from source_zendesk_support.ZendeskSupportAvailabilityStrategy import ZendeskSupportAvailabilityStrategy

DATETIME_FORMAT: str = "%Y-%m-%dT%H:%M:%SZ"
LAST_END_TIME_KEY: str = "_last_end_time"
Expand Down Expand Up @@ -120,8 +122,8 @@ def __init__(self, subdomain: str, start_date: str, ignore_pagination: bool = Fa
self._ignore_pagination = ignore_pagination

@property
def availability_strategy(self) -> Optional["AvailabilityStrategy"]:
return None
def availability_strategy(self) -> Optional[AvailabilityStrategy]:
return HttpAvailabilityStrategy()

def backoff_time(self, response: requests.Response) -> Union[int, float]:
"""
Expand Down Expand Up @@ -220,6 +222,10 @@ def __init__(self, authenticator: Union[AuthBase, HttpAuthenticator] = None, **k
def url_base(self) -> str:
return f"https://{self._subdomain}.zendesk.com/api/v2/"

@property
def availability_strategy(self) -> Optional["AvailabilityStrategy"]:
return ZendeskSupportAvailabilityStrategy()

def path(self, **kwargs):
return self.name

Expand Down
4 changes: 2 additions & 2 deletions connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
| **Dockerhub** | <img alt="Dockerhub icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/dockerhub.svg" height="30" height="30"/> | Source | airbyte/source-dockerhub:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/dockerhub) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-dockerhub) | <small>`72d405a3-56d8-499f-a571-667c03406e43`</small> |
| **Dremio** | <img alt="Dremio icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/dremio.svg" height="30" height="30"/> | Source | airbyte/source-dremio:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/dremio) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-dremio) | <small>`d99e9ace-8621-46c2-9144-76ae4751d64b`</small> |
| **Drift** | <img alt="Drift icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/drift.svg" height="30" height="30"/> | Source | airbyte/source-drift:0.2.5 | alpha | [link](https://docs.airbyte.com/integrations/sources/drift) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-drift) | <small>`445831eb-78db-4b1f-8f1f-0d96ad8739e2`</small> |
| **DynamoDB** | <img alt="DynamoDB icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/dynamodb.svg" height="30" height="30"/> | Source | airbyte/source-dynamodb:0.1.1 | alpha | [link](https://docs.airbyte.com/integrations/sources/dynamodb) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-dynamodb) | <small>`50401137-8871-4c5a-abb7-1f5fda35545a`</small> |
| **DynamoDB** | <img alt="DynamoDB icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/dynamodb.svg" height="30" height="30"/> | Source | airbyte/source-dynamodb:0.1.2 | alpha | [link](https://docs.airbyte.com/integrations/sources/dynamodb) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-dynamodb) | <small>`50401137-8871-4c5a-abb7-1f5fda35545a`</small> |
| **E2E Testing** | <img alt="E2E Testing icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/airbyte.svg" height="30" height="30"/> | Source | airbyte/source-e2e-test:2.1.3 | alpha | [link](https://docs.airbyte.com/integrations/sources/e2e-test) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-e2e-test) | <small>`d53f9084-fa6b-4a5a-976c-5b8392f4ad8a`</small> |
| **Elasticsearch** | <img alt="Elasticsearch icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/elasticsearch.svg" height="30" height="30"/> | Source | airbyte/source-elasticsearch:0.1.1 | alpha | [link](https://docs.airbyte.com/integrations/sources/elasticsearch) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-elasticsearch) | <small>`7cf88806-25f5-4e1a-b422-b2fa9e1b0090`</small> |
| **EmailOctopus** | <img alt="EmailOctopus icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/emailoctopus.svg" height="30" height="30"/> | Source | airbyte/source-emailoctopus:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/emailoctopus) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-emailoctopus) | <small>`46b25e70-c980-4590-a811-8deaf50ee09f`</small> |
Expand Down Expand Up @@ -265,7 +265,7 @@
| **Zendesk Chat** | <img alt="Zendesk Chat icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-chat.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-chat:0.1.12 | generally_available | [link](https://docs.airbyte.com/integrations/sources/zendesk-chat) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-chat) | <small>`40d24d0f-b8f9-4fe0-9e6c-b06c0f3f45e4`</small> |
| **Zendesk Sell** | <img alt="Zendesk Sell icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-sell:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/zendesk-sell) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-sell) | <small>`982eaa4c-bba1-4cce-a971-06a41f700b8c`</small> |
| **Zendesk Sunshine** | <img alt="Zendesk Sunshine icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-sunshine.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-sunshine:0.1.1 | alpha | [link](https://docs.airbyte.com/integrations/sources/zendesk-sunshine) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-sunshine) | <small>`325e0640-e7b3-4e24-b823-3361008f603f`</small> |
| **Zendesk Support** | <img alt="Zendesk Support icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-support.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-support:0.2.24 | generally_available | [link](https://docs.airbyte.com/integrations/sources/zendesk-support) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-support) | <small>`79c1aa37-dae3-42ae-b333-d1c105477715`</small> |
| **Zendesk Support** | <img alt="Zendesk Support icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-support.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-support:0.2.25 | generally_available | [link](https://docs.airbyte.com/integrations/sources/zendesk-support) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-support) | <small>`79c1aa37-dae3-42ae-b333-d1c105477715`</small> |
| **Zendesk Talk** | <img alt="Zendesk Talk icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-talk.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-talk:0.1.6 | generally_available | [link](https://docs.airbyte.com/integrations/sources/zendesk-talk) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-talk) | <small>`c8630570-086d-4a40-99ae-ea5b18673071`</small> |
| **Zenefits** | <img alt="Zenefits icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zenefits.svg" height="30" height="30"/> | Source | airbyte/source-zenefits:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/zenefits) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zenefits) | <small>`8baba53d-2fe3-4e33-bc85-210d0eb62884`</small> |
| **Zenloop** | <img alt="Zenloop icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zenloop.svg" height="30" height="30"/> | Source | airbyte/source-zenloop:0.1.5 | beta | [link](https://docs.airbyte.com/integrations/sources/zenloop) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zenloop) | <small>`f1e4c7f6-db5c-4035-981f-d35ab4998794`</small> |
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/zendesk-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ The Zendesk connector ideally should not run into Zendesk API limitations under

| Version | Date | Pull Request | Subject |
|:---------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `0.2.25` | 2023-02-28 | [22308](https://github.com/airbytehq/airbyte/pull/22308) | Add `AvailabilityStrategy` for all streams |
| `0.2.24` | 2023-02-17 | [23246](https://github.com/airbytehq/airbyte/pull/23246) | Handle `StartTimeTooRecent` error for Tickets stream |
| `0.2.23` | 2023-02-15 | [23035](https://github.com/airbytehq/airbyte/pull/23035) | Handle 403 Error |
| `0.2.22` | 2023-02-14 | [22483](https://github.com/airbytehq/airbyte/pull/22483) | Fix test; handle 400 error |
Expand Down

0 comments on commit 33eed67

Please sign in to comment.