airflow.providers.zendesk.hooks.zendesk¶
Classes¶
Interact with Zendesk. This hook uses the Zendesk conn_id. |
Module Contents¶
- class airflow.providers.zendesk.hooks.zendesk.ZendeskHook(zendesk_conn_id=default_conn_name)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseHookInteract with Zendesk. This hook uses the Zendesk conn_id.
- Parameters:
zendesk_conn_id (str) – The Airflow connection used for Zendesk credentials.
Authentication modes (configured via Connection extras):
API token (recommended): Set
tokenin the extra field to your Zendesk API token. Theloginfield should be your email address.API token via password field: Set
use_token: truein extras and put the API token in thepasswordfield. Useful when managing secrets via environment variables.loginshould be your email address.OAuth token: Set
oauth_tokenin the extra field.loginis not required for OAuth.Password (deprecated): If none of the above extras are set, the
passwordfield is used for basic authentication. Zendesk has deprecated this method; prefer API token auth.
Precedence order when multiple extras are set:
use_token→token→oauth_token→ password fallback.- property zenpy_client: zenpy.Zenpy[source]¶
Get the underlying Zenpy client (cached property for backward compatibility).
- Returns:
zenpy.Zenpy client.
- Return type:
zenpy.Zenpy
- get_conn()[source]¶
Get the underlying Zenpy client (lazy-initialized).
- Returns:
zenpy.Zenpy client.
- Return type:
zenpy.Zenpy
- property get: Any[source]¶
Expose the underlying Zenpy search/get method for backward compatibility.
Used by system tests and legacy custom calls.
- get_ticket(ticket_id)[source]¶
Retrieve ticket.
- Returns:
Ticket object retrieved.
- Return type:
zenpy.lib.api_objects.Ticket
- search_tickets(**kwargs)[source]¶
Search tickets.
- Parameters:
kwargs – (optional) Search fields given to the zenpy search method.
- Returns:
SearchResultGenerator of Ticket objects.
- Return type:
zenpy.lib.generator.SearchResultGenerator
- create_tickets(tickets, **kwargs)[source]¶
Create tickets.
- Parameters:
tickets (zenpy.lib.api_objects.Ticket | list[zenpy.lib.api_objects.Ticket]) – Ticket or List of Ticket to create.
kwargs – (optional) Additional fields given to the zenpy create method.
- Returns:
A TicketAudit object containing information about the Ticket created. When sending bulk request, returns a JobStatus object.
- Return type:
zenpy.lib.api_objects.TicketAudit | zenpy.lib.api_objects.JobStatus
- update_tickets(tickets, **kwargs)[source]¶
Update tickets.
- Parameters:
tickets (zenpy.lib.api_objects.Ticket | list[zenpy.lib.api_objects.Ticket]) – Updated Ticket or List of Ticket object to update.
kwargs – (optional) Additional fields given to the zenpy update method.
- Returns:
A TicketAudit object containing information about the Ticket updated. When sending bulk request, returns a JobStatus object.
- Return type:
zenpy.lib.api_objects.TicketAudit | zenpy.lib.api_objects.JobStatus
- delete_tickets(tickets, **kwargs)[source]¶
Delete tickets, returns nothing on success and raises APIException on failure.
- Parameters:
tickets (zenpy.lib.api_objects.Ticket | list[zenpy.lib.api_objects.Ticket]) – Ticket or List of Ticket to delete.
kwargs – (optional) Additional fields given to the zenpy delete method.
- Returns:
- Return type:
None