Class: KillBillClient::Model::Catalog
Constant Summary
collapse
- KILLBILL_API_CATALOG_PREFIX =
"#{KILLBILL_API_PREFIX}/catalog"
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
-
.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
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
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, = nil, options = {})
require_multi_tenant_options!(options, "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 => ,
}.merge(options)
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, options = {})
get "#{KILLBILL_API_CATALOG_PREFIX}/availableAddons",
{
:baseProductName => base_product_name,
:accountId => account_id
},
options,
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, options = {})
get "#{KILLBILL_API_CATALOG_PREFIX}/availableBasePlans",
{
:accountId => account_id
},
options,
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, = nil, options = {})
delete "#{KILLBILL_API_CATALOG_PREFIX}",
{},
{},
{
:user => user,
:reason => reason,
:comment => ,
}.merge(options)
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, options = {})
require_multi_tenant_options!(options, "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,
options
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, options = {})
require_multi_tenant_options!(options, "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,
options
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, options = {})
require_multi_tenant_options!(options, "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,
options
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, options = {})
require_multi_tenant_options!(options, "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,
options
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, options = {})
require_multi_tenant_options!(options, "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(options)
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, options = {})
require_multi_tenant_options!(options, "Retrieving catalog versions is only supported in multi-tenant mode")
get "#{KILLBILL_API_CATALOG_PREFIX}/versions",
{
:accountId => account_id
},
options
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, options = {})
require_multi_tenant_options!(options, "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(options)
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, options = {})
get "#{KILLBILL_API_CATALOG_PREFIX}",
{
:accountId => account_id
},
options
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, = nil, options = {})
require_multi_tenant_options!(options, "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 => ,
}.merge(options)
get_tenant_catalog_json(nil, nil, options)
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, = nil, options = {})
require_multi_tenant_options!(options, "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 => ,
}.merge(options)
end
|