cbox_billing 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (736) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +215 -0
  3. data/cbox_billing.gemspec +26 -0
  4. data/lib/cbox_billing/api/accounting_api.rb +1893 -0
  5. data/lib/cbox_billing/api/affiliates_api.rb +2009 -0
  6. data/lib/cbox_billing/api/agreements_api.rb +552 -0
  7. data/lib/cbox_billing/api/bank_reconciliation_api.rb +505 -0
  8. data/lib/cbox_billing/api/catalog_api.rb +361 -0
  9. data/lib/cbox_billing/api/checkout_portal_api.rb +696 -0
  10. data/lib/cbox_billing/api/coupons_api.rb +538 -0
  11. data/lib/cbox_billing/api/credit_notes_api.rb +403 -0
  12. data/lib/cbox_billing/api/disputes_api.rb +540 -0
  13. data/lib/cbox_billing/api/dunning_api.rb +902 -0
  14. data/lib/cbox_billing/api/enforcement_api.rb +746 -0
  15. data/lib/cbox_billing/api/environments_api.rb +343 -0
  16. data/lib/cbox_billing/api/invoices_api.rb +1662 -0
  17. data/lib/cbox_billing/api/licence_data_api.rb +619 -0
  18. data/lib/cbox_billing/api/licenses_api.rb +293 -0
  19. data/lib/cbox_billing/api/management_api.rb +253 -0
  20. data/lib/cbox_billing/api/meters_api.rb +538 -0
  21. data/lib/cbox_billing/api/orders_and_delivery_api.rb +1745 -0
  22. data/lib/cbox_billing/api/organizations_api.rb +1110 -0
  23. data/lib/cbox_billing/api/payment_gateways_api.rb +227 -0
  24. data/lib/cbox_billing/api/payment_intents_api.rb +376 -0
  25. data/lib/cbox_billing/api/payment_methods_api.rb +96 -0
  26. data/lib/cbox_billing/api/plans_api.rb +654 -0
  27. data/lib/cbox_billing/api/product_access_api.rb +2033 -0
  28. data/lib/cbox_billing/api/quotes_api.rb +1062 -0
  29. data/lib/cbox_billing/api/seats_api.rb +938 -0
  30. data/lib/cbox_billing/api/service_connections_api.rb +245 -0
  31. data/lib/cbox_billing/api/subscriptions_api.rb +4697 -0
  32. data/lib/cbox_billing/api/tax_returns_api.rb +453 -0
  33. data/lib/cbox_billing/api/test_mode_api.rb +96 -0
  34. data/lib/cbox_billing/api/usage_api.rb +1116 -0
  35. data/lib/cbox_billing/api/webhook_endpoints_api.rb +835 -0
  36. data/lib/cbox_billing/api_client.rb +441 -0
  37. data/lib/cbox_billing/api_error.rb +58 -0
  38. data/lib/cbox_billing/api_model_base.rb +88 -0
  39. data/lib/cbox_billing/client.rb +49 -0
  40. data/lib/cbox_billing/configuration.rb +408 -0
  41. data/lib/cbox_billing/enforcement/client.rb +665 -0
  42. data/lib/cbox_billing/enforcement/errors.rb +48 -0
  43. data/lib/cbox_billing/enforcement/stores.rb +129 -0
  44. data/lib/cbox_billing/enforcement/transport.rb +79 -0
  45. data/lib/cbox_billing/enforcement/types.rb +63 -0
  46. data/lib/cbox_billing/enforcement.rb +9 -0
  47. data/lib/cbox_billing/errors.rb +110 -0
  48. data/lib/cbox_billing/idempotency.rb +16 -0
  49. data/lib/cbox_billing/models/accept_agreement201_response.rb +177 -0
  50. data/lib/cbox_billing/models/accept_agreement_request.rb +294 -0
  51. data/lib/cbox_billing/models/accept_agreement_request_user.rb +202 -0
  52. data/lib/cbox_billing/models/access_balance.rb +276 -0
  53. data/lib/cbox_billing/models/access_balance_request.rb +309 -0
  54. data/lib/cbox_billing/models/access_batch.rb +321 -0
  55. data/lib/cbox_billing/models/access_batch_filters.rb +183 -0
  56. data/lib/cbox_billing/models/access_cancel_request.rb +207 -0
  57. data/lib/cbox_billing/models/access_commit_request.rb +207 -0
  58. data/lib/cbox_billing/models/access_entry.rb +383 -0
  59. data/lib/cbox_billing/models/access_grant.rb +287 -0
  60. data/lib/cbox_billing/models/access_grant_request.rb +310 -0
  61. data/lib/cbox_billing/models/access_invitation.rb +404 -0
  62. data/lib/cbox_billing/models/access_invite_request.rb +337 -0
  63. data/lib/cbox_billing/models/access_join_request.rb +369 -0
  64. data/lib/cbox_billing/models/access_program.rb +511 -0
  65. data/lib/cbox_billing/models/access_program_input.rb +433 -0
  66. data/lib/cbox_billing/models/access_redeem_request.rb +335 -0
  67. data/lib/cbox_billing/models/access_redemption.rb +394 -0
  68. data/lib/cbox_billing/models/access_report.rb +250 -0
  69. data/lib/cbox_billing/models/access_report_balances.rb +252 -0
  70. data/lib/cbox_billing/models/access_report_batches.rb +252 -0
  71. data/lib/cbox_billing/models/access_report_entries.rb +252 -0
  72. data/lib/cbox_billing/models/access_report_grants.rb +252 -0
  73. data/lib/cbox_billing/models/access_report_invitations.rb +252 -0
  74. data/lib/cbox_billing/models/access_report_redemptions.rb +252 -0
  75. data/lib/cbox_billing/models/access_restore_grant_request.rb +207 -0
  76. data/lib/cbox_billing/models/access_retry_delivery_request.rb +207 -0
  77. data/lib/cbox_billing/models/access_revoke_grant_request.rb +207 -0
  78. data/lib/cbox_billing/models/access_revoke_invitation200_response.rb +195 -0
  79. data/lib/cbox_billing/models/access_revoke_invitation_request.rb +207 -0
  80. data/lib/cbox_billing/models/access_select200_response.rb +356 -0
  81. data/lib/cbox_billing/models/access_select_request.rb +323 -0
  82. data/lib/cbox_billing/models/account_credit.rb +258 -0
  83. data/lib/cbox_billing/models/account_credit_movements_inner.rb +255 -0
  84. data/lib/cbox_billing/models/account_entitlement.rb +240 -0
  85. data/lib/cbox_billing/models/accounting_connection.rb +336 -0
  86. data/lib/cbox_billing/models/accounting_connection_company.rb +170 -0
  87. data/lib/cbox_billing/models/accounting_contact_conflict.rb +308 -0
  88. data/lib/cbox_billing/models/accounting_contact_import.rb +397 -0
  89. data/lib/cbox_billing/models/accounting_contact_import_counts.rb +308 -0
  90. data/lib/cbox_billing/models/accounting_contact_import_row.rb +363 -0
  91. data/lib/cbox_billing/models/accounting_contact_import_row_candidates_inner.rb +227 -0
  92. data/lib/cbox_billing/models/accounting_contact_sync.rb +351 -0
  93. data/lib/cbox_billing/models/accounting_contact_sync_failure.rb +266 -0
  94. data/lib/cbox_billing/models/accounting_customer_document.rb +318 -0
  95. data/lib/cbox_billing/models/accounting_customer_link.rb +354 -0
  96. data/lib/cbox_billing/models/accounting_customer_link_company.rb +180 -0
  97. data/lib/cbox_billing/models/accounting_customer_link_contact.rb +292 -0
  98. data/lib/cbox_billing/models/accounting_customer_link_contact_sync.rb +291 -0
  99. data/lib/cbox_billing/models/accounting_customer_link_contact_sync_conflicts_inner.rb +237 -0
  100. data/lib/cbox_billing/models/accounting_customer_link_several_contacts_inner.rb +227 -0
  101. data/lib/cbox_billing/models/accounting_customer_link_shared_with_inner.rb +203 -0
  102. data/lib/cbox_billing/models/accounting_invoice.rb +532 -0
  103. data/lib/cbox_billing/models/accounting_invoice_contact.rb +189 -0
  104. data/lib/cbox_billing/models/accounting_sync.rb +356 -0
  105. data/lib/cbox_billing/models/accounting_vendor_contact.rb +307 -0
  106. data/lib/cbox_billing/models/accounting_vendor_link.rb +216 -0
  107. data/lib/cbox_billing/models/activation_bundle.rb +293 -0
  108. data/lib/cbox_billing/models/add_dispute_evidence_file201_response.rb +177 -0
  109. data/lib/cbox_billing/models/add_dispute_evidence_file422_response.rb +104 -0
  110. data/lib/cbox_billing/models/add_dispute_evidence_file_request.rb +261 -0
  111. data/lib/cbox_billing/models/add_invoice_item201_response.rb +177 -0
  112. data/lib/cbox_billing/models/add_invoice_item202_response.rb +228 -0
  113. data/lib/cbox_billing/models/add_invoice_item_request.rb +248 -0
  114. data/lib/cbox_billing/models/add_on.rb +305 -0
  115. data/lib/cbox_billing/models/add_on_preview.rb +170 -0
  116. data/lib/cbox_billing/models/add_on_request.rb +434 -0
  117. data/lib/cbox_billing/models/add_on_result.rb +203 -0
  118. data/lib/cbox_billing/models/add_product_file_request1.rb +233 -0
  119. data/lib/cbox_billing/models/add_subscription_phase201_response.rb +177 -0
  120. data/lib/cbox_billing/models/adjust_affiliate_balance_request.rb +257 -0
  121. data/lib/cbox_billing/models/admit_service_organization200_response.rb +169 -0
  122. data/lib/cbox_billing/models/affiliate.rb +505 -0
  123. data/lib/cbox_billing/models/affiliate_commission.rb +520 -0
  124. data/lib/cbox_billing/models/affiliate_detail.rb +523 -0
  125. data/lib/cbox_billing/models/affiliate_payout.rb +443 -0
  126. data/lib/cbox_billing/models/affiliate_payout_run.rb +446 -0
  127. data/lib/cbox_billing/models/affiliate_payout_run_list.rb +229 -0
  128. data/lib/cbox_billing/models/affiliate_payout_settings.rb +356 -0
  129. data/lib/cbox_billing/models/affiliate_portal_link.rb +203 -0
  130. data/lib/cbox_billing/models/affiliate_program.rb +556 -0
  131. data/lib/cbox_billing/models/affiliate_program_commission.rb +269 -0
  132. data/lib/cbox_billing/models/affiliate_rate_plan.rb +273 -0
  133. data/lib/cbox_billing/models/affiliate_rate_plan_phases_inner.rb +316 -0
  134. data/lib/cbox_billing/models/affiliate_rate_rule.rb +233 -0
  135. data/lib/cbox_billing/models/affiliate_referral.rb +325 -0
  136. data/lib/cbox_billing/models/agreement_block.rb +337 -0
  137. data/lib/cbox_billing/models/agreement_error.rb +227 -0
  138. data/lib/cbox_billing/models/agreement_status.rb +453 -0
  139. data/lib/cbox_billing/models/agreement_status_requires_inner.rb +202 -0
  140. data/lib/cbox_billing/models/align_renewals_request.rb +264 -0
  141. data/lib/cbox_billing/models/allowance_window.rb +269 -0
  142. data/lib/cbox_billing/models/appendix.rb +293 -0
  143. data/lib/cbox_billing/models/appendix_column.rb +257 -0
  144. data/lib/cbox_billing/models/apply_catalog409_response.rb +369 -0
  145. data/lib/cbox_billing/models/apply_subscription_coupon200_response.rb +177 -0
  146. data/lib/cbox_billing/models/apply_subscription_coupon_request.rb +197 -0
  147. data/lib/cbox_billing/models/archive_affiliate_program_request.rb +162 -0
  148. data/lib/cbox_billing/models/auto_top_up.rb +462 -0
  149. data/lib/cbox_billing/models/auto_top_up_attempts_inner.rb +290 -0
  150. data/lib/cbox_billing/models/auto_top_up_limits.rb +230 -0
  151. data/lib/cbox_billing/models/bank_csv_mapping.rb +467 -0
  152. data/lib/cbox_billing/models/bank_import_result.rb +285 -0
  153. data/lib/cbox_billing/models/bank_line.rb +486 -0
  154. data/lib/cbox_billing/models/bank_line_detail.rb +233 -0
  155. data/lib/cbox_billing/models/bank_line_detail_payments_inner.rb +280 -0
  156. data/lib/cbox_billing/models/bank_line_detail_suggestions_inner.rb +267 -0
  157. data/lib/cbox_billing/models/bank_statement.rb +412 -0
  158. data/lib/cbox_billing/models/bank_statement_import.rb +258 -0
  159. data/lib/cbox_billing/models/billing_parent.rb +219 -0
  160. data/lib/cbox_billing/models/billing_policy.rb +299 -0
  161. data/lib/cbox_billing/models/billing_policy_policy.rb +228 -0
  162. data/lib/cbox_billing/models/billing_policy_request.rb +323 -0
  163. data/lib/cbox_billing/models/bundle_benefit.rb +597 -0
  164. data/lib/cbox_billing/models/bundle_benefit_tiers_inner.rb +230 -0
  165. data/lib/cbox_billing/models/bundle_consequence.rb +450 -0
  166. data/lib/cbox_billing/models/bundle_offer.rb +508 -0
  167. data/lib/cbox_billing/models/bundle_offer_plan.rb +398 -0
  168. data/lib/cbox_billing/models/bundle_offer_products_to_add_inner.rb +169 -0
  169. data/lib/cbox_billing/models/bundle_offer_saves.rb +226 -0
  170. data/lib/cbox_billing/models/cancel_preview.rb +264 -0
  171. data/lib/cbox_billing/models/cancel_request.rb +256 -0
  172. data/lib/cbox_billing/models/cancel_subscription200_response.rb +652 -0
  173. data/lib/cbox_billing/models/catalog_changes.rb +286 -0
  174. data/lib/cbox_billing/models/catalog_changes_changes_inner.rb +264 -0
  175. data/lib/cbox_billing/models/catalog_changes_diff_inner.rb +303 -0
  176. data/lib/cbox_billing/models/catalog_changes_diff_inner_fields_inner.rb +180 -0
  177. data/lib/cbox_billing/models/catalog_changes_diff_inner_fields_inner_from.rb +105 -0
  178. data/lib/cbox_billing/models/catalog_changes_impact.rb +215 -0
  179. data/lib/cbox_billing/models/catalog_changes_impact_bundle_repriced_inner.rb +224 -0
  180. data/lib/cbox_billing/models/catalog_changes_impact_sample_inner.rb +169 -0
  181. data/lib/cbox_billing/models/catalog_changes_summary.rb +178 -0
  182. data/lib/cbox_billing/models/catalog_manifest.rb +215 -0
  183. data/lib/cbox_billing/models/catalog_manifest_bundles_inner.rb +344 -0
  184. data/lib/cbox_billing/models/catalog_manifest_bundles_inner_applies_to.rb +199 -0
  185. data/lib/cbox_billing/models/catalog_manifest_bundles_inner_copy_value.rb +263 -0
  186. data/lib/cbox_billing/models/catalog_manifest_bundles_inner_discount.rb +286 -0
  187. data/lib/cbox_billing/models/catalog_manifest_bundles_inner_requires.rb +254 -0
  188. data/lib/cbox_billing/models/catalog_manifest_existing.rb +242 -0
  189. data/lib/cbox_billing/models/catalog_manifest_products_inner.rb +246 -0
  190. data/lib/cbox_billing/models/catalog_manifest_products_inner_features_inner.rb +269 -0
  191. data/lib/cbox_billing/models/catalog_manifest_products_inner_meters_inner.rb +410 -0
  192. data/lib/cbox_billing/models/catalog_manifest_products_inner_plans_inner.rb +258 -0
  193. data/lib/cbox_billing/models/catalog_manifest_products_inner_plans_inner_meters_value.rb +356 -0
  194. data/lib/cbox_billing/models/catalog_manifest_products_inner_plans_inner_meters_value_price_value.rb +471 -0
  195. data/lib/cbox_billing/models/catalog_manifest_products_inner_plans_inner_meters_value_price_value_matrix_inner.rb +274 -0
  196. data/lib/cbox_billing/models/catalog_manifest_products_inner_plans_inner_meters_value_price_value_rates_inner.rb +216 -0
  197. data/lib/cbox_billing/models/change_subscription_dates200_response.rb +187 -0
  198. data/lib/cbox_billing/models/change_subscription_dates_request.rb +325 -0
  199. data/lib/cbox_billing/models/charged_invoice.rb +322 -0
  200. data/lib/cbox_billing/models/check_service_admission200_response.rb +178 -0
  201. data/lib/cbox_billing/models/checkout_session_request.rb +354 -0
  202. data/lib/cbox_billing/models/checkout_session_request_items_inner.rb +217 -0
  203. data/lib/cbox_billing/models/choose_accounting_contact_import_row200_response.rb +177 -0
  204. data/lib/cbox_billing/models/clear_subscription_end_date200_response.rb +162 -0
  205. data/lib/cbox_billing/models/commit_request.rb +214 -0
  206. data/lib/cbox_billing/models/commit_request_actuals_inner.rb +212 -0
  207. data/lib/cbox_billing/models/commitment.rb +499 -0
  208. data/lib/cbox_billing/models/commitment_ramp_step.rb +221 -0
  209. data/lib/cbox_billing/models/commitment_refusal.rb +239 -0
  210. data/lib/cbox_billing/models/commitment_request.rb +409 -0
  211. data/lib/cbox_billing/models/commitment_response.rb +203 -0
  212. data/lib/cbox_billing/models/commitment_term.rb +227 -0
  213. data/lib/cbox_billing/models/confirm_accounting_contact_import200_response.rb +177 -0
  214. data/lib/cbox_billing/models/confirm_accounting_contact_import_request.rb +190 -0
  215. data/lib/cbox_billing/models/connect_engage_service200_response.rb +212 -0
  216. data/lib/cbox_billing/models/connect_engage_service_request.rb +267 -0
  217. data/lib/cbox_billing/models/contract_cap_discount.rb +284 -0
  218. data/lib/cbox_billing/models/contract_price_cap.rb +332 -0
  219. data/lib/cbox_billing/models/contract_price_cap_basis.rb +216 -0
  220. data/lib/cbox_billing/models/coupon.rb +307 -0
  221. data/lib/cbox_billing/models/coupon_definition.rb +520 -0
  222. data/lib/cbox_billing/models/coupon_definition_detail.rb +555 -0
  223. data/lib/cbox_billing/models/coupon_definition_detail_all_of_redemptions.rb +216 -0
  224. data/lib/cbox_billing/models/coupon_definition_list.rb +226 -0
  225. data/lib/cbox_billing/models/coupon_deleted.rb +227 -0
  226. data/lib/cbox_billing/models/coupon_request.rb +537 -0
  227. data/lib/cbox_billing/models/create_affiliate_payout_request.rb +247 -0
  228. data/lib/cbox_billing/models/create_affiliate_program_request.rb +423 -0
  229. data/lib/cbox_billing/models/create_affiliate_program_request_commission.rb +348 -0
  230. data/lib/cbox_billing/models/create_affiliate_referral_request.rb +178 -0
  231. data/lib/cbox_billing/models/create_affiliate_request.rb +415 -0
  232. data/lib/cbox_billing/models/create_credit_purchase422_response.rb +104 -0
  233. data/lib/cbox_billing/models/create_customers_from_accounting_contact_import200_response.rb +207 -0
  234. data/lib/cbox_billing/models/create_customers_from_accounting_contact_import200_response_created_inner.rb +204 -0
  235. data/lib/cbox_billing/models/create_customers_from_accounting_contact_import200_response_refused_inner.rb +204 -0
  236. data/lib/cbox_billing/models/create_customers_from_accounting_contact_import_request.rb +197 -0
  237. data/lib/cbox_billing/models/create_download_grant_request.rb +248 -0
  238. data/lib/cbox_billing/models/create_download_links200_response.rb +205 -0
  239. data/lib/cbox_billing/models/create_download_links200_response_data_inner.rb +227 -0
  240. data/lib/cbox_billing/models/create_download_links_request.rb +190 -0
  241. data/lib/cbox_billing/models/create_environment_request.rb +270 -0
  242. data/lib/cbox_billing/models/create_license_key_request.rb +273 -0
  243. data/lib/cbox_billing/models/create_order_request.rb +420 -0
  244. data/lib/cbox_billing/models/create_order_request_lines_inner.rb +262 -0
  245. data/lib/cbox_billing/models/create_private_plan_request.rb +318 -0
  246. data/lib/cbox_billing/models/create_spend_alert_request.rb +295 -0
  247. data/lib/cbox_billing/models/created_access_invitation.rb +464 -0
  248. data/lib/cbox_billing/models/created_environment.rb +214 -0
  249. data/lib/cbox_billing/models/credit_adjustment_applied.rb +247 -0
  250. data/lib/cbox_billing/models/credit_adjustment_pending.rb +228 -0
  251. data/lib/cbox_billing/models/credit_adjustment_request.rb +375 -0
  252. data/lib/cbox_billing/models/credit_delta.rb +229 -0
  253. data/lib/cbox_billing/models/credit_movement.rb +364 -0
  254. data/lib/cbox_billing/models/credit_movement_list.rb +226 -0
  255. data/lib/cbox_billing/models/credit_note.rb +455 -0
  256. data/lib/cbox_billing/models/credit_note_detail.rb +517 -0
  257. data/lib/cbox_billing/models/credit_note_detail_all_of_lines.rb +294 -0
  258. data/lib/cbox_billing/models/credit_note_list.rb +226 -0
  259. data/lib/cbox_billing/models/credit_pool.rb +567 -0
  260. data/lib/cbox_billing/models/credit_pool_expiries_inner.rb +241 -0
  261. data/lib/cbox_billing/models/credit_pool_label.rb +204 -0
  262. data/lib/cbox_billing/models/credit_pool_list.rb +205 -0
  263. data/lib/cbox_billing/models/credit_pool_pay_as_you_go.rb +218 -0
  264. data/lib/cbox_billing/models/credit_pool_period.rb +175 -0
  265. data/lib/cbox_billing/models/credit_pool_scope.rb +207 -0
  266. data/lib/cbox_billing/models/credit_pool_scope_conditions_inner.rb +256 -0
  267. data/lib/cbox_billing/models/credit_purchase.rb +306 -0
  268. data/lib/cbox_billing/models/credit_purchase_credit.rb +203 -0
  269. data/lib/cbox_billing/models/customer_contract.rb +227 -0
  270. data/lib/cbox_billing/models/customer_overage_cap_row.rb +345 -0
  271. data/lib/cbox_billing/models/customer_overage_cap_row_customer.rb +202 -0
  272. data/lib/cbox_billing/models/date_change_preview.rb +370 -0
  273. data/lib/cbox_billing/models/date_change_request.rb +272 -0
  274. data/lib/cbox_billing/models/delete_entitlement_override200_response.rb +204 -0
  275. data/lib/cbox_billing/models/delete_overage_cap200_response.rb +203 -0
  276. data/lib/cbox_billing/models/delete_spend_alert200_response.rb +203 -0
  277. data/lib/cbox_billing/models/delete_webhook_endpoint200_response.rb +239 -0
  278. data/lib/cbox_billing/models/delivery.rb +339 -0
  279. data/lib/cbox_billing/models/destroy_environment200_response.rb +178 -0
  280. data/lib/cbox_billing/models/detach_payment_method422_response.rb +253 -0
  281. data/lib/cbox_billing/models/detach_payment_method422_response_errors.rb +162 -0
  282. data/lib/cbox_billing/models/directory_registration.rb +244 -0
  283. data/lib/cbox_billing/models/directory_service.rb +472 -0
  284. data/lib/cbox_billing/models/disable_license_key_request.rb +161 -0
  285. data/lib/cbox_billing/models/dispute.rb +471 -0
  286. data/lib/cbox_billing/models/dispute_detail.rb +229 -0
  287. data/lib/cbox_billing/models/dispute_detail_evidence.rb +205 -0
  288. data/lib/cbox_billing/models/dispute_detail_evidence_text.rb +200 -0
  289. data/lib/cbox_billing/models/dispute_detail_pack.rb +193 -0
  290. data/lib/cbox_billing/models/dispute_detail_pack_sections_inner.rb +269 -0
  291. data/lib/cbox_billing/models/dispute_evidence.rb +312 -0
  292. data/lib/cbox_billing/models/dispute_evidence_file.rb +357 -0
  293. data/lib/cbox_billing/models/dispute_evidence_slot.rb +43 -0
  294. data/lib/cbox_billing/models/dispute_refusal.rb +256 -0
  295. data/lib/cbox_billing/models/dispute_status.rb +46 -0
  296. data/lib/cbox_billing/models/download_grant.rb +401 -0
  297. data/lib/cbox_billing/models/dunning_hold.rb +344 -0
  298. data/lib/cbox_billing/models/dunning_state.rb +217 -0
  299. data/lib/cbox_billing/models/dunning_state_invoice.rb +281 -0
  300. data/lib/cbox_billing/models/dunning_state_retry.rb +232 -0
  301. data/lib/cbox_billing/models/e_invoice_refusal.rb +229 -0
  302. data/lib/cbox_billing/models/effective_billing_policy.rb +298 -0
  303. data/lib/cbox_billing/models/effective_entitlement.rb +271 -0
  304. data/lib/cbox_billing/models/effective_usage_threshold.rb +280 -0
  305. data/lib/cbox_billing/models/entitlement.rb +366 -0
  306. data/lib/cbox_billing/models/entitlement_override.rb +557 -0
  307. data/lib/cbox_billing/models/entitlement_override_input.rb +353 -0
  308. data/lib/cbox_billing/models/entitlement_override_result.rb +591 -0
  309. data/lib/cbox_billing/models/entitlement_terms.rb +293 -0
  310. data/lib/cbox_billing/models/entitlements_response.rb +200 -0
  311. data/lib/cbox_billing/models/environment.rb +379 -0
  312. data/lib/cbox_billing/models/error_body.rb +242 -0
  313. data/lib/cbox_billing/models/export_catalog200_response.rb +232 -0
  314. data/lib/cbox_billing/models/extend_invoice_due_date_request.rb +213 -0
  315. data/lib/cbox_billing/models/feature.rb +277 -0
  316. data/lib/cbox_billing/models/feature_check.rb +310 -0
  317. data/lib/cbox_billing/models/feature_set.rb +179 -0
  318. data/lib/cbox_billing/models/feature_value.rb +105 -0
  319. data/lib/cbox_billing/models/first_period.rb +461 -0
  320. data/lib/cbox_billing/models/gateway_intent.rb +254 -0
  321. data/lib/cbox_billing/models/get_accounting_connection200_response.rb +163 -0
  322. data/lib/cbox_billing/models/get_accounting_contact200_response.rb +227 -0
  323. data/lib/cbox_billing/models/get_accounting_contact_sync200_response.rb +229 -0
  324. data/lib/cbox_billing/models/get_accounting_invoice_sync200_response.rb +293 -0
  325. data/lib/cbox_billing/models/get_accounting_invoice_sync200_response_settings.rb +241 -0
  326. data/lib/cbox_billing/models/get_accounting_invoice_sync200_response_sync.rb +318 -0
  327. data/lib/cbox_billing/models/get_accounting_organization200_response.rb +231 -0
  328. data/lib/cbox_billing/models/get_bank_statement200_response.rb +205 -0
  329. data/lib/cbox_billing/models/get_customer_statement200_response.rb +339 -0
  330. data/lib/cbox_billing/models/get_customer_statement200_response_account_credit.rb +169 -0
  331. data/lib/cbox_billing/models/get_customer_statement200_response_activity_inner.rb +334 -0
  332. data/lib/cbox_billing/models/get_customer_statement200_response_balances_inner.rb +229 -0
  333. data/lib/cbox_billing/models/get_customer_statement200_response_subscriptions_inner.rb +281 -0
  334. data/lib/cbox_billing/models/get_customer_statement200_response_subscriptions_inner_next.rb +200 -0
  335. data/lib/cbox_billing/models/get_latest_accounting_contact_import200_response.rb +163 -0
  336. data/lib/cbox_billing/models/get_product_delivery200_response.rb +217 -0
  337. data/lib/cbox_billing/models/get_resource_limits200_response.rb +257 -0
  338. data/lib/cbox_billing/models/get_service_admission_policy200_response.rb +160 -0
  339. data/lib/cbox_billing/models/get_service_registrations200_response.rb +179 -0
  340. data/lib/cbox_billing/models/get_service_registrations200_response_data_inner.rb +190 -0
  341. data/lib/cbox_billing/models/get_service_registrations_request.rb +284 -0
  342. data/lib/cbox_billing/models/grandfathered_subscriber.rb +356 -0
  343. data/lib/cbox_billing/models/grandfathered_subscriber_contract_cap.rb +230 -0
  344. data/lib/cbox_billing/models/guest_waitlist_input.rb +271 -0
  345. data/lib/cbox_billing/models/hold_invoice_dunning_request.rb +249 -0
  346. data/lib/cbox_billing/models/hold_invoice_for_review200_response.rb +177 -0
  347. data/lib/cbox_billing/models/hosted_session.rb +204 -0
  348. data/lib/cbox_billing/models/import_bank_statement201_response.rb +203 -0
  349. data/lib/cbox_billing/models/inline_object.rb +227 -0
  350. data/lib/cbox_billing/models/inline_object1.rb +255 -0
  351. data/lib/cbox_billing/models/inline_object2.rb +255 -0
  352. data/lib/cbox_billing/models/invoice.rb +523 -0
  353. data/lib/cbox_billing/models/invoice_balance.rb +281 -0
  354. data/lib/cbox_billing/models/invoice_detail.rb +655 -0
  355. data/lib/cbox_billing/models/invoice_draft.rb +452 -0
  356. data/lib/cbox_billing/models/invoice_draft_lines_inner.rb +199 -0
  357. data/lib/cbox_billing/models/invoice_item.rb +354 -0
  358. data/lib/cbox_billing/models/invoice_line.rb +295 -0
  359. data/lib/cbox_billing/models/invoice_list.rb +226 -0
  360. data/lib/cbox_billing/models/invoice_payment.rb +292 -0
  361. data/lib/cbox_billing/models/invoice_payment_result.rb +203 -0
  362. data/lib/cbox_billing/models/join_service_waitlist200_response.rb +163 -0
  363. data/lib/cbox_billing/models/join_service_waitlist_as_guest200_response.rb +194 -0
  364. data/lib/cbox_billing/models/join_service_waitlist_request.rb +378 -0
  365. data/lib/cbox_billing/models/keep_accounting_contact200_response.rb +231 -0
  366. data/lib/cbox_billing/models/keep_accounting_contact_request.rb +186 -0
  367. data/lib/cbox_billing/models/lease.rb +266 -0
  368. data/lib/cbox_billing/models/lease_request.rb +341 -0
  369. data/lib/cbox_billing/models/leave_feature_waitlist200_response.rb +201 -0
  370. data/lib/cbox_billing/models/leave_feature_waitlist_request.rb +249 -0
  371. data/lib/cbox_billing/models/licence_period_document.rb +408 -0
  372. data/lib/cbox_billing/models/licence_period_document_usage_measures_inner.rb +170 -0
  373. data/lib/cbox_billing/models/licence_period_list.rb +230 -0
  374. data/lib/cbox_billing/models/licence_period_summary.rb +344 -0
  375. data/lib/cbox_billing/models/licence_reportable.rb +204 -0
  376. data/lib/cbox_billing/models/licence_row_list.rb +244 -0
  377. data/lib/cbox_billing/models/licence_seat_count.rb +355 -0
  378. data/lib/cbox_billing/models/licence_seat_ledger_entry.rb +578 -0
  379. data/lib/cbox_billing/models/licence_seat_ledger_list.rb +217 -0
  380. data/lib/cbox_billing/models/licence_seat_snapshot_list.rb +243 -0
  381. data/lib/cbox_billing/models/license.rb +407 -0
  382. data/lib/cbox_billing/models/license_issue_request.rb +232 -0
  383. data/lib/cbox_billing/models/license_key.rb +503 -0
  384. data/lib/cbox_billing/models/license_key_detail.rb +537 -0
  385. data/lib/cbox_billing/models/license_key_detail_all_of_instances.rb +277 -0
  386. data/lib/cbox_billing/models/license_renew_request.rb +160 -0
  387. data/lib/cbox_billing/models/license_revoke_request.rb +160 -0
  388. data/lib/cbox_billing/models/license_revoke_result.rb +227 -0
  389. data/lib/cbox_billing/models/limit_increase_decision.rb +368 -0
  390. data/lib/cbox_billing/models/limit_increase_input.rb +300 -0
  391. data/lib/cbox_billing/models/limit_increase_request.rb +516 -0
  392. data/lib/cbox_billing/models/link_accounting_contact200_response.rb +177 -0
  393. data/lib/cbox_billing/models/link_accounting_contact_request.rb +187 -0
  394. data/lib/cbox_billing/models/list_access_programs200_response.rb +252 -0
  395. data/lib/cbox_billing/models/list_accounting_contact_duplicates200_response.rb +205 -0
  396. data/lib/cbox_billing/models/list_accounting_contact_duplicates200_response_duplicates_inner.rb +205 -0
  397. data/lib/cbox_billing/models/list_accounting_contact_duplicates200_response_duplicates_inner_organizations_inner.rb +203 -0
  398. data/lib/cbox_billing/models/list_accounting_contact_import_rows200_response.rb +192 -0
  399. data/lib/cbox_billing/models/list_accounting_contact_sync_failures200_response.rb +217 -0
  400. data/lib/cbox_billing/models/list_accounting_contacts200_response.rb +282 -0
  401. data/lib/cbox_billing/models/list_accounting_organization_invoices200_response.rb +191 -0
  402. data/lib/cbox_billing/models/list_accounting_syncs200_response.rb +179 -0
  403. data/lib/cbox_billing/models/list_affiliate_commissions200_response.rb +226 -0
  404. data/lib/cbox_billing/models/list_affiliate_payout_runs200_response.rb +226 -0
  405. data/lib/cbox_billing/models/list_affiliate_payouts200_response.rb +226 -0
  406. data/lib/cbox_billing/models/list_affiliate_programs200_response.rb +226 -0
  407. data/lib/cbox_billing/models/list_affiliates200_response.rb +226 -0
  408. data/lib/cbox_billing/models/list_agreements200_response.rb +179 -0
  409. data/lib/cbox_billing/models/list_all_invoices400_response.rb +177 -0
  410. data/lib/cbox_billing/models/list_bank_lines200_response.rb +215 -0
  411. data/lib/cbox_billing/models/list_bank_statements200_response.rb +215 -0
  412. data/lib/cbox_billing/models/list_connected_financial_events200_response.rb +292 -0
  413. data/lib/cbox_billing/models/list_connected_production_environments200_response.rb +205 -0
  414. data/lib/cbox_billing/models/list_connected_production_environments200_response_data_inner.rb +203 -0
  415. data/lib/cbox_billing/models/list_customer_dunning_holds200_response.rb +179 -0
  416. data/lib/cbox_billing/models/list_disputes200_response.rb +217 -0
  417. data/lib/cbox_billing/models/list_download_grants200_response.rb +226 -0
  418. data/lib/cbox_billing/models/list_entitlement_overrides200_response.rb +207 -0
  419. data/lib/cbox_billing/models/list_environments200_response.rb +162 -0
  420. data/lib/cbox_billing/models/list_financial_events200_response.rb +240 -0
  421. data/lib/cbox_billing/models/list_financial_events200_response_data_inner.rb +342 -0
  422. data/lib/cbox_billing/models/list_financial_events200_response_data_inner_data.rb +408 -0
  423. data/lib/cbox_billing/models/list_grandfathered_subscribers200_response.rb +244 -0
  424. data/lib/cbox_billing/models/list_invoice_drafts200_response.rb +215 -0
  425. data/lib/cbox_billing/models/list_invoice_items200_response.rb +179 -0
  426. data/lib/cbox_billing/models/list_invoice_payments200_response.rb +205 -0
  427. data/lib/cbox_billing/models/list_license_keys200_response.rb +226 -0
  428. data/lib/cbox_billing/models/list_limit_increase_requests200_response.rb +231 -0
  429. data/lib/cbox_billing/models/list_one_off_products200_response.rb +179 -0
  430. data/lib/cbox_billing/models/list_orders200_response.rb +226 -0
  431. data/lib/cbox_billing/models/list_organization_purchases200_response.rb +205 -0
  432. data/lib/cbox_billing/models/list_organization_subscriptions200_response.rb +179 -0
  433. data/lib/cbox_billing/models/list_overage_caps200_response.rb +179 -0
  434. data/lib/cbox_billing/models/list_plan_moves200_response.rb +179 -0
  435. data/lib/cbox_billing/models/list_private_plans200_response.rb +179 -0
  436. data/lib/cbox_billing/models/list_product_files200_response.rb +179 -0
  437. data/lib/cbox_billing/models/list_scheduled_catalog_changes200_response.rb +179 -0
  438. data/lib/cbox_billing/models/list_service_directory200_response.rb +249 -0
  439. data/lib/cbox_billing/models/list_signed_agreements200_response.rb +226 -0
  440. data/lib/cbox_billing/models/list_spend_alerts200_response.rb +218 -0
  441. data/lib/cbox_billing/models/list_spend_alerts200_response_spend.rb +222 -0
  442. data/lib/cbox_billing/models/list_subscription_date_moves200_response.rb +179 -0
  443. data/lib/cbox_billing/models/list_subscription_schedule200_response.rb +179 -0
  444. data/lib/cbox_billing/models/list_tax_return_lines200_response.rb +215 -0
  445. data/lib/cbox_billing/models/list_tax_returns200_response.rb +215 -0
  446. data/lib/cbox_billing/models/list_unmatched_accounting_invoices200_response.rb +192 -0
  447. data/lib/cbox_billing/models/lock_subscription_price_request.rb +162 -0
  448. data/lib/cbox_billing/models/mark_affiliate_payout_paid_request.rb +176 -0
  449. data/lib/cbox_billing/models/mark_invoice_paid_request.rb +176 -0
  450. data/lib/cbox_billing/models/match_bank_line_request.rb +197 -0
  451. data/lib/cbox_billing/models/match_bank_line_request_allocations_inner.rb +221 -0
  452. data/lib/cbox_billing/models/meter.rb +524 -0
  453. data/lib/cbox_billing/models/meter_detail.rb +587 -0
  454. data/lib/cbox_billing/models/meter_detail_all_of_entitlements.rb +260 -0
  455. data/lib/cbox_billing/models/meter_list.rb +226 -0
  456. data/lib/cbox_billing/models/meter_request.rb +463 -0
  457. data/lib/cbox_billing/models/meter_request_resets.rb +237 -0
  458. data/lib/cbox_billing/models/meter_resets.rb +279 -0
  459. data/lib/cbox_billing/models/meter_staged.rb +309 -0
  460. data/lib/cbox_billing/models/meter_staged_changeset.rb +265 -0
  461. data/lib/cbox_billing/models/money.rb +222 -0
  462. data/lib/cbox_billing/models/money_amount.rb +203 -0
  463. data/lib/cbox_billing/models/move_affiliate_referral_request.rb +213 -0
  464. data/lib/cbox_billing/models/move_affiliate_request.rb +188 -0
  465. data/lib/cbox_billing/models/negotiated_price.rb +277 -0
  466. data/lib/cbox_billing/models/new_auto_top_up.rb +277 -0
  467. data/lib/cbox_billing/models/new_credit_purchase.rb +271 -0
  468. data/lib/cbox_billing/models/new_invoice.rb +264 -0
  469. data/lib/cbox_billing/models/new_invoice_line.rb +295 -0
  470. data/lib/cbox_billing/models/ok.rb +201 -0
  471. data/lib/cbox_billing/models/one_off_product.rb +359 -0
  472. data/lib/cbox_billing/models/one_off_purchase.rb +396 -0
  473. data/lib/cbox_billing/models/one_off_purchase_items_inner.rb +255 -0
  474. data/lib/cbox_billing/models/one_off_quote.rb +527 -0
  475. data/lib/cbox_billing/models/one_off_quote_organization.rb +177 -0
  476. data/lib/cbox_billing/models/one_off_quote_request.rb +324 -0
  477. data/lib/cbox_billing/models/order.rb +573 -0
  478. data/lib/cbox_billing/models/order_items_inner.rb +311 -0
  479. data/lib/cbox_billing/models/organization.rb +545 -0
  480. data/lib/cbox_billing/models/organization_accounting_contact.rb +255 -0
  481. data/lib/cbox_billing/models/organization_bundles.rb +310 -0
  482. data/lib/cbox_billing/models/organization_bundles_active_inner.rb +242 -0
  483. data/lib/cbox_billing/models/organization_response.rb +177 -0
  484. data/lib/cbox_billing/models/organization_upsert_request.rb +666 -0
  485. data/lib/cbox_billing/models/overage_cap.rb +105 -0
  486. data/lib/cbox_billing/models/overage_cap_binding.rb +263 -0
  487. data/lib/cbox_billing/models/overage_cap_one_of.rb +186 -0
  488. data/lib/cbox_billing/models/overage_cap_one_of1.rb +231 -0
  489. data/lib/cbox_billing/models/overage_cap_state.rb +380 -0
  490. data/lib/cbox_billing/models/page.rb +192 -0
  491. data/lib/cbox_billing/models/payment_gateway_failover.rb +233 -0
  492. data/lib/cbox_billing/models/payment_gateway_failover_failovers_inner.rb +348 -0
  493. data/lib/cbox_billing/models/payment_gateway_failover_failovers_inner_hops_inner.rb +190 -0
  494. data/lib/cbox_billing/models/payment_gateway_failover_gateways_inner.rb +230 -0
  495. data/lib/cbox_billing/models/payment_gateway_failover_gateways_inner_circuit.rb +288 -0
  496. data/lib/cbox_billing/models/payment_gateway_failover_routing.rb +235 -0
  497. data/lib/cbox_billing/models/payment_intent_request.rb +254 -0
  498. data/lib/cbox_billing/models/payment_mandate.rb +253 -0
  499. data/lib/cbox_billing/models/payment_method.rb +374 -0
  500. data/lib/cbox_billing/models/payment_method_id_request.rb +177 -0
  501. data/lib/cbox_billing/models/payment_method_list.rb +226 -0
  502. data/lib/cbox_billing/models/payment_method_set.rb +180 -0
  503. data/lib/cbox_billing/models/payment_terms.rb +281 -0
  504. data/lib/cbox_billing/models/payment_terms_request.rb +235 -0
  505. data/lib/cbox_billing/models/pending_approval.rb +229 -0
  506. data/lib/cbox_billing/models/pending_price_change.rb +257 -0
  507. data/lib/cbox_billing/models/per_value_entitlements.rb +206 -0
  508. data/lib/cbox_billing/models/per_value_entitlements_values_value.rb +263 -0
  509. data/lib/cbox_billing/models/plan.rb +425 -0
  510. data/lib/cbox_billing/models/plan_change_input.rb +224 -0
  511. data/lib/cbox_billing/models/plan_change_preview.rb +478 -0
  512. data/lib/cbox_billing/models/plan_change_preview_seat_types_inner.rb +356 -0
  513. data/lib/cbox_billing/models/plan_change_price_options.rb +280 -0
  514. data/lib/cbox_billing/models/plan_change_price_options_keep_negotiated.rb +230 -0
  515. data/lib/cbox_billing/models/plan_change_request.rb +256 -0
  516. data/lib/cbox_billing/models/plan_change_result.rb +543 -0
  517. data/lib/cbox_billing/models/plan_features_value.rb +105 -0
  518. data/lib/cbox_billing/models/plan_list.rb +253 -0
  519. data/lib/cbox_billing/models/plan_meter_entitlement.rb +250 -0
  520. data/lib/cbox_billing/models/plan_move.rb +386 -0
  521. data/lib/cbox_billing/models/plan_move_subscribers.rb +188 -0
  522. data/lib/cbox_billing/models/plan_price.rb +256 -0
  523. data/lib/cbox_billing/models/plan_prices_inner.rb +241 -0
  524. data/lib/cbox_billing/models/plane_invoice_list.rb +226 -0
  525. data/lib/cbox_billing/models/plane_invoice_list_all_of_data.rb +557 -0
  526. data/lib/cbox_billing/models/portal_session_request.rb +309 -0
  527. data/lib/cbox_billing/models/prepare_tax_return200_response.rb +177 -0
  528. data/lib/cbox_billing/models/prepare_tax_return_request.rb +237 -0
  529. data/lib/cbox_billing/models/preview_renewal_alignment_request.rb +201 -0
  530. data/lib/cbox_billing/models/preview_service_invitation200_response.rb +161 -0
  531. data/lib/cbox_billing/models/preview_service_invitation200_response_invitation.rb +189 -0
  532. data/lib/cbox_billing/models/preview_service_invitation_request.rb +186 -0
  533. data/lib/cbox_billing/models/preview_subscription_cancel_request.rb +216 -0
  534. data/lib/cbox_billing/models/preview_subscription_coupon200_response.rb +205 -0
  535. data/lib/cbox_billing/models/preview_subscription_coupon_request.rb +186 -0
  536. data/lib/cbox_billing/models/price_lock.rb +215 -0
  537. data/lib/cbox_billing/models/price_lock_state.rb +190 -0
  538. data/lib/cbox_billing/models/price_tax.rb +348 -0
  539. data/lib/cbox_billing/models/private_plan.rb +380 -0
  540. data/lib/cbox_billing/models/product_definition_manifest.rb +269 -0
  541. data/lib/cbox_billing/models/product_definition_manifest_features_inner.rb +333 -0
  542. data/lib/cbox_billing/models/product_definition_manifest_meters_inner.rb +434 -0
  543. data/lib/cbox_billing/models/product_file.rb +420 -0
  544. data/lib/cbox_billing/models/proration_line.rb +203 -0
  545. data/lib/cbox_billing/models/quantity_preview.rb +321 -0
  546. data/lib/cbox_billing/models/quantity_request.rb +196 -0
  547. data/lib/cbox_billing/models/quote.rb +700 -0
  548. data/lib/cbox_billing/models/quote_all_of_acceptance.rb +206 -0
  549. data/lib/cbox_billing/models/quote_all_of_approval.rb +201 -0
  550. data/lib/cbox_billing/models/quote_all_of_grants.rb +205 -0
  551. data/lib/cbox_billing/models/quote_all_of_lines.rb +284 -0
  552. data/lib/cbox_billing/models/quote_all_of_terms.rb +285 -0
  553. data/lib/cbox_billing/models/quote_all_of_terms_ramp.rb +169 -0
  554. data/lib/cbox_billing/models/quote_all_of_totals.rb +255 -0
  555. data/lib/cbox_billing/models/quote_all_of_totals_lines.rb +223 -0
  556. data/lib/cbox_billing/models/quote_line_grants.rb +212 -0
  557. data/lib/cbox_billing/models/quote_line_grants_features_inner.rb +204 -0
  558. data/lib/cbox_billing/models/quote_line_grants_meters_inner.rb +260 -0
  559. data/lib/cbox_billing/models/quote_line_request.rb +368 -0
  560. data/lib/cbox_billing/models/quote_list.rb +226 -0
  561. data/lib/cbox_billing/models/quote_request.rb +650 -0
  562. data/lib/cbox_billing/models/quote_request_ramp_inner.rb +221 -0
  563. data/lib/cbox_billing/models/quote_signer.rb +434 -0
  564. data/lib/cbox_billing/models/quote_signer_request.rb +247 -0
  565. data/lib/cbox_billing/models/quote_signer_signature.rb +296 -0
  566. data/lib/cbox_billing/models/quote_signing.rb +384 -0
  567. data/lib/cbox_billing/models/quote_signing_request.rb +278 -0
  568. data/lib/cbox_billing/models/quote_signing_signed_document.rb +240 -0
  569. data/lib/cbox_billing/models/quote_summary.rb +440 -0
  570. data/lib/cbox_billing/models/rate_limit_error_body.rb +177 -0
  571. data/lib/cbox_billing/models/reconcile_id_signals_inclusion200_response.rb +211 -0
  572. data/lib/cbox_billing/models/reconcile_id_signals_inclusion_request.rb +162 -0
  573. data/lib/cbox_billing/models/record_invoice_payment_request.rb +223 -0
  574. data/lib/cbox_billing/models/recurring_price.rb +230 -0
  575. data/lib/cbox_billing/models/refund.rb +493 -0
  576. data/lib/cbox_billing/models/refund_list.rb +179 -0
  577. data/lib/cbox_billing/models/refund_order_request.rb +223 -0
  578. data/lib/cbox_billing/models/refund_request.rb +227 -0
  579. data/lib/cbox_billing/models/refund_result.rb +239 -0
  580. data/lib/cbox_billing/models/refusal.rb +205 -0
  581. data/lib/cbox_billing/models/release_invoice_from_review200_response.rb +205 -0
  582. data/lib/cbox_billing/models/remove_billing_parent_request.rb +186 -0
  583. data/lib/cbox_billing/models/remove_subscription_coupon200_response.rb +177 -0
  584. data/lib/cbox_billing/models/remove_subscription_coupon_request.rb +177 -0
  585. data/lib/cbox_billing/models/reserve_outcome.rb +251 -0
  586. data/lib/cbox_billing/models/reserve_request.rb +225 -0
  587. data/lib/cbox_billing/models/reserve_request_meters_inner.rb +212 -0
  588. data/lib/cbox_billing/models/reset_environment200_response.rb +187 -0
  589. data/lib/cbox_billing/models/reset_environment_request.rb +162 -0
  590. data/lib/cbox_billing/models/reset_period.rb +247 -0
  591. data/lib/cbox_billing/models/resource_limit.rb +392 -0
  592. data/lib/cbox_billing/models/retry_accounting_sync202_response.rb +177 -0
  593. data/lib/cbox_billing/models/retry_invoice_dunning_request.rb +176 -0
  594. data/lib/cbox_billing/models/reverse_invoice_payment_request.rb +186 -0
  595. data/lib/cbox_billing/models/revoke_limit_increase_request.rb +195 -0
  596. data/lib/cbox_billing/models/schedule_phase.rb +486 -0
  597. data/lib/cbox_billing/models/schedule_phase_request.rb +396 -0
  598. data/lib/cbox_billing/models/schedule_plan_move_request.rb +231 -0
  599. data/lib/cbox_billing/models/scheduled_catalog_change.rb +331 -0
  600. data/lib/cbox_billing/models/scheduled_catalog_change_existing.rb +215 -0
  601. data/lib/cbox_billing/models/seat_breakdown.rb +404 -0
  602. data/lib/cbox_billing/models/seat_entitlement.rb +267 -0
  603. data/lib/cbox_billing/models/seat_ledger_entry.rb +440 -0
  604. data/lib/cbox_billing/models/seat_ledger_page.rb +205 -0
  605. data/lib/cbox_billing/models/seat_ledger_page_meta.rb +255 -0
  606. data/lib/cbox_billing/models/seat_reassign_request.rb +187 -0
  607. data/lib/cbox_billing/models/seat_subject_request.rb +178 -0
  608. data/lib/cbox_billing/models/seat_type_change.rb +384 -0
  609. data/lib/cbox_billing/models/seat_type_entitlement.rb +269 -0
  610. data/lib/cbox_billing/models/seat_type_quantity_request.rb +205 -0
  611. data/lib/cbox_billing/models/seat_type_response.rb +177 -0
  612. data/lib/cbox_billing/models/seat_type_state.rb +565 -0
  613. data/lib/cbox_billing/models/seat_type_state_holders_inner.rb +189 -0
  614. data/lib/cbox_billing/models/seats_set_request.rb +186 -0
  615. data/lib/cbox_billing/models/service_admission_identity.rb +237 -0
  616. data/lib/cbox_billing/models/service_admission_input.rb +388 -0
  617. data/lib/cbox_billing/models/set_backup_card_consent200_response.rb +189 -0
  618. data/lib/cbox_billing/models/set_backup_card_consent_request.rb +177 -0
  619. data/lib/cbox_billing/models/set_billing_parent409_response.rb +227 -0
  620. data/lib/cbox_billing/models/set_billing_parent_request.rb +212 -0
  621. data/lib/cbox_billing/models/set_customer_contract_request.rb +197 -0
  622. data/lib/cbox_billing/models/set_invoice_consolidation_request.rb +177 -0
  623. data/lib/cbox_billing/models/set_overage_cap422_response.rb +227 -0
  624. data/lib/cbox_billing/models/set_product_delivery_request.rb +342 -0
  625. data/lib/cbox_billing/models/set_subscription_purchase_order200_response.rb +189 -0
  626. data/lib/cbox_billing/models/set_subscription_purchase_order_request.rb +176 -0
  627. data/lib/cbox_billing/models/setup_intent.rb +302 -0
  628. data/lib/cbox_billing/models/setup_intent_request.rb +177 -0
  629. data/lib/cbox_billing/models/show_environment200_response.rb +160 -0
  630. data/lib/cbox_billing/models/signals_source200_response.rb +214 -0
  631. data/lib/cbox_billing/models/signals_source200_response_meta.rb +471 -0
  632. data/lib/cbox_billing/models/signals_source_erasures200_response.rb +214 -0
  633. data/lib/cbox_billing/models/signals_source_erasures200_response_meta.rb +329 -0
  634. data/lib/cbox_billing/models/signed_agreement.rb +498 -0
  635. data/lib/cbox_billing/models/signed_agreement_document.rb +252 -0
  636. data/lib/cbox_billing/models/skip_accounting_contact_import_rows200_response.rb +177 -0
  637. data/lib/cbox_billing/models/skip_accounting_contact_import_rows_request.rb +188 -0
  638. data/lib/cbox_billing/models/skip_invoice_dunning_step_request.rb +186 -0
  639. data/lib/cbox_billing/models/spend_alert.rb +395 -0
  640. data/lib/cbox_billing/models/start_accounting_contact_import202_response.rb +177 -0
  641. data/lib/cbox_billing/models/stop_invoice_dunning_request.rb +247 -0
  642. data/lib/cbox_billing/models/submit_dispute_evidence_request.rb +178 -0
  643. data/lib/cbox_billing/models/subscribe_request.rb +373 -0
  644. data/lib/cbox_billing/models/subscribe_result.rb +215 -0
  645. data/lib/cbox_billing/models/subscription.rb +617 -0
  646. data/lib/cbox_billing/models/subscription_bundle.rb +200 -0
  647. data/lib/cbox_billing/models/subscription_change.rb +505 -0
  648. data/lib/cbox_billing/models/subscription_change_list.rb +226 -0
  649. data/lib/cbox_billing/models/subscription_contract.rb +188 -0
  650. data/lib/cbox_billing/models/subscription_contract_term.rb +385 -0
  651. data/lib/cbox_billing/models/subscription_date_move.rb +295 -0
  652. data/lib/cbox_billing/models/subscription_discount.rb +315 -0
  653. data/lib/cbox_billing/models/subscription_pending_change.rb +171 -0
  654. data/lib/cbox_billing/models/subscription_standing.rb +230 -0
  655. data/lib/cbox_billing/models/subscription_terms.rb +459 -0
  656. data/lib/cbox_billing/models/subscription_terms_price.rb +178 -0
  657. data/lib/cbox_billing/models/sync_product_definitions200_response.rb +179 -0
  658. data/lib/cbox_billing/models/sync_product_definitions200_response_data_inner.rb +335 -0
  659. data/lib/cbox_billing/models/tax_return.rb +663 -0
  660. data/lib/cbox_billing/models/tax_return_boxes_inner.rb +307 -0
  661. data/lib/cbox_billing/models/tax_return_corrections_inner.rb +178 -0
  662. data/lib/cbox_billing/models/tax_return_issues_inner.rb +227 -0
  663. data/lib/cbox_billing/models/tax_return_line.rb +550 -0
  664. data/lib/cbox_billing/models/tax_return_line_document.rb +214 -0
  665. data/lib/cbox_billing/models/tax_return_line_fx.rb +212 -0
  666. data/lib/cbox_billing/models/tax_return_member_states_inner.rb +250 -0
  667. data/lib/cbox_billing/models/tax_return_not_from_billing_inner.rb +229 -0
  668. data/lib/cbox_billing/models/test_clock_advance_request.rb +178 -0
  669. data/lib/cbox_billing/models/test_clock_advance_result.rb +334 -0
  670. data/lib/cbox_billing/models/test_clock_advance_result_clock.rb +230 -0
  671. data/lib/cbox_billing/models/upcoming_invoice.rb +440 -0
  672. data/lib/cbox_billing/models/upcoming_invoice_first_period.rb +251 -0
  673. data/lib/cbox_billing/models/upcoming_invoice_interim.rb +245 -0
  674. data/lib/cbox_billing/models/upcoming_invoice_interim_invoices_inner.rb +286 -0
  675. data/lib/cbox_billing/models/upcoming_invoice_interim_reconciliation.rb +270 -0
  676. data/lib/cbox_billing/models/upcoming_invoice_interim_reconciliation_credit_notes_inner.rb +282 -0
  677. data/lib/cbox_billing/models/upcoming_invoice_lines_inner.rb +282 -0
  678. data/lib/cbox_billing/models/update_affiliate_program_request.rb +398 -0
  679. data/lib/cbox_billing/models/update_affiliate_request.rb +321 -0
  680. data/lib/cbox_billing/models/update_dispute_evidence_request.rb +177 -0
  681. data/lib/cbox_billing/models/update_dispute_evidence_request_evidence.rb +251 -0
  682. data/lib/cbox_billing/models/update_entitlement_override_request.rb +309 -0
  683. data/lib/cbox_billing/models/update_invoice_draft_request.rb +214 -0
  684. data/lib/cbox_billing/models/update_invoice_draft_request_lines_inner.rb +224 -0
  685. data/lib/cbox_billing/models/update_license_key_request.rb +186 -0
  686. data/lib/cbox_billing/models/update_payment_gateway_routing_request.rb +234 -0
  687. data/lib/cbox_billing/models/update_product_file_request.rb +208 -0
  688. data/lib/cbox_billing/models/update_spend_alert_request.rb +296 -0
  689. data/lib/cbox_billing/models/upgrade_offer.rb +189 -0
  690. data/lib/cbox_billing/models/usage_correction.rb +471 -0
  691. data/lib/cbox_billing/models/usage_correction_actor.rb +211 -0
  692. data/lib/cbox_billing/models/usage_correction_adjustment.rb +411 -0
  693. data/lib/cbox_billing/models/usage_correction_list.rb +226 -0
  694. data/lib/cbox_billing/models/usage_correction_list_all_of_data.rb +506 -0
  695. data/lib/cbox_billing/models/usage_corrections_request.rb +246 -0
  696. data/lib/cbox_billing/models/usage_corrections_request_corrections_inner.rb +413 -0
  697. data/lib/cbox_billing/models/usage_corrections_result.rb +395 -0
  698. data/lib/cbox_billing/models/usage_corrections_result_rejected_inner.rb +262 -0
  699. data/lib/cbox_billing/models/usage_event_values.rb +252 -0
  700. data/lib/cbox_billing/models/usage_events_request.rb +234 -0
  701. data/lib/cbox_billing/models/usage_events_request_events_inner.rb +385 -0
  702. data/lib/cbox_billing/models/usage_events_request_events_inner_dimensions_value.rb +104 -0
  703. data/lib/cbox_billing/models/usage_events_result.rb +301 -0
  704. data/lib/cbox_billing/models/usage_events_result_rejected_inner.rb +263 -0
  705. data/lib/cbox_billing/models/usage_ingest_request.rb +225 -0
  706. data/lib/cbox_billing/models/usage_ingest_request_entries_inner.rb +290 -0
  707. data/lib/cbox_billing/models/usage_ingest_result.rb +374 -0
  708. data/lib/cbox_billing/models/usage_ingest_result_unsupported_meters_inner.rb +203 -0
  709. data/lib/cbox_billing/models/usage_price.rb +258 -0
  710. data/lib/cbox_billing/models/usage_summary.rb +205 -0
  711. data/lib/cbox_billing/models/usage_summary_meters_value.rb +289 -0
  712. data/lib/cbox_billing/models/usage_summary_meters_value_breakdown_inner.rb +205 -0
  713. data/lib/cbox_billing/models/usage_summary_period.rb +247 -0
  714. data/lib/cbox_billing/models/usage_threshold.rb +275 -0
  715. data/lib/cbox_billing/models/usage_threshold_level.rb +217 -0
  716. data/lib/cbox_billing/models/usage_threshold_request.rb +248 -0
  717. data/lib/cbox_billing/models/usage_threshold_subscriptions_inner.rb +201 -0
  718. data/lib/cbox_billing/models/validation_error_body.rb +206 -0
  719. data/lib/cbox_billing/models/value_rule.rb +291 -0
  720. data/lib/cbox_billing/models/value_rules.rb +235 -0
  721. data/lib/cbox_billing/models/waitlist_answer.rb +105 -0
  722. data/lib/cbox_billing/models/waitlist_question.rb +411 -0
  723. data/lib/cbox_billing/models/webhook_delivery.rb +435 -0
  724. data/lib/cbox_billing/models/webhook_delivery_list.rb +226 -0
  725. data/lib/cbox_billing/models/webhook_endpoint.rb +347 -0
  726. data/lib/cbox_billing/models/webhook_endpoint_list.rb +226 -0
  727. data/lib/cbox_billing/models/webhook_endpoint_request.rb +270 -0
  728. data/lib/cbox_billing/models/webhook_endpoint_with_secret.rb +367 -0
  729. data/lib/cbox_billing/models/withdraw_agreement_request.rb +220 -0
  730. data/lib/cbox_billing/models/withdraw_agreement_request_user.rb +177 -0
  731. data/lib/cbox_billing/pagination.rb +28 -0
  732. data/lib/cbox_billing/retry.rb +96 -0
  733. data/lib/cbox_billing/version.rb +15 -0
  734. data/lib/cbox_billing/webhook.rb +77 -0
  735. data/lib/cbox_billing.rb +765 -0
  736. metadata +824 -0
@@ -0,0 +1,2009 @@
1
+ =begin
2
+ #Cbox Billing API
3
+
4
+ #The HTTP API of Cbox Billing. Reference: https://github.com/cboxdk/cbox-billing/tree/main/docs/api
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module CboxBilling
16
+ class AffiliatesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Adjust what an affiliate can be paid
23
+ # Add to (`amount_minor` above 0) or take from (below 0) what the affiliate can be paid in `currency`, with a `note` saying why: a bonus, a correction, a deal agreed outside Billing. It is an approved commission without a customer, payable at once, that the next payout includes.
24
+ # @param id [String]
25
+ # @param adjust_affiliate_balance_request [AdjustAffiliateBalanceRequest]
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is `409`.
28
+ # @return [AffiliateCommission]
29
+ def adjust_affiliate_balance(id, adjust_affiliate_balance_request, opts = {})
30
+ data, _status_code, _headers = adjust_affiliate_balance_with_http_info(id, adjust_affiliate_balance_request, opts)
31
+ data
32
+ end
33
+
34
+ # Adjust what an affiliate can be paid
35
+ # Add to (`amount_minor` above 0) or take from (below 0) what the affiliate can be paid in `currency`, with a `note` saying why: a bonus, a correction, a deal agreed outside Billing. It is an approved commission without a customer, payable at once, that the next payout includes.
36
+ # @param id [String]
37
+ # @param adjust_affiliate_balance_request [AdjustAffiliateBalanceRequest]
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is `409`.
40
+ # @return [Array<(AffiliateCommission, Integer, Hash)>] AffiliateCommission data, response status code and response headers
41
+ def adjust_affiliate_balance_with_http_info(id, adjust_affiliate_balance_request, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.adjust_affiliate_balance ...'
44
+ end
45
+ # verify the required parameter 'id' is set
46
+ if @api_client.config.client_side_validation && id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.adjust_affiliate_balance"
48
+ end
49
+ pattern = Regexp.new(/^aff_[0-9A-Za-z]+$/)
50
+ if @api_client.config.client_side_validation && id !~ pattern
51
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.adjust_affiliate_balance, must conform to the pattern #{pattern}."
52
+ end
53
+
54
+ # verify the required parameter 'adjust_affiliate_balance_request' is set
55
+ if @api_client.config.client_side_validation && adjust_affiliate_balance_request.nil?
56
+ fail ArgumentError, "Missing the required parameter 'adjust_affiliate_balance_request' when calling AffiliatesApi.adjust_affiliate_balance"
57
+ end
58
+ # resource path
59
+ local_var_path = '/affiliates/{id}/adjustments'.sub('{id}', CGI.escape(id.to_s))
60
+
61
+ # query parameters
62
+ query_params = opts[:query_params] || {}
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
68
+ # HTTP header 'Content-Type'
69
+ content_type = @api_client.select_header_content_type(['application/json'])
70
+ if !content_type.nil?
71
+ header_params['Content-Type'] = content_type
72
+ end
73
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
74
+
75
+ # form parameters
76
+ form_params = opts[:form_params] || {}
77
+
78
+ # http body (model)
79
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(adjust_affiliate_balance_request)
80
+
81
+ # return_type
82
+ return_type = opts[:debug_return_type] || 'AffiliateCommission'
83
+
84
+ # auth_names
85
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
86
+
87
+ new_options = opts.merge(
88
+ :operation => :"AffiliatesApi.adjust_affiliate_balance",
89
+ :header_params => header_params,
90
+ :query_params => query_params,
91
+ :form_params => form_params,
92
+ :body => post_body,
93
+ :auth_names => auth_names,
94
+ :return_type => return_type
95
+ )
96
+
97
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug "API called: AffiliatesApi#adjust_affiliate_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
100
+ end
101
+ return data, status_code, headers
102
+ end
103
+
104
+ # Approve an affiliate
105
+ # Its link and coupon refer customers from now on, and it is mailed a link to its dashboard. Approving an approved affiliate changes nothing and sends nothing.
106
+ # @param id [String]
107
+ # @param [Hash] opts the optional parameters
108
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
109
+ # @return [Affiliate]
110
+ def approve_affiliate(id, opts = {})
111
+ data, _status_code, _headers = approve_affiliate_with_http_info(id, opts)
112
+ data
113
+ end
114
+
115
+ # Approve an affiliate
116
+ # Its link and coupon refer customers from now on, and it is mailed a link to its dashboard. Approving an approved affiliate changes nothing and sends nothing.
117
+ # @param id [String]
118
+ # @param [Hash] opts the optional parameters
119
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
120
+ # @return [Array<(Affiliate, Integer, Hash)>] Affiliate data, response status code and response headers
121
+ def approve_affiliate_with_http_info(id, opts = {})
122
+ if @api_client.config.debugging
123
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.approve_affiliate ...'
124
+ end
125
+ # verify the required parameter 'id' is set
126
+ if @api_client.config.client_side_validation && id.nil?
127
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.approve_affiliate"
128
+ end
129
+ pattern = Regexp.new(/^aff_[0-9A-Za-z]+$/)
130
+ if @api_client.config.client_side_validation && id !~ pattern
131
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.approve_affiliate, must conform to the pattern #{pattern}."
132
+ end
133
+
134
+ # resource path
135
+ local_var_path = '/affiliates/{id}/approve'.sub('{id}', CGI.escape(id.to_s))
136
+
137
+ # query parameters
138
+ query_params = opts[:query_params] || {}
139
+
140
+ # header parameters
141
+ header_params = opts[:header_params] || {}
142
+ # HTTP header 'Accept' (if needed)
143
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
144
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
145
+
146
+ # form parameters
147
+ form_params = opts[:form_params] || {}
148
+
149
+ # http body (model)
150
+ post_body = opts[:debug_body]
151
+
152
+ # return_type
153
+ return_type = opts[:debug_return_type] || 'Affiliate'
154
+
155
+ # auth_names
156
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
157
+
158
+ new_options = opts.merge(
159
+ :operation => :"AffiliatesApi.approve_affiliate",
160
+ :header_params => header_params,
161
+ :query_params => query_params,
162
+ :form_params => form_params,
163
+ :body => post_body,
164
+ :auth_names => auth_names,
165
+ :return_type => return_type
166
+ )
167
+
168
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug "API called: AffiliatesApi#approve_affiliate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
171
+ end
172
+ return data, status_code, headers
173
+ end
174
+
175
+ # Archive or restore an affiliate program
176
+ # An archived program refers no one and earns nothing new; what was earned stays payable. Send `archived: false` to restore it.
177
+ # @param id [String]
178
+ # @param [Hash] opts the optional parameters
179
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
180
+ # @option opts [ArchiveAffiliateProgramRequest] :archive_affiliate_program_request
181
+ # @return [AffiliateProgram]
182
+ def archive_affiliate_program(id, opts = {})
183
+ data, _status_code, _headers = archive_affiliate_program_with_http_info(id, opts)
184
+ data
185
+ end
186
+
187
+ # Archive or restore an affiliate program
188
+ # An archived program refers no one and earns nothing new; what was earned stays payable. Send &#x60;archived: false&#x60; to restore it.
189
+ # @param id [String]
190
+ # @param [Hash] opts the optional parameters
191
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
192
+ # @option opts [ArchiveAffiliateProgramRequest] :archive_affiliate_program_request
193
+ # @return [Array<(AffiliateProgram, Integer, Hash)>] AffiliateProgram data, response status code and response headers
194
+ def archive_affiliate_program_with_http_info(id, opts = {})
195
+ if @api_client.config.debugging
196
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.archive_affiliate_program ...'
197
+ end
198
+ # verify the required parameter 'id' is set
199
+ if @api_client.config.client_side_validation && id.nil?
200
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.archive_affiliate_program"
201
+ end
202
+ pattern = Regexp.new(/^afp_[0-9A-Za-z]+$/)
203
+ if @api_client.config.client_side_validation && id !~ pattern
204
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.archive_affiliate_program, must conform to the pattern #{pattern}."
205
+ end
206
+
207
+ # resource path
208
+ local_var_path = '/affiliate-programs/{id}/archive'.sub('{id}', CGI.escape(id.to_s))
209
+
210
+ # query parameters
211
+ query_params = opts[:query_params] || {}
212
+
213
+ # header parameters
214
+ header_params = opts[:header_params] || {}
215
+ # HTTP header 'Accept' (if needed)
216
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
217
+ # HTTP header 'Content-Type'
218
+ content_type = @api_client.select_header_content_type(['application/json'])
219
+ if !content_type.nil?
220
+ header_params['Content-Type'] = content_type
221
+ end
222
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
223
+
224
+ # form parameters
225
+ form_params = opts[:form_params] || {}
226
+
227
+ # http body (model)
228
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'archive_affiliate_program_request'])
229
+
230
+ # return_type
231
+ return_type = opts[:debug_return_type] || 'AffiliateProgram'
232
+
233
+ # auth_names
234
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
235
+
236
+ new_options = opts.merge(
237
+ :operation => :"AffiliatesApi.archive_affiliate_program",
238
+ :header_params => header_params,
239
+ :query_params => query_params,
240
+ :form_params => form_params,
241
+ :body => post_body,
242
+ :auth_names => auth_names,
243
+ :return_type => return_type
244
+ )
245
+
246
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
247
+ if @api_client.config.debugging
248
+ @api_client.config.logger.debug "API called: AffiliatesApi#archive_affiliate_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
249
+ end
250
+ return data, status_code, headers
251
+ end
252
+
253
+ # Add an affiliate
254
+ # Add an affiliate to a program, approved unless `status` says otherwise.
255
+ # @param create_affiliate_request [CreateAffiliateRequest]
256
+ # @param [Hash] opts the optional parameters
257
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
258
+ # @return [Affiliate]
259
+ def create_affiliate(create_affiliate_request, opts = {})
260
+ data, _status_code, _headers = create_affiliate_with_http_info(create_affiliate_request, opts)
261
+ data
262
+ end
263
+
264
+ # Add an affiliate
265
+ # Add an affiliate to a program, approved unless &#x60;status&#x60; says otherwise.
266
+ # @param create_affiliate_request [CreateAffiliateRequest]
267
+ # @param [Hash] opts the optional parameters
268
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
269
+ # @return [Array<(Affiliate, Integer, Hash)>] Affiliate data, response status code and response headers
270
+ def create_affiliate_with_http_info(create_affiliate_request, opts = {})
271
+ if @api_client.config.debugging
272
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.create_affiliate ...'
273
+ end
274
+ # verify the required parameter 'create_affiliate_request' is set
275
+ if @api_client.config.client_side_validation && create_affiliate_request.nil?
276
+ fail ArgumentError, "Missing the required parameter 'create_affiliate_request' when calling AffiliatesApi.create_affiliate"
277
+ end
278
+ # resource path
279
+ local_var_path = '/affiliates'
280
+
281
+ # query parameters
282
+ query_params = opts[:query_params] || {}
283
+
284
+ # header parameters
285
+ header_params = opts[:header_params] || {}
286
+ # HTTP header 'Accept' (if needed)
287
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
288
+ # HTTP header 'Content-Type'
289
+ content_type = @api_client.select_header_content_type(['application/json'])
290
+ if !content_type.nil?
291
+ header_params['Content-Type'] = content_type
292
+ end
293
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
294
+
295
+ # form parameters
296
+ form_params = opts[:form_params] || {}
297
+
298
+ # http body (model)
299
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_affiliate_request)
300
+
301
+ # return_type
302
+ return_type = opts[:debug_return_type] || 'Affiliate'
303
+
304
+ # auth_names
305
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
306
+
307
+ new_options = opts.merge(
308
+ :operation => :"AffiliatesApi.create_affiliate",
309
+ :header_params => header_params,
310
+ :query_params => query_params,
311
+ :form_params => form_params,
312
+ :body => post_body,
313
+ :auth_names => auth_names,
314
+ :return_type => return_type
315
+ )
316
+
317
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug "API called: AffiliatesApi#create_affiliate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ end
321
+ return data, status_code, headers
322
+ end
323
+
324
+ # Create an affiliate payout
325
+ # Gather everything an affiliate can be paid in one currency into a payout now, outside the monthly run, and send it the way the program pays. An `export` payout stays pending until you mark it paid. Refused when nothing is payable or the total is below the program's minimum.
326
+ # @param create_affiliate_payout_request [CreateAffiliatePayoutRequest]
327
+ # @param [Hash] opts the optional parameters
328
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
329
+ # @return [AffiliatePayout]
330
+ def create_affiliate_payout(create_affiliate_payout_request, opts = {})
331
+ data, _status_code, _headers = create_affiliate_payout_with_http_info(create_affiliate_payout_request, opts)
332
+ data
333
+ end
334
+
335
+ # Create an affiliate payout
336
+ # Gather everything an affiliate can be paid in one currency into a payout now, outside the monthly run, and send it the way the program pays. An &#x60;export&#x60; payout stays pending until you mark it paid. Refused when nothing is payable or the total is below the program&#39;s minimum.
337
+ # @param create_affiliate_payout_request [CreateAffiliatePayoutRequest]
338
+ # @param [Hash] opts the optional parameters
339
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
340
+ # @return [Array<(AffiliatePayout, Integer, Hash)>] AffiliatePayout data, response status code and response headers
341
+ def create_affiliate_payout_with_http_info(create_affiliate_payout_request, opts = {})
342
+ if @api_client.config.debugging
343
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.create_affiliate_payout ...'
344
+ end
345
+ # verify the required parameter 'create_affiliate_payout_request' is set
346
+ if @api_client.config.client_side_validation && create_affiliate_payout_request.nil?
347
+ fail ArgumentError, "Missing the required parameter 'create_affiliate_payout_request' when calling AffiliatesApi.create_affiliate_payout"
348
+ end
349
+ # resource path
350
+ local_var_path = '/affiliate-payouts'
351
+
352
+ # query parameters
353
+ query_params = opts[:query_params] || {}
354
+
355
+ # header parameters
356
+ header_params = opts[:header_params] || {}
357
+ # HTTP header 'Accept' (if needed)
358
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
359
+ # HTTP header 'Content-Type'
360
+ content_type = @api_client.select_header_content_type(['application/json'])
361
+ if !content_type.nil?
362
+ header_params['Content-Type'] = content_type
363
+ end
364
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
365
+
366
+ # form parameters
367
+ form_params = opts[:form_params] || {}
368
+
369
+ # http body (model)
370
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_affiliate_payout_request)
371
+
372
+ # return_type
373
+ return_type = opts[:debug_return_type] || 'AffiliatePayout'
374
+
375
+ # auth_names
376
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
377
+
378
+ new_options = opts.merge(
379
+ :operation => :"AffiliatesApi.create_affiliate_payout",
380
+ :header_params => header_params,
381
+ :query_params => query_params,
382
+ :form_params => form_params,
383
+ :body => post_body,
384
+ :auth_names => auth_names,
385
+ :return_type => return_type
386
+ )
387
+
388
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
389
+ if @api_client.config.debugging
390
+ @api_client.config.logger.debug "API called: AffiliatesApi#create_affiliate_payout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
391
+ end
392
+ return data, status_code, headers
393
+ end
394
+
395
+ # Get a link to an affiliate's dashboard
396
+ # A signed link to the affiliate's dashboard (its link, coupon, referrals, earnings and payouts) that works for 14 days. Each call signs a fresh one; nothing changes. Refused for an affiliate that is not approved.
397
+ # @param id [String]
398
+ # @param [Hash] opts the optional parameters
399
+ # @return [AffiliatePortalLink]
400
+ def create_affiliate_portal_link(id, opts = {})
401
+ data, _status_code, _headers = create_affiliate_portal_link_with_http_info(id, opts)
402
+ data
403
+ end
404
+
405
+ # Get a link to an affiliate&#39;s dashboard
406
+ # A signed link to the affiliate&#39;s dashboard (its link, coupon, referrals, earnings and payouts) that works for 14 days. Each call signs a fresh one; nothing changes. Refused for an affiliate that is not approved.
407
+ # @param id [String]
408
+ # @param [Hash] opts the optional parameters
409
+ # @return [Array<(AffiliatePortalLink, Integer, Hash)>] AffiliatePortalLink data, response status code and response headers
410
+ def create_affiliate_portal_link_with_http_info(id, opts = {})
411
+ if @api_client.config.debugging
412
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.create_affiliate_portal_link ...'
413
+ end
414
+ # verify the required parameter 'id' is set
415
+ if @api_client.config.client_side_validation && id.nil?
416
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.create_affiliate_portal_link"
417
+ end
418
+ pattern = Regexp.new(/^aff_[0-9A-Za-z]+$/)
419
+ if @api_client.config.client_side_validation && id !~ pattern
420
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.create_affiliate_portal_link, must conform to the pattern #{pattern}."
421
+ end
422
+
423
+ # resource path
424
+ local_var_path = '/affiliates/{id}/portal-link'.sub('{id}', CGI.escape(id.to_s))
425
+
426
+ # query parameters
427
+ query_params = opts[:query_params] || {}
428
+
429
+ # header parameters
430
+ header_params = opts[:header_params] || {}
431
+ # HTTP header 'Accept' (if needed)
432
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
433
+
434
+ # form parameters
435
+ form_params = opts[:form_params] || {}
436
+
437
+ # http body (model)
438
+ post_body = opts[:debug_body]
439
+
440
+ # return_type
441
+ return_type = opts[:debug_return_type] || 'AffiliatePortalLink'
442
+
443
+ # auth_names
444
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
445
+
446
+ new_options = opts.merge(
447
+ :operation => :"AffiliatesApi.create_affiliate_portal_link",
448
+ :header_params => header_params,
449
+ :query_params => query_params,
450
+ :form_params => form_params,
451
+ :body => post_body,
452
+ :auth_names => auth_names,
453
+ :return_type => return_type
454
+ )
455
+
456
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
457
+ if @api_client.config.debugging
458
+ @api_client.config.logger.debug "API called: AffiliatesApi#create_affiliate_portal_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
459
+ end
460
+ return data, status_code, headers
461
+ end
462
+
463
+ # Create an affiliate program
464
+ # The terms affiliates promote under: a share of each payment after discounts and before tax, or a fixed amount per payment; on the first payment or every one; the cookie window; the refund hold; the minimum payout.
465
+ # @param create_affiliate_program_request [CreateAffiliateProgramRequest]
466
+ # @param [Hash] opts the optional parameters
467
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
468
+ # @return [AffiliateProgram]
469
+ def create_affiliate_program(create_affiliate_program_request, opts = {})
470
+ data, _status_code, _headers = create_affiliate_program_with_http_info(create_affiliate_program_request, opts)
471
+ data
472
+ end
473
+
474
+ # Create an affiliate program
475
+ # The terms affiliates promote under: a share of each payment after discounts and before tax, or a fixed amount per payment; on the first payment or every one; the cookie window; the refund hold; the minimum payout.
476
+ # @param create_affiliate_program_request [CreateAffiliateProgramRequest]
477
+ # @param [Hash] opts the optional parameters
478
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
479
+ # @return [Array<(AffiliateProgram, Integer, Hash)>] AffiliateProgram data, response status code and response headers
480
+ def create_affiliate_program_with_http_info(create_affiliate_program_request, opts = {})
481
+ if @api_client.config.debugging
482
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.create_affiliate_program ...'
483
+ end
484
+ # verify the required parameter 'create_affiliate_program_request' is set
485
+ if @api_client.config.client_side_validation && create_affiliate_program_request.nil?
486
+ fail ArgumentError, "Missing the required parameter 'create_affiliate_program_request' when calling AffiliatesApi.create_affiliate_program"
487
+ end
488
+ # resource path
489
+ local_var_path = '/affiliate-programs'
490
+
491
+ # query parameters
492
+ query_params = opts[:query_params] || {}
493
+
494
+ # header parameters
495
+ header_params = opts[:header_params] || {}
496
+ # HTTP header 'Accept' (if needed)
497
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
498
+ # HTTP header 'Content-Type'
499
+ content_type = @api_client.select_header_content_type(['application/json'])
500
+ if !content_type.nil?
501
+ header_params['Content-Type'] = content_type
502
+ end
503
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
504
+
505
+ # form parameters
506
+ form_params = opts[:form_params] || {}
507
+
508
+ # http body (model)
509
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_affiliate_program_request)
510
+
511
+ # return_type
512
+ return_type = opts[:debug_return_type] || 'AffiliateProgram'
513
+
514
+ # auth_names
515
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
516
+
517
+ new_options = opts.merge(
518
+ :operation => :"AffiliatesApi.create_affiliate_program",
519
+ :header_params => header_params,
520
+ :query_params => query_params,
521
+ :form_params => form_params,
522
+ :body => post_body,
523
+ :auth_names => auth_names,
524
+ :return_type => return_type
525
+ )
526
+
527
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
528
+ if @api_client.config.debugging
529
+ @api_client.config.logger.debug "API called: AffiliatesApi#create_affiliate_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
530
+ end
531
+ return data, status_code, headers
532
+ end
533
+
534
+ # Record a referral
535
+ # Record that this affiliate referred a customer. A customer belongs to the first affiliate that referred it; another affiliate is refused.
536
+ # @param id [String]
537
+ # @param create_affiliate_referral_request [CreateAffiliateReferralRequest]
538
+ # @param [Hash] opts the optional parameters
539
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
540
+ # @return [AffiliateReferral]
541
+ def create_affiliate_referral(id, create_affiliate_referral_request, opts = {})
542
+ data, _status_code, _headers = create_affiliate_referral_with_http_info(id, create_affiliate_referral_request, opts)
543
+ data
544
+ end
545
+
546
+ # Record a referral
547
+ # Record that this affiliate referred a customer. A customer belongs to the first affiliate that referred it; another affiliate is refused.
548
+ # @param id [String]
549
+ # @param create_affiliate_referral_request [CreateAffiliateReferralRequest]
550
+ # @param [Hash] opts the optional parameters
551
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
552
+ # @return [Array<(AffiliateReferral, Integer, Hash)>] AffiliateReferral data, response status code and response headers
553
+ def create_affiliate_referral_with_http_info(id, create_affiliate_referral_request, opts = {})
554
+ if @api_client.config.debugging
555
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.create_affiliate_referral ...'
556
+ end
557
+ # verify the required parameter 'id' is set
558
+ if @api_client.config.client_side_validation && id.nil?
559
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.create_affiliate_referral"
560
+ end
561
+ pattern = Regexp.new(/^aff_[0-9A-Za-z]+$/)
562
+ if @api_client.config.client_side_validation && id !~ pattern
563
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.create_affiliate_referral, must conform to the pattern #{pattern}."
564
+ end
565
+
566
+ # verify the required parameter 'create_affiliate_referral_request' is set
567
+ if @api_client.config.client_side_validation && create_affiliate_referral_request.nil?
568
+ fail ArgumentError, "Missing the required parameter 'create_affiliate_referral_request' when calling AffiliatesApi.create_affiliate_referral"
569
+ end
570
+ # resource path
571
+ local_var_path = '/affiliates/{id}/referrals'.sub('{id}', CGI.escape(id.to_s))
572
+
573
+ # query parameters
574
+ query_params = opts[:query_params] || {}
575
+
576
+ # header parameters
577
+ header_params = opts[:header_params] || {}
578
+ # HTTP header 'Accept' (if needed)
579
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
580
+ # HTTP header 'Content-Type'
581
+ content_type = @api_client.select_header_content_type(['application/json'])
582
+ if !content_type.nil?
583
+ header_params['Content-Type'] = content_type
584
+ end
585
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
586
+
587
+ # form parameters
588
+ form_params = opts[:form_params] || {}
589
+
590
+ # http body (model)
591
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_affiliate_referral_request)
592
+
593
+ # return_type
594
+ return_type = opts[:debug_return_type] || 'AffiliateReferral'
595
+
596
+ # auth_names
597
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
598
+
599
+ new_options = opts.merge(
600
+ :operation => :"AffiliatesApi.create_affiliate_referral",
601
+ :header_params => header_params,
602
+ :query_params => query_params,
603
+ :form_params => form_params,
604
+ :body => post_body,
605
+ :auth_names => auth_names,
606
+ :return_type => return_type
607
+ )
608
+
609
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
610
+ if @api_client.config.debugging
611
+ @api_client.config.logger.debug "API called: AffiliatesApi#create_affiliate_referral\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
612
+ end
613
+ return data, status_code, headers
614
+ end
615
+
616
+ # Download a payout file
617
+ # The run's export payouts still to pay in one currency, as a CSV the payout service reads: `paypal` for PayPal Payouts (email, amount, currency, payout id, note, wallet; no header) or `wise` for a Wise batch sent by email. Each row pays the affiliate's `payout_email`, else their email. Upload it, then mark each payout paid.
618
+ # @param id [String]
619
+ # @param format [String]
620
+ # @param currency [String]
621
+ # @param [Hash] opts the optional parameters
622
+ # @return [String]
623
+ def export_affiliate_payout_run(id, format, currency, opts = {})
624
+ data, _status_code, _headers = export_affiliate_payout_run_with_http_info(id, format, currency, opts)
625
+ data
626
+ end
627
+
628
+ # Download a payout file
629
+ # The run&#39;s export payouts still to pay in one currency, as a CSV the payout service reads: &#x60;paypal&#x60; for PayPal Payouts (email, amount, currency, payout id, note, wallet; no header) or &#x60;wise&#x60; for a Wise batch sent by email. Each row pays the affiliate&#39;s &#x60;payout_email&#x60;, else their email. Upload it, then mark each payout paid.
630
+ # @param id [String]
631
+ # @param format [String]
632
+ # @param currency [String]
633
+ # @param [Hash] opts the optional parameters
634
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
635
+ def export_affiliate_payout_run_with_http_info(id, format, currency, opts = {})
636
+ if @api_client.config.debugging
637
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.export_affiliate_payout_run ...'
638
+ end
639
+ # verify the required parameter 'id' is set
640
+ if @api_client.config.client_side_validation && id.nil?
641
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.export_affiliate_payout_run"
642
+ end
643
+ pattern = Regexp.new(/^afrun_[0-9A-Za-z]+$/)
644
+ if @api_client.config.client_side_validation && id !~ pattern
645
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.export_affiliate_payout_run, must conform to the pattern #{pattern}."
646
+ end
647
+
648
+ # verify the required parameter 'format' is set
649
+ if @api_client.config.client_side_validation && format.nil?
650
+ fail ArgumentError, "Missing the required parameter 'format' when calling AffiliatesApi.export_affiliate_payout_run"
651
+ end
652
+ # verify enum value
653
+ allowable_values = ["paypal", "wise"]
654
+ if @api_client.config.client_side_validation && !allowable_values.include?(format)
655
+ fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}"
656
+ end
657
+ # verify the required parameter 'currency' is set
658
+ if @api_client.config.client_side_validation && currency.nil?
659
+ fail ArgumentError, "Missing the required parameter 'currency' when calling AffiliatesApi.export_affiliate_payout_run"
660
+ end
661
+ if @api_client.config.client_side_validation && currency.to_s.length > 3
662
+ fail ArgumentError, 'invalid value for "currency" when calling AffiliatesApi.export_affiliate_payout_run, the character length must be smaller than or equal to 3.'
663
+ end
664
+
665
+ if @api_client.config.client_side_validation && currency.to_s.length < 3
666
+ fail ArgumentError, 'invalid value for "currency" when calling AffiliatesApi.export_affiliate_payout_run, the character length must be greater than or equal to 3.'
667
+ end
668
+
669
+ # resource path
670
+ local_var_path = '/affiliate-payout-runs/{id}/export'.sub('{id}', CGI.escape(id.to_s))
671
+
672
+ # query parameters
673
+ query_params = opts[:query_params] || {}
674
+ query_params[:'format'] = format
675
+ query_params[:'currency'] = currency
676
+
677
+ # header parameters
678
+ header_params = opts[:header_params] || {}
679
+ # HTTP header 'Accept' (if needed)
680
+ header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json']) unless header_params['Accept']
681
+
682
+ # form parameters
683
+ form_params = opts[:form_params] || {}
684
+
685
+ # http body (model)
686
+ post_body = opts[:debug_body]
687
+
688
+ # return_type
689
+ return_type = opts[:debug_return_type] || 'String'
690
+
691
+ # auth_names
692
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
693
+
694
+ new_options = opts.merge(
695
+ :operation => :"AffiliatesApi.export_affiliate_payout_run",
696
+ :header_params => header_params,
697
+ :query_params => query_params,
698
+ :form_params => form_params,
699
+ :body => post_body,
700
+ :auth_names => auth_names,
701
+ :return_type => return_type
702
+ )
703
+
704
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
705
+ if @api_client.config.debugging
706
+ @api_client.config.logger.debug "API called: AffiliatesApi#export_affiliate_payout_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
707
+ end
708
+ return data, status_code, headers
709
+ end
710
+
711
+ # Show an affiliate
712
+ # One affiliate, with what it can be paid now per currency.
713
+ # @param id [String]
714
+ # @param [Hash] opts the optional parameters
715
+ # @return [AffiliateDetail]
716
+ def get_affiliate(id, opts = {})
717
+ data, _status_code, _headers = get_affiliate_with_http_info(id, opts)
718
+ data
719
+ end
720
+
721
+ # Show an affiliate
722
+ # One affiliate, with what it can be paid now per currency.
723
+ # @param id [String]
724
+ # @param [Hash] opts the optional parameters
725
+ # @return [Array<(AffiliateDetail, Integer, Hash)>] AffiliateDetail data, response status code and response headers
726
+ def get_affiliate_with_http_info(id, opts = {})
727
+ if @api_client.config.debugging
728
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.get_affiliate ...'
729
+ end
730
+ # verify the required parameter 'id' is set
731
+ if @api_client.config.client_side_validation && id.nil?
732
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.get_affiliate"
733
+ end
734
+ pattern = Regexp.new(/^aff_[0-9A-Za-z]+$/)
735
+ if @api_client.config.client_side_validation && id !~ pattern
736
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.get_affiliate, must conform to the pattern #{pattern}."
737
+ end
738
+
739
+ # resource path
740
+ local_var_path = '/affiliates/{id}'.sub('{id}', CGI.escape(id.to_s))
741
+
742
+ # query parameters
743
+ query_params = opts[:query_params] || {}
744
+
745
+ # header parameters
746
+ header_params = opts[:header_params] || {}
747
+ # HTTP header 'Accept' (if needed)
748
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
749
+
750
+ # form parameters
751
+ form_params = opts[:form_params] || {}
752
+
753
+ # http body (model)
754
+ post_body = opts[:debug_body]
755
+
756
+ # return_type
757
+ return_type = opts[:debug_return_type] || 'AffiliateDetail'
758
+
759
+ # auth_names
760
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
761
+
762
+ new_options = opts.merge(
763
+ :operation => :"AffiliatesApi.get_affiliate",
764
+ :header_params => header_params,
765
+ :query_params => query_params,
766
+ :form_params => form_params,
767
+ :body => post_body,
768
+ :auth_names => auth_names,
769
+ :return_type => return_type
770
+ )
771
+
772
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
773
+ if @api_client.config.debugging
774
+ @api_client.config.logger.debug "API called: AffiliatesApi#get_affiliate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
775
+ end
776
+ return data, status_code, headers
777
+ end
778
+
779
+ # Show an affiliate payout run
780
+ # One run, with the currencies it has export payouts to pay in (one file each).
781
+ # @param id [String]
782
+ # @param [Hash] opts the optional parameters
783
+ # @return [AffiliatePayoutRun]
784
+ def get_affiliate_payout_run(id, opts = {})
785
+ data, _status_code, _headers = get_affiliate_payout_run_with_http_info(id, opts)
786
+ data
787
+ end
788
+
789
+ # Show an affiliate payout run
790
+ # One run, with the currencies it has export payouts to pay in (one file each).
791
+ # @param id [String]
792
+ # @param [Hash] opts the optional parameters
793
+ # @return [Array<(AffiliatePayoutRun, Integer, Hash)>] AffiliatePayoutRun data, response status code and response headers
794
+ def get_affiliate_payout_run_with_http_info(id, opts = {})
795
+ if @api_client.config.debugging
796
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.get_affiliate_payout_run ...'
797
+ end
798
+ # verify the required parameter 'id' is set
799
+ if @api_client.config.client_side_validation && id.nil?
800
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.get_affiliate_payout_run"
801
+ end
802
+ pattern = Regexp.new(/^afrun_[0-9A-Za-z]+$/)
803
+ if @api_client.config.client_side_validation && id !~ pattern
804
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.get_affiliate_payout_run, must conform to the pattern #{pattern}."
805
+ end
806
+
807
+ # resource path
808
+ local_var_path = '/affiliate-payout-runs/{id}'.sub('{id}', CGI.escape(id.to_s))
809
+
810
+ # query parameters
811
+ query_params = opts[:query_params] || {}
812
+
813
+ # header parameters
814
+ header_params = opts[:header_params] || {}
815
+ # HTTP header 'Accept' (if needed)
816
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
817
+
818
+ # form parameters
819
+ form_params = opts[:form_params] || {}
820
+
821
+ # http body (model)
822
+ post_body = opts[:debug_body]
823
+
824
+ # return_type
825
+ return_type = opts[:debug_return_type] || 'AffiliatePayoutRun'
826
+
827
+ # auth_names
828
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
829
+
830
+ new_options = opts.merge(
831
+ :operation => :"AffiliatesApi.get_affiliate_payout_run",
832
+ :header_params => header_params,
833
+ :query_params => query_params,
834
+ :form_params => form_params,
835
+ :body => post_body,
836
+ :auth_names => auth_names,
837
+ :return_type => return_type
838
+ )
839
+
840
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
841
+ if @api_client.config.debugging
842
+ @api_client.config.logger.debug "API called: AffiliatesApi#get_affiliate_payout_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
843
+ end
844
+ return data, status_code, headers
845
+ end
846
+
847
+ # Show an affiliate program
848
+ # One program.
849
+ # @param id [String]
850
+ # @param [Hash] opts the optional parameters
851
+ # @return [AffiliateProgram]
852
+ def get_affiliate_program(id, opts = {})
853
+ data, _status_code, _headers = get_affiliate_program_with_http_info(id, opts)
854
+ data
855
+ end
856
+
857
+ # Show an affiliate program
858
+ # One program.
859
+ # @param id [String]
860
+ # @param [Hash] opts the optional parameters
861
+ # @return [Array<(AffiliateProgram, Integer, Hash)>] AffiliateProgram data, response status code and response headers
862
+ def get_affiliate_program_with_http_info(id, opts = {})
863
+ if @api_client.config.debugging
864
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.get_affiliate_program ...'
865
+ end
866
+ # verify the required parameter 'id' is set
867
+ if @api_client.config.client_side_validation && id.nil?
868
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.get_affiliate_program"
869
+ end
870
+ pattern = Regexp.new(/^afp_[0-9A-Za-z]+$/)
871
+ if @api_client.config.client_side_validation && id !~ pattern
872
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.get_affiliate_program, must conform to the pattern #{pattern}."
873
+ end
874
+
875
+ # resource path
876
+ local_var_path = '/affiliate-programs/{id}'.sub('{id}', CGI.escape(id.to_s))
877
+
878
+ # query parameters
879
+ query_params = opts[:query_params] || {}
880
+
881
+ # header parameters
882
+ header_params = opts[:header_params] || {}
883
+ # HTTP header 'Accept' (if needed)
884
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
885
+
886
+ # form parameters
887
+ form_params = opts[:form_params] || {}
888
+
889
+ # http body (model)
890
+ post_body = opts[:debug_body]
891
+
892
+ # return_type
893
+ return_type = opts[:debug_return_type] || 'AffiliateProgram'
894
+
895
+ # auth_names
896
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
897
+
898
+ new_options = opts.merge(
899
+ :operation => :"AffiliatesApi.get_affiliate_program",
900
+ :header_params => header_params,
901
+ :query_params => query_params,
902
+ :form_params => form_params,
903
+ :body => post_body,
904
+ :auth_names => auth_names,
905
+ :return_type => return_type
906
+ )
907
+
908
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
909
+ if @api_client.config.debugging
910
+ @api_client.config.logger.debug "API called: AffiliatesApi#get_affiliate_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
911
+ end
912
+ return data, status_code, headers
913
+ end
914
+
915
+ # List affiliate commissions
916
+ # What referred payments earned, newest first. `pending` waits out the program's refund hold, `approved` is payable, `paid` was settled by a payout, `reversed` was refunded in full. A negative amount is a clawback: a refund after the commission was paid, netted by the next payout.
917
+ # @param [Hash] opts the optional parameters
918
+ # @option opts [String] :affiliate
919
+ # @option opts [String] :status
920
+ # @option opts [String] :customer
921
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
922
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
923
+ # @return [ListAffiliateCommissions200Response]
924
+ def list_affiliate_commissions(opts = {})
925
+ data, _status_code, _headers = list_affiliate_commissions_with_http_info(opts)
926
+ data
927
+ end
928
+
929
+ # List affiliate commissions
930
+ # What referred payments earned, newest first. &#x60;pending&#x60; waits out the program&#39;s refund hold, &#x60;approved&#x60; is payable, &#x60;paid&#x60; was settled by a payout, &#x60;reversed&#x60; was refunded in full. A negative amount is a clawback: a refund after the commission was paid, netted by the next payout.
931
+ # @param [Hash] opts the optional parameters
932
+ # @option opts [String] :affiliate
933
+ # @option opts [String] :status
934
+ # @option opts [String] :customer
935
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
936
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
937
+ # @return [Array<(ListAffiliateCommissions200Response, Integer, Hash)>] ListAffiliateCommissions200Response data, response status code and response headers
938
+ def list_affiliate_commissions_with_http_info(opts = {})
939
+ if @api_client.config.debugging
940
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.list_affiliate_commissions ...'
941
+ end
942
+ allowable_values = ["pending", "approved", "paid", "reversed"]
943
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
944
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
945
+ end
946
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
947
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliate_commissions, must be smaller than or equal to 100.'
948
+ end
949
+
950
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
951
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliate_commissions, must be greater than or equal to 1.'
952
+ end
953
+
954
+ # resource path
955
+ local_var_path = '/affiliate-commissions'
956
+
957
+ # query parameters
958
+ query_params = opts[:query_params] || {}
959
+ query_params[:'affiliate'] = opts[:'affiliate'] if !opts[:'affiliate'].nil?
960
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
961
+ query_params[:'customer'] = opts[:'customer'] if !opts[:'customer'].nil?
962
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
963
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
964
+
965
+ # header parameters
966
+ header_params = opts[:header_params] || {}
967
+ # HTTP header 'Accept' (if needed)
968
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
969
+
970
+ # form parameters
971
+ form_params = opts[:form_params] || {}
972
+
973
+ # http body (model)
974
+ post_body = opts[:debug_body]
975
+
976
+ # return_type
977
+ return_type = opts[:debug_return_type] || 'ListAffiliateCommissions200Response'
978
+
979
+ # auth_names
980
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
981
+
982
+ new_options = opts.merge(
983
+ :operation => :"AffiliatesApi.list_affiliate_commissions",
984
+ :header_params => header_params,
985
+ :query_params => query_params,
986
+ :form_params => form_params,
987
+ :body => post_body,
988
+ :auth_names => auth_names,
989
+ :return_type => return_type
990
+ )
991
+
992
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
993
+ if @api_client.config.debugging
994
+ @api_client.config.logger.debug "API called: AffiliatesApi#list_affiliate_commissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
995
+ end
996
+ return data, status_code, headers
997
+ end
998
+
999
+ # List affiliate payout runs
1000
+ # Payout runs, newest period first. A run is made each month once a program's NET term has passed.
1001
+ # @param [Hash] opts the optional parameters
1002
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
1003
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
1004
+ # @return [ListAffiliatePayoutRuns200Response]
1005
+ def list_affiliate_payout_runs(opts = {})
1006
+ data, _status_code, _headers = list_affiliate_payout_runs_with_http_info(opts)
1007
+ data
1008
+ end
1009
+
1010
+ # List affiliate payout runs
1011
+ # Payout runs, newest period first. A run is made each month once a program&#39;s NET term has passed.
1012
+ # @param [Hash] opts the optional parameters
1013
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
1014
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
1015
+ # @return [Array<(ListAffiliatePayoutRuns200Response, Integer, Hash)>] ListAffiliatePayoutRuns200Response data, response status code and response headers
1016
+ def list_affiliate_payout_runs_with_http_info(opts = {})
1017
+ if @api_client.config.debugging
1018
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.list_affiliate_payout_runs ...'
1019
+ end
1020
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1021
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliate_payout_runs, must be smaller than or equal to 100.'
1022
+ end
1023
+
1024
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1025
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliate_payout_runs, must be greater than or equal to 1.'
1026
+ end
1027
+
1028
+ # resource path
1029
+ local_var_path = '/affiliate-payout-runs'
1030
+
1031
+ # query parameters
1032
+ query_params = opts[:query_params] || {}
1033
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1034
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1035
+
1036
+ # header parameters
1037
+ header_params = opts[:header_params] || {}
1038
+ # HTTP header 'Accept' (if needed)
1039
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1040
+
1041
+ # form parameters
1042
+ form_params = opts[:form_params] || {}
1043
+
1044
+ # http body (model)
1045
+ post_body = opts[:debug_body]
1046
+
1047
+ # return_type
1048
+ return_type = opts[:debug_return_type] || 'ListAffiliatePayoutRuns200Response'
1049
+
1050
+ # auth_names
1051
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1052
+
1053
+ new_options = opts.merge(
1054
+ :operation => :"AffiliatesApi.list_affiliate_payout_runs",
1055
+ :header_params => header_params,
1056
+ :query_params => query_params,
1057
+ :form_params => form_params,
1058
+ :body => post_body,
1059
+ :auth_names => auth_names,
1060
+ :return_type => return_type
1061
+ )
1062
+
1063
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1064
+ if @api_client.config.debugging
1065
+ @api_client.config.logger.debug "API called: AffiliatesApi#list_affiliate_payout_runs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1066
+ end
1067
+ return data, status_code, headers
1068
+ end
1069
+
1070
+ # List affiliate payouts
1071
+ # Payouts, newest first.
1072
+ # @param [Hash] opts the optional parameters
1073
+ # @option opts [String] :affiliate
1074
+ # @option opts [String] :status
1075
+ # @option opts [String] :run
1076
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
1077
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
1078
+ # @return [ListAffiliatePayouts200Response]
1079
+ def list_affiliate_payouts(opts = {})
1080
+ data, _status_code, _headers = list_affiliate_payouts_with_http_info(opts)
1081
+ data
1082
+ end
1083
+
1084
+ # List affiliate payouts
1085
+ # Payouts, newest first.
1086
+ # @param [Hash] opts the optional parameters
1087
+ # @option opts [String] :affiliate
1088
+ # @option opts [String] :status
1089
+ # @option opts [String] :run
1090
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
1091
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
1092
+ # @return [Array<(ListAffiliatePayouts200Response, Integer, Hash)>] ListAffiliatePayouts200Response data, response status code and response headers
1093
+ def list_affiliate_payouts_with_http_info(opts = {})
1094
+ if @api_client.config.debugging
1095
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.list_affiliate_payouts ...'
1096
+ end
1097
+ allowable_values = ["pending", "paid"]
1098
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
1099
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
1100
+ end
1101
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1102
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliate_payouts, must be smaller than or equal to 100.'
1103
+ end
1104
+
1105
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1106
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliate_payouts, must be greater than or equal to 1.'
1107
+ end
1108
+
1109
+ # resource path
1110
+ local_var_path = '/affiliate-payouts'
1111
+
1112
+ # query parameters
1113
+ query_params = opts[:query_params] || {}
1114
+ query_params[:'affiliate'] = opts[:'affiliate'] if !opts[:'affiliate'].nil?
1115
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
1116
+ query_params[:'run'] = opts[:'run'] if !opts[:'run'].nil?
1117
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1118
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1119
+
1120
+ # header parameters
1121
+ header_params = opts[:header_params] || {}
1122
+ # HTTP header 'Accept' (if needed)
1123
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1124
+
1125
+ # form parameters
1126
+ form_params = opts[:form_params] || {}
1127
+
1128
+ # http body (model)
1129
+ post_body = opts[:debug_body]
1130
+
1131
+ # return_type
1132
+ return_type = opts[:debug_return_type] || 'ListAffiliatePayouts200Response'
1133
+
1134
+ # auth_names
1135
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1136
+
1137
+ new_options = opts.merge(
1138
+ :operation => :"AffiliatesApi.list_affiliate_payouts",
1139
+ :header_params => header_params,
1140
+ :query_params => query_params,
1141
+ :form_params => form_params,
1142
+ :body => post_body,
1143
+ :auth_names => auth_names,
1144
+ :return_type => return_type
1145
+ )
1146
+
1147
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1148
+ if @api_client.config.debugging
1149
+ @api_client.config.logger.debug "API called: AffiliatesApi#list_affiliate_payouts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1150
+ end
1151
+ return data, status_code, headers
1152
+ end
1153
+
1154
+ # List affiliate programs
1155
+ # Programs, newest first. Archived programs only with `archived=true`. Operator tokens of the whole environment; a product-bound token is refused.
1156
+ # @param [Hash] opts the optional parameters
1157
+ # @option opts [Boolean] :archived
1158
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
1159
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
1160
+ # @return [ListAffiliatePrograms200Response]
1161
+ def list_affiliate_programs(opts = {})
1162
+ data, _status_code, _headers = list_affiliate_programs_with_http_info(opts)
1163
+ data
1164
+ end
1165
+
1166
+ # List affiliate programs
1167
+ # Programs, newest first. Archived programs only with &#x60;archived&#x3D;true&#x60;. Operator tokens of the whole environment; a product-bound token is refused.
1168
+ # @param [Hash] opts the optional parameters
1169
+ # @option opts [Boolean] :archived
1170
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
1171
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
1172
+ # @return [Array<(ListAffiliatePrograms200Response, Integer, Hash)>] ListAffiliatePrograms200Response data, response status code and response headers
1173
+ def list_affiliate_programs_with_http_info(opts = {})
1174
+ if @api_client.config.debugging
1175
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.list_affiliate_programs ...'
1176
+ end
1177
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1178
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliate_programs, must be smaller than or equal to 100.'
1179
+ end
1180
+
1181
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1182
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliate_programs, must be greater than or equal to 1.'
1183
+ end
1184
+
1185
+ # resource path
1186
+ local_var_path = '/affiliate-programs'
1187
+
1188
+ # query parameters
1189
+ query_params = opts[:query_params] || {}
1190
+ query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
1191
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1192
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1193
+
1194
+ # header parameters
1195
+ header_params = opts[:header_params] || {}
1196
+ # HTTP header 'Accept' (if needed)
1197
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1198
+
1199
+ # form parameters
1200
+ form_params = opts[:form_params] || {}
1201
+
1202
+ # http body (model)
1203
+ post_body = opts[:debug_body]
1204
+
1205
+ # return_type
1206
+ return_type = opts[:debug_return_type] || 'ListAffiliatePrograms200Response'
1207
+
1208
+ # auth_names
1209
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1210
+
1211
+ new_options = opts.merge(
1212
+ :operation => :"AffiliatesApi.list_affiliate_programs",
1213
+ :header_params => header_params,
1214
+ :query_params => query_params,
1215
+ :form_params => form_params,
1216
+ :body => post_body,
1217
+ :auth_names => auth_names,
1218
+ :return_type => return_type
1219
+ )
1220
+
1221
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1222
+ if @api_client.config.debugging
1223
+ @api_client.config.logger.debug "API called: AffiliatesApi#list_affiliate_programs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1224
+ end
1225
+ return data, status_code, headers
1226
+ end
1227
+
1228
+ # List affiliates
1229
+ # Affiliates, newest first. Filter by `program` and `status`; `q` finds a code, an email or the start of a name.
1230
+ # @param [Hash] opts the optional parameters
1231
+ # @option opts [String] :program
1232
+ # @option opts [String] :status
1233
+ # @option opts [String] :q
1234
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
1235
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
1236
+ # @return [ListAffiliates200Response]
1237
+ def list_affiliates(opts = {})
1238
+ data, _status_code, _headers = list_affiliates_with_http_info(opts)
1239
+ data
1240
+ end
1241
+
1242
+ # List affiliates
1243
+ # Affiliates, newest first. Filter by &#x60;program&#x60; and &#x60;status&#x60;; &#x60;q&#x60; finds a code, an email or the start of a name.
1244
+ # @param [Hash] opts the optional parameters
1245
+ # @option opts [String] :program
1246
+ # @option opts [String] :status
1247
+ # @option opts [String] :q
1248
+ # @option opts [String] :cursor The opaque &#x60;next_cursor&#x60; from a previous page. Treat it as a black box — echo it back verbatim to fetch the following page. Omit it for the first page. A malformed cursor is a &#x60;400&#x60;.
1249
+ # @option opts [Integer] :limit Maximum items per page (1–100). Defaults to 20. (default to 20)
1250
+ # @return [Array<(ListAffiliates200Response, Integer, Hash)>] ListAffiliates200Response data, response status code and response headers
1251
+ def list_affiliates_with_http_info(opts = {})
1252
+ if @api_client.config.debugging
1253
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.list_affiliates ...'
1254
+ end
1255
+ allowable_values = ["pending", "approved", "suspended"]
1256
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
1257
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
1258
+ end
1259
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1260
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliates, must be smaller than or equal to 100.'
1261
+ end
1262
+
1263
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1264
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AffiliatesApi.list_affiliates, must be greater than or equal to 1.'
1265
+ end
1266
+
1267
+ # resource path
1268
+ local_var_path = '/affiliates'
1269
+
1270
+ # query parameters
1271
+ query_params = opts[:query_params] || {}
1272
+ query_params[:'program'] = opts[:'program'] if !opts[:'program'].nil?
1273
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
1274
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
1275
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1276
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1277
+
1278
+ # header parameters
1279
+ header_params = opts[:header_params] || {}
1280
+ # HTTP header 'Accept' (if needed)
1281
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1282
+
1283
+ # form parameters
1284
+ form_params = opts[:form_params] || {}
1285
+
1286
+ # http body (model)
1287
+ post_body = opts[:debug_body]
1288
+
1289
+ # return_type
1290
+ return_type = opts[:debug_return_type] || 'ListAffiliates200Response'
1291
+
1292
+ # auth_names
1293
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1294
+
1295
+ new_options = opts.merge(
1296
+ :operation => :"AffiliatesApi.list_affiliates",
1297
+ :header_params => header_params,
1298
+ :query_params => query_params,
1299
+ :form_params => form_params,
1300
+ :body => post_body,
1301
+ :auth_names => auth_names,
1302
+ :return_type => return_type
1303
+ )
1304
+
1305
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1306
+ if @api_client.config.debugging
1307
+ @api_client.config.logger.debug "API called: AffiliatesApi#list_affiliates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1308
+ end
1309
+ return data, status_code, headers
1310
+ end
1311
+
1312
+ # Mark an affiliate payout paid
1313
+ # The money was sent. The payout and its commissions are paid; `reference` names the transfer.
1314
+ # @param id [String]
1315
+ # @param [Hash] opts the optional parameters
1316
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1317
+ # @option opts [MarkAffiliatePayoutPaidRequest] :mark_affiliate_payout_paid_request
1318
+ # @return [AffiliatePayout]
1319
+ def mark_affiliate_payout_paid(id, opts = {})
1320
+ data, _status_code, _headers = mark_affiliate_payout_paid_with_http_info(id, opts)
1321
+ data
1322
+ end
1323
+
1324
+ # Mark an affiliate payout paid
1325
+ # The money was sent. The payout and its commissions are paid; &#x60;reference&#x60; names the transfer.
1326
+ # @param id [String]
1327
+ # @param [Hash] opts the optional parameters
1328
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1329
+ # @option opts [MarkAffiliatePayoutPaidRequest] :mark_affiliate_payout_paid_request
1330
+ # @return [Array<(AffiliatePayout, Integer, Hash)>] AffiliatePayout data, response status code and response headers
1331
+ def mark_affiliate_payout_paid_with_http_info(id, opts = {})
1332
+ if @api_client.config.debugging
1333
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.mark_affiliate_payout_paid ...'
1334
+ end
1335
+ # verify the required parameter 'id' is set
1336
+ if @api_client.config.client_side_validation && id.nil?
1337
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.mark_affiliate_payout_paid"
1338
+ end
1339
+ pattern = Regexp.new(/^afpo_[0-9A-Za-z]+$/)
1340
+ if @api_client.config.client_side_validation && id !~ pattern
1341
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.mark_affiliate_payout_paid, must conform to the pattern #{pattern}."
1342
+ end
1343
+
1344
+ # resource path
1345
+ local_var_path = '/affiliate-payouts/{id}/paid'.sub('{id}', CGI.escape(id.to_s))
1346
+
1347
+ # query parameters
1348
+ query_params = opts[:query_params] || {}
1349
+
1350
+ # header parameters
1351
+ header_params = opts[:header_params] || {}
1352
+ # HTTP header 'Accept' (if needed)
1353
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1354
+ # HTTP header 'Content-Type'
1355
+ content_type = @api_client.select_header_content_type(['application/json'])
1356
+ if !content_type.nil?
1357
+ header_params['Content-Type'] = content_type
1358
+ end
1359
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1360
+
1361
+ # form parameters
1362
+ form_params = opts[:form_params] || {}
1363
+
1364
+ # http body (model)
1365
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'mark_affiliate_payout_paid_request'])
1366
+
1367
+ # return_type
1368
+ return_type = opts[:debug_return_type] || 'AffiliatePayout'
1369
+
1370
+ # auth_names
1371
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1372
+
1373
+ new_options = opts.merge(
1374
+ :operation => :"AffiliatesApi.mark_affiliate_payout_paid",
1375
+ :header_params => header_params,
1376
+ :query_params => query_params,
1377
+ :form_params => form_params,
1378
+ :body => post_body,
1379
+ :auth_names => auth_names,
1380
+ :return_type => return_type
1381
+ )
1382
+
1383
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1384
+ if @api_client.config.debugging
1385
+ @api_client.config.logger.debug "API called: AffiliatesApi#mark_affiliate_payout_paid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1386
+ end
1387
+ return data, status_code, headers
1388
+ end
1389
+
1390
+ # Move an affiliate to another program
1391
+ # The affiliate keeps its code, link, coupon, customers and everything it earned. What its customers pay from now on earns under the new program's terms. Refused for an archived program, or one where its email is already an affiliate.
1392
+ # @param id [String]
1393
+ # @param move_affiliate_request [MoveAffiliateRequest]
1394
+ # @param [Hash] opts the optional parameters
1395
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1396
+ # @return [Affiliate]
1397
+ def move_affiliate(id, move_affiliate_request, opts = {})
1398
+ data, _status_code, _headers = move_affiliate_with_http_info(id, move_affiliate_request, opts)
1399
+ data
1400
+ end
1401
+
1402
+ # Move an affiliate to another program
1403
+ # The affiliate keeps its code, link, coupon, customers and everything it earned. What its customers pay from now on earns under the new program&#39;s terms. Refused for an archived program, or one where its email is already an affiliate.
1404
+ # @param id [String]
1405
+ # @param move_affiliate_request [MoveAffiliateRequest]
1406
+ # @param [Hash] opts the optional parameters
1407
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1408
+ # @return [Array<(Affiliate, Integer, Hash)>] Affiliate data, response status code and response headers
1409
+ def move_affiliate_with_http_info(id, move_affiliate_request, opts = {})
1410
+ if @api_client.config.debugging
1411
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.move_affiliate ...'
1412
+ end
1413
+ # verify the required parameter 'id' is set
1414
+ if @api_client.config.client_side_validation && id.nil?
1415
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.move_affiliate"
1416
+ end
1417
+ pattern = Regexp.new(/^aff_[0-9A-Za-z]+$/)
1418
+ if @api_client.config.client_side_validation && id !~ pattern
1419
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.move_affiliate, must conform to the pattern #{pattern}."
1420
+ end
1421
+
1422
+ # verify the required parameter 'move_affiliate_request' is set
1423
+ if @api_client.config.client_side_validation && move_affiliate_request.nil?
1424
+ fail ArgumentError, "Missing the required parameter 'move_affiliate_request' when calling AffiliatesApi.move_affiliate"
1425
+ end
1426
+ # resource path
1427
+ local_var_path = '/affiliates/{id}/move'.sub('{id}', CGI.escape(id.to_s))
1428
+
1429
+ # query parameters
1430
+ query_params = opts[:query_params] || {}
1431
+
1432
+ # header parameters
1433
+ header_params = opts[:header_params] || {}
1434
+ # HTTP header 'Accept' (if needed)
1435
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1436
+ # HTTP header 'Content-Type'
1437
+ content_type = @api_client.select_header_content_type(['application/json'])
1438
+ if !content_type.nil?
1439
+ header_params['Content-Type'] = content_type
1440
+ end
1441
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1442
+
1443
+ # form parameters
1444
+ form_params = opts[:form_params] || {}
1445
+
1446
+ # http body (model)
1447
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(move_affiliate_request)
1448
+
1449
+ # return_type
1450
+ return_type = opts[:debug_return_type] || 'Affiliate'
1451
+
1452
+ # auth_names
1453
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1454
+
1455
+ new_options = opts.merge(
1456
+ :operation => :"AffiliatesApi.move_affiliate",
1457
+ :header_params => header_params,
1458
+ :query_params => query_params,
1459
+ :form_params => form_params,
1460
+ :body => post_body,
1461
+ :auth_names => auth_names,
1462
+ :return_type => return_type
1463
+ )
1464
+
1465
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1466
+ if @api_client.config.debugging
1467
+ @api_client.config.logger.debug "API called: AffiliatesApi#move_affiliate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1468
+ end
1469
+ return data, status_code, headers
1470
+ end
1471
+
1472
+ # Give a referred customer to another affiliate
1473
+ # What the customer paid before stays earned by the affiliate that earned it; what it pays from now on earns for `affiliate`, continuing where the customer is in the rate plan. Both affiliates' history records the move. Refused when `affiliate` is the customer's own account.
1474
+ # @param id [String]
1475
+ # @param move_affiliate_referral_request [MoveAffiliateReferralRequest]
1476
+ # @param [Hash] opts the optional parameters
1477
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1478
+ # @return [AffiliateReferral]
1479
+ def move_affiliate_referral(id, move_affiliate_referral_request, opts = {})
1480
+ data, _status_code, _headers = move_affiliate_referral_with_http_info(id, move_affiliate_referral_request, opts)
1481
+ data
1482
+ end
1483
+
1484
+ # Give a referred customer to another affiliate
1485
+ # What the customer paid before stays earned by the affiliate that earned it; what it pays from now on earns for &#x60;affiliate&#x60;, continuing where the customer is in the rate plan. Both affiliates&#39; history records the move. Refused when &#x60;affiliate&#x60; is the customer&#39;s own account.
1486
+ # @param id [String]
1487
+ # @param move_affiliate_referral_request [MoveAffiliateReferralRequest]
1488
+ # @param [Hash] opts the optional parameters
1489
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1490
+ # @return [Array<(AffiliateReferral, Integer, Hash)>] AffiliateReferral data, response status code and response headers
1491
+ def move_affiliate_referral_with_http_info(id, move_affiliate_referral_request, opts = {})
1492
+ if @api_client.config.debugging
1493
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.move_affiliate_referral ...'
1494
+ end
1495
+ # verify the required parameter 'id' is set
1496
+ if @api_client.config.client_side_validation && id.nil?
1497
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.move_affiliate_referral"
1498
+ end
1499
+ pattern = Regexp.new(/^afr_[0-9A-Za-z]+$/)
1500
+ if @api_client.config.client_side_validation && id !~ pattern
1501
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.move_affiliate_referral, must conform to the pattern #{pattern}."
1502
+ end
1503
+
1504
+ # verify the required parameter 'move_affiliate_referral_request' is set
1505
+ if @api_client.config.client_side_validation && move_affiliate_referral_request.nil?
1506
+ fail ArgumentError, "Missing the required parameter 'move_affiliate_referral_request' when calling AffiliatesApi.move_affiliate_referral"
1507
+ end
1508
+ # resource path
1509
+ local_var_path = '/affiliate-referrals/{id}/move'.sub('{id}', CGI.escape(id.to_s))
1510
+
1511
+ # query parameters
1512
+ query_params = opts[:query_params] || {}
1513
+
1514
+ # header parameters
1515
+ header_params = opts[:header_params] || {}
1516
+ # HTTP header 'Accept' (if needed)
1517
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1518
+ # HTTP header 'Content-Type'
1519
+ content_type = @api_client.select_header_content_type(['application/json'])
1520
+ if !content_type.nil?
1521
+ header_params['Content-Type'] = content_type
1522
+ end
1523
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1524
+
1525
+ # form parameters
1526
+ form_params = opts[:form_params] || {}
1527
+
1528
+ # http body (model)
1529
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(move_affiliate_referral_request)
1530
+
1531
+ # return_type
1532
+ return_type = opts[:debug_return_type] || 'AffiliateReferral'
1533
+
1534
+ # auth_names
1535
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1536
+
1537
+ new_options = opts.merge(
1538
+ :operation => :"AffiliatesApi.move_affiliate_referral",
1539
+ :header_params => header_params,
1540
+ :query_params => query_params,
1541
+ :form_params => form_params,
1542
+ :body => post_body,
1543
+ :auth_names => auth_names,
1544
+ :return_type => return_type
1545
+ )
1546
+
1547
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1548
+ if @api_client.config.debugging
1549
+ @api_client.config.logger.debug "API called: AffiliatesApi#move_affiliate_referral\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1550
+ end
1551
+ return data, status_code, headers
1552
+ end
1553
+
1554
+ # Take a commission back
1555
+ # Take a whole commission back by hand, as a full refund would: not yet paid out, it is `reversed`; already paid out, it stays `paid` and the next payout takes the amount back. Refused for a commission already reversed, or a clawback.
1556
+ # @param id [String]
1557
+ # @param skip_invoice_dunning_step_request [SkipInvoiceDunningStepRequest]
1558
+ # @param [Hash] opts the optional parameters
1559
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1560
+ # @return [AffiliateCommission]
1561
+ def reverse_affiliate_commission(id, skip_invoice_dunning_step_request, opts = {})
1562
+ data, _status_code, _headers = reverse_affiliate_commission_with_http_info(id, skip_invoice_dunning_step_request, opts)
1563
+ data
1564
+ end
1565
+
1566
+ # Take a commission back
1567
+ # Take a whole commission back by hand, as a full refund would: not yet paid out, it is &#x60;reversed&#x60;; already paid out, it stays &#x60;paid&#x60; and the next payout takes the amount back. Refused for a commission already reversed, or a clawback.
1568
+ # @param id [String]
1569
+ # @param skip_invoice_dunning_step_request [SkipInvoiceDunningStepRequest]
1570
+ # @param [Hash] opts the optional parameters
1571
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1572
+ # @return [Array<(AffiliateCommission, Integer, Hash)>] AffiliateCommission data, response status code and response headers
1573
+ def reverse_affiliate_commission_with_http_info(id, skip_invoice_dunning_step_request, opts = {})
1574
+ if @api_client.config.debugging
1575
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.reverse_affiliate_commission ...'
1576
+ end
1577
+ # verify the required parameter 'id' is set
1578
+ if @api_client.config.client_side_validation && id.nil?
1579
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.reverse_affiliate_commission"
1580
+ end
1581
+ pattern = Regexp.new(/^afc_[0-9A-Za-z]+$/)
1582
+ if @api_client.config.client_side_validation && id !~ pattern
1583
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.reverse_affiliate_commission, must conform to the pattern #{pattern}."
1584
+ end
1585
+
1586
+ # verify the required parameter 'skip_invoice_dunning_step_request' is set
1587
+ if @api_client.config.client_side_validation && skip_invoice_dunning_step_request.nil?
1588
+ fail ArgumentError, "Missing the required parameter 'skip_invoice_dunning_step_request' when calling AffiliatesApi.reverse_affiliate_commission"
1589
+ end
1590
+ # resource path
1591
+ local_var_path = '/affiliate-commissions/{id}/reverse'.sub('{id}', CGI.escape(id.to_s))
1592
+
1593
+ # query parameters
1594
+ query_params = opts[:query_params] || {}
1595
+
1596
+ # header parameters
1597
+ header_params = opts[:header_params] || {}
1598
+ # HTTP header 'Accept' (if needed)
1599
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1600
+ # HTTP header 'Content-Type'
1601
+ content_type = @api_client.select_header_content_type(['application/json'])
1602
+ if !content_type.nil?
1603
+ header_params['Content-Type'] = content_type
1604
+ end
1605
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1606
+
1607
+ # form parameters
1608
+ form_params = opts[:form_params] || {}
1609
+
1610
+ # http body (model)
1611
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(skip_invoice_dunning_step_request)
1612
+
1613
+ # return_type
1614
+ return_type = opts[:debug_return_type] || 'AffiliateCommission'
1615
+
1616
+ # auth_names
1617
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1618
+
1619
+ new_options = opts.merge(
1620
+ :operation => :"AffiliatesApi.reverse_affiliate_commission",
1621
+ :header_params => header_params,
1622
+ :query_params => query_params,
1623
+ :form_params => form_params,
1624
+ :body => post_body,
1625
+ :auth_names => auth_names,
1626
+ :return_type => return_type
1627
+ )
1628
+
1629
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1630
+ if @api_client.config.debugging
1631
+ @api_client.config.logger.debug "API called: AffiliatesApi#reverse_affiliate_commission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1632
+ end
1633
+ return data, status_code, headers
1634
+ end
1635
+
1636
+ # Run the affiliate payouts that are due
1637
+ # Make the payouts that are due today now instead of waiting for the daily run: per program, every commission payable by the last month end its NET term has reached, one payout per affiliate and currency at or above the minimum, each sent the way the program pays. A second call adds only what became due since. Returns the runs that got payouts; an empty list when nothing was due.
1638
+ # @param [Hash] opts the optional parameters
1639
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1640
+ # @return [AffiliatePayoutRunList]
1641
+ def run_affiliate_payouts(opts = {})
1642
+ data, _status_code, _headers = run_affiliate_payouts_with_http_info(opts)
1643
+ data
1644
+ end
1645
+
1646
+ # Run the affiliate payouts that are due
1647
+ # Make the payouts that are due today now instead of waiting for the daily run: per program, every commission payable by the last month end its NET term has reached, one payout per affiliate and currency at or above the minimum, each sent the way the program pays. A second call adds only what became due since. Returns the runs that got payouts; an empty list when nothing was due.
1648
+ # @param [Hash] opts the optional parameters
1649
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1650
+ # @return [Array<(AffiliatePayoutRunList, Integer, Hash)>] AffiliatePayoutRunList data, response status code and response headers
1651
+ def run_affiliate_payouts_with_http_info(opts = {})
1652
+ if @api_client.config.debugging
1653
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.run_affiliate_payouts ...'
1654
+ end
1655
+ # resource path
1656
+ local_var_path = '/affiliate-payout-runs'
1657
+
1658
+ # query parameters
1659
+ query_params = opts[:query_params] || {}
1660
+
1661
+ # header parameters
1662
+ header_params = opts[:header_params] || {}
1663
+ # HTTP header 'Accept' (if needed)
1664
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1665
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1666
+
1667
+ # form parameters
1668
+ form_params = opts[:form_params] || {}
1669
+
1670
+ # http body (model)
1671
+ post_body = opts[:debug_body]
1672
+
1673
+ # return_type
1674
+ return_type = opts[:debug_return_type] || 'AffiliatePayoutRunList'
1675
+
1676
+ # auth_names
1677
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1678
+
1679
+ new_options = opts.merge(
1680
+ :operation => :"AffiliatesApi.run_affiliate_payouts",
1681
+ :header_params => header_params,
1682
+ :query_params => query_params,
1683
+ :form_params => form_params,
1684
+ :body => post_body,
1685
+ :auth_names => auth_names,
1686
+ :return_type => return_type
1687
+ )
1688
+
1689
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1690
+ if @api_client.config.debugging
1691
+ @api_client.config.logger.debug "API called: AffiliatesApi#run_affiliate_payouts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1692
+ end
1693
+ return data, status_code, headers
1694
+ end
1695
+
1696
+ # Send an affiliate payout again
1697
+ # Send a payout that has not gone out (`failure` says why) the way its program pays, once the cause is fixed: a Stripe account added, a customer account linked, the Stripe balance funded. Stripe never transfers the same payout twice. Refused for a paid payout.
1698
+ # @param id [String]
1699
+ # @param [Hash] opts the optional parameters
1700
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1701
+ # @return [AffiliatePayout]
1702
+ def send_affiliate_payout(id, opts = {})
1703
+ data, _status_code, _headers = send_affiliate_payout_with_http_info(id, opts)
1704
+ data
1705
+ end
1706
+
1707
+ # Send an affiliate payout again
1708
+ # Send a payout that has not gone out (&#x60;failure&#x60; says why) the way its program pays, once the cause is fixed: a Stripe account added, a customer account linked, the Stripe balance funded. Stripe never transfers the same payout twice. Refused for a paid payout.
1709
+ # @param id [String]
1710
+ # @param [Hash] opts the optional parameters
1711
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1712
+ # @return [Array<(AffiliatePayout, Integer, Hash)>] AffiliatePayout data, response status code and response headers
1713
+ def send_affiliate_payout_with_http_info(id, opts = {})
1714
+ if @api_client.config.debugging
1715
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.send_affiliate_payout ...'
1716
+ end
1717
+ # verify the required parameter 'id' is set
1718
+ if @api_client.config.client_side_validation && id.nil?
1719
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.send_affiliate_payout"
1720
+ end
1721
+ pattern = Regexp.new(/^afpo_[0-9A-Za-z]+$/)
1722
+ if @api_client.config.client_side_validation && id !~ pattern
1723
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.send_affiliate_payout, must conform to the pattern #{pattern}."
1724
+ end
1725
+
1726
+ # resource path
1727
+ local_var_path = '/affiliate-payouts/{id}/send'.sub('{id}', CGI.escape(id.to_s))
1728
+
1729
+ # query parameters
1730
+ query_params = opts[:query_params] || {}
1731
+
1732
+ # header parameters
1733
+ header_params = opts[:header_params] || {}
1734
+ # HTTP header 'Accept' (if needed)
1735
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1736
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1737
+
1738
+ # form parameters
1739
+ form_params = opts[:form_params] || {}
1740
+
1741
+ # http body (model)
1742
+ post_body = opts[:debug_body]
1743
+
1744
+ # return_type
1745
+ return_type = opts[:debug_return_type] || 'AffiliatePayout'
1746
+
1747
+ # auth_names
1748
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1749
+
1750
+ new_options = opts.merge(
1751
+ :operation => :"AffiliatesApi.send_affiliate_payout",
1752
+ :header_params => header_params,
1753
+ :query_params => query_params,
1754
+ :form_params => form_params,
1755
+ :body => post_body,
1756
+ :auth_names => auth_names,
1757
+ :return_type => return_type
1758
+ )
1759
+
1760
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1761
+ if @api_client.config.debugging
1762
+ @api_client.config.logger.debug "API called: AffiliatesApi#send_affiliate_payout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1763
+ end
1764
+ return data, status_code, headers
1765
+ end
1766
+
1767
+ # Suspend an affiliate
1768
+ # Its link and coupon refer no one and its customers earn nothing new. What it earned stays payable.
1769
+ # @param id [String]
1770
+ # @param [Hash] opts the optional parameters
1771
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1772
+ # @option opts [RetryInvoiceDunningRequest] :retry_invoice_dunning_request
1773
+ # @return [Affiliate]
1774
+ def suspend_affiliate(id, opts = {})
1775
+ data, _status_code, _headers = suspend_affiliate_with_http_info(id, opts)
1776
+ data
1777
+ end
1778
+
1779
+ # Suspend an affiliate
1780
+ # Its link and coupon refer no one and its customers earn nothing new. What it earned stays payable.
1781
+ # @param id [String]
1782
+ # @param [Hash] opts the optional parameters
1783
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1784
+ # @option opts [RetryInvoiceDunningRequest] :retry_invoice_dunning_request
1785
+ # @return [Array<(Affiliate, Integer, Hash)>] Affiliate data, response status code and response headers
1786
+ def suspend_affiliate_with_http_info(id, opts = {})
1787
+ if @api_client.config.debugging
1788
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.suspend_affiliate ...'
1789
+ end
1790
+ # verify the required parameter 'id' is set
1791
+ if @api_client.config.client_side_validation && id.nil?
1792
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.suspend_affiliate"
1793
+ end
1794
+ pattern = Regexp.new(/^aff_[0-9A-Za-z]+$/)
1795
+ if @api_client.config.client_side_validation && id !~ pattern
1796
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.suspend_affiliate, must conform to the pattern #{pattern}."
1797
+ end
1798
+
1799
+ # resource path
1800
+ local_var_path = '/affiliates/{id}/suspend'.sub('{id}', CGI.escape(id.to_s))
1801
+
1802
+ # query parameters
1803
+ query_params = opts[:query_params] || {}
1804
+
1805
+ # header parameters
1806
+ header_params = opts[:header_params] || {}
1807
+ # HTTP header 'Accept' (if needed)
1808
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1809
+ # HTTP header 'Content-Type'
1810
+ content_type = @api_client.select_header_content_type(['application/json'])
1811
+ if !content_type.nil?
1812
+ header_params['Content-Type'] = content_type
1813
+ end
1814
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1815
+
1816
+ # form parameters
1817
+ form_params = opts[:form_params] || {}
1818
+
1819
+ # http body (model)
1820
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'retry_invoice_dunning_request'])
1821
+
1822
+ # return_type
1823
+ return_type = opts[:debug_return_type] || 'Affiliate'
1824
+
1825
+ # auth_names
1826
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1827
+
1828
+ new_options = opts.merge(
1829
+ :operation => :"AffiliatesApi.suspend_affiliate",
1830
+ :header_params => header_params,
1831
+ :query_params => query_params,
1832
+ :form_params => form_params,
1833
+ :body => post_body,
1834
+ :auth_names => auth_names,
1835
+ :return_type => return_type
1836
+ )
1837
+
1838
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1839
+ if @api_client.config.debugging
1840
+ @api_client.config.logger.debug "API called: AffiliatesApi#suspend_affiliate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1841
+ end
1842
+ return data, status_code, headers
1843
+ end
1844
+
1845
+ # Change an affiliate
1846
+ # Only the fields sent change. `coupon: null` detaches the coupon; `payout_details: null` clears them.
1847
+ # @param id [String]
1848
+ # @param update_affiliate_request [UpdateAffiliateRequest]
1849
+ # @param [Hash] opts the optional parameters
1850
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1851
+ # @return [Affiliate]
1852
+ def update_affiliate(id, update_affiliate_request, opts = {})
1853
+ data, _status_code, _headers = update_affiliate_with_http_info(id, update_affiliate_request, opts)
1854
+ data
1855
+ end
1856
+
1857
+ # Change an affiliate
1858
+ # Only the fields sent change. &#x60;coupon: null&#x60; detaches the coupon; &#x60;payout_details: null&#x60; clears them.
1859
+ # @param id [String]
1860
+ # @param update_affiliate_request [UpdateAffiliateRequest]
1861
+ # @param [Hash] opts the optional parameters
1862
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1863
+ # @return [Array<(Affiliate, Integer, Hash)>] Affiliate data, response status code and response headers
1864
+ def update_affiliate_with_http_info(id, update_affiliate_request, opts = {})
1865
+ if @api_client.config.debugging
1866
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.update_affiliate ...'
1867
+ end
1868
+ # verify the required parameter 'id' is set
1869
+ if @api_client.config.client_side_validation && id.nil?
1870
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.update_affiliate"
1871
+ end
1872
+ pattern = Regexp.new(/^aff_[0-9A-Za-z]+$/)
1873
+ if @api_client.config.client_side_validation && id !~ pattern
1874
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.update_affiliate, must conform to the pattern #{pattern}."
1875
+ end
1876
+
1877
+ # verify the required parameter 'update_affiliate_request' is set
1878
+ if @api_client.config.client_side_validation && update_affiliate_request.nil?
1879
+ fail ArgumentError, "Missing the required parameter 'update_affiliate_request' when calling AffiliatesApi.update_affiliate"
1880
+ end
1881
+ # resource path
1882
+ local_var_path = '/affiliates/{id}'.sub('{id}', CGI.escape(id.to_s))
1883
+
1884
+ # query parameters
1885
+ query_params = opts[:query_params] || {}
1886
+
1887
+ # header parameters
1888
+ header_params = opts[:header_params] || {}
1889
+ # HTTP header 'Accept' (if needed)
1890
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1891
+ # HTTP header 'Content-Type'
1892
+ content_type = @api_client.select_header_content_type(['application/json'])
1893
+ if !content_type.nil?
1894
+ header_params['Content-Type'] = content_type
1895
+ end
1896
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1897
+
1898
+ # form parameters
1899
+ form_params = opts[:form_params] || {}
1900
+
1901
+ # http body (model)
1902
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_affiliate_request)
1903
+
1904
+ # return_type
1905
+ return_type = opts[:debug_return_type] || 'Affiliate'
1906
+
1907
+ # auth_names
1908
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1909
+
1910
+ new_options = opts.merge(
1911
+ :operation => :"AffiliatesApi.update_affiliate",
1912
+ :header_params => header_params,
1913
+ :query_params => query_params,
1914
+ :form_params => form_params,
1915
+ :body => post_body,
1916
+ :auth_names => auth_names,
1917
+ :return_type => return_type
1918
+ )
1919
+
1920
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1921
+ if @api_client.config.debugging
1922
+ @api_client.config.logger.debug "API called: AffiliatesApi#update_affiliate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1923
+ end
1924
+ return data, status_code, headers
1925
+ end
1926
+
1927
+ # Change an affiliate program
1928
+ # Only the fields sent change. New terms apply to payments from now on; commissions already earned keep theirs.
1929
+ # @param id [String]
1930
+ # @param update_affiliate_program_request [UpdateAffiliateProgramRequest]
1931
+ # @param [Hash] opts the optional parameters
1932
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1933
+ # @return [AffiliateProgram]
1934
+ def update_affiliate_program(id, update_affiliate_program_request, opts = {})
1935
+ data, _status_code, _headers = update_affiliate_program_with_http_info(id, update_affiliate_program_request, opts)
1936
+ data
1937
+ end
1938
+
1939
+ # Change an affiliate program
1940
+ # Only the fields sent change. New terms apply to payments from now on; commissions already earned keep theirs.
1941
+ # @param id [String]
1942
+ # @param update_affiliate_program_request [UpdateAffiliateProgramRequest]
1943
+ # @param [Hash] opts the optional parameters
1944
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
1945
+ # @return [Array<(AffiliateProgram, Integer, Hash)>] AffiliateProgram data, response status code and response headers
1946
+ def update_affiliate_program_with_http_info(id, update_affiliate_program_request, opts = {})
1947
+ if @api_client.config.debugging
1948
+ @api_client.config.logger.debug 'Calling API: AffiliatesApi.update_affiliate_program ...'
1949
+ end
1950
+ # verify the required parameter 'id' is set
1951
+ if @api_client.config.client_side_validation && id.nil?
1952
+ fail ArgumentError, "Missing the required parameter 'id' when calling AffiliatesApi.update_affiliate_program"
1953
+ end
1954
+ pattern = Regexp.new(/^afp_[0-9A-Za-z]+$/)
1955
+ if @api_client.config.client_side_validation && id !~ pattern
1956
+ fail ArgumentError, "invalid value for 'id' when calling AffiliatesApi.update_affiliate_program, must conform to the pattern #{pattern}."
1957
+ end
1958
+
1959
+ # verify the required parameter 'update_affiliate_program_request' is set
1960
+ if @api_client.config.client_side_validation && update_affiliate_program_request.nil?
1961
+ fail ArgumentError, "Missing the required parameter 'update_affiliate_program_request' when calling AffiliatesApi.update_affiliate_program"
1962
+ end
1963
+ # resource path
1964
+ local_var_path = '/affiliate-programs/{id}'.sub('{id}', CGI.escape(id.to_s))
1965
+
1966
+ # query parameters
1967
+ query_params = opts[:query_params] || {}
1968
+
1969
+ # header parameters
1970
+ header_params = opts[:header_params] || {}
1971
+ # HTTP header 'Accept' (if needed)
1972
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1973
+ # HTTP header 'Content-Type'
1974
+ content_type = @api_client.select_header_content_type(['application/json'])
1975
+ if !content_type.nil?
1976
+ header_params['Content-Type'] = content_type
1977
+ end
1978
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1979
+
1980
+ # form parameters
1981
+ form_params = opts[:form_params] || {}
1982
+
1983
+ # http body (model)
1984
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_affiliate_program_request)
1985
+
1986
+ # return_type
1987
+ return_type = opts[:debug_return_type] || 'AffiliateProgram'
1988
+
1989
+ # auth_names
1990
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1991
+
1992
+ new_options = opts.merge(
1993
+ :operation => :"AffiliatesApi.update_affiliate_program",
1994
+ :header_params => header_params,
1995
+ :query_params => query_params,
1996
+ :form_params => form_params,
1997
+ :body => post_body,
1998
+ :auth_names => auth_names,
1999
+ :return_type => return_type
2000
+ )
2001
+
2002
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
2003
+ if @api_client.config.debugging
2004
+ @api_client.config.logger.debug "API called: AffiliatesApi#update_affiliate_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2005
+ end
2006
+ return data, status_code, headers
2007
+ end
2008
+ end
2009
+ end