airflow.providers.zendesk.hooks.zendesk

Module Contents

Classes

ZendeskHook

Interact with Zendesk. This hook uses the Zendesk conn_id.

class airflow.providers.zendesk.hooks.zendesk.ZendeskHook(zendesk_conn_id=default_conn_name)[source]

Bases: airflow.hooks.base.BaseHook

Interact with Zendesk. This hook uses the Zendesk conn_id.

Parameters

zendesk_conn_id (str) -- The Airflow connection used for Zendesk credentials.

conn_name_attr = zendesk_conn_id[source]
default_conn_name = zendesk_default[source]
conn_type = zendesk[source]
hook_name = Zendesk[source]
get_conn(self)[source]

Get the underlying Zenpy client.

Returns

zenpy.Zenpy client.

Return type

zenpy.Zenpy

get_ticket(self, ticket_id)[source]

Retrieve ticket.

Returns

Ticket object retrieved.

Return type

zenpy.lib.api_objects.Ticket

search_tickets(self, **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(self, tickets, **kwargs)[source]

Create tickets.

Parameters
  • tickets (Union[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

Union[zenpy.lib.api_objects.TicketAudit, zenpy.lib.api_objects.JobStatus]

update_tickets(self, tickets, **kwargs)[source]

Update tickets.

Parameters
  • tickets (Union[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

Union[zenpy.lib.api_objects.TicketAudit, zenpy.lib.api_objects.JobStatus]

delete_tickets(self, tickets, **kwargs)[source]

Delete tickets, returns nothing on success and raises APIException on failure.

Parameters
  • tickets (Union[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

Was this entry helpful?