Sha256: 5f66137e52326556257ef43edc46c57548ca6be24f20d888b7d4e9fb99d5a5cc

Contents?: true

Size: 986 Bytes

Versions: 41

Compression:

Stored size: 986 Bytes

Contents

class Zendesk2::Client::TicketAudit < Cistern::Model
  extend Zendesk2::Attributes

  # @return [Integer] Automatically assigned when creating audits
  identity :id, type: :integer
  # @return [Integer] The ID of the associated ticket
  attribute :ticket_id, type: :integer
  # @return [Hash] Metadata for the audit, custom and system data
  attribute :metadata
  # @return [Hash] This object explains how this audit was created
  attribute :via
  # @return [Time] The time the audit was created
  attribute :created_at, type: :time
  # @return [Integer] The user who created the audit
  attribute :author_id, type: :integer
  # @return [Array] An array of the events that happened in this audit
  attribute :events, type: :array

  def ticket
    requires :ticket_id

    self.connection.tickets.get(self.ticket_id)
  end

  def events
    (self.attributes[:events] || []).map{|ae| Zendesk2::Client::AuditEvent.for(ae.merge(ticket_audit: self, connection: self.connection))}
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
zendesk2-1.4.2 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.4.1 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.4.0 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.3.3 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.3.2 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.3.1 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.3.0 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.10 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.9 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.7 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.6 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.5 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.4 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.3 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.2 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.1 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.2.0 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.1.3 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.1.2 lib/zendesk2/client/models/ticket_audit.rb
zendesk2-1.0.0 lib/zendesk2/client/models/ticket_audit.rb