Class: KillBillClient::Model::Bundle
- Inherits:
-
BundleAttributes
- Object
- Resource
- BundleAttributes
- KillBillClient::Model::Bundle
- Defined in:
- lib/killbill_client/models/bundle.rb
Constant Summary collapse
- KILLBILL_API_BUNDLES_PREFIX =
"#{KILLBILL_API_PREFIX}/bundles"
Constants inherited from Resource
Resource::KILLBILL_API_PAGINATION_PREFIX, Resource::KILLBILL_API_PREFIX
Instance Attribute Summary
Attributes inherited from Resource
#clazz, #etag, #response, #session_id, #uri
Class Method Summary collapse
-
.find_all_by_account_id_and_external_key(account_id, external_key, options = {}) ⇒ Object
Return active and inactive ones.
-
.find_by_external_key(external_key, options = {}) ⇒ Object
Return the active one.
- .find_by_id(bundle_id, options = {}) ⇒ Object
Instance Method Summary collapse
-
#pause(requested_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Pause the bundle (and all its subscription).
-
#resume(requested_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Resume the bundle (and all its subscription).
-
#transfer(bundle_id, requested_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Transfer the bundle to the new account.
Methods inherited from Resource
#==, #_to_hash, attribute, create_alias, delete, extract_session_id, from_json, from_response, get, has_many, has_one, #hash, head, instantiate_record_from_json, post, put, #refresh, #to_hash, #to_json
Class Method Details
.find_all_by_account_id_and_external_key(account_id, external_key, options = {}) ⇒ Object
Return active and inactive ones
25 26 27 28 29 |
# File 'lib/killbill_client/models/bundle.rb', line 25 def find_all_by_account_id_and_external_key(account_id, external_key, = {}) get "#{Account::KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/bundles?externalKey=#{external_key}", {}, end |
.find_by_external_key(external_key, options = {}) ⇒ Object
Return the active one
18 19 20 21 22 |
# File 'lib/killbill_client/models/bundle.rb', line 18 def find_by_external_key(external_key, = {}) get "#{KILLBILL_API_BUNDLES_PREFIX}?externalKey=#{external_key}", {}, end |
.find_by_id(bundle_id, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/killbill_client/models/bundle.rb', line 11 def find_by_id(bundle_id, = {}) get "#{KILLBILL_API_BUNDLES_PREFIX}/#{bundle_id}", {}, end |
Instance Method Details
#pause(requested_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Pause the bundle (and all its subscription)
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/killbill_client/models/bundle.rb', line 53 def pause(requested_date = nil, user = nil, reason = nil, comment = nil, = {}) params = {} params[:requestedDate] = requested_date unless requested_date.nil? self.class.put "#{KILLBILL_API_BUNDLES_PREFIX}/#{@bundle_id}/pause", {}, params, { :user => user, :reason => reason, :comment => comment, }.merge() end |
#resume(requested_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Resume the bundle (and all its subscription)
69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/killbill_client/models/bundle.rb', line 69 def resume(requested_date = nil, user = nil, reason = nil, comment = nil, = {}) params = {} params[:requestedDate] = requested_date unless requested_date.nil? self.class.put "#{KILLBILL_API_BUNDLES_PREFIX}/#{@bundle_id}/resume", {}, params, { :user => user, :reason => reason, :comment => comment, }.merge() end |
#transfer(bundle_id, requested_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Transfer the bundle to the new account. the new account_id should be set in this object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/killbill_client/models/bundle.rb', line 35 def transfer(bundle_id, requested_date = nil, user = nil, reason = nil, comment = nil, = {}) params = {} params[:requestedDate] = requested_date unless requested_date.nil? result = self.class.put "#{KILLBILL_API_BUNDLES_PREFIX}/#{bundle_id}", to_json, params, { :user => user, :reason => reason, :comment => comment, }.merge() result.refresh() end |