Class: Frame::Billing

Inherits:
APIResource show all
Defined in:
lib/frame/resources/billing.rb

Constant Summary collapse

OBJECT_NAME =
"billing"

Instance Attribute Summary

Attributes inherited from FrameObject

#id, #original_values

Class Method Summary collapse

Methods inherited from APIResource

class_name, #refresh, resource_url, #resource_url, retrieve

Methods included from APIOperations::Request

included

Methods inherited from FrameObject

#[], #[]=, construct_from, #each, #initialize, #initialize_from, #inspect, #keys, #serialize_params, #to_hash, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Frame::FrameObject

Class Method Details

.create_billing_credit(params = {}, opts = {}) ⇒ Object



39
40
41
# File 'lib/frame/resources/billing.rb', line 39

def self.create_billing_credit(params = {}, opts = {})
  request_object(:post, "/v1/billing/billing_credit", params, opts)
end

.create_billing_invoice(params = {}, opts = {}) ⇒ Object



35
36
37
# File 'lib/frame/resources/billing.rb', line 35

def self.create_billing_invoice(params = {}, opts = {})
  request_object(:post, "/v1/billing/billing_invoice", params, opts)
end

.create_metering(params = {}, opts = {}) ⇒ Object



11
12
13
# File 'lib/frame/resources/billing.rb', line 11

def self.create_metering(params = {}, opts = {})
  request_object(:post, "/v1/billing/metering", params, opts)
end

.create_metering_event(params = {}, opts = {}) ⇒ Object



23
24
25
# File 'lib/frame/resources/billing.rb', line 23

def self.create_metering_event(params = {}, opts = {})
  request_object(:post, "/v1/billing/metering_events", params, opts)
end

.customer_report(params = {}, opts = {}) ⇒ Object



47
48
49
# File 'lib/frame/resources/billing.rb', line 47

def self.customer_report(params = {}, opts = {})
  request_object(:get, "/v1/billing/report/customer", params, opts)
end

.event_report(event_name, params = {}, opts = {}) ⇒ Object



51
52
53
# File 'lib/frame/resources/billing.rb', line 51

def self.event_report(event_name, params = {}, opts = {})
  request_object(:get, "/v1/billing/report/event/#{CGI.escape(event_name)}", params, opts)
end

.events_report(params = {}, opts = {}) ⇒ Object



55
56
57
# File 'lib/frame/resources/billing.rb', line 55

def self.events_report(params = {}, opts = {})
  request_object(:get, "/v1/billing/report/events", params, opts)
end

.get_billing_credit(id, opts = {}) ⇒ Object



43
44
45
# File 'lib/frame/resources/billing.rb', line 43

def self.get_billing_credit(id, opts = {})
  request_object(:get, "/v1/billing/billing_credit/#{CGI.escape(id)}", {}, opts)
end

.get_metering(id, opts = {}) ⇒ Object



15
16
17
# File 'lib/frame/resources/billing.rb', line 15

def self.get_metering(id, opts = {})
  request_object(:get, "/v1/billing/metering/#{CGI.escape(id)}", {}, opts)
end

.get_metering_event(id, opts = {}) ⇒ Object



27
28
29
# File 'lib/frame/resources/billing.rb', line 27

def self.get_metering_event(id, opts = {})
  request_object(:get, "/v1/billing/metering_events/#{CGI.escape(id)}", {}, opts)
end

.object_nameObject



7
8
9
# File 'lib/frame/resources/billing.rb', line 7

def self.object_name
  OBJECT_NAME
end

.subscription_report(params = {}, opts = {}) ⇒ Object



59
60
61
# File 'lib/frame/resources/billing.rb', line 59

def self.subscription_report(params = {}, opts = {})
  request_object(:get, "/v1/billing/report/subscription", params, opts)
end

.threshold_progress_report(params = {}, opts = {}) ⇒ Object



63
64
65
# File 'lib/frame/resources/billing.rb', line 63

def self.threshold_progress_report(params = {}, opts = {})
  request_object(:get, "/v1/billing/report/threshold_progress", params, opts)
end

.update_metering(id, params = {}, opts = {}) ⇒ Object



19
20
21
# File 'lib/frame/resources/billing.rb', line 19

def self.update_metering(id, params = {}, opts = {})
  request_object(:patch, "/v1/billing/metering/#{CGI.escape(id)}", params, opts)
end

.update_metering_event(id, params = {}, opts = {}) ⇒ Object



31
32
33
# File 'lib/frame/resources/billing.rb', line 31

def self.update_metering_event(id, params = {}, opts = {})
  request_object(:patch, "/v1/billing/metering_events/#{CGI.escape(id)}", params, opts)
end