Sha256: 9a86238c3fd1692f16dd5e61117b95962aadd0139210d4934f92c6d09a449c86

Contents?: true

Size: 765 Bytes

Versions: 15

Compression:

Stored size: 765 Bytes

Contents

module ChargeBee
  class Event < Model

  attr_accessor :id, :occurred_at, :source, :webhook_status, :webhook_failure_reason, :event_type

  class Content < Result
  end

  def content
    Content.new(@values[:content])
  end

  def self.deserialize(json)
    begin
      webhook_data = JSON.parse(json)
    rescue JSON::ParserError
      raise APIError.new("Invalid webhook object to deserialize")
    end
    webhook_data = Util.symbolize_keys(webhook_data)
    Event.construct(webhook_data)
  end

  # OPERATIONS
  #-----------
    
  def self.list(params={}, env=nil)
    Request.send('get', "/events", params, env)
  end    

  def self.retrieve(id, env=nil)
    Request.send('get', "/events/#{id.to_s}", {}, env)
  end    

  end # ~Event
end # ~ChargeBee    

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
chargebee-1.3.9 lib/chargebee/models/event.rb
chargebee-1.3.8 lib/chargebee/models/event.rb
chargebee-1.3.7 lib/chargebee/models/event.rb
chargebee-1.3.6 lib/chargebee/models/event.rb
chargebee-1.3.5 lib/chargebee/models/event.rb
chargebee-1.3.4 lib/chargebee/models/event.rb
chargebee-1.3.3 lib/chargebee/models/event.rb
chargebee-1.3.2 lib/chargebee/models/event.rb
chargebee-1.3.1 lib/chargebee/models/event.rb
chargebee-1.3.0 lib/chargebee/models/event.rb
chargebee-1.2.9 lib/chargebee/models/event.rb
chargebee-1.2.8 lib/chargebee/models/event.rb
chargebee-1.2.7 lib/chargebee/models/event.rb
chargebee-1.2.6 lib/chargebee/models/event.rb
chargebee-1.2.5 lib/chargebee/models/event.rb