Class: KillBillClient::Model::Catalog
- Inherits:
-
CatalogAttributes
- Object
- Resource
- CatalogAttributes
- KillBillClient::Model::Catalog
- Defined in:
- lib/killbill_client/models/catalog.rb
Constant Summary collapse
- KILLBILL_API_CATALOG_PREFIX =
"#{KILLBILL_API_PREFIX}/catalog"
Class Method Summary collapse
- .add_tenant_catalog_simple_plan(simple_plan, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .available_addons(base_product_name, account_id = nil, options = {}) ⇒ Object
- .available_base_plans(account_id = nil, options = {}) ⇒ Object
- .delete_catalog(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .get_catalog_phase(subscription_id, requested_date, options = {}) ⇒ Object
- .get_catalog_plan(subscription_id, requested_date, options = {}) ⇒ Object
- .get_catalog_price_list(subscription_id, requested_date, options = {}) ⇒ Object
- .get_catalog_product(subscription_id, requested_date, options = {}) ⇒ Object
- .get_tenant_catalog_json(requested_date = nil, account_id = nil, options = {}) ⇒ Object
- .get_tenant_catalog_versions(account_id = nil, options = {}) ⇒ Object
- .get_tenant_catalog_xml(requested_date = nil, account_id = nil, options = {}) ⇒ Object
- .simple_catalog(account_id = nil, options = {}) ⇒ Object
- .upload_tenant_catalog(catalog_xml, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .validate_catalog(catalog_xml, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Class Method Details
.add_tenant_catalog_simple_plan(simple_plan, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/killbill_client/models/catalog.rb', line 155 def add_tenant_catalog_simple_plan(simple_plan, user = nil, reason = nil, comment = nil, = {}) (, "Uploading a catalog is only supported in multi-tenant mode") post "#{KILLBILL_API_CATALOG_PREFIX}/simplePlan", simple_plan.to_json, { }, { :user => user, :reason => reason, :comment => comment, }.merge() end |
.available_addons(base_product_name, account_id = nil, options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/killbill_client/models/catalog.rb', line 18 def available_addons(base_product_name, account_id = nil, = {}) get "#{KILLBILL_API_CATALOG_PREFIX}/availableAddons", { :baseProductName => base_product_name, :accountId => account_id }, , PlanDetail end |
.available_base_plans(account_id = nil, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/killbill_client/models/catalog.rb', line 28 def available_base_plans(account_id = nil, = {}) get "#{KILLBILL_API_CATALOG_PREFIX}/availableBasePlans", { :accountId => account_id }, , PlanDetail end |
.delete_catalog(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/killbill_client/models/catalog.rb', line 170 def delete_catalog(user = nil, reason = nil, comment = nil, = {}) delete "#{KILLBILL_API_CATALOG_PREFIX}", {}, {}, { :user => user, :reason => reason, :comment => comment, }.merge() end |
.get_catalog_phase(subscription_id, requested_date, options = {}) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/killbill_client/models/catalog.rb', line 84 def get_catalog_phase(subscription_id, requested_date, = {}) (, "Retrieving catalog phase is only supported in multi-tenant mode") params = {} params[:subscriptionId] = subscription_id if subscription_id params[:requestedDate] = requested_date if requested_date get "#{KILLBILL_API_CATALOG_PREFIX}/phase", params, end |
.get_catalog_plan(subscription_id, requested_date, options = {}) ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/killbill_client/models/catalog.rb', line 97 def get_catalog_plan(subscription_id, requested_date, = {}) (, "Retrieving catalog plan is only supported in multi-tenant mode") params = {} params[:subscriptionId] = subscription_id if subscription_id params[:requestedDate] = requested_date if requested_date get "#{KILLBILL_API_CATALOG_PREFIX}/plan", params, end |
.get_catalog_price_list(subscription_id, requested_date, options = {}) ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/killbill_client/models/catalog.rb', line 110 def get_catalog_price_list(subscription_id, requested_date, = {}) (, "Retrieving catalog price list is only supported in multi-tenant mode") params = {} params[:subscriptionId] = subscription_id if subscription_id params[:requestedDate] = requested_date if requested_date get "#{KILLBILL_API_CATALOG_PREFIX}/priceList", params, end |
.get_catalog_product(subscription_id, requested_date, options = {}) ⇒ Object
123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/killbill_client/models/catalog.rb', line 123 def get_catalog_product(subscription_id, requested_date, = {}) (, "Retrieving catalog product list is only supported in multi-tenant mode") params = {} params[:subscriptionId] = subscription_id if subscription_id params[:requestedDate] = requested_date if requested_date get "#{KILLBILL_API_CATALOG_PREFIX}/product", params, end |
.get_tenant_catalog_json(requested_date = nil, account_id = nil, options = {}) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/killbill_client/models/catalog.rb', line 66 def get_tenant_catalog_json(requested_date = nil, account_id = nil, = {}) (, "Retrieving a catalog is only supported in multi-tenant mode") params = {} params[:requestedDate] = requested_date if requested_date params[:account_id] = account_id if account_id get KILLBILL_API_CATALOG_PREFIX, params, { :head => {'Accept' => "application/json"}, :content_type => "application/json", }.merge() end |
.get_tenant_catalog_versions(account_id = nil, options = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/killbill_client/models/catalog.rb', line 37 def get_tenant_catalog_versions(account_id = nil, = {}) (, "Retrieving catalog versions is only supported in multi-tenant mode") get "#{KILLBILL_API_CATALOG_PREFIX}/versions", { :accountId => account_id }, end |
.get_tenant_catalog_xml(requested_date = nil, account_id = nil, options = {}) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/killbill_client/models/catalog.rb', line 48 def get_tenant_catalog_xml(requested_date = nil, account_id = nil, = {}) (, "Retrieving a catalog is only supported in multi-tenant mode") params = {} params[:requestedDate] = requested_date if requested_date params[:account_id] = account_id if account_id get "#{KILLBILL_API_CATALOG_PREFIX}/xml", params, { :head => {'Accept' => "text/xml"}, :content_type => "text/xml", }.merge() end |
.simple_catalog(account_id = nil, options = {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/killbill_client/models/catalog.rb', line 10 def simple_catalog(account_id = nil, = {}) get "#{KILLBILL_API_CATALOG_PREFIX}", { :accountId => account_id }, end |
.upload_tenant_catalog(catalog_xml, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/killbill_client/models/catalog.rb', line 136 def upload_tenant_catalog(catalog_xml, user = nil, reason = nil, comment = nil, = {}) (, "Uploading a catalog is only supported in multi-tenant mode") post "#{KILLBILL_API_CATALOG_PREFIX}/xml", catalog_xml, { }, { :head => {'Accept' => 'application/json'}, :content_type => 'text/xml', :user => user, :reason => reason, :comment => comment, }.merge() get_tenant_catalog_json(nil, nil, ) end |
.validate_catalog(catalog_xml, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/killbill_client/models/catalog.rb', line 182 def validate_catalog(catalog_xml, user = nil, reason = nil, comment = nil, = {}) (, "Validating a catalog is only supported in multi-tenant mode") errors = post "#{KILLBILL_API_CATALOG_PREFIX}/xml/validate", catalog_xml, {}, { :head => {'Accept' => 'application/json'}, :content_type => 'text/xml', :user => user, :reason => reason, :comment => comment, }.merge() end |