Class: ZendeskAPI::Ticket

Inherits:
Resource show all
Defined in:
lib/zendesk_api/resources/ticket.rb

Defined Under Namespace

Classes: Audit

Instance Attribute Summary

Attributes inherited from Data

#association, #attributes

Class Method Summary collapse

Methods included from Read

#find

Methods included from Destroy

#destroy, #destroyed?

Methods included from Save

#save, #save!, #save_associations

Methods included from Verbs

#delete, #post, #put

Methods inherited from Data

#==, #id, #initialize, #method_missing, #new_record?, only_send_unnested_params, #path, resource_name, singular_resource_name, #to_s, unnested_params

Methods included from Associations

#wrap_resource

Constructor Details

This class inherits a constructor from ZendeskAPI::Data

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ZendeskAPI::Data

Class Method Details

.import(client, attributes) ⇒ Ticket

Imports a ticket through the imports/tickets endpoint

Parameters:

  • client (Client)

    The Client object to be used

  • attributes (Hash)

    The attributes to create.

Returns:

  • (Ticket)

    Created object or nil



35
36
37
38
39
# File 'lib/zendesk_api/resources/ticket.rb', line 35

def self.import(client, attributes)
  ticket = new(client, attributes)
  return unless ticket.save(:path => "imports/tickets")
  ticket
end

.incremental_export(client, start_time) ⇒ Collection

Gets a incremental export of tickets from the start_time until now.

Parameters:

  • client (Client)

    The Client object to be used

  • start_time (Integer)

    The start_time parameter

Returns:



27
28
29
# File 'lib/zendesk_api/resources/ticket.rb', line 27

def self.incremental_export(client, start_time)
  ZendeskAPI::Collection.new(client, self, :path => "exports/tickets?start_time=#{start_time.to_i}")
end