Class: KillBillClient::Model::Tenant
- Inherits:
-
TenantAttributes
- Object
- Resource
- TenantAttributes
- KillBillClient::Model::Tenant
- Defined in:
- lib/killbill_client/models/tenant.rb
Constant Summary collapse
- KILLBILL_API_TENANTS_PREFIX =
"#{KILLBILL_API_PREFIX}/tenants"- KILLBILL_API_TENANTS_NOTIFICATION =
"#{KILLBILL_API_TENANTS_PREFIX}/registerNotificationCallback"- KILLBILL_API_TENANTS_SYSTEM_CONFIGURATION =
"#{KILLBILL_API_TENANTS_PREFIX}/uploadPerTenantConfig"- KILLBILL_API_TENANTS_PLUGIN_PAYMENT_STATE_MACHINE =
"#{KILLBILL_API_TENANTS_PREFIX}/uploadPluginPaymentStateMachineConfig"
Class Method Summary collapse
- .add_payment_state_machine(plugin_name, state_machine_config, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .add_system_configuration(configuration, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .delete_payment_state_machine(plugin_name, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .delete_push_notification(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .delete_system_configurations(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .delete_tenant_key_value(key_name, key_path, error_id_str, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .delete_tenant_plugin_config(plugin_name, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .delete_tenant_user_key_value(key_name, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .find_by_api_key(api_key, options = {}) ⇒ Object
- .find_by_id(tenant_id, options = {}) ⇒ Object
- .get_tenant_key_value(key_name, key_path, error_id_str, options = {}) ⇒ Object
- .get_tenant_plugin_config(plugin_name, options = {}) ⇒ Object
- .get_tenant_user_key_value(key_name, options = {}) ⇒ Object
- .register_push_notification(cb, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .retrieve_payment_state_machine(plugin_name, options = {}) ⇒ Object
- .retrieve_push_notification(options = {}) ⇒ Object
- .retrieve_system_configurations(options = {}) ⇒ Object
- .search_tenant_config(key_prefix, options = {}) ⇒ Object
- .upload_tenant_key_value(key_name, key_value, key_path, get_method, error_id_str, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .upload_tenant_plugin_config(plugin_name, plugin_config, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- .upload_tenant_user_key_value(key_name, key_value, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Instance Method Summary collapse
Class Method Details
.add_payment_state_machine(plugin_name, state_machine_config, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/killbill_client/models/tenant.rb', line 170 def add_payment_state_machine(plugin_name, state_machine_config, user = nil, reason = nil, comment = nil, = {}) (, "Payment state machine is only supported in multi-tenant mode") post "#{KILLBILL_API_TENANTS_PLUGIN_PAYMENT_STATE_MACHINE}/#{plugin_name}", state_machine_config, {}, { :content_type => 'text/plain', :user => user, :reason => reason, :comment => comment, }.merge() end |
.add_system_configuration(configuration, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/killbill_client/models/tenant.rb', line 140 def add_system_configuration(configuration, user = nil, reason = nil, comment = nil, = {}) (, "System configuration is only supported in multi-tenant mode") post "#{KILLBILL_API_TENANTS_SYSTEM_CONFIGURATION}", configuration, {}, { :content_type => 'text/plain', :user => user, :reason => reason, :comment => comment, }.merge() end |
.delete_payment_state_machine(plugin_name, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/killbill_client/models/tenant.rb', line 188 def delete_payment_state_machine(plugin_name, user = nil, reason = nil, comment = nil, = {}) (, "Payment state machine is only supported in multi-tenant mode") delete "#{KILLBILL_API_TENANTS_PLUGIN_PAYMENT_STATE_MACHINE}/#{plugin_name}", {}, {}, { :user => user, :reason => reason, :comment => comment, }.merge() end |
.delete_push_notification(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/killbill_client/models/tenant.rb', line 128 def delete_push_notification(user = nil, reason = nil, comment = nil, = {}) (, "Push notification is only supported in multi-tenant mode") delete "#{KILLBILL_API_TENANTS_NOTIFICATION}", {}, {}, { :user => user, :reason => reason, :comment => comment, }.merge() end |
.delete_system_configurations(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/killbill_client/models/tenant.rb', line 158 def delete_system_configurations(user = nil, reason = nil, comment = nil, = {}) (, "System configuration is only supported in multi-tenant mode") delete "#{KILLBILL_API_TENANTS_SYSTEM_CONFIGURATION}", {}, {}, { :user => user, :reason => reason, :comment => comment, }.merge() end |
.delete_tenant_key_value(key_name, key_path, error_id_str, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/killbill_client/models/tenant.rb', line 93 def delete_tenant_key_value(key_name, key_path, error_id_str, user = nil, reason = nil, comment = nil, = {}) (, "Deleting a #{error_id_str} is only supported in multi-tenant mode") uri = KILLBILL_API_TENANTS_PREFIX + "/#{key_path}/" + key_name delete uri, {}, { }, { :content_type => 'text/plain', :user => user, :reason => reason, :comment => comment, }.merge() end |
.delete_tenant_plugin_config(plugin_name, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
32 33 34 |
# File 'lib/killbill_client/models/tenant.rb', line 32 def delete_tenant_plugin_config(plugin_name, user = nil, reason = nil, comment = nil, = {}) delete_tenant_key_value(plugin_name, "uploadPluginConfig", "plugin config", user, reason, comment, ) end |
.delete_tenant_user_key_value(key_name, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
45 46 47 |
# File 'lib/killbill_client/models/tenant.rb', line 45 def delete_tenant_user_key_value(key_name, user = nil, reason = nil, comment = nil, = {}) delete_tenant_key_value(key_name, "userKeyValue", "tenant key/value", user, reason, comment, ) end |
.find_by_api_key(api_key, options = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/killbill_client/models/tenant.rb', line 18 def find_by_api_key(api_key, = {}) get "#{KILLBILL_API_TENANTS_PREFIX}/?apiKey=#{api_key}", {}, end |
.find_by_id(tenant_id, options = {}) ⇒ Object
12 13 14 15 16 |
# File 'lib/killbill_client/models/tenant.rb', line 12 def find_by_id(tenant_id, = {}) get "#{KILLBILL_API_TENANTS_PREFIX}/#{tenant_id}", {}, end |
.get_tenant_key_value(key_name, key_path, error_id_str, options = {}) ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/killbill_client/models/tenant.rb', line 62 def get_tenant_key_value(key_name, key_path, error_id_str, = {}) (, "Retrieving a #{error_id_str} is only supported in multi-tenant mode") uri = KILLBILL_API_TENANTS_PREFIX + "/#{key_path}/" + key_name get uri, {}, { }.merge(), KillBillClient::Model::TenantKeyValueAttributes end |
.get_tenant_plugin_config(plugin_name, options = {}) ⇒ Object
24 25 26 |
# File 'lib/killbill_client/models/tenant.rb', line 24 def get_tenant_plugin_config(plugin_name, = {}) get_tenant_key_value(plugin_name, "uploadPluginConfig", "plugin config", ) end |
.get_tenant_user_key_value(key_name, options = {}) ⇒ Object
36 37 38 |
# File 'lib/killbill_client/models/tenant.rb', line 36 def get_tenant_user_key_value(key_name, = {}) get_tenant_key_value(key_name, "userKeyValue", "tenant key/value", ) end |
.register_push_notification(cb, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/killbill_client/models/tenant.rb', line 111 def register_push_notification(cb, user = nil, reason = nil, comment = nil, = {}) (, "Push notification is only supported in multi-tenant mode") post "#{KILLBILL_API_TENANTS_NOTIFICATION}", {}, {:cb => cb}, { :user => user, :reason => reason, :comment => comment, }.merge() end |
.retrieve_payment_state_machine(plugin_name, options = {}) ⇒ Object
183 184 185 186 |
# File 'lib/killbill_client/models/tenant.rb', line 183 def retrieve_payment_state_machine(plugin_name, = {}) (, "Payment state machine is only supported in multi-tenant mode") get "#{KILLBILL_API_TENANTS_PLUGIN_PAYMENT_STATE_MACHINE}/#{plugin_name}", {}, end |
.retrieve_push_notification(options = {}) ⇒ Object
123 124 125 126 |
# File 'lib/killbill_client/models/tenant.rb', line 123 def retrieve_push_notification( = {}) (, "Push notification is only supported in multi-tenant mode") get "#{KILLBILL_API_TENANTS_NOTIFICATION}", {}, end |
.retrieve_system_configurations(options = {}) ⇒ Object
153 154 155 156 |
# File 'lib/killbill_client/models/tenant.rb', line 153 def retrieve_system_configurations( = {}) (, "System configuration is only supported in multi-tenant mode") get "#{KILLBILL_API_TENANTS_SYSTEM_CONFIGURATION}", {}, end |
.search_tenant_config(key_prefix, options = {}) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/killbill_client/models/tenant.rb', line 49 def search_tenant_config(key_prefix, = {}) (, "Searching for plugin config is only supported in multi-tenant mode") uri = KILLBILL_API_TENANTS_PREFIX + "/uploadPerTenantConfig/" + key_prefix + "/search" get uri, {}, { }.merge(), KillBillClient::Model::TenantKeyValueAttributes end |
.upload_tenant_key_value(key_name, key_value, key_path, get_method, error_id_str, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/killbill_client/models/tenant.rb', line 75 def upload_tenant_key_value(key_name, key_value, key_path, get_method, error_id_str, user = nil, reason = nil, comment = nil, = {}) (, "Uploading a #{error_id_str} is only supported in multi-tenant mode") uri = KILLBILL_API_TENANTS_PREFIX + "/#{key_path}/" + key_name post uri, key_value, { }, { :content_type => 'text/plain', :user => user, :reason => reason, :comment => comment, }.merge() send(get_method.to_sym, key_name, ) end |
.upload_tenant_plugin_config(plugin_name, plugin_config, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
28 29 30 |
# File 'lib/killbill_client/models/tenant.rb', line 28 def upload_tenant_plugin_config(plugin_name, plugin_config, user = nil, reason = nil, comment = nil, = {}) upload_tenant_key_value(plugin_name, plugin_config, "uploadPluginConfig", "get_tenant_plugin_config", "plugin config", user, reason, comment, ) end |
.upload_tenant_user_key_value(key_name, key_value, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
40 41 42 |
# File 'lib/killbill_client/models/tenant.rb', line 40 def upload_tenant_user_key_value(key_name, key_value, user = nil, reason = nil, comment = nil, = {}) upload_tenant_key_value(key_name, key_value, "userKeyValue", "get_tenant_user_key_value", "tenant key/value", user, reason, comment, ) end |
Instance Method Details
#create(use_global_default = true, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/killbill_client/models/tenant.rb', line 202 def create(use_global_default=true, user = nil, reason = nil, comment = nil, = {}) created_tenant = self.class.post KILLBILL_API_TENANTS_PREFIX, to_json, {:useGlobalDefault => use_global_default}, { :user => user, :reason => reason, :comment => comment, }.merge() # # Specify api_key and api_secret before making the call to retrieve the tenant object # otherwise that would fail with a 401 # [:api_key] = @api_key [:api_secret] = @api_secret created_tenant.refresh() end |