Class: KillBillClient::Model::RolledUpUsage

Inherits:
RolledUpUsageAttributes show all
Defined in:
lib/killbill_client/models/rolled_up_usage.rb

Constant Summary collapse

KILLBILL_API_USAGES_PREFIX =
"#{KILLBILL_API_PREFIX}/usages"

Constants inherited from Resource

KillBillClient::Model::Resource::KILLBILL_API_PAGINATION_PREFIX, KillBillClient::Model::Resource::KILLBILL_API_PREFIX

Instance Attribute Summary

Attributes inherited from Resource

#clazz, #etag, #response, #session_id, #uri

Class Method Summary collapse

Methods inherited from Resource

#==, #_to_hash, attribute, create_alias, delete, extract_session_id, from_json, from_response, get, has_many, has_one, #hash, head, #initialize, instantiate_record_from_json, post, put, #refresh, require_multi_tenant_options!, #to_hash, #to_json

Constructor Details

This class inherits a constructor from KillBillClient::Model::Resource

Class Method Details

.find_by_subscription_id(subscription_id, start_date, end_date, options = {}) ⇒ Object



11
12
13
# File 'lib/killbill_client/models/rolled_up_usage.rb', line 11

def find_by_subscription_id(subscription_id, start_date, end_date, options = {})
  find_by_subscription_id_and_type(subscription_id, start_date, end_date, nil, options)
end

.find_by_subscription_id_and_type(subscription_id, start_date, end_date, unit_type, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/killbill_client/models/rolled_up_usage.rb', line 15

def find_by_subscription_id_and_type(subscription_id, start_date, end_date, unit_type, options = {})
  params                  = {}
  params[:startDate] = start_date
  params[:endDate]  = end_date

  path = "#{KILLBILL_API_USAGES_PREFIX}/#{subscription_id}"
  path = "#{path}/#{unit_type}" if unit_type
  get path,
      params,
      options
end