Class: Brevo::BalanceApi
- Inherits:
-
Object
- Object
- Brevo::BalanceApi
- Defined in:
- lib/brevo/api/balance_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#begin_transaction(pid, body, opts = {}) ⇒ Transaction
Create new transaction Creates new transaction and returns information.
-
#begin_transaction_with_http_info(pid, body, opts = {}) ⇒ Array<(Transaction, Fixnum, Hash)>
Create new transaction Creates new transaction and returns information.
-
#cancel_transaction(pid, tid, opts = {}) ⇒ Transaction
Cancel transaction Cancels transaction.
-
#cancel_transaction_with_http_info(pid, tid, opts = {}) ⇒ Array<(Transaction, Fixnum, Hash)>
Cancel transaction Cancels transaction.
-
#complete_transaction(pid, tid, opts = {}) ⇒ Transaction
Complete transaction Completes transaction.
-
#complete_transaction_with_http_info(pid, tid, opts = {}) ⇒ Array<(Transaction, Fixnum, Hash)>
Complete transaction Completes transaction.
-
#create_balance_limit(pid, bdid, body, opts = {}) ⇒ BalanceLimit
Create balance limits Creates balance limit and sends the created UUID along with the data.
-
#create_balance_limit_with_http_info(pid, bdid, body, opts = {}) ⇒ Array<(BalanceLimit, Fixnum, Hash)>
Create balance limits Creates balance limit and sends the created UUID along with the data.
-
#create_balance_order(pid, body, opts = {}) ⇒ BalanceOrder
Create balance order Returns created order.
-
#create_balance_order_with_http_info(pid, body, opts = {}) ⇒ Array<(BalanceOrder, Fixnum, Hash)>
Create balance order Returns created order.
-
#delete_balance_definition(pid, bdid, opts = {}) ⇒ nil
Delete balance definition Delete Balance definition.
-
#delete_balance_definition_with_http_info(pid, bdid, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete balance definition Delete Balance definition.
-
#delete_balance_limit(pid, bdid, blid, opts = {}) ⇒ nil
Delete balance limit Delete balance limit.
-
#delete_balance_limit_with_http_info(pid, bdid, blid, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete balance limit Delete balance limit.
-
#get_balance_definition(pid, bdid, opts = {}) ⇒ BalanceDefinition
Get balance definition Returns balance definition.
-
#get_balance_definition_list(pid, opts = {}) ⇒ BalanceDefinitionPage
Get balance definition list Returns balance definition page.
-
#get_balance_definition_list_with_http_info(pid, opts = {}) ⇒ Array<(BalanceDefinitionPage, Fixnum, Hash)>
Get balance definition list Returns balance definition page.
-
#get_balance_definition_with_http_info(pid, bdid, opts = {}) ⇒ Array<(BalanceDefinition, Fixnum, Hash)>
Get balance definition Returns balance definition.
-
#get_balance_limit(pid, bdid, blid, opts = {}) ⇒ BalanceLimit
Get balance limits Fetches balance limits and send the created UUID along with the data.
-
#get_balance_limit_with_http_info(pid, bdid, blid, opts = {}) ⇒ Array<(BalanceLimit, Fixnum, Hash)>
Get balance limits Fetches balance limits and send the created UUID along with the data.
-
#get_contact_balances(pid, opts = {}) ⇒ ContactBalancesResp
Get balance list Returns balance list.
-
#get_contact_balances_with_http_info(pid, opts = {}) ⇒ Array<(ContactBalancesResp, Fixnum, Hash)>
Get balance list Returns balance list.
-
#get_subscription_balances(cid, pid, opts = {}) ⇒ ModelSubscriptionBalanceResp
Get subscription balances Returns subscription balances.
-
#get_subscription_balances_with_http_info(cid, pid, opts = {}) ⇒ Array<(ModelSubscriptionBalanceResp, Fixnum, Hash)>
Get subscription balances Returns subscription balances.
-
#initialize(api_client = ApiClient.default) ⇒ BalanceApi
constructor
A new instance of BalanceApi.
-
#loyalty_balance_programs_pid_active_balance_get(pid, contact_id, balance_definition_id, opts = {}) ⇒ BalanceLimit
Get Active Balances API Returns Active Balances.
-
#loyalty_balance_programs_pid_active_balance_get_with_http_info(pid, contact_id, balance_definition_id, opts = {}) ⇒ Array<(BalanceLimit, Fixnum, Hash)>
Get Active Balances API Returns Active Balances.
-
#loyalty_balance_programs_pid_balance_definitions_post(pid, body, opts = {}) ⇒ BalanceDefinition
Create balance definition Creates balance definition and returns information.
-
#loyalty_balance_programs_pid_balance_definitions_post_with_http_info(pid, body, opts = {}) ⇒ Array<(BalanceDefinition, Fixnum, Hash)>
Create balance definition Creates balance definition and returns information.
-
#loyalty_balance_programs_pid_subscriptions_cid_balances_post(pid, cid, body, opts = {}) ⇒ Balance
Create subscription balances Creates a balance for a contact.
-
#loyalty_balance_programs_pid_subscriptions_cid_balances_post_with_http_info(pid, cid, body, opts = {}) ⇒ Array<(Balance, Fixnum, Hash)>
Create subscription balances Creates a balance for a contact.
-
#loyalty_balance_programs_pid_transaction_history_get(pid, contact_id, balance_definition_id, opts = {}) ⇒ TransactionHistoryResp
Get Transaction History API Returns transaction history.
-
#loyalty_balance_programs_pid_transaction_history_get_with_http_info(pid, contact_id, balance_definition_id, opts = {}) ⇒ Array<(TransactionHistoryResp, Fixnum, Hash)>
Get Transaction History API Returns transaction history.
-
#update_balance_definition(pid, bdid, body, opts = {}) ⇒ BalanceDefinition
Update balance definition Updates Balance definition.
-
#update_balance_definition_with_http_info(pid, bdid, body, opts = {}) ⇒ Array<(BalanceDefinition, Fixnum, Hash)>
Update balance definition Updates Balance definition.
-
#update_balance_limit(pid, bdid, blid, body, opts = {}) ⇒ BalanceLimit
Updates balance limit Updates balance limit.
-
#update_balance_limit_with_http_info(pid, bdid, blid, body, opts = {}) ⇒ Array<(BalanceLimit, Fixnum, Hash)>
Updates balance limit Updates balance limit.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ BalanceApi
Returns a new instance of BalanceApi.
19 20 21 |
# File 'lib/brevo/api/balance_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/brevo/api/balance_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#begin_transaction(pid, body, opts = {}) ⇒ Transaction
Create new transaction Creates new transaction and returns information
28 29 30 31 |
# File 'lib/brevo/api/balance_api.rb', line 28 def begin_transaction(pid, body, opts = {}) data, _status_code, _headers = begin_transaction_with_http_info(pid, body, opts) data end |
#begin_transaction_with_http_info(pid, body, opts = {}) ⇒ Array<(Transaction, Fixnum, Hash)>
Create new transaction Creates new transaction and returns information
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/brevo/api/balance_api.rb', line 39 def begin_transaction_with_http_info(pid, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.begin_transaction ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.begin_transaction" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling BalanceApi.begin_transaction" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/transactions'.sub('{' + 'pid' + '}', pid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Transaction') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#begin_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#cancel_transaction(pid, tid, opts = {}) ⇒ Transaction
Cancel transaction Cancels transaction
88 89 90 91 |
# File 'lib/brevo/api/balance_api.rb', line 88 def cancel_transaction(pid, tid, opts = {}) data, _status_code, _headers = cancel_transaction_with_http_info(pid, tid, opts) data end |
#cancel_transaction_with_http_info(pid, tid, opts = {}) ⇒ Array<(Transaction, Fixnum, Hash)>
Cancel transaction Cancels transaction
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/brevo/api/balance_api.rb', line 99 def cancel_transaction_with_http_info(pid, tid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.cancel_transaction ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.cancel_transaction" end # verify the required parameter 'tid' is set if @api_client.config.client_side_validation && tid.nil? fail ArgumentError, "Missing the required parameter 'tid' when calling BalanceApi.cancel_transaction" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/transactions/{tid}/cancel'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'tid' + '}', tid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Transaction') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#cancel_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#complete_transaction(pid, tid, opts = {}) ⇒ Transaction
Complete transaction Completes transaction
148 149 150 151 |
# File 'lib/brevo/api/balance_api.rb', line 148 def complete_transaction(pid, tid, opts = {}) data, _status_code, _headers = complete_transaction_with_http_info(pid, tid, opts) data end |
#complete_transaction_with_http_info(pid, tid, opts = {}) ⇒ Array<(Transaction, Fixnum, Hash)>
Complete transaction Completes transaction
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/brevo/api/balance_api.rb', line 159 def complete_transaction_with_http_info(pid, tid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.complete_transaction ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.complete_transaction" end # verify the required parameter 'tid' is set if @api_client.config.client_side_validation && tid.nil? fail ArgumentError, "Missing the required parameter 'tid' when calling BalanceApi.complete_transaction" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/transactions/{tid}/complete'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'tid' + '}', tid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Transaction') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#complete_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_balance_limit(pid, bdid, body, opts = {}) ⇒ BalanceLimit
Create balance limits Creates balance limit and sends the created UUID along with the data
209 210 211 212 |
# File 'lib/brevo/api/balance_api.rb', line 209 def create_balance_limit(pid, bdid, body, opts = {}) data, _status_code, _headers = create_balance_limit_with_http_info(pid, bdid, body, opts) data end |
#create_balance_limit_with_http_info(pid, bdid, body, opts = {}) ⇒ Array<(BalanceLimit, Fixnum, Hash)>
Create balance limits Creates balance limit and sends the created UUID along with the data
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/brevo/api/balance_api.rb', line 221 def create_balance_limit_with_http_info(pid, bdid, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.create_balance_limit ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.create_balance_limit" end # verify the required parameter 'bdid' is set if @api_client.config.client_side_validation && bdid.nil? fail ArgumentError, "Missing the required parameter 'bdid' when calling BalanceApi.create_balance_limit" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling BalanceApi.create_balance_limit" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'bdid' + '}', bdid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceLimit') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#create_balance_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_balance_order(pid, body, opts = {}) ⇒ BalanceOrder
Create balance order Returns created order
274 275 276 277 |
# File 'lib/brevo/api/balance_api.rb', line 274 def create_balance_order(pid, body, opts = {}) data, _status_code, _headers = create_balance_order_with_http_info(pid, body, opts) data end |
#create_balance_order_with_http_info(pid, body, opts = {}) ⇒ Array<(BalanceOrder, Fixnum, Hash)>
Create balance order Returns created order
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/brevo/api/balance_api.rb', line 285 def create_balance_order_with_http_info(pid, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.create_balance_order ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.create_balance_order" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling BalanceApi.create_balance_order" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/create-order'.sub('{' + 'pid' + '}', pid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceOrder') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#create_balance_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_balance_definition(pid, bdid, opts = {}) ⇒ nil
Delete balance definition Delete Balance definition
334 335 336 337 |
# File 'lib/brevo/api/balance_api.rb', line 334 def delete_balance_definition(pid, bdid, opts = {}) delete_balance_definition_with_http_info(pid, bdid, opts) nil end |
#delete_balance_definition_with_http_info(pid, bdid, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete balance definition Delete Balance definition
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/brevo/api/balance_api.rb', line 345 def delete_balance_definition_with_http_info(pid, bdid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.delete_balance_definition ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.delete_balance_definition" end # verify the required parameter 'bdid' is set if @api_client.config.client_side_validation && bdid.nil? fail ArgumentError, "Missing the required parameter 'bdid' when calling BalanceApi.delete_balance_definition" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'bdid' + '}', bdid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#delete_balance_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_balance_limit(pid, bdid, blid, opts = {}) ⇒ nil
Delete balance limit Delete balance limit
394 395 396 397 |
# File 'lib/brevo/api/balance_api.rb', line 394 def delete_balance_limit(pid, bdid, blid, opts = {}) delete_balance_limit_with_http_info(pid, bdid, blid, opts) nil end |
#delete_balance_limit_with_http_info(pid, bdid, blid, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete balance limit Delete balance limit
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/brevo/api/balance_api.rb', line 406 def delete_balance_limit_with_http_info(pid, bdid, blid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.delete_balance_limit ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.delete_balance_limit" end # verify the required parameter 'bdid' is set if @api_client.config.client_side_validation && bdid.nil? fail ArgumentError, "Missing the required parameter 'bdid' when calling BalanceApi.delete_balance_limit" end # verify the required parameter 'blid' is set if @api_client.config.client_side_validation && blid.nil? fail ArgumentError, "Missing the required parameter 'blid' when calling BalanceApi.delete_balance_limit" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'bdid' + '}', bdid.to_s).sub('{' + 'blid' + '}', blid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#delete_balance_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_balance_definition(pid, bdid, opts = {}) ⇒ BalanceDefinition
Get balance definition Returns balance definition
459 460 461 462 |
# File 'lib/brevo/api/balance_api.rb', line 459 def get_balance_definition(pid, bdid, opts = {}) data, _status_code, _headers = get_balance_definition_with_http_info(pid, bdid, opts) data end |
#get_balance_definition_list(pid, opts = {}) ⇒ BalanceDefinitionPage
Get balance definition list Returns balance definition page
528 529 530 531 |
# File 'lib/brevo/api/balance_api.rb', line 528 def get_balance_definition_list(pid, opts = {}) data, _status_code, _headers = get_balance_definition_list_with_http_info(pid, opts) data end |
#get_balance_definition_list_with_http_info(pid, opts = {}) ⇒ Array<(BalanceDefinitionPage, Fixnum, Hash)>
Get balance definition list Returns balance definition page
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
# File 'lib/brevo/api/balance_api.rb', line 543 def get_balance_definition_list_with_http_info(pid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.get_balance_definition_list ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.get_balance_definition_list" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BalanceApi.get_balance_definition_list, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BalanceApi.get_balance_definition_list, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BalanceApi.get_balance_definition_list, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && opts[:'sort_field'] && !['name', 'created_at', 'updated_at'].include?(opts[:'sort_field']) fail ArgumentError, 'invalid value for "sort_field", must be one of name, created_at, updated_at' end if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' end if @api_client.config.client_side_validation && opts[:'version'] && !['active', 'draft'].include?(opts[:'version']) fail ArgumentError, 'invalid value for "version", must be one of active, draft' end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions'.sub('{' + 'pid' + '}', pid.to_s) # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sortField'] = opts[:'sort_field'] if !opts[:'sort_field'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceDefinitionPage') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#get_balance_definition_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_balance_definition_with_http_info(pid, bdid, opts = {}) ⇒ Array<(BalanceDefinition, Fixnum, Hash)>
Get balance definition Returns balance definition
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 |
# File 'lib/brevo/api/balance_api.rb', line 471 def get_balance_definition_with_http_info(pid, bdid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.get_balance_definition ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.get_balance_definition" end # verify the required parameter 'bdid' is set if @api_client.config.client_side_validation && bdid.nil? fail ArgumentError, "Missing the required parameter 'bdid' when calling BalanceApi.get_balance_definition" end if @api_client.config.client_side_validation && opts[:'version'] && !['active', 'draft'].include?(opts[:'version']) fail ArgumentError, 'invalid value for "version", must be one of active, draft' end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'bdid' + '}', bdid.to_s) # query parameters query_params = {} query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceDefinition') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#get_balance_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_balance_limit(pid, bdid, blid, opts = {}) ⇒ BalanceLimit
Get balance limits Fetches balance limits and send the created UUID along with the data
616 617 618 619 |
# File 'lib/brevo/api/balance_api.rb', line 616 def get_balance_limit(pid, bdid, blid, opts = {}) data, _status_code, _headers = get_balance_limit_with_http_info(pid, bdid, blid, opts) data end |
#get_balance_limit_with_http_info(pid, bdid, blid, opts = {}) ⇒ Array<(BalanceLimit, Fixnum, Hash)>
Get balance limits Fetches balance limits and send the created UUID along with the data
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 |
# File 'lib/brevo/api/balance_api.rb', line 629 def get_balance_limit_with_http_info(pid, bdid, blid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.get_balance_limit ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.get_balance_limit" end # verify the required parameter 'bdid' is set if @api_client.config.client_side_validation && bdid.nil? fail ArgumentError, "Missing the required parameter 'bdid' when calling BalanceApi.get_balance_limit" end # verify the required parameter 'blid' is set if @api_client.config.client_side_validation && blid.nil? fail ArgumentError, "Missing the required parameter 'blid' when calling BalanceApi.get_balance_limit" end if @api_client.config.client_side_validation && opts[:'version'] && !['active', 'draft'].include?(opts[:'version']) fail ArgumentError, 'invalid value for "version", must be one of active, draft' end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'bdid' + '}', bdid.to_s).sub('{' + 'blid' + '}', blid.to_s) # query parameters query_params = {} query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceLimit') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#get_balance_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_contact_balances(pid, opts = {}) ⇒ ContactBalancesResp
Get balance list Returns balance list
685 686 687 688 |
# File 'lib/brevo/api/balance_api.rb', line 685 def get_contact_balances(pid, opts = {}) data, _status_code, _headers = get_contact_balances_with_http_info(pid, opts) data end |
#get_contact_balances_with_http_info(pid, opts = {}) ⇒ Array<(ContactBalancesResp, Fixnum, Hash)>
Get balance list Returns balance list
695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 |
# File 'lib/brevo/api/balance_api.rb', line 695 def get_contact_balances_with_http_info(pid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.get_contact_balances ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.get_contact_balances" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/contact-balances'.sub('{' + 'pid' + '}', pid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ContactBalancesResp') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#get_contact_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_subscription_balances(cid, pid, opts = {}) ⇒ ModelSubscriptionBalanceResp
Get subscription balances Returns subscription balances
740 741 742 743 |
# File 'lib/brevo/api/balance_api.rb', line 740 def get_subscription_balances(cid, pid, opts = {}) data, _status_code, _headers = get_subscription_balances_with_http_info(cid, pid, opts) data end |
#get_subscription_balances_with_http_info(cid, pid, opts = {}) ⇒ Array<(ModelSubscriptionBalanceResp, Fixnum, Hash)>
Get subscription balances Returns subscription balances
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 |
# File 'lib/brevo/api/balance_api.rb', line 751 def get_subscription_balances_with_http_info(cid, pid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.get_subscription_balances ...' end # verify the required parameter 'cid' is set if @api_client.config.client_side_validation && cid.nil? fail ArgumentError, "Missing the required parameter 'cid' when calling BalanceApi.get_subscription_balances" end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.get_subscription_balances" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/subscriptions/{cid}/balances'.sub('{' + 'cid' + '}', cid.to_s).sub('{' + 'pid' + '}', pid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ModelSubscriptionBalanceResp') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#get_subscription_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#loyalty_balance_programs_pid_active_balance_get(pid, contact_id, balance_definition_id, opts = {}) ⇒ BalanceLimit
Get Active Balances API Returns Active Balances
805 806 807 808 |
# File 'lib/brevo/api/balance_api.rb', line 805 def loyalty_balance_programs_pid_active_balance_get(pid, contact_id, balance_definition_id, opts = {}) data, _status_code, _headers = loyalty_balance_programs_pid_active_balance_get_with_http_info(pid, contact_id, balance_definition_id, opts) data end |
#loyalty_balance_programs_pid_active_balance_get_with_http_info(pid, contact_id, balance_definition_id, opts = {}) ⇒ Array<(BalanceLimit, Fixnum, Hash)>
Get Active Balances API Returns Active Balances
821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 |
# File 'lib/brevo/api/balance_api.rb', line 821 def loyalty_balance_programs_pid_active_balance_get_with_http_info(pid, contact_id, balance_definition_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.loyalty_balance_programs_pid_active_balance_get ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.loyalty_balance_programs_pid_active_balance_get" end # verify the required parameter 'contact_id' is set if @api_client.config.client_side_validation && contact_id.nil? fail ArgumentError, "Missing the required parameter 'contact_id' when calling BalanceApi.loyalty_balance_programs_pid_active_balance_get" end if @api_client.config.client_side_validation && contact_id < 1 fail ArgumentError, 'invalid value for "contact_id" when calling BalanceApi.loyalty_balance_programs_pid_active_balance_get, must be greater than or equal to 1.' end # verify the required parameter 'balance_definition_id' is set if @api_client.config.client_side_validation && balance_definition_id.nil? fail ArgumentError, "Missing the required parameter 'balance_definition_id' when calling BalanceApi.loyalty_balance_programs_pid_active_balance_get" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BalanceApi.loyalty_balance_programs_pid_active_balance_get, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BalanceApi.loyalty_balance_programs_pid_active_balance_get, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BalanceApi.loyalty_balance_programs_pid_active_balance_get, must be greater than or equal to 0.' end # resource path local_var_path = '/loyalty/balance/programs/{pid}/active-balance'.sub('{' + 'pid' + '}', pid.to_s) # query parameters query_params = {} query_params[:'contact_id'] = contact_id query_params[:'balance_definition_id'] = balance_definition_id query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceLimit') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#loyalty_balance_programs_pid_active_balance_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#loyalty_balance_programs_pid_balance_definitions_post(pid, body, opts = {}) ⇒ BalanceDefinition
Create balance definition Creates balance definition and returns information
896 897 898 899 |
# File 'lib/brevo/api/balance_api.rb', line 896 def loyalty_balance_programs_pid_balance_definitions_post(pid, body, opts = {}) data, _status_code, _headers = loyalty_balance_programs_pid_balance_definitions_post_with_http_info(pid, body, opts) data end |
#loyalty_balance_programs_pid_balance_definitions_post_with_http_info(pid, body, opts = {}) ⇒ Array<(BalanceDefinition, Fixnum, Hash)>
Create balance definition Creates balance definition and returns information
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 |
# File 'lib/brevo/api/balance_api.rb', line 907 def loyalty_balance_programs_pid_balance_definitions_post_with_http_info(pid, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.loyalty_balance_programs_pid_balance_definitions_post ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.loyalty_balance_programs_pid_balance_definitions_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling BalanceApi.loyalty_balance_programs_pid_balance_definitions_post" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions'.sub('{' + 'pid' + '}', pid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceDefinition') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#loyalty_balance_programs_pid_balance_definitions_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#loyalty_balance_programs_pid_subscriptions_cid_balances_post(pid, cid, body, opts = {}) ⇒ Balance
Create subscription balances Creates a balance for a contact
957 958 959 960 |
# File 'lib/brevo/api/balance_api.rb', line 957 def loyalty_balance_programs_pid_subscriptions_cid_balances_post(pid, cid, body, opts = {}) data, _status_code, _headers = loyalty_balance_programs_pid_subscriptions_cid_balances_post_with_http_info(pid, cid, body, opts) data end |
#loyalty_balance_programs_pid_subscriptions_cid_balances_post_with_http_info(pid, cid, body, opts = {}) ⇒ Array<(Balance, Fixnum, Hash)>
Create subscription balances Creates a balance for a contact
969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 |
# File 'lib/brevo/api/balance_api.rb', line 969 def loyalty_balance_programs_pid_subscriptions_cid_balances_post_with_http_info(pid, cid, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.loyalty_balance_programs_pid_subscriptions_cid_balances_post ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.loyalty_balance_programs_pid_subscriptions_cid_balances_post" end # verify the required parameter 'cid' is set if @api_client.config.client_side_validation && cid.nil? fail ArgumentError, "Missing the required parameter 'cid' when calling BalanceApi.loyalty_balance_programs_pid_subscriptions_cid_balances_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling BalanceApi.loyalty_balance_programs_pid_subscriptions_cid_balances_post" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/subscriptions/{cid}/balances'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'cid' + '}', cid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Balance') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#loyalty_balance_programs_pid_subscriptions_cid_balances_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#loyalty_balance_programs_pid_transaction_history_get(pid, contact_id, balance_definition_id, opts = {}) ⇒ TransactionHistoryResp
Get Transaction History API Returns transaction history
1028 1029 1030 1031 |
# File 'lib/brevo/api/balance_api.rb', line 1028 def loyalty_balance_programs_pid_transaction_history_get(pid, contact_id, balance_definition_id, opts = {}) data, _status_code, _headers = loyalty_balance_programs_pid_transaction_history_get_with_http_info(pid, contact_id, balance_definition_id, opts) data end |
#loyalty_balance_programs_pid_transaction_history_get_with_http_info(pid, contact_id, balance_definition_id, opts = {}) ⇒ Array<(TransactionHistoryResp, Fixnum, Hash)>
Get Transaction History API Returns transaction history
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 |
# File 'lib/brevo/api/balance_api.rb', line 1045 def loyalty_balance_programs_pid_transaction_history_get_with_http_info(pid, contact_id, balance_definition_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.loyalty_balance_programs_pid_transaction_history_get ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.loyalty_balance_programs_pid_transaction_history_get" end # verify the required parameter 'contact_id' is set if @api_client.config.client_side_validation && contact_id.nil? fail ArgumentError, "Missing the required parameter 'contact_id' when calling BalanceApi.loyalty_balance_programs_pid_transaction_history_get" end # verify the required parameter 'balance_definition_id' is set if @api_client.config.client_side_validation && balance_definition_id.nil? fail ArgumentError, "Missing the required parameter 'balance_definition_id' when calling BalanceApi.loyalty_balance_programs_pid_transaction_history_get" end if @api_client.config.client_side_validation && opts[:'sort_field'] && !['name', 'created_at', 'updated_at'].include?(opts[:'sort_field']) fail ArgumentError, 'invalid value for "sort_field", must be one of name, created_at, updated_at' end if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' end # resource path local_var_path = '/loyalty/balance/programs/{pid}/transaction-history'.sub('{' + 'pid' + '}', pid.to_s) # query parameters query_params = {} query_params[:'contact_id'] = contact_id query_params[:'balance_definition_id'] = balance_definition_id query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'filters'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TransactionHistoryResp') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#loyalty_balance_programs_pid_transaction_history_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_balance_definition(pid, bdid, body, opts = {}) ⇒ BalanceDefinition
Update balance definition Updates Balance definition
1112 1113 1114 1115 |
# File 'lib/brevo/api/balance_api.rb', line 1112 def update_balance_definition(pid, bdid, body, opts = {}) data, _status_code, _headers = update_balance_definition_with_http_info(pid, bdid, body, opts) data end |
#update_balance_definition_with_http_info(pid, bdid, body, opts = {}) ⇒ Array<(BalanceDefinition, Fixnum, Hash)>
Update balance definition Updates Balance definition
1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 |
# File 'lib/brevo/api/balance_api.rb', line 1124 def update_balance_definition_with_http_info(pid, bdid, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.update_balance_definition ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.update_balance_definition" end # verify the required parameter 'bdid' is set if @api_client.config.client_side_validation && bdid.nil? fail ArgumentError, "Missing the required parameter 'bdid' when calling BalanceApi.update_balance_definition" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling BalanceApi.update_balance_definition" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'bdid' + '}', bdid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceDefinition') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#update_balance_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_balance_limit(pid, bdid, blid, body, opts = {}) ⇒ BalanceLimit
Updates balance limit Updates balance limit
1179 1180 1181 1182 |
# File 'lib/brevo/api/balance_api.rb', line 1179 def update_balance_limit(pid, bdid, blid, body, opts = {}) data, _status_code, _headers = update_balance_limit_with_http_info(pid, bdid, blid, body, opts) data end |
#update_balance_limit_with_http_info(pid, bdid, blid, body, opts = {}) ⇒ Array<(BalanceLimit, Fixnum, Hash)>
Updates balance limit Updates balance limit
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 |
# File 'lib/brevo/api/balance_api.rb', line 1192 def update_balance_limit_with_http_info(pid, bdid, blid, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BalanceApi.update_balance_limit ...' end # verify the required parameter 'pid' is set if @api_client.config.client_side_validation && pid.nil? fail ArgumentError, "Missing the required parameter 'pid' when calling BalanceApi.update_balance_limit" end # verify the required parameter 'bdid' is set if @api_client.config.client_side_validation && bdid.nil? fail ArgumentError, "Missing the required parameter 'bdid' when calling BalanceApi.update_balance_limit" end # verify the required parameter 'blid' is set if @api_client.config.client_side_validation && blid.nil? fail ArgumentError, "Missing the required parameter 'blid' when calling BalanceApi.update_balance_limit" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling BalanceApi.update_balance_limit" end # resource path local_var_path = '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'.sub('{' + 'pid' + '}', pid.to_s).sub('{' + 'bdid' + '}', bdid.to_s).sub('{' + 'blid' + '}', blid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['api-key', 'partner-key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'BalanceLimit') if @api_client.config.debugging @api_client.config.logger.debug "API called: BalanceApi#update_balance_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |