bf_ruby2 1.2016.229

Sign up to get free protection for your applications and to get access to all the features.
Files changed (886) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +824 -0
  4. data/bf_ruby2-1.0.0.gem +0 -0
  5. data/bf_ruby2.gemspec +55 -0
  6. data/docs/APIConfigurationPagedMetadata.md +14 -0
  7. data/docs/APIQuote.md +36 -0
  8. data/docs/APIQuotePagedMetadata.md +14 -0
  9. data/docs/APIQuoteResponseQuantity.md +25 -0
  10. data/docs/Account.md +21 -0
  11. data/docs/AccountLTVResultPagedMetadata.md +14 -0
  12. data/docs/AccountPagedMetadata.md +14 -0
  13. data/docs/AccountPaymentsResultPagedMetadata.md +14 -0
  14. data/docs/AccountsApi.md +1021 -0
  15. data/docs/AddChargeRequest.md +23 -0
  16. data/docs/AddCouponCodeRequest.md +11 -0
  17. data/docs/AddPaymentMethodRequest.md +8 -0
  18. data/docs/AddTaxationStrategyRequest.md +11 -0
  19. data/docs/Address.md +23 -0
  20. data/docs/AddressPagedMetadata.md +14 -0
  21. data/docs/AddressesApi.md +104 -0
  22. data/docs/AggregatingComponent.md +17 -0
  23. data/docs/Amendment.md +19 -0
  24. data/docs/AmendmentDiscardAmendment.md +20 -0
  25. data/docs/AmendmentPagedMetadata.md +14 -0
  26. data/docs/AmendmentPriceNTimePagedMetadata.md +14 -0
  27. data/docs/AmendmentsApi.md +639 -0
  28. data/docs/AnalyticsApi.md +641 -0
  29. data/docs/AuditEntry.md +17 -0
  30. data/docs/AuditEntryPagedMetadata.md +14 -0
  31. data/docs/AuditlogsApi.md +308 -0
  32. data/docs/AuthCaptureRequest.md +17 -0
  33. data/docs/AuthorizeNetTokenPagedMetadata.md +14 -0
  34. data/docs/BFError.md +11 -0
  35. data/docs/BFPermission.md +17 -0
  36. data/docs/BFPermissionPagedMetadata.md +14 -0
  37. data/docs/BankAccountVerificationPagedMetadata.md +14 -0
  38. data/docs/BillforwardManagedPaymentsResultPagedMetadata.md +14 -0
  39. data/docs/BillingEntityBase.md +8 -0
  40. data/docs/BraintreeAuthCaptureRequest.md +19 -0
  41. data/docs/BraintreeCaptureRequest.md +20 -0
  42. data/docs/BraintreeTokenPagedMetadata.md +14 -0
  43. data/docs/CancelSubscriptionRequest.md +14 -0
  44. data/docs/CancellationAmendment.md +24 -0
  45. data/docs/CassChurnResultPagedMetadata.md +14 -0
  46. data/docs/CassPaymentResultPagedMetadata.md +14 -0
  47. data/docs/CassUpgradeResultPagedMetadata.md +14 -0
  48. data/docs/ChargesApi.md +408 -0
  49. data/docs/Client.md +21 -0
  50. data/docs/ClientPagedMetadata.md +14 -0
  51. data/docs/ClientsApi.md +215 -0
  52. data/docs/ComponentChange.md +20 -0
  53. data/docs/ComponentCost.md +9 -0
  54. data/docs/CompoundUsage.md +11 -0
  55. data/docs/CompoundUsageSession.md +11 -0
  56. data/docs/ConfigurationsApi.md +221 -0
  57. data/docs/Coupon.md +32 -0
  58. data/docs/CouponBook.md +21 -0
  59. data/docs/CouponBookDefinition.md +24 -0
  60. data/docs/CouponBookDefinitionPagedMetadata.md +14 -0
  61. data/docs/CouponBookPagedMetadata.md +14 -0
  62. data/docs/CouponDefinition.md +26 -0
  63. data/docs/CouponDefinitionPagedMetadata.md +14 -0
  64. data/docs/CouponDiscount.md +18 -0
  65. data/docs/CouponDiscountEstimate.md +13 -0
  66. data/docs/CouponInstance.md +26 -0
  67. data/docs/CouponInstanceExistingValue.md +15 -0
  68. data/docs/CouponInstancePagedMetadata.md +14 -0
  69. data/docs/CouponModifierBase.md +22 -0
  70. data/docs/CouponModifierBasePagedMetadata.md +14 -0
  71. data/docs/CouponPagedMetadata.md +14 -0
  72. data/docs/CouponRule.md +24 -0
  73. data/docs/CouponRulePagedMetadata.md +14 -0
  74. data/docs/CouponUniqueCodesRequest.md +11 -0
  75. data/docs/CouponUniqueCodesResponse.md +10 -0
  76. data/docs/CouponUniqueCodesResponsePagedMetadata.md +14 -0
  77. data/docs/CouponWrapperResponse.md +13 -0
  78. data/docs/CouponbookApi.md +496 -0
  79. data/docs/CouponbookdefinitionApi.md +329 -0
  80. data/docs/CoupondefinitionApi.md +267 -0
  81. data/docs/CouponinstanceApi.md +578 -0
  82. data/docs/CouponmodifierApi.md +369 -0
  83. data/docs/CouponruleApi.md +269 -0
  84. data/docs/CouponsApi.md +456 -0
  85. data/docs/CreateAccountProfileRequest.md +20 -0
  86. data/docs/CreateAccountRequest.md +13 -0
  87. data/docs/CreateAddressRequest.md +17 -0
  88. data/docs/CreateAggregatingComponentRequest.md +10 -0
  89. data/docs/CreateAggregatingSubscriptionRequest.md +21 -0
  90. data/docs/CreateProfileAddressRequest.md +16 -0
  91. data/docs/CreateSubscriptionBatchRequest.md +10 -0
  92. data/docs/CreateSubscriptionChargeAmendment.md +29 -0
  93. data/docs/CreateSubscriptionRequest.md +26 -0
  94. data/docs/CreditAccountRequest.md +13 -0
  95. data/docs/CreditNote.md +21 -0
  96. data/docs/CreditNotePagedMetadata.md +14 -0
  97. data/docs/CreditSubscriptionRequest.md +12 -0
  98. data/docs/CreditnotesApi.md +339 -0
  99. data/docs/CybersourceTokenPagedMetadata.md +14 -0
  100. data/docs/CybersourcetokensApi.md +259 -0
  101. data/docs/DataSynchronisationAppConfigurationPagedMetadata.md +14 -0
  102. data/docs/DataSynchronisationConfiguration.md +20 -0
  103. data/docs/DataSynchronisationConfigurationPagedMetadata.md +14 -0
  104. data/docs/DataSynchronizationJobPagedMetadata.md +14 -0
  105. data/docs/DebtsResultPagedMetadata.md +14 -0
  106. data/docs/DunningLine.md +18 -0
  107. data/docs/DunningLinePagedMetadata.md +14 -0
  108. data/docs/DunninglinesApi.md +328 -0
  109. data/docs/DynamicMetadata.md +7 -0
  110. data/docs/Email.md +35 -0
  111. data/docs/EmailPagedMetadata.md +14 -0
  112. data/docs/EmailProvider.md +18 -0
  113. data/docs/EmailProviderPagedMetadata.md +14 -0
  114. data/docs/EmailSubscription.md +20 -0
  115. data/docs/EmailSubscriptionPagedMetadata.md +14 -0
  116. data/docs/EmailprovidersApi.md +221 -0
  117. data/docs/EmailsApi.md +164 -0
  118. data/docs/EmailsubscriptionsApi.md +273 -0
  119. data/docs/EndTrialAmendment.md +19 -0
  120. data/docs/Event.md +15 -0
  121. data/docs/EventData.md +9 -0
  122. data/docs/FileSham.md +7 -0
  123. data/docs/FixedTerm.md +24 -0
  124. data/docs/FixedTermDefinitionPagedMetadata.md +14 -0
  125. data/docs/FixedTermExpiryAmendment.md +20 -0
  126. data/docs/FixedTermPagedMetadata.md +14 -0
  127. data/docs/FixedtermdefinitionsApi.md +104 -0
  128. data/docs/FixedtermsApi.md +56 -0
  129. data/docs/FlatPricingComponent.md +32 -0
  130. data/docs/ImportInvoiceLine.md +16 -0
  131. data/docs/InsertableBillingEntity.md +21 -0
  132. data/docs/Invoice.md +54 -0
  133. data/docs/InvoiceChargeRequest.md +11 -0
  134. data/docs/InvoiceLine.md +38 -0
  135. data/docs/InvoiceLinePayment.md +36 -0
  136. data/docs/InvoiceLinePaymentPagedMetadata.md +14 -0
  137. data/docs/InvoiceNextExecutionAttemptAmendment.md +21 -0
  138. data/docs/InvoiceOutstandingChargesAmendment.md +20 -0
  139. data/docs/InvoicePagedMetadata.md +14 -0
  140. data/docs/InvoicePayment.md +22 -0
  141. data/docs/InvoiceRecalculationAmendment.md +23 -0
  142. data/docs/InvoiceRecalculationRequest.md +12 -0
  143. data/docs/InvoicesApi.md +2474 -0
  144. data/docs/IssueInvoiceAmendment.md +20 -0
  145. data/docs/MetadataApi.md +210 -0
  146. data/docs/MetadataKeyValuesPagedMetadata.md +14 -0
  147. data/docs/MigrationRequest.md +16 -0
  148. data/docs/ModelAlias.md +14 -0
  149. data/docs/MutableBillingEntity.md +27 -0
  150. data/docs/Notification.md +27 -0
  151. data/docs/NotificationPagedMetadata.md +14 -0
  152. data/docs/NotificationsApi.md +370 -0
  153. data/docs/Organization.md +21 -0
  154. data/docs/OrganizationPagedMetadata.md +14 -0
  155. data/docs/OrganizationsApi.md +378 -0
  156. data/docs/Password.md +14 -0
  157. data/docs/PasswordPagedMetadata.md +14 -0
  158. data/docs/PasswordResetRequest.md +8 -0
  159. data/docs/PasswordsApi.md +56 -0
  160. data/docs/PauseRequest.md +9 -0
  161. data/docs/Payment.md +24 -0
  162. data/docs/PaymentMethod.md +32 -0
  163. data/docs/PaymentMethodPagedMetadata.md +14 -0
  164. data/docs/PaymentMethodSubscriptionLink.md +17 -0
  165. data/docs/PaymentMethodSubscriptionLinkPagedMetadata.md +14 -0
  166. data/docs/PaymentPagedMetadata.md +14 -0
  167. data/docs/PaymentRetryRequest.md +9 -0
  168. data/docs/PaymentmethodsApi.md +445 -0
  169. data/docs/PaymentmethodsubscriptionlinksApi.md +107 -0
  170. data/docs/PaymentsApi.md +464 -0
  171. data/docs/PendingComponentValueChange.md +11 -0
  172. data/docs/Period.md +16 -0
  173. data/docs/PeriodPagedMetadata.md +14 -0
  174. data/docs/PeriodsApi.md +125 -0
  175. data/docs/PermissionActionEntityPagedMetadata.md +14 -0
  176. data/docs/PermissionResourceEntityPagedMetadata.md +14 -0
  177. data/docs/PermissionsApi.md +322 -0
  178. data/docs/PriceCalculationPagedMetadata.md +14 -0
  179. data/docs/PricingComponent.md +32 -0
  180. data/docs/PricingComponentCouponModifier.md +22 -0
  181. data/docs/PricingComponentMigrationValue.md +12 -0
  182. data/docs/PricingComponentPagedMetadata.md +14 -0
  183. data/docs/PricingComponentQuantityRequest.md +10 -0
  184. data/docs/PricingComponentTier.md +19 -0
  185. data/docs/PricingComponentTierPagedMetadata.md +14 -0
  186. data/docs/PricingComponentValue.md +20 -0
  187. data/docs/PricingComponentValueChangeAmendment.md +22 -0
  188. data/docs/PricingComponentValueChangePagedMetadata.md +14 -0
  189. data/docs/PricingComponentValueMigrationAmendmentMapping.md +16 -0
  190. data/docs/PricingComponentValuePagedMetadata.md +14 -0
  191. data/docs/PricingComponentValueRequest.md +12 -0
  192. data/docs/PricingComponentValueResponsePagedMetadata.md +14 -0
  193. data/docs/PricingcalculatorApi.md +152 -0
  194. data/docs/PricingcomponentsApi.md +339 -0
  195. data/docs/PricingcomponenttiersApi.md +281 -0
  196. data/docs/PricingcomponentvaluechangesApi.md +345 -0
  197. data/docs/PricingcomponentvaluesApi.md +287 -0
  198. data/docs/Product.md +25 -0
  199. data/docs/ProductCouponModifier.md +22 -0
  200. data/docs/ProductPagedMetadata.md +14 -0
  201. data/docs/ProductPaymentsResultPagedMetadata.md +14 -0
  202. data/docs/ProductRatePlan.md +39 -0
  203. data/docs/ProductRatePlanMigrationAmendment.md +27 -0
  204. data/docs/ProductRatePlanPagedMetadata.md +14 -0
  205. data/docs/ProductRatePlanPaymentsResultPagedMetadata.md +14 -0
  206. data/docs/ProductrateplansApi.md +786 -0
  207. data/docs/ProductsApi.md +493 -0
  208. data/docs/Profile.md +25 -0
  209. data/docs/ProfilePagedMetadata.md +14 -0
  210. data/docs/ProfilesApi.md +287 -0
  211. data/docs/QuoteRequest.md +24 -0
  212. data/docs/QuoteRequestValue.md +11 -0
  213. data/docs/QuotesApi.md +56 -0
  214. data/docs/RecalculateChargeRequest.md +15 -0
  215. data/docs/Receipt.md +36 -0
  216. data/docs/ReceiptPagedMetadata.md +14 -0
  217. data/docs/ReceiptsApi.md +421 -0
  218. data/docs/Refund.md +35 -0
  219. data/docs/RefundPagedMetadata.md +14 -0
  220. data/docs/RefundsApi.md +432 -0
  221. data/docs/ResumeRequest.md +10 -0
  222. data/docs/ResumeSubscriptionAmendment.md +19 -0
  223. data/docs/RevenueAttribution.md +31 -0
  224. data/docs/RevenueAttributionPagedMetadata.md +14 -0
  225. data/docs/ReviveSubscriptionRequest.md +8 -0
  226. data/docs/Role.md +19 -0
  227. data/docs/RolePagedMetadata.md +14 -0
  228. data/docs/RolesApi.md +327 -0
  229. data/docs/RuleSatisfaction.md +11 -0
  230. data/docs/SearchApi.md +70 -0
  231. data/docs/SearchResultPagedMetadata.md +14 -0
  232. data/docs/ServiceEndAmendment.md +19 -0
  233. data/docs/StripeACHTokenPagedMetadata.md +14 -0
  234. data/docs/StripeAuthCaptureRequest.md +20 -0
  235. data/docs/StripeObject.md +7 -0
  236. data/docs/StripeTokenPagedMetadata.md +14 -0
  237. data/docs/Subscription.md +47 -0
  238. data/docs/SubscriptionCancellationPagedMetadata.md +14 -0
  239. data/docs/SubscriptionCharge.md +32 -0
  240. data/docs/SubscriptionChargePagedMetadata.md +14 -0
  241. data/docs/SubscriptionLTVResultPagedMetadata.md +14 -0
  242. data/docs/SubscriptionPagedMetadata.md +14 -0
  243. data/docs/SubscriptionsApi.md +2841 -0
  244. data/docs/SwaggerTypeList.md +9 -0
  245. data/docs/SwaggerTypeListInv.md +8 -0
  246. data/docs/SwaggerTypeListSubs.md +9 -0
  247. data/docs/SynchAppConfigsApi.md +208 -0
  248. data/docs/SynchConfigsApi.md +317 -0
  249. data/docs/SynchJobsApi.md +421 -0
  250. data/docs/TaxationLinkPagedMetadata.md +14 -0
  251. data/docs/TaxationStrategyPagedMetadata.md +14 -0
  252. data/docs/TaxationlinksApi.md +339 -0
  253. data/docs/TaxationstrategiesApi.md +514 -0
  254. data/docs/TieredPricingComponent.md +32 -0
  255. data/docs/TieredVolumePricingComponent.md +32 -0
  256. data/docs/TimeApi.md +56 -0
  257. data/docs/TimeRequest.md +16 -0
  258. data/docs/TimeResponse.md +18 -0
  259. data/docs/TimeResponsePagedMetadata.md +14 -0
  260. data/docs/TimeZone.md +11 -0
  261. data/docs/TimerAmendment.md +26 -0
  262. data/docs/TokenizationApi.md +340 -0
  263. data/docs/TokenizationPreAuthPagedMetadata.md +14 -0
  264. data/docs/TrustCommerceTokenPagedMetadata.md +14 -0
  265. data/docs/UnitDiscount.md +11 -0
  266. data/docs/UnitOfMeasure.md +16 -0
  267. data/docs/UnitOfMeasureCouponModifier.md +22 -0
  268. data/docs/UnitOfMeasurePagedMetadata.md +14 -0
  269. data/docs/UnitofmeasureApi.md +215 -0
  270. data/docs/UpdateAddressRequest.md +18 -0
  271. data/docs/UpdateComponentValueAmendment.md +23 -0
  272. data/docs/UpdateProfileRequest.md +22 -0
  273. data/docs/UpdateRoleRequest.md +13 -0
  274. data/docs/UpdateSubscriptionRequest.md +16 -0
  275. data/docs/Usage.md +26 -0
  276. data/docs/UsageApi.md +296 -0
  277. data/docs/UsagePagedMetadata.md +14 -0
  278. data/docs/UsagePeriodPagedMetadata.md +14 -0
  279. data/docs/UsageRoundingStrategyPagedMetadata.md +14 -0
  280. data/docs/UsageSession.md +21 -0
  281. data/docs/UsageSessionPagedMetadata.md +14 -0
  282. data/docs/UsageperiodsApi.md +194 -0
  283. data/docs/UsageroundingstrategiesApi.md +228 -0
  284. data/docs/UsagesessionsApi.md +224 -0
  285. data/docs/User.md +21 -0
  286. data/docs/UserCreationRequest.md +17 -0
  287. data/docs/UserCreationResponsePagedMetadata.md +14 -0
  288. data/docs/UserPagedMetadata.md +14 -0
  289. data/docs/Username.md +13 -0
  290. data/docs/UsernamePagedMetadata.md +14 -0
  291. data/docs/UsernamesApi.md +56 -0
  292. data/docs/UsersApi.md +564 -0
  293. data/docs/VaultedgatewaysApi.md +648 -0
  294. data/docs/WebhookPagedMetadata.md +14 -0
  295. data/docs/WebhooksApi.md +366 -0
  296. data/git_push.sh +67 -0
  297. data/lib/bf_ruby2/api/accounts_api.rb +1257 -0
  298. data/lib/bf_ruby2/api/addresses_api.rb +148 -0
  299. data/lib/bf_ruby2/api/amendments_api.rb +819 -0
  300. data/lib/bf_ruby2/api/analytics_api.rb +815 -0
  301. data/lib/bf_ruby2/api/auditlogs_api.rb +410 -0
  302. data/lib/bf_ruby2/api/charges_api.rb +527 -0
  303. data/lib/bf_ruby2/api/clients_api.rb +282 -0
  304. data/lib/bf_ruby2/api/configurations_api.rb +298 -0
  305. data/lib/bf_ruby2/api/couponbook_api.rb +619 -0
  306. data/lib/bf_ruby2/api/couponbookdefinition_api.rb +420 -0
  307. data/lib/bf_ruby2/api/coupondefinition_api.rb +342 -0
  308. data/lib/bf_ruby2/api/couponinstance_api.rb +737 -0
  309. data/lib/bf_ruby2/api/couponmodifier_api.rb +456 -0
  310. data/lib/bf_ruby2/api/couponrule_api.rb +342 -0
  311. data/lib/bf_ruby2/api/coupons_api.rb +580 -0
  312. data/lib/bf_ruby2/api/creditnotes_api.rb +438 -0
  313. data/lib/bf_ruby2/api/cybersourcetokens_api.rb +330 -0
  314. data/lib/bf_ruby2/api/dunninglines_api.rb +422 -0
  315. data/lib/bf_ruby2/api/emailproviders_api.rb +288 -0
  316. data/lib/bf_ruby2/api/emails_api.rb +214 -0
  317. data/lib/bf_ruby2/api/emailsubscriptions_api.rb +364 -0
  318. data/lib/bf_ruby2/api/fixedtermdefinitions_api.rb +148 -0
  319. data/lib/bf_ruby2/api/fixedterms_api.rb +91 -0
  320. data/lib/bf_ruby2/api/invoices_api.rb +3066 -0
  321. data/lib/bf_ruby2/api/metadata_api.rb +266 -0
  322. data/lib/bf_ruby2/api/notifications_api.rb +480 -0
  323. data/lib/bf_ruby2/api/organizations_api.rb +476 -0
  324. data/lib/bf_ruby2/api/passwords_api.rb +91 -0
  325. data/lib/bf_ruby2/api/paymentmethods_api.rb +565 -0
  326. data/lib/bf_ruby2/api/paymentmethodsubscriptionlinks_api.rb +153 -0
  327. data/lib/bf_ruby2/api/payments_api.rb +601 -0
  328. data/lib/bf_ruby2/api/periods_api.rb +180 -0
  329. data/lib/bf_ruby2/api/permissions_api.rb +408 -0
  330. data/lib/bf_ruby2/api/pricingcalculator_api.rb +205 -0
  331. data/lib/bf_ruby2/api/pricingcomponents_api.rb +438 -0
  332. data/lib/bf_ruby2/api/pricingcomponenttiers_api.rb +369 -0
  333. data/lib/bf_ruby2/api/pricingcomponentvaluechanges_api.rb +447 -0
  334. data/lib/bf_ruby2/api/pricingcomponentvalues_api.rb +378 -0
  335. data/lib/bf_ruby2/api/productrateplans_api.rb +971 -0
  336. data/lib/bf_ruby2/api/products_api.rb +611 -0
  337. data/lib/bf_ruby2/api/profiles_api.rb +375 -0
  338. data/lib/bf_ruby2/api/quotes_api.rb +91 -0
  339. data/lib/bf_ruby2/api/receipts_api.rb +559 -0
  340. data/lib/bf_ruby2/api/refunds_api.rb +540 -0
  341. data/lib/bf_ruby2/api/roles_api.rb +421 -0
  342. data/lib/bf_ruby2/api/search_api.rb +109 -0
  343. data/lib/bf_ruby2/api/subscriptions_api.rb +3490 -0
  344. data/lib/bf_ruby2/api/synch_app_configs_api.rb +272 -0
  345. data/lib/bf_ruby2/api/synch_configs_api.rb +403 -0
  346. data/lib/bf_ruby2/api/synch_jobs_api.rb +535 -0
  347. data/lib/bf_ruby2/api/taxationlinks_api.rb +438 -0
  348. data/lib/bf_ruby2/api/taxationstrategies_api.rb +660 -0
  349. data/lib/bf_ruby2/api/time_api.rb +91 -0
  350. data/lib/bf_ruby2/api/tokenization_api.rb +431 -0
  351. data/lib/bf_ruby2/api/unitofmeasure_api.rb +282 -0
  352. data/lib/bf_ruby2/api/usage_api.rb +389 -0
  353. data/lib/bf_ruby2/api/usageperiods_api.rb +267 -0
  354. data/lib/bf_ruby2/api/usageroundingstrategies_api.rb +304 -0
  355. data/lib/bf_ruby2/api/usagesessions_api.rb +298 -0
  356. data/lib/bf_ruby2/api/usernames_api.rb +91 -0
  357. data/lib/bf_ruby2/api/users_api.rb +692 -0
  358. data/lib/bf_ruby2/api/vaultedgateways_api.rb +787 -0
  359. data/lib/bf_ruby2/api/webhooks_api.rb +461 -0
  360. data/lib/bf_ruby2/api_client.rb +378 -0
  361. data/lib/bf_ruby2/api_error.rb +47 -0
  362. data/lib/bf_ruby2/configuration.rb +207 -0
  363. data/lib/bf_ruby2/models/account.rb +335 -0
  364. data/lib/bf_ruby2/models/account_ltv_result_paged_metadata.rb +269 -0
  365. data/lib/bf_ruby2/models/account_paged_metadata.rb +269 -0
  366. data/lib/bf_ruby2/models/account_payments_result_paged_metadata.rb +269 -0
  367. data/lib/bf_ruby2/models/add_charge_request.rb +414 -0
  368. data/lib/bf_ruby2/models/add_coupon_code_request.rb +231 -0
  369. data/lib/bf_ruby2/models/add_payment_method_request.rb +200 -0
  370. data/lib/bf_ruby2/models/add_taxation_strategy_request.rb +230 -0
  371. data/lib/bf_ruby2/models/address.rb +359 -0
  372. data/lib/bf_ruby2/models/address_paged_metadata.rb +269 -0
  373. data/lib/bf_ruby2/models/aggregating_component.rb +294 -0
  374. data/lib/bf_ruby2/models/amendment.rb +374 -0
  375. data/lib/bf_ruby2/models/amendment_discard_amendment.rb +385 -0
  376. data/lib/bf_ruby2/models/amendment_paged_metadata.rb +269 -0
  377. data/lib/bf_ruby2/models/amendment_price_n_time_paged_metadata.rb +269 -0
  378. data/lib/bf_ruby2/models/api_configuration_paged_metadata.rb +269 -0
  379. data/lib/bf_ruby2/models/api_quote.rb +525 -0
  380. data/lib/bf_ruby2/models/api_quote_paged_metadata.rb +269 -0
  381. data/lib/bf_ruby2/models/api_quote_response_quantity.rb +405 -0
  382. data/lib/bf_ruby2/models/audit_entry.rb +359 -0
  383. data/lib/bf_ruby2/models/audit_entry_paged_metadata.rb +269 -0
  384. data/lib/bf_ruby2/models/auth_capture_request.rb +337 -0
  385. data/lib/bf_ruby2/models/authorize_net_token_paged_metadata.rb +269 -0
  386. data/lib/bf_ruby2/models/bank_account_verification_paged_metadata.rb +269 -0
  387. data/lib/bf_ruby2/models/bf_error.rb +265 -0
  388. data/lib/bf_ruby2/models/bf_permission.rb +337 -0
  389. data/lib/bf_ruby2/models/bf_permission_paged_metadata.rb +269 -0
  390. data/lib/bf_ruby2/models/billforward_managed_payments_result_paged_metadata.rb +269 -0
  391. data/lib/bf_ruby2/models/billing_entity_base.rb +200 -0
  392. data/lib/bf_ruby2/models/braintree_auth_capture_request.rb +358 -0
  393. data/lib/bf_ruby2/models/braintree_capture_request.rb +327 -0
  394. data/lib/bf_ruby2/models/braintree_token_paged_metadata.rb +269 -0
  395. data/lib/bf_ruby2/models/cancel_subscription_request.rb +301 -0
  396. data/lib/bf_ruby2/models/cancellation_amendment.rb +451 -0
  397. data/lib/bf_ruby2/models/cass_churn_result_paged_metadata.rb +269 -0
  398. data/lib/bf_ruby2/models/cass_payment_result_paged_metadata.rb +269 -0
  399. data/lib/bf_ruby2/models/cass_upgrade_result_paged_metadata.rb +269 -0
  400. data/lib/bf_ruby2/models/client.rb +342 -0
  401. data/lib/bf_ruby2/models/client_paged_metadata.rb +269 -0
  402. data/lib/bf_ruby2/models/component_change.rb +373 -0
  403. data/lib/bf_ruby2/models/component_cost.rb +208 -0
  404. data/lib/bf_ruby2/models/compound_usage.rb +234 -0
  405. data/lib/bf_ruby2/models/compound_usage_session.rb +233 -0
  406. data/lib/bf_ruby2/models/coupon.rb +484 -0
  407. data/lib/bf_ruby2/models/coupon_book.rb +342 -0
  408. data/lib/bf_ruby2/models/coupon_book_definition.rb +417 -0
  409. data/lib/bf_ruby2/models/coupon_book_definition_paged_metadata.rb +269 -0
  410. data/lib/bf_ruby2/models/coupon_book_paged_metadata.rb +269 -0
  411. data/lib/bf_ruby2/models/coupon_definition.rb +454 -0
  412. data/lib/bf_ruby2/models/coupon_definition_paged_metadata.rb +269 -0
  413. data/lib/bf_ruby2/models/coupon_discount.rb +298 -0
  414. data/lib/bf_ruby2/models/coupon_discount_estimate.rb +258 -0
  415. data/lib/bf_ruby2/models/coupon_instance.rb +426 -0
  416. data/lib/bf_ruby2/models/coupon_instance_existing_value.rb +272 -0
  417. data/lib/bf_ruby2/models/coupon_instance_paged_metadata.rb +269 -0
  418. data/lib/bf_ruby2/models/coupon_modifier_base.rb +410 -0
  419. data/lib/bf_ruby2/models/coupon_modifier_base_paged_metadata.rb +269 -0
  420. data/lib/bf_ruby2/models/coupon_paged_metadata.rb +269 -0
  421. data/lib/bf_ruby2/models/coupon_rule.rb +470 -0
  422. data/lib/bf_ruby2/models/coupon_rule_paged_metadata.rb +269 -0
  423. data/lib/bf_ruby2/models/coupon_unique_codes_request.rb +232 -0
  424. data/lib/bf_ruby2/models/coupon_unique_codes_response.rb +219 -0
  425. data/lib/bf_ruby2/models/coupon_unique_codes_response_paged_metadata.rb +269 -0
  426. data/lib/bf_ruby2/models/coupon_wrapper_response.rb +250 -0
  427. data/lib/bf_ruby2/models/create_account_profile_request.rb +323 -0
  428. data/lib/bf_ruby2/models/create_account_request.rb +248 -0
  429. data/lib/bf_ruby2/models/create_address_request.rb +298 -0
  430. data/lib/bf_ruby2/models/create_aggregating_component_request.rb +221 -0
  431. data/lib/bf_ruby2/models/create_aggregating_subscription_request.rb +393 -0
  432. data/lib/bf_ruby2/models/create_profile_address_request.rb +287 -0
  433. data/lib/bf_ruby2/models/create_subscription_batch_request.rb +222 -0
  434. data/lib/bf_ruby2/models/create_subscription_charge_amendment.rb +514 -0
  435. data/lib/bf_ruby2/models/create_subscription_request.rb +444 -0
  436. data/lib/bf_ruby2/models/credit_account_request.rb +252 -0
  437. data/lib/bf_ruby2/models/credit_note.rb +368 -0
  438. data/lib/bf_ruby2/models/credit_note_paged_metadata.rb +269 -0
  439. data/lib/bf_ruby2/models/credit_subscription_request.rb +241 -0
  440. data/lib/bf_ruby2/models/cybersource_token_paged_metadata.rb +269 -0
  441. data/lib/bf_ruby2/models/data_synchronisation_app_configuration_paged_metadata.rb +269 -0
  442. data/lib/bf_ruby2/models/data_synchronisation_configuration.rb +362 -0
  443. data/lib/bf_ruby2/models/data_synchronisation_configuration_paged_metadata.rb +269 -0
  444. data/lib/bf_ruby2/models/data_synchronization_job_paged_metadata.rb +269 -0
  445. data/lib/bf_ruby2/models/debts_result_paged_metadata.rb +269 -0
  446. data/lib/bf_ruby2/models/dunning_line.rb +354 -0
  447. data/lib/bf_ruby2/models/dunning_line_paged_metadata.rb +269 -0
  448. data/lib/bf_ruby2/models/dynamic_metadata.rb +190 -0
  449. data/lib/bf_ruby2/models/email.rb +518 -0
  450. data/lib/bf_ruby2/models/email_paged_metadata.rb +269 -0
  451. data/lib/bf_ruby2/models/email_provider.rb +302 -0
  452. data/lib/bf_ruby2/models/email_provider_paged_metadata.rb +269 -0
  453. data/lib/bf_ruby2/models/email_subscription.rb +364 -0
  454. data/lib/bf_ruby2/models/email_subscription_paged_metadata.rb +269 -0
  455. data/lib/bf_ruby2/models/end_trial_amendment.rb +374 -0
  456. data/lib/bf_ruby2/models/event.rb +272 -0
  457. data/lib/bf_ruby2/models/event_data.rb +212 -0
  458. data/lib/bf_ruby2/models/file_sham.rb +190 -0
  459. data/lib/bf_ruby2/models/fixed_term.rb +419 -0
  460. data/lib/bf_ruby2/models/fixed_term_definition_paged_metadata.rb +269 -0
  461. data/lib/bf_ruby2/models/fixed_term_expiry_amendment.rb +385 -0
  462. data/lib/bf_ruby2/models/fixed_term_paged_metadata.rb +269 -0
  463. data/lib/bf_ruby2/models/flat_pricing_component.rb +546 -0
  464. data/lib/bf_ruby2/models/import_invoice_line.rb +271 -0
  465. data/lib/bf_ruby2/models/insertable_billing_entity.rb +384 -0
  466. data/lib/bf_ruby2/models/invoice.rb +746 -0
  467. data/lib/bf_ruby2/models/invoice_charge_request.rb +267 -0
  468. data/lib/bf_ruby2/models/invoice_line.rb +575 -0
  469. data/lib/bf_ruby2/models/invoice_line_payment.rb +539 -0
  470. data/lib/bf_ruby2/models/invoice_line_payment_paged_metadata.rb +269 -0
  471. data/lib/bf_ruby2/models/invoice_next_execution_attempt_amendment.rb +398 -0
  472. data/lib/bf_ruby2/models/invoice_outstanding_charges_amendment.rb +385 -0
  473. data/lib/bf_ruby2/models/invoice_paged_metadata.rb +269 -0
  474. data/lib/bf_ruby2/models/invoice_payment.rb +384 -0
  475. data/lib/bf_ruby2/models/invoice_recalculation_amendment.rb +444 -0
  476. data/lib/bf_ruby2/models/invoice_recalculation_request.rb +293 -0
  477. data/lib/bf_ruby2/models/issue_invoice_amendment.rb +385 -0
  478. data/lib/bf_ruby2/models/metadata_key_values_paged_metadata.rb +269 -0
  479. data/lib/bf_ruby2/models/migration_request.rb +332 -0
  480. data/lib/bf_ruby2/models/model_alias.rb +266 -0
  481. data/lib/bf_ruby2/models/mutable_billing_entity.rb +472 -0
  482. data/lib/bf_ruby2/models/notification.rb +472 -0
  483. data/lib/bf_ruby2/models/notification_paged_metadata.rb +269 -0
  484. data/lib/bf_ruby2/models/organization.rb +349 -0
  485. data/lib/bf_ruby2/models/organization_paged_metadata.rb +269 -0
  486. data/lib/bf_ruby2/models/password.rb +266 -0
  487. data/lib/bf_ruby2/models/password_paged_metadata.rb +269 -0
  488. data/lib/bf_ruby2/models/password_reset_request.rb +201 -0
  489. data/lib/bf_ruby2/models/pause_request.rb +210 -0
  490. data/lib/bf_ruby2/models/payment.rb +417 -0
  491. data/lib/bf_ruby2/models/payment_method.rb +487 -0
  492. data/lib/bf_ruby2/models/payment_method_paged_metadata.rb +269 -0
  493. data/lib/bf_ruby2/models/payment_method_subscription_link.rb +291 -0
  494. data/lib/bf_ruby2/models/payment_method_subscription_link_paged_metadata.rb +269 -0
  495. data/lib/bf_ruby2/models/payment_paged_metadata.rb +269 -0
  496. data/lib/bf_ruby2/models/payment_retry_request.rb +210 -0
  497. data/lib/bf_ruby2/models/pending_component_value_change.rb +226 -0
  498. data/lib/bf_ruby2/models/period.rb +330 -0
  499. data/lib/bf_ruby2/models/period_paged_metadata.rb +269 -0
  500. data/lib/bf_ruby2/models/permission_action_entity_paged_metadata.rb +269 -0
  501. data/lib/bf_ruby2/models/permission_resource_entity_paged_metadata.rb +269 -0
  502. data/lib/bf_ruby2/models/price_calculation_paged_metadata.rb +269 -0
  503. data/lib/bf_ruby2/models/pricing_component.rb +546 -0
  504. data/lib/bf_ruby2/models/pricing_component_coupon_modifier.rb +410 -0
  505. data/lib/bf_ruby2/models/pricing_component_migration_value.rb +242 -0
  506. data/lib/bf_ruby2/models/pricing_component_paged_metadata.rb +269 -0
  507. data/lib/bf_ruby2/models/pricing_component_quantity_request.rb +220 -0
  508. data/lib/bf_ruby2/models/pricing_component_tier.rb +346 -0
  509. data/lib/bf_ruby2/models/pricing_component_tier_paged_metadata.rb +269 -0
  510. data/lib/bf_ruby2/models/pricing_component_value.rb +323 -0
  511. data/lib/bf_ruby2/models/pricing_component_value_change_amendment.rb +419 -0
  512. data/lib/bf_ruby2/models/pricing_component_value_change_paged_metadata.rb +269 -0
  513. data/lib/bf_ruby2/models/pricing_component_value_migration_amendment_mapping.rb +283 -0
  514. data/lib/bf_ruby2/models/pricing_component_value_paged_metadata.rb +269 -0
  515. data/lib/bf_ruby2/models/pricing_component_value_request.rb +288 -0
  516. data/lib/bf_ruby2/models/pricing_component_value_response_paged_metadata.rb +269 -0
  517. data/lib/bf_ruby2/models/product.rb +435 -0
  518. data/lib/bf_ruby2/models/product_coupon_modifier.rb +410 -0
  519. data/lib/bf_ruby2/models/product_paged_metadata.rb +269 -0
  520. data/lib/bf_ruby2/models/product_payments_result_paged_metadata.rb +269 -0
  521. data/lib/bf_ruby2/models/product_rate_plan.rb +658 -0
  522. data/lib/bf_ruby2/models/product_rate_plan_migration_amendment.rb +483 -0
  523. data/lib/bf_ruby2/models/product_rate_plan_paged_metadata.rb +269 -0
  524. data/lib/bf_ruby2/models/product_rate_plan_payments_result_paged_metadata.rb +269 -0
  525. data/lib/bf_ruby2/models/profile.rb +378 -0
  526. data/lib/bf_ruby2/models/profile_paged_metadata.rb +269 -0
  527. data/lib/bf_ruby2/models/quote_request.rb +431 -0
  528. data/lib/bf_ruby2/models/quote_request_value.rb +232 -0
  529. data/lib/bf_ruby2/models/recalculate_charge_request.rb +318 -0
  530. data/lib/bf_ruby2/models/receipt.rb +535 -0
  531. data/lib/bf_ruby2/models/receipt_paged_metadata.rb +269 -0
  532. data/lib/bf_ruby2/models/refund.rb +535 -0
  533. data/lib/bf_ruby2/models/refund_paged_metadata.rb +269 -0
  534. data/lib/bf_ruby2/models/resume_request.rb +222 -0
  535. data/lib/bf_ruby2/models/resume_subscription_amendment.rb +374 -0
  536. data/lib/bf_ruby2/models/revenue_attribution.rb +451 -0
  537. data/lib/bf_ruby2/models/revenue_attribution_paged_metadata.rb +269 -0
  538. data/lib/bf_ruby2/models/revive_subscription_request.rb +200 -0
  539. data/lib/bf_ruby2/models/role.rb +318 -0
  540. data/lib/bf_ruby2/models/role_paged_metadata.rb +269 -0
  541. data/lib/bf_ruby2/models/rule_satisfaction.rb +234 -0
  542. data/lib/bf_ruby2/models/search_result_paged_metadata.rb +269 -0
  543. data/lib/bf_ruby2/models/service_end_amendment.rb +374 -0
  544. data/lib/bf_ruby2/models/stripe_ach_token_paged_metadata.rb +269 -0
  545. data/lib/bf_ruby2/models/stripe_auth_capture_request.rb +367 -0
  546. data/lib/bf_ruby2/models/stripe_object.rb +190 -0
  547. data/lib/bf_ruby2/models/stripe_token_paged_metadata.rb +269 -0
  548. data/lib/bf_ruby2/models/subscription.rb +681 -0
  549. data/lib/bf_ruby2/models/subscription_cancellation_paged_metadata.rb +269 -0
  550. data/lib/bf_ruby2/models/subscription_charge.rb +529 -0
  551. data/lib/bf_ruby2/models/subscription_charge_paged_metadata.rb +269 -0
  552. data/lib/bf_ruby2/models/subscription_ltv_result_paged_metadata.rb +269 -0
  553. data/lib/bf_ruby2/models/subscription_paged_metadata.rb +269 -0
  554. data/lib/bf_ruby2/models/swagger_type_list.rb +210 -0
  555. data/lib/bf_ruby2/models/swagger_type_list_inv.rb +201 -0
  556. data/lib/bf_ruby2/models/swagger_type_list_subs.rb +212 -0
  557. data/lib/bf_ruby2/models/taxation_link_paged_metadata.rb +269 -0
  558. data/lib/bf_ruby2/models/taxation_strategy_paged_metadata.rb +269 -0
  559. data/lib/bf_ruby2/models/tiered_pricing_component.rb +546 -0
  560. data/lib/bf_ruby2/models/tiered_volume_pricing_component.rb +546 -0
  561. data/lib/bf_ruby2/models/time_request.rb +323 -0
  562. data/lib/bf_ruby2/models/time_response.rb +345 -0
  563. data/lib/bf_ruby2/models/time_response_paged_metadata.rb +269 -0
  564. data/lib/bf_ruby2/models/time_zone.rb +226 -0
  565. data/lib/bf_ruby2/models/timer_amendment.rb +485 -0
  566. data/lib/bf_ruby2/models/tokenization_pre_auth_paged_metadata.rb +269 -0
  567. data/lib/bf_ruby2/models/trust_commerce_token_paged_metadata.rb +269 -0
  568. data/lib/bf_ruby2/models/unit_discount.rb +226 -0
  569. data/lib/bf_ruby2/models/unit_of_measure.rb +286 -0
  570. data/lib/bf_ruby2/models/unit_of_measure_coupon_modifier.rb +410 -0
  571. data/lib/bf_ruby2/models/unit_of_measure_paged_metadata.rb +269 -0
  572. data/lib/bf_ruby2/models/update_address_request.rb +303 -0
  573. data/lib/bf_ruby2/models/update_component_value_amendment.rb +418 -0
  574. data/lib/bf_ruby2/models/update_profile_request.rb +342 -0
  575. data/lib/bf_ruby2/models/update_role_request.rb +253 -0
  576. data/lib/bf_ruby2/models/update_subscription_request.rb +328 -0
  577. data/lib/bf_ruby2/models/usage.rb +423 -0
  578. data/lib/bf_ruby2/models/usage_paged_metadata.rb +269 -0
  579. data/lib/bf_ruby2/models/usage_period_paged_metadata.rb +269 -0
  580. data/lib/bf_ruby2/models/usage_rounding_strategy_paged_metadata.rb +269 -0
  581. data/lib/bf_ruby2/models/usage_session.rb +368 -0
  582. data/lib/bf_ruby2/models/usage_session_paged_metadata.rb +269 -0
  583. data/lib/bf_ruby2/models/user.rb +352 -0
  584. data/lib/bf_ruby2/models/user_creation_request.rb +302 -0
  585. data/lib/bf_ruby2/models/user_creation_response_paged_metadata.rb +269 -0
  586. data/lib/bf_ruby2/models/user_paged_metadata.rb +269 -0
  587. data/lib/bf_ruby2/models/username.rb +253 -0
  588. data/lib/bf_ruby2/models/username_paged_metadata.rb +269 -0
  589. data/lib/bf_ruby2/models/webhook_paged_metadata.rb +269 -0
  590. data/lib/bf_ruby2/version.rb +26 -0
  591. data/lib/bf_ruby2.rb +340 -0
  592. data/setup.scratch.rb +33 -0
  593. data/spec/api/accounts_api_spec.rb +318 -0
  594. data/spec/api/addresses_api_spec.rb +70 -0
  595. data/spec/api/amendments_api_spec.rb +220 -0
  596. data/spec/api/analytics_api_spec.rb +220 -0
  597. data/spec/api/auditlogs_api_spec.rb +131 -0
  598. data/spec/api/charges_api_spec.rb +156 -0
  599. data/spec/api/clients_api_spec.rb +100 -0
  600. data/spec/api/configurations_api_spec.rb +103 -0
  601. data/spec/api/couponbook_api_spec.rb +175 -0
  602. data/spec/api/couponbookdefinition_api_spec.rb +131 -0
  603. data/spec/api/coupondefinition_api_spec.rb +113 -0
  604. data/spec/api/couponinstance_api_spec.rb +203 -0
  605. data/spec/api/couponmodifier_api_spec.rb +138 -0
  606. data/spec/api/couponrule_api_spec.rb +113 -0
  607. data/spec/api/coupons_api_spec.rb +168 -0
  608. data/spec/api/creditnotes_api_spec.rb +135 -0
  609. data/spec/api/cybersourcetokens_api_spec.rb +109 -0
  610. data/spec/api/dunninglines_api_spec.rb +131 -0
  611. data/spec/api/emailproviders_api_spec.rb +102 -0
  612. data/spec/api/emails_api_spec.rb +85 -0
  613. data/spec/api/emailsubscriptions_api_spec.rb +115 -0
  614. data/spec/api/fixedtermdefinitions_api_spec.rb +70 -0
  615. data/spec/api/fixedterms_api_spec.rb +58 -0
  616. data/spec/api/invoices_api_spec.rb +727 -0
  617. data/spec/api/metadata_api_spec.rb +96 -0
  618. data/spec/api/notifications_api_spec.rb +148 -0
  619. data/spec/api/organizations_api_spec.rb +143 -0
  620. data/spec/api/passwords_api_spec.rb +58 -0
  621. data/spec/api/paymentmethods_api_spec.rb +163 -0
  622. data/spec/api/paymentmethodsubscriptionlinks_api_spec.rb +71 -0
  623. data/spec/api/payments_api_spec.rb +172 -0
  624. data/spec/api/periods_api_spec.rb +79 -0
  625. data/spec/api/permissions_api_spec.rb +127 -0
  626. data/spec/api/pricingcalculator_api_spec.rb +82 -0
  627. data/spec/api/pricingcomponents_api_spec.rb +136 -0
  628. data/spec/api/pricingcomponenttiers_api_spec.rb +120 -0
  629. data/spec/api/pricingcomponentvaluechanges_api_spec.rb +138 -0
  630. data/spec/api/pricingcomponentvalues_api_spec.rb +123 -0
  631. data/spec/api/productrateplans_api_spec.rb +254 -0
  632. data/spec/api/products_api_spec.rb +173 -0
  633. data/spec/api/profiles_api_spec.rb +122 -0
  634. data/spec/api/quotes_api_spec.rb +58 -0
  635. data/spec/api/receipts_api_spec.rb +164 -0
  636. data/spec/api/refunds_api_spec.rb +156 -0
  637. data/spec/api/roles_api_spec.rb +129 -0
  638. data/spec/api/search_api_spec.rb +64 -0
  639. data/spec/api/subscriptions_api_spec.rb +809 -0
  640. data/spec/api/synch_app_configs_api_spec.rb +96 -0
  641. data/spec/api/synch_configs_api_spec.rb +125 -0
  642. data/spec/api/synch_jobs_api_spec.rb +151 -0
  643. data/spec/api/taxationlinks_api_spec.rb +136 -0
  644. data/spec/api/taxationstrategies_api_spec.rb +185 -0
  645. data/spec/api/time_api_spec.rb +58 -0
  646. data/spec/api/tokenization_api_spec.rb +138 -0
  647. data/spec/api/unitofmeasure_api_spec.rb +100 -0
  648. data/spec/api/usage_api_spec.rb +125 -0
  649. data/spec/api/usageperiods_api_spec.rb +99 -0
  650. data/spec/api/usageroundingstrategies_api_spec.rb +106 -0
  651. data/spec/api/usagesessions_api_spec.rb +104 -0
  652. data/spec/api/usernames_api_spec.rb +58 -0
  653. data/spec/api/users_api_spec.rb +187 -0
  654. data/spec/api/vaultedgateways_api_spec.rb +206 -0
  655. data/spec/api/webhooks_api_spec.rb +138 -0
  656. data/spec/api_client_spec.rb +237 -0
  657. data/spec/configuration_spec.rb +53 -0
  658. data/spec/models/account_ltv_result_paged_metadata_spec.rb +89 -0
  659. data/spec/models/account_paged_metadata_spec.rb +89 -0
  660. data/spec/models/account_payments_result_paged_metadata_spec.rb +89 -0
  661. data/spec/models/account_spec.rb +131 -0
  662. data/spec/models/add_charge_request_spec.rb +155 -0
  663. data/spec/models/add_coupon_code_request_spec.rb +71 -0
  664. data/spec/models/add_payment_method_request_spec.rb +53 -0
  665. data/spec/models/add_taxation_strategy_request_spec.rb +71 -0
  666. data/spec/models/address_paged_metadata_spec.rb +89 -0
  667. data/spec/models/address_spec.rb +143 -0
  668. data/spec/models/aggregating_component_spec.rb +107 -0
  669. data/spec/models/amendment_discard_amendment_spec.rb +137 -0
  670. data/spec/models/amendment_paged_metadata_spec.rb +89 -0
  671. data/spec/models/amendment_price_n_time_paged_metadata_spec.rb +89 -0
  672. data/spec/models/amendment_spec.rb +131 -0
  673. data/spec/models/api_configuration_paged_metadata_spec.rb +89 -0
  674. data/spec/models/api_quote_paged_metadata_spec.rb +89 -0
  675. data/spec/models/api_quote_response_quantity_spec.rb +159 -0
  676. data/spec/models/api_quote_spec.rb +225 -0
  677. data/spec/models/audit_entry_paged_metadata_spec.rb +89 -0
  678. data/spec/models/audit_entry_spec.rb +119 -0
  679. data/spec/models/auth_capture_request_spec.rb +115 -0
  680. data/spec/models/authorize_net_token_paged_metadata_spec.rb +89 -0
  681. data/spec/models/bank_account_verification_paged_metadata_spec.rb +89 -0
  682. data/spec/models/bf_error_spec.rb +75 -0
  683. data/spec/models/bf_permission_paged_metadata_spec.rb +89 -0
  684. data/spec/models/bf_permission_spec.rb +115 -0
  685. data/spec/models/billforward_managed_payments_result_paged_metadata_spec.rb +89 -0
  686. data/spec/models/billing_entity_base_spec.rb +53 -0
  687. data/spec/models/braintree_auth_capture_request_spec.rb +127 -0
  688. data/spec/models/braintree_capture_request_spec.rb +125 -0
  689. data/spec/models/braintree_token_paged_metadata_spec.rb +89 -0
  690. data/spec/models/cancel_subscription_request_spec.rb +97 -0
  691. data/spec/models/cancellation_amendment_spec.rb +169 -0
  692. data/spec/models/cass_churn_result_paged_metadata_spec.rb +89 -0
  693. data/spec/models/cass_payment_result_paged_metadata_spec.rb +89 -0
  694. data/spec/models/cass_upgrade_result_paged_metadata_spec.rb +89 -0
  695. data/spec/models/client_paged_metadata_spec.rb +89 -0
  696. data/spec/models/client_spec.rb +131 -0
  697. data/spec/models/component_change_spec.rb +133 -0
  698. data/spec/models/component_cost_spec.rb +59 -0
  699. data/spec/models/compound_usage_session_spec.rb +71 -0
  700. data/spec/models/compound_usage_spec.rb +71 -0
  701. data/spec/models/coupon_book_definition_paged_metadata_spec.rb +89 -0
  702. data/spec/models/coupon_book_definition_spec.rb +157 -0
  703. data/spec/models/coupon_book_paged_metadata_spec.rb +89 -0
  704. data/spec/models/coupon_book_spec.rb +131 -0
  705. data/spec/models/coupon_definition_paged_metadata_spec.rb +89 -0
  706. data/spec/models/coupon_definition_spec.rb +173 -0
  707. data/spec/models/coupon_discount_estimate_spec.rb +83 -0
  708. data/spec/models/coupon_discount_spec.rb +113 -0
  709. data/spec/models/coupon_instance_existing_value_spec.rb +95 -0
  710. data/spec/models/coupon_instance_paged_metadata_spec.rb +89 -0
  711. data/spec/models/coupon_instance_spec.rb +165 -0
  712. data/spec/models/coupon_modifier_base_paged_metadata_spec.rb +89 -0
  713. data/spec/models/coupon_modifier_base_spec.rb +149 -0
  714. data/spec/models/coupon_paged_metadata_spec.rb +89 -0
  715. data/spec/models/coupon_rule_paged_metadata_spec.rb +89 -0
  716. data/spec/models/coupon_rule_spec.rb +173 -0
  717. data/spec/models/coupon_spec.rb +201 -0
  718. data/spec/models/coupon_unique_codes_request_spec.rb +71 -0
  719. data/spec/models/coupon_unique_codes_response_paged_metadata_spec.rb +89 -0
  720. data/spec/models/coupon_unique_codes_response_spec.rb +65 -0
  721. data/spec/models/coupon_wrapper_response_spec.rb +83 -0
  722. data/spec/models/create_account_profile_request_spec.rb +125 -0
  723. data/spec/models/create_account_request_spec.rb +83 -0
  724. data/spec/models/create_address_request_spec.rb +107 -0
  725. data/spec/models/create_aggregating_component_request_spec.rb +65 -0
  726. data/spec/models/create_aggregating_subscription_request_spec.rb +143 -0
  727. data/spec/models/create_profile_address_request_spec.rb +101 -0
  728. data/spec/models/create_subscription_batch_request_spec.rb +65 -0
  729. data/spec/models/create_subscription_charge_amendment_spec.rb +203 -0
  730. data/spec/models/create_subscription_request_spec.rb +173 -0
  731. data/spec/models/credit_account_request_spec.rb +83 -0
  732. data/spec/models/credit_note_paged_metadata_spec.rb +89 -0
  733. data/spec/models/credit_note_spec.rb +135 -0
  734. data/spec/models/credit_subscription_request_spec.rb +77 -0
  735. data/spec/models/cybersource_token_paged_metadata_spec.rb +89 -0
  736. data/spec/models/data_synchronisation_app_configuration_paged_metadata_spec.rb +89 -0
  737. data/spec/models/data_synchronisation_configuration_paged_metadata_spec.rb +89 -0
  738. data/spec/models/data_synchronisation_configuration_spec.rb +129 -0
  739. data/spec/models/data_synchronization_job_paged_metadata_spec.rb +89 -0
  740. data/spec/models/debts_result_paged_metadata_spec.rb +89 -0
  741. data/spec/models/dunning_line_paged_metadata_spec.rb +89 -0
  742. data/spec/models/dunning_line_spec.rb +121 -0
  743. data/spec/models/dynamic_metadata_spec.rb +47 -0
  744. data/spec/models/email_paged_metadata_spec.rb +89 -0
  745. data/spec/models/email_provider_paged_metadata_spec.rb +89 -0
  746. data/spec/models/email_provider_spec.rb +113 -0
  747. data/spec/models/email_spec.rb +223 -0
  748. data/spec/models/email_subscription_paged_metadata_spec.rb +89 -0
  749. data/spec/models/email_subscription_spec.rb +133 -0
  750. data/spec/models/end_trial_amendment_spec.rb +131 -0
  751. data/spec/models/event_data_spec.rb +59 -0
  752. data/spec/models/event_spec.rb +95 -0
  753. data/spec/models/file_sham_spec.rb +47 -0
  754. data/spec/models/fixed_term_definition_paged_metadata_spec.rb +89 -0
  755. data/spec/models/fixed_term_expiry_amendment_spec.rb +137 -0
  756. data/spec/models/fixed_term_paged_metadata_spec.rb +89 -0
  757. data/spec/models/fixed_term_spec.rb +157 -0
  758. data/spec/models/flat_pricing_component_spec.rb +221 -0
  759. data/spec/models/import_invoice_line_spec.rb +101 -0
  760. data/spec/models/insertable_billing_entity_spec.rb +139 -0
  761. data/spec/models/invoice_charge_request_spec.rb +75 -0
  762. data/spec/models/invoice_line_payment_paged_metadata_spec.rb +89 -0
  763. data/spec/models/invoice_line_payment_spec.rb +225 -0
  764. data/spec/models/invoice_line_spec.rb +245 -0
  765. data/spec/models/invoice_next_execution_attempt_amendment_spec.rb +143 -0
  766. data/spec/models/invoice_outstanding_charges_amendment_spec.rb +137 -0
  767. data/spec/models/invoice_paged_metadata_spec.rb +89 -0
  768. data/spec/models/invoice_payment_spec.rb +141 -0
  769. data/spec/models/invoice_recalculation_amendment_spec.rb +163 -0
  770. data/spec/models/invoice_recalculation_request_spec.rb +85 -0
  771. data/spec/models/invoice_spec.rb +341 -0
  772. data/spec/models/issue_invoice_amendment_spec.rb +137 -0
  773. data/spec/models/metadata_key_values_paged_metadata_spec.rb +89 -0
  774. data/spec/models/migration_request_spec.rb +109 -0
  775. data/spec/models/model_alias_spec.rb +89 -0
  776. data/spec/models/mutable_billing_entity_spec.rb +183 -0
  777. data/spec/models/notification_paged_metadata_spec.rb +89 -0
  778. data/spec/models/notification_spec.rb +183 -0
  779. data/spec/models/organization_paged_metadata_spec.rb +89 -0
  780. data/spec/models/organization_spec.rb +131 -0
  781. data/spec/models/password_paged_metadata_spec.rb +89 -0
  782. data/spec/models/password_reset_request_spec.rb +53 -0
  783. data/spec/models/password_spec.rb +89 -0
  784. data/spec/models/pause_request_spec.rb +59 -0
  785. data/spec/models/payment_method_paged_metadata_spec.rb +89 -0
  786. data/spec/models/payment_method_spec.rb +205 -0
  787. data/spec/models/payment_method_subscription_link_paged_metadata_spec.rb +89 -0
  788. data/spec/models/payment_method_subscription_link_spec.rb +107 -0
  789. data/spec/models/payment_paged_metadata_spec.rb +89 -0
  790. data/spec/models/payment_retry_request_spec.rb +59 -0
  791. data/spec/models/payment_spec.rb +157 -0
  792. data/spec/models/pending_component_value_change_spec.rb +71 -0
  793. data/spec/models/period_paged_metadata_spec.rb +89 -0
  794. data/spec/models/period_spec.rb +109 -0
  795. data/spec/models/permission_action_entity_paged_metadata_spec.rb +89 -0
  796. data/spec/models/permission_resource_entity_paged_metadata_spec.rb +89 -0
  797. data/spec/models/price_calculation_paged_metadata_spec.rb +89 -0
  798. data/spec/models/pricing_component_coupon_modifier_spec.rb +149 -0
  799. data/spec/models/pricing_component_migration_value_spec.rb +77 -0
  800. data/spec/models/pricing_component_paged_metadata_spec.rb +89 -0
  801. data/spec/models/pricing_component_quantity_request_spec.rb +65 -0
  802. data/spec/models/pricing_component_spec.rb +221 -0
  803. data/spec/models/pricing_component_tier_paged_metadata_spec.rb +89 -0
  804. data/spec/models/pricing_component_tier_spec.rb +123 -0
  805. data/spec/models/pricing_component_value_change_amendment_spec.rb +153 -0
  806. data/spec/models/pricing_component_value_change_paged_metadata_spec.rb +89 -0
  807. data/spec/models/pricing_component_value_migration_amendment_mapping_spec.rb +101 -0
  808. data/spec/models/pricing_component_value_paged_metadata_spec.rb +89 -0
  809. data/spec/models/pricing_component_value_request_spec.rb +85 -0
  810. data/spec/models/pricing_component_value_response_paged_metadata_spec.rb +89 -0
  811. data/spec/models/pricing_component_value_spec.rb +125 -0
  812. data/spec/models/product_coupon_modifier_spec.rb +149 -0
  813. data/spec/models/product_paged_metadata_spec.rb +89 -0
  814. data/spec/models/product_payments_result_paged_metadata_spec.rb +89 -0
  815. data/spec/models/product_rate_plan_migration_amendment_spec.rb +187 -0
  816. data/spec/models/product_rate_plan_paged_metadata_spec.rb +89 -0
  817. data/spec/models/product_rate_plan_payments_result_paged_metadata_spec.rb +89 -0
  818. data/spec/models/product_rate_plan_spec.rb +275 -0
  819. data/spec/models/product_spec.rb +167 -0
  820. data/spec/models/profile_paged_metadata_spec.rb +89 -0
  821. data/spec/models/profile_spec.rb +155 -0
  822. data/spec/models/quote_request_spec.rb +161 -0
  823. data/spec/models/quote_request_value_spec.rb +71 -0
  824. data/spec/models/recalculate_charge_request_spec.rb +103 -0
  825. data/spec/models/receipt_paged_metadata_spec.rb +89 -0
  826. data/spec/models/receipt_spec.rb +237 -0
  827. data/spec/models/refund_paged_metadata_spec.rb +89 -0
  828. data/spec/models/refund_spec.rb +227 -0
  829. data/spec/models/resume_request_spec.rb +65 -0
  830. data/spec/models/resume_subscription_amendment_spec.rb +131 -0
  831. data/spec/models/revenue_attribution_paged_metadata_spec.rb +89 -0
  832. data/spec/models/revenue_attribution_spec.rb +191 -0
  833. data/spec/models/revive_subscription_request_spec.rb +53 -0
  834. data/spec/models/role_paged_metadata_spec.rb +89 -0
  835. data/spec/models/role_spec.rb +119 -0
  836. data/spec/models/rule_satisfaction_spec.rb +71 -0
  837. data/spec/models/search_result_paged_metadata_spec.rb +89 -0
  838. data/spec/models/service_end_amendment_spec.rb +131 -0
  839. data/spec/models/stripe_ach_token_paged_metadata_spec.rb +89 -0
  840. data/spec/models/stripe_auth_capture_request_spec.rb +133 -0
  841. data/spec/models/stripe_object_spec.rb +47 -0
  842. data/spec/models/stripe_token_paged_metadata_spec.rb +89 -0
  843. data/spec/models/subscription_cancellation_paged_metadata_spec.rb +89 -0
  844. data/spec/models/subscription_charge_paged_metadata_spec.rb +89 -0
  845. data/spec/models/subscription_charge_spec.rb +217 -0
  846. data/spec/models/subscription_ltv_result_paged_metadata_spec.rb +89 -0
  847. data/spec/models/subscription_paged_metadata_spec.rb +89 -0
  848. data/spec/models/subscription_spec.rb +303 -0
  849. data/spec/models/swagger_type_list_inv_spec.rb +53 -0
  850. data/spec/models/swagger_type_list_spec.rb +59 -0
  851. data/spec/models/swagger_type_list_subs_spec.rb +59 -0
  852. data/spec/models/taxation_link_paged_metadata_spec.rb +89 -0
  853. data/spec/models/taxation_strategy_paged_metadata_spec.rb +89 -0
  854. data/spec/models/tiered_pricing_component_spec.rb +221 -0
  855. data/spec/models/tiered_volume_pricing_component_spec.rb +221 -0
  856. data/spec/models/time_request_spec.rb +105 -0
  857. data/spec/models/time_response_paged_metadata_spec.rb +89 -0
  858. data/spec/models/time_response_spec.rb +117 -0
  859. data/spec/models/time_zone_spec.rb +71 -0
  860. data/spec/models/timer_amendment_spec.rb +189 -0
  861. data/spec/models/tokenization_pre_auth_paged_metadata_spec.rb +89 -0
  862. data/spec/models/trust_commerce_token_paged_metadata_spec.rb +89 -0
  863. data/spec/models/unit_discount_spec.rb +71 -0
  864. data/spec/models/unit_of_measure_coupon_modifier_spec.rb +149 -0
  865. data/spec/models/unit_of_measure_paged_metadata_spec.rb +89 -0
  866. data/spec/models/unit_of_measure_spec.rb +101 -0
  867. data/spec/models/update_address_request_spec.rb +113 -0
  868. data/spec/models/update_component_value_amendment_spec.rb +155 -0
  869. data/spec/models/update_profile_request_spec.rb +137 -0
  870. data/spec/models/update_role_request_spec.rb +83 -0
  871. data/spec/models/update_subscription_request_spec.rb +109 -0
  872. data/spec/models/usage_paged_metadata_spec.rb +89 -0
  873. data/spec/models/usage_period_paged_metadata_spec.rb +89 -0
  874. data/spec/models/usage_rounding_strategy_paged_metadata_spec.rb +89 -0
  875. data/spec/models/usage_session_paged_metadata_spec.rb +89 -0
  876. data/spec/models/usage_session_spec.rb +135 -0
  877. data/spec/models/usage_spec.rb +165 -0
  878. data/spec/models/user_creation_request_spec.rb +107 -0
  879. data/spec/models/user_creation_response_paged_metadata_spec.rb +89 -0
  880. data/spec/models/user_paged_metadata_spec.rb +89 -0
  881. data/spec/models/user_spec.rb +131 -0
  882. data/spec/models/username_paged_metadata_spec.rb +89 -0
  883. data/spec/models/username_spec.rb +83 -0
  884. data/spec/models/webhook_paged_metadata_spec.rb +89 -0
  885. data/spec/spec_helper.rb +122 -0
  886. metadata +1401 -0
@@ -0,0 +1,3490 @@
1
+ =begin
2
+ #BillForward REST API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require "uri"
25
+
26
+ module BillForward
27
+ class SubscriptionsApi
28
+ attr_accessor :api_client
29
+
30
+ def initialize(api_client = ApiClient.default)
31
+ @api_client = api_client
32
+ end
33
+
34
+ # Creates a charge on the specified subscription.
35
+ # {\"nickname\":\"Add Charge\",\"response\":\"addChargeToSubscriptionRequest.html\",\"response\":\"addChargeToSubscription.html\"}
36
+ # @param subscription_id ID of the subscription.
37
+ # @param charge The charge request
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [SubscriptionChargePagedMetadata]
40
+ def add_charge_to_subscription(subscription_id, charge, opts = {})
41
+ data, _status_code, _headers = add_charge_to_subscription_with_http_info(subscription_id, charge, opts)
42
+ return data
43
+ end
44
+
45
+ # Creates a charge on the specified subscription.
46
+ # {\"nickname\":\"Add Charge\",\"response\":\"addChargeToSubscriptionRequest.html\",\"response\":\"addChargeToSubscription.html\"}
47
+ # @param subscription_id ID of the subscription.
48
+ # @param charge The charge request
49
+ # @param [Hash] opts the optional parameters
50
+ # @return [Array<(SubscriptionChargePagedMetadata, Fixnum, Hash)>] SubscriptionChargePagedMetadata data, response status code and response headers
51
+ def add_charge_to_subscription_with_http_info(subscription_id, charge, opts = {})
52
+ if @api_client.config.debugging
53
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.add_charge_to_subscription ..."
54
+ end
55
+ # verify the required parameter 'subscription_id' is set
56
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.add_charge_to_subscription" if subscription_id.nil?
57
+ # verify the required parameter 'charge' is set
58
+ fail ArgumentError, "Missing the required parameter 'charge' when calling SubscriptionsApi.add_charge_to_subscription" if charge.nil?
59
+ # resource path
60
+ local_var_path = "/subscriptions/{subscription-ID}/charge".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
61
+
62
+ # query parameters
63
+ query_params = {}
64
+
65
+ # header parameters
66
+ header_params = {}
67
+
68
+ # HTTP header 'Accept' (if needed)
69
+ local_header_accept = ['application/json']
70
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
71
+
72
+ # HTTP header 'Content-Type'
73
+ local_header_content_type = ['application/json']
74
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
75
+
76
+ # form parameters
77
+ form_params = {}
78
+
79
+ # http body (model)
80
+ post_body = @api_client.object_to_http_body(charge)
81
+ auth_names = []
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
83
+ :header_params => header_params,
84
+ :query_params => query_params,
85
+ :form_params => form_params,
86
+ :body => post_body,
87
+ :auth_names => auth_names,
88
+ :return_type => 'SubscriptionChargePagedMetadata')
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug "API called: SubscriptionsApi#add_charge_to_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Applies a coupon to a subscription.
96
+ # {\"nickname\":\"Apply coupon\", \"request\":\"addCouponCodeRequest.html\",\"response\":\"addCouponCodeResponse.html\"}
97
+ # @param subscription_id
98
+ # @param request Request containing the coupon code.
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [CouponPagedMetadata]
101
+ def add_coupon_to_subscription(subscription_id, request, opts = {})
102
+ data, _status_code, _headers = add_coupon_to_subscription_with_http_info(subscription_id, request, opts)
103
+ return data
104
+ end
105
+
106
+ # Applies a coupon to a subscription.
107
+ # {\&quot;nickname\&quot;:\&quot;Apply coupon\&quot;, \&quot;request\&quot;:\&quot;addCouponCodeRequest.html\&quot;,\&quot;response\&quot;:\&quot;addCouponCodeResponse.html\&quot;}
108
+ # @param subscription_id
109
+ # @param request Request containing the coupon code.
110
+ # @param [Hash] opts the optional parameters
111
+ # @return [Array<(CouponPagedMetadata, Fixnum, Hash)>] CouponPagedMetadata data, response status code and response headers
112
+ def add_coupon_to_subscription_with_http_info(subscription_id, request, opts = {})
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.add_coupon_to_subscription ..."
115
+ end
116
+ # verify the required parameter 'subscription_id' is set
117
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.add_coupon_to_subscription" if subscription_id.nil?
118
+ # verify the required parameter 'request' is set
119
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.add_coupon_to_subscription" if request.nil?
120
+ # resource path
121
+ local_var_path = "/subscriptions/{subscription-ID}/coupons".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
122
+
123
+ # query parameters
124
+ query_params = {}
125
+
126
+ # header parameters
127
+ header_params = {}
128
+
129
+ # HTTP header 'Accept' (if needed)
130
+ local_header_accept = ['application/json']
131
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
132
+
133
+ # HTTP header 'Content-Type'
134
+ local_header_content_type = ['application/json']
135
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
136
+
137
+ # form parameters
138
+ form_params = {}
139
+
140
+ # http body (model)
141
+ post_body = @api_client.object_to_http_body(request)
142
+ auth_names = []
143
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => 'CouponPagedMetadata')
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug "API called: SubscriptionsApi#add_coupon_to_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
152
+ end
153
+ return data, status_code, headers
154
+ end
155
+
156
+ # Creates a credit-note which may be used by only the specified subscription.
157
+ # {\"nickname\":\"Add Credit\",\"request\":\"addCreditNoteToSubscriptionRequest.html\", \"response\":\"addCreditNoteToSubscription.html\"}
158
+ # @param subscription_id ID of the subscription.
159
+ # @param credit_note The credit-note request
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [CreditNotePagedMetadata]
162
+ def add_credit_note_to_subscription(subscription_id, credit_note, opts = {})
163
+ data, _status_code, _headers = add_credit_note_to_subscription_with_http_info(subscription_id, credit_note, opts)
164
+ return data
165
+ end
166
+
167
+ # Creates a credit-note which may be used by only the specified subscription.
168
+ # {\&quot;nickname\&quot;:\&quot;Add Credit\&quot;,\&quot;request\&quot;:\&quot;addCreditNoteToSubscriptionRequest.html\&quot;, \&quot;response\&quot;:\&quot;addCreditNoteToSubscription.html\&quot;}
169
+ # @param subscription_id ID of the subscription.
170
+ # @param credit_note The credit-note request
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [Array<(CreditNotePagedMetadata, Fixnum, Hash)>] CreditNotePagedMetadata data, response status code and response headers
173
+ def add_credit_note_to_subscription_with_http_info(subscription_id, credit_note, opts = {})
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.add_credit_note_to_subscription ..."
176
+ end
177
+ # verify the required parameter 'subscription_id' is set
178
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.add_credit_note_to_subscription" if subscription_id.nil?
179
+ # verify the required parameter 'credit_note' is set
180
+ fail ArgumentError, "Missing the required parameter 'credit_note' when calling SubscriptionsApi.add_credit_note_to_subscription" if credit_note.nil?
181
+ # resource path
182
+ local_var_path = "/subscriptions/{subscription-ID}/credit".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
183
+
184
+ # query parameters
185
+ query_params = {}
186
+
187
+ # header parameters
188
+ header_params = {}
189
+
190
+ # HTTP header 'Accept' (if needed)
191
+ local_header_accept = ['application/json']
192
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
193
+
194
+ # HTTP header 'Content-Type'
195
+ local_header_content_type = ['application/json']
196
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
197
+
198
+ # form parameters
199
+ form_params = {}
200
+
201
+ # http body (model)
202
+ post_body = @api_client.object_to_http_body(credit_note)
203
+ auth_names = []
204
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
205
+ :header_params => header_params,
206
+ :query_params => query_params,
207
+ :form_params => form_params,
208
+ :body => post_body,
209
+ :auth_names => auth_names,
210
+ :return_type => 'CreditNotePagedMetadata')
211
+ if @api_client.config.debugging
212
+ @api_client.config.logger.debug "API called: SubscriptionsApi#add_credit_note_to_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
213
+ end
214
+ return data, status_code, headers
215
+ end
216
+
217
+ # Enables the payment method to pay invoices of this subscription.
218
+ # {\"nickname\":\"Add payment-method to subscription\",\"response\":\"addPaymentMethod.html\",\"request\":\"addPaymentMethod.request.html\"}
219
+ # @param subscription_id
220
+ # @param payment_method
221
+ # @param [Hash] opts the optional parameters
222
+ # @return [PaymentMethodPagedMetadata]
223
+ def add_payment_method_to_subscription(subscription_id, payment_method, opts = {})
224
+ data, _status_code, _headers = add_payment_method_to_subscription_with_http_info(subscription_id, payment_method, opts)
225
+ return data
226
+ end
227
+
228
+ # Enables the payment method to pay invoices of this subscription.
229
+ # {\&quot;nickname\&quot;:\&quot;Add payment-method to subscription\&quot;,\&quot;response\&quot;:\&quot;addPaymentMethod.html\&quot;,\&quot;request\&quot;:\&quot;addPaymentMethod.request.html\&quot;}
230
+ # @param subscription_id
231
+ # @param payment_method
232
+ # @param [Hash] opts the optional parameters
233
+ # @return [Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>] PaymentMethodPagedMetadata data, response status code and response headers
234
+ def add_payment_method_to_subscription_with_http_info(subscription_id, payment_method, opts = {})
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.add_payment_method_to_subscription ..."
237
+ end
238
+ # verify the required parameter 'subscription_id' is set
239
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.add_payment_method_to_subscription" if subscription_id.nil?
240
+ # verify the required parameter 'payment_method' is set
241
+ fail ArgumentError, "Missing the required parameter 'payment_method' when calling SubscriptionsApi.add_payment_method_to_subscription" if payment_method.nil?
242
+ # resource path
243
+ local_var_path = "/subscriptions/{subscription-ID}/payment-methods".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
244
+
245
+ # query parameters
246
+ query_params = {}
247
+
248
+ # header parameters
249
+ header_params = {}
250
+
251
+ # HTTP header 'Accept' (if needed)
252
+ local_header_accept = ['application/json']
253
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
254
+
255
+ # HTTP header 'Content-Type'
256
+ local_header_content_type = ['application/json']
257
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
258
+
259
+ # form parameters
260
+ form_params = {}
261
+
262
+ # http body (model)
263
+ post_body = @api_client.object_to_http_body(payment_method)
264
+ auth_names = []
265
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
266
+ :header_params => header_params,
267
+ :query_params => query_params,
268
+ :form_params => form_params,
269
+ :body => post_body,
270
+ :auth_names => auth_names,
271
+ :return_type => 'PaymentMethodPagedMetadata')
272
+ if @api_client.config.debugging
273
+ @api_client.config.logger.debug "API called: SubscriptionsApi#add_payment_method_to_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
274
+ end
275
+ return data, status_code, headers
276
+ end
277
+
278
+ # Advance the subscription through time.
279
+ # {\"nickname\":\"Advance\",\"request\":\"advanceSubscriptionRequest.html\",\"response\":\"advanceSubscription.html\"}
280
+ # @param subscription_id ID of the subscription.
281
+ # @param request The request
282
+ # @param [Hash] opts the optional parameters
283
+ # @return [TimeResponsePagedMetadata]
284
+ def advance_subscription(subscription_id, request, opts = {})
285
+ data, _status_code, _headers = advance_subscription_with_http_info(subscription_id, request, opts)
286
+ return data
287
+ end
288
+
289
+ # Advance the subscription through time.
290
+ # {\&quot;nickname\&quot;:\&quot;Advance\&quot;,\&quot;request\&quot;:\&quot;advanceSubscriptionRequest.html\&quot;,\&quot;response\&quot;:\&quot;advanceSubscription.html\&quot;}
291
+ # @param subscription_id ID of the subscription.
292
+ # @param request The request
293
+ # @param [Hash] opts the optional parameters
294
+ # @return [Array<(TimeResponsePagedMetadata, Fixnum, Hash)>] TimeResponsePagedMetadata data, response status code and response headers
295
+ def advance_subscription_with_http_info(subscription_id, request, opts = {})
296
+ if @api_client.config.debugging
297
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.advance_subscription ..."
298
+ end
299
+ # verify the required parameter 'subscription_id' is set
300
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.advance_subscription" if subscription_id.nil?
301
+ # verify the required parameter 'request' is set
302
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.advance_subscription" if request.nil?
303
+ # resource path
304
+ local_var_path = "/subscriptions/{subscription-ID}/advance".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
305
+
306
+ # query parameters
307
+ query_params = {}
308
+
309
+ # header parameters
310
+ header_params = {}
311
+
312
+ # HTTP header 'Accept' (if needed)
313
+ local_header_accept = ['application/json']
314
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
315
+
316
+ # HTTP header 'Content-Type'
317
+ local_header_content_type = ['application/json']
318
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
319
+
320
+ # form parameters
321
+ form_params = {}
322
+
323
+ # http body (model)
324
+ post_body = @api_client.object_to_http_body(request)
325
+ auth_names = []
326
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
327
+ :header_params => header_params,
328
+ :query_params => query_params,
329
+ :form_params => form_params,
330
+ :body => post_body,
331
+ :auth_names => auth_names,
332
+ :return_type => 'TimeResponsePagedMetadata')
333
+ if @api_client.config.debugging
334
+ @api_client.config.logger.debug "API called: SubscriptionsApi#advance_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
335
+ end
336
+ return data, status_code, headers
337
+ end
338
+
339
+ # Returns all available payment methods for the specified subscription. By default 10 values are returned. Records are returned in natural order.
340
+ # { \"nickname\" : \"List on subscription\",\"response\" : \"getAvailablePaymentMethods.html\"}
341
+ # @param subscription_id
342
+ # @param [Hash] opts the optional parameters
343
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
344
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
345
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
346
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to id)
347
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
348
+ # @return [PaymentMethodPagedMetadata]
349
+ def available_payment_methods_for_subscription(subscription_id, opts = {})
350
+ data, _status_code, _headers = available_payment_methods_for_subscription_with_http_info(subscription_id, opts)
351
+ return data
352
+ end
353
+
354
+ # Returns all available payment methods for the specified subscription. By default 10 values are returned. Records are returned in natural order.
355
+ # { \&quot;nickname\&quot; : \&quot;List on subscription\&quot;,\&quot;response\&quot; : \&quot;getAvailablePaymentMethods.html\&quot;}
356
+ # @param subscription_id
357
+ # @param [Hash] opts the optional parameters
358
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
359
+ # @option opts [Integer] :offset The offset from the first subscription to return.
360
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
361
+ # @option opts [String] :order_by Specify a field used to order the result set.
362
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
363
+ # @return [Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>] PaymentMethodPagedMetadata data, response status code and response headers
364
+ def available_payment_methods_for_subscription_with_http_info(subscription_id, opts = {})
365
+ if @api_client.config.debugging
366
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.available_payment_methods_for_subscription ..."
367
+ end
368
+ # verify the required parameter 'subscription_id' is set
369
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.available_payment_methods_for_subscription" if subscription_id.nil?
370
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
371
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
372
+ end
373
+ # resource path
374
+ local_var_path = "/subscriptions/{subscription-ID}/payment-methods".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
375
+
376
+ # query parameters
377
+ query_params = {}
378
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
379
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
380
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
381
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
382
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
383
+
384
+ # header parameters
385
+ header_params = {}
386
+
387
+ # HTTP header 'Accept' (if needed)
388
+ local_header_accept = ['application/json']
389
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
390
+
391
+ # HTTP header 'Content-Type'
392
+ local_header_content_type = ['text/plain', 'application/json']
393
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
394
+
395
+ # form parameters
396
+ form_params = {}
397
+
398
+ # http body (model)
399
+ post_body = nil
400
+ auth_names = []
401
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
402
+ :header_params => header_params,
403
+ :query_params => query_params,
404
+ :form_params => form_params,
405
+ :body => post_body,
406
+ :auth_names => auth_names,
407
+ :return_type => 'PaymentMethodPagedMetadata')
408
+ if @api_client.config.debugging
409
+ @api_client.config.logger.debug "API called: SubscriptionsApi#available_payment_methods_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
410
+ end
411
+ return data, status_code, headers
412
+ end
413
+
414
+ # Create multiple subscriptions.
415
+ # {\"nickname\":\"Create multiple subscriptions\",\"response\":\"createMultipleSubscriptionViaHelper.html\",\"request\":\"createMultipleSubscriptionViaHelper.request.html\"}
416
+ # @param request
417
+ # @param [Hash] opts the optional parameters
418
+ # @return [SubscriptionPagedMetadata]
419
+ def batch_create_subscriptions(request, opts = {})
420
+ data, _status_code, _headers = batch_create_subscriptions_with_http_info(request, opts)
421
+ return data
422
+ end
423
+
424
+ # Create multiple subscriptions.
425
+ # {\&quot;nickname\&quot;:\&quot;Create multiple subscriptions\&quot;,\&quot;response\&quot;:\&quot;createMultipleSubscriptionViaHelper.html\&quot;,\&quot;request\&quot;:\&quot;createMultipleSubscriptionViaHelper.request.html\&quot;}
426
+ # @param request
427
+ # @param [Hash] opts the optional parameters
428
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
429
+ def batch_create_subscriptions_with_http_info(request, opts = {})
430
+ if @api_client.config.debugging
431
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.batch_create_subscriptions ..."
432
+ end
433
+ # verify the required parameter 'request' is set
434
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.batch_create_subscriptions" if request.nil?
435
+ # resource path
436
+ local_var_path = "/subscriptions/batch".sub('{format}','json')
437
+
438
+ # query parameters
439
+ query_params = {}
440
+
441
+ # header parameters
442
+ header_params = {}
443
+
444
+ # HTTP header 'Accept' (if needed)
445
+ local_header_accept = ['application/json']
446
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
447
+
448
+ # HTTP header 'Content-Type'
449
+ local_header_content_type = ['application/json']
450
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
451
+
452
+ # form parameters
453
+ form_params = {}
454
+
455
+ # http body (model)
456
+ post_body = @api_client.object_to_http_body(request)
457
+ auth_names = []
458
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
459
+ :header_params => header_params,
460
+ :query_params => query_params,
461
+ :form_params => form_params,
462
+ :body => post_body,
463
+ :auth_names => auth_names,
464
+ :return_type => 'SubscriptionPagedMetadata')
465
+ if @api_client.config.debugging
466
+ @api_client.config.logger.debug "API called: SubscriptionsApi#batch_create_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
467
+ end
468
+ return data, status_code, headers
469
+ end
470
+
471
+ # Retires the subscription specified by the subscription-ID parameter. Retiring a subscription causes it to cancel based on the specified retirement settings for the product.
472
+ # {\"nickname\":\"Cancel subscription\",\"response\":\"deleteSubscription.html\",\"request\":\"deleteSubscriptionRequest.html\"}
473
+ # @param subscription_id
474
+ # @param subscription_cancellation The cancellation request
475
+ # @param [Hash] opts the optional parameters
476
+ # @return [SubscriptionCancellationPagedMetadata]
477
+ def cancel_subscription(subscription_id, subscription_cancellation, opts = {})
478
+ data, _status_code, _headers = cancel_subscription_with_http_info(subscription_id, subscription_cancellation, opts)
479
+ return data
480
+ end
481
+
482
+ # Retires the subscription specified by the subscription-ID parameter. Retiring a subscription causes it to cancel based on the specified retirement settings for the product.
483
+ # {\&quot;nickname\&quot;:\&quot;Cancel subscription\&quot;,\&quot;response\&quot;:\&quot;deleteSubscription.html\&quot;,\&quot;request\&quot;:\&quot;deleteSubscriptionRequest.html\&quot;}
484
+ # @param subscription_id
485
+ # @param subscription_cancellation The cancellation request
486
+ # @param [Hash] opts the optional parameters
487
+ # @return [Array<(SubscriptionCancellationPagedMetadata, Fixnum, Hash)>] SubscriptionCancellationPagedMetadata data, response status code and response headers
488
+ def cancel_subscription_with_http_info(subscription_id, subscription_cancellation, opts = {})
489
+ if @api_client.config.debugging
490
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.cancel_subscription ..."
491
+ end
492
+ # verify the required parameter 'subscription_id' is set
493
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.cancel_subscription" if subscription_id.nil?
494
+ # verify the required parameter 'subscription_cancellation' is set
495
+ fail ArgumentError, "Missing the required parameter 'subscription_cancellation' when calling SubscriptionsApi.cancel_subscription" if subscription_cancellation.nil?
496
+ # resource path
497
+ local_var_path = "/subscriptions/{subscription-ID}/cancel".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
498
+
499
+ # query parameters
500
+ query_params = {}
501
+
502
+ # header parameters
503
+ header_params = {}
504
+
505
+ # HTTP header 'Accept' (if needed)
506
+ local_header_accept = ['application/json']
507
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
508
+
509
+ # HTTP header 'Content-Type'
510
+ local_header_content_type = ['application/json']
511
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
512
+
513
+ # form parameters
514
+ form_params = {}
515
+
516
+ # http body (model)
517
+ post_body = @api_client.object_to_http_body(subscription_cancellation)
518
+ auth_names = []
519
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
520
+ :header_params => header_params,
521
+ :query_params => query_params,
522
+ :form_params => form_params,
523
+ :body => post_body,
524
+ :auth_names => auth_names,
525
+ :return_type => 'SubscriptionCancellationPagedMetadata')
526
+ if @api_client.config.debugging
527
+ @api_client.config.logger.debug "API called: SubscriptionsApi#cancel_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
528
+ end
529
+ return data, status_code, headers
530
+ end
531
+
532
+ # Create an aggregating subscription.
533
+ # {\"nickname\":\"Create aggregating subscription\",\"response\":\"createAggregatingSubscription.html\",\"request\":\"createAggregatingSubscription.request.html\"}
534
+ # @param request
535
+ # @param [Hash] opts the optional parameters
536
+ # @return [SubscriptionPagedMetadata]
537
+ def create_aggregating_subscription(request, opts = {})
538
+ data, _status_code, _headers = create_aggregating_subscription_with_http_info(request, opts)
539
+ return data
540
+ end
541
+
542
+ # Create an aggregating subscription.
543
+ # {\&quot;nickname\&quot;:\&quot;Create aggregating subscription\&quot;,\&quot;response\&quot;:\&quot;createAggregatingSubscription.html\&quot;,\&quot;request\&quot;:\&quot;createAggregatingSubscription.request.html\&quot;}
544
+ # @param request
545
+ # @param [Hash] opts the optional parameters
546
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
547
+ def create_aggregating_subscription_with_http_info(request, opts = {})
548
+ if @api_client.config.debugging
549
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.create_aggregating_subscription ..."
550
+ end
551
+ # verify the required parameter 'request' is set
552
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.create_aggregating_subscription" if request.nil?
553
+ # resource path
554
+ local_var_path = "/subscriptions/aggregating".sub('{format}','json')
555
+
556
+ # query parameters
557
+ query_params = {}
558
+
559
+ # header parameters
560
+ header_params = {}
561
+
562
+ # HTTP header 'Accept' (if needed)
563
+ local_header_accept = ['application/json']
564
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
565
+
566
+ # HTTP header 'Content-Type'
567
+ local_header_content_type = ['application/json']
568
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
569
+
570
+ # form parameters
571
+ form_params = {}
572
+
573
+ # http body (model)
574
+ post_body = @api_client.object_to_http_body(request)
575
+ auth_names = []
576
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
577
+ :header_params => header_params,
578
+ :query_params => query_params,
579
+ :form_params => form_params,
580
+ :body => post_body,
581
+ :auth_names => auth_names,
582
+ :return_type => 'SubscriptionPagedMetadata')
583
+ if @api_client.config.debugging
584
+ @api_client.config.logger.debug "API called: SubscriptionsApi#create_aggregating_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
585
+ end
586
+ return data, status_code, headers
587
+ end
588
+
589
+ # Create a new subscription.
590
+ # {\"nickname\":\"Create a new subscription\",\"request\":\"createSubscriptionRequest.html\",\"response\":\"createSubscriptionResponse.html\"}
591
+ # @param subscription The subscription object to be updated.
592
+ # @param [Hash] opts the optional parameters
593
+ # @return [SubscriptionPagedMetadata]
594
+ def create_subscription(subscription, opts = {})
595
+ data, _status_code, _headers = create_subscription_with_http_info(subscription, opts)
596
+ return data
597
+ end
598
+
599
+ # Create a new subscription.
600
+ # {\&quot;nickname\&quot;:\&quot;Create a new subscription\&quot;,\&quot;request\&quot;:\&quot;createSubscriptionRequest.html\&quot;,\&quot;response\&quot;:\&quot;createSubscriptionResponse.html\&quot;}
601
+ # @param subscription The subscription object to be updated.
602
+ # @param [Hash] opts the optional parameters
603
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
604
+ def create_subscription_with_http_info(subscription, opts = {})
605
+ if @api_client.config.debugging
606
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.create_subscription ..."
607
+ end
608
+ # verify the required parameter 'subscription' is set
609
+ fail ArgumentError, "Missing the required parameter 'subscription' when calling SubscriptionsApi.create_subscription" if subscription.nil?
610
+ # resource path
611
+ local_var_path = "/subscriptions".sub('{format}','json')
612
+
613
+ # query parameters
614
+ query_params = {}
615
+
616
+ # header parameters
617
+ header_params = {}
618
+
619
+ # HTTP header 'Accept' (if needed)
620
+ local_header_accept = ['text/xml', 'application/xml', 'application/json']
621
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
622
+
623
+ # HTTP header 'Content-Type'
624
+ local_header_content_type = ['application/json']
625
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
626
+
627
+ # form parameters
628
+ form_params = {}
629
+
630
+ # http body (model)
631
+ post_body = @api_client.object_to_http_body(subscription)
632
+ auth_names = []
633
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
634
+ :header_params => header_params,
635
+ :query_params => query_params,
636
+ :form_params => form_params,
637
+ :body => post_body,
638
+ :auth_names => auth_names,
639
+ :return_type => 'SubscriptionPagedMetadata')
640
+ if @api_client.config.debugging
641
+ @api_client.config.logger.debug "API called: SubscriptionsApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
642
+ end
643
+ return data, status_code, headers
644
+ end
645
+
646
+ # Create a subscription (V2).
647
+ # {\"nickname\":\"Create a subscription (V2)\",\"response\":\"createSubscriptionViaHelper.html\",\"request\":\"createSubscriptionViaHelper.request.html\"}
648
+ # @param request
649
+ # @param [Hash] opts the optional parameters
650
+ # @return [SubscriptionPagedMetadata]
651
+ def create_subscription_v2(request, opts = {})
652
+ data, _status_code, _headers = create_subscription_v2_with_http_info(request, opts)
653
+ return data
654
+ end
655
+
656
+ # Create a subscription (V2).
657
+ # {\&quot;nickname\&quot;:\&quot;Create a subscription (V2)\&quot;,\&quot;response\&quot;:\&quot;createSubscriptionViaHelper.html\&quot;,\&quot;request\&quot;:\&quot;createSubscriptionViaHelper.request.html\&quot;}
658
+ # @param request
659
+ # @param [Hash] opts the optional parameters
660
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
661
+ def create_subscription_v2_with_http_info(request, opts = {})
662
+ if @api_client.config.debugging
663
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.create_subscription_v2 ..."
664
+ end
665
+ # verify the required parameter 'request' is set
666
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.create_subscription_v2" if request.nil?
667
+ # resource path
668
+ local_var_path = "/subscriptions/create".sub('{format}','json')
669
+
670
+ # query parameters
671
+ query_params = {}
672
+
673
+ # header parameters
674
+ header_params = {}
675
+
676
+ # HTTP header 'Accept' (if needed)
677
+ local_header_accept = ['application/json']
678
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
679
+
680
+ # HTTP header 'Content-Type'
681
+ local_header_content_type = ['application/json']
682
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
683
+
684
+ # form parameters
685
+ form_params = {}
686
+
687
+ # http body (model)
688
+ post_body = @api_client.object_to_http_body(request)
689
+ auth_names = []
690
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
691
+ :header_params => header_params,
692
+ :query_params => query_params,
693
+ :form_params => form_params,
694
+ :body => post_body,
695
+ :auth_names => auth_names,
696
+ :return_type => 'SubscriptionPagedMetadata')
697
+ if @api_client.config.debugging
698
+ @api_client.config.logger.debug "API called: SubscriptionsApi#create_subscription_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
699
+ end
700
+ return data, status_code, headers
701
+ end
702
+
703
+ # Create a timer for a subscription event.
704
+ # {\"nickname\":\"Create Timer\",\"response\":\"createSubscriptionTimer.html\",\"request\":\"createSubscriptionTimer.request.html\"}
705
+ # @param subscription_id
706
+ # @param request
707
+ # @param [Hash] opts the optional parameters
708
+ # @return [TimerAmendment]
709
+ def create_timer(subscription_id, request, opts = {})
710
+ data, _status_code, _headers = create_timer_with_http_info(subscription_id, request, opts)
711
+ return data
712
+ end
713
+
714
+ # Create a timer for a subscription event.
715
+ # {\&quot;nickname\&quot;:\&quot;Create Timer\&quot;,\&quot;response\&quot;:\&quot;createSubscriptionTimer.html\&quot;,\&quot;request\&quot;:\&quot;createSubscriptionTimer.request.html\&quot;}
716
+ # @param subscription_id
717
+ # @param request
718
+ # @param [Hash] opts the optional parameters
719
+ # @return [Array<(TimerAmendment, Fixnum, Hash)>] TimerAmendment data, response status code and response headers
720
+ def create_timer_with_http_info(subscription_id, request, opts = {})
721
+ if @api_client.config.debugging
722
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.create_timer ..."
723
+ end
724
+ # verify the required parameter 'subscription_id' is set
725
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.create_timer" if subscription_id.nil?
726
+ # verify the required parameter 'request' is set
727
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.create_timer" if request.nil?
728
+ # resource path
729
+ local_var_path = "/subscriptions/{subscription-ID}/timer".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
730
+
731
+ # query parameters
732
+ query_params = {}
733
+
734
+ # header parameters
735
+ header_params = {}
736
+
737
+ # HTTP header 'Accept' (if needed)
738
+ local_header_accept = ['application/json']
739
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
740
+
741
+ # HTTP header 'Content-Type'
742
+ local_header_content_type = ['application/json']
743
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
744
+
745
+ # form parameters
746
+ form_params = {}
747
+
748
+ # http body (model)
749
+ post_body = @api_client.object_to_http_body(request)
750
+ auth_names = []
751
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
752
+ :header_params => header_params,
753
+ :query_params => query_params,
754
+ :form_params => form_params,
755
+ :body => post_body,
756
+ :auth_names => auth_names,
757
+ :return_type => 'TimerAmendment')
758
+ if @api_client.config.debugging
759
+ @api_client.config.logger.debug "API called: SubscriptionsApi#create_timer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
760
+ end
761
+ return data, status_code, headers
762
+ end
763
+
764
+ # Remove any associated metadata.
765
+ # {\"nickname\":\"Clear from subscription\",\"request\" :\"deleteSubscriptionMetadataRequest.html\",\"response\":\"deleteSubscriptionMetadataResponse.html\"}
766
+ # @param subscription_id
767
+ # @param [Hash] opts the optional parameters
768
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
769
+ # @return [DynamicMetadata]
770
+ def delete_metadata_for_subscription(subscription_id, opts = {})
771
+ data, _status_code, _headers = delete_metadata_for_subscription_with_http_info(subscription_id, opts)
772
+ return data
773
+ end
774
+
775
+ # Remove any associated metadata.
776
+ # {\&quot;nickname\&quot;:\&quot;Clear from subscription\&quot;,\&quot;request\&quot; :\&quot;deleteSubscriptionMetadataRequest.html\&quot;,\&quot;response\&quot;:\&quot;deleteSubscriptionMetadataResponse.html\&quot;}
777
+ # @param subscription_id
778
+ # @param [Hash] opts the optional parameters
779
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
780
+ # @return [Array<(DynamicMetadata, Fixnum, Hash)>] DynamicMetadata data, response status code and response headers
781
+ def delete_metadata_for_subscription_with_http_info(subscription_id, opts = {})
782
+ if @api_client.config.debugging
783
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.delete_metadata_for_subscription ..."
784
+ end
785
+ # verify the required parameter 'subscription_id' is set
786
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.delete_metadata_for_subscription" if subscription_id.nil?
787
+ # resource path
788
+ local_var_path = "/subscriptions/{subscription-ID}/metadata".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
789
+
790
+ # query parameters
791
+ query_params = {}
792
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
793
+
794
+ # header parameters
795
+ header_params = {}
796
+
797
+ # HTTP header 'Accept' (if needed)
798
+ local_header_accept = ['application/json']
799
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
800
+
801
+ # HTTP header 'Content-Type'
802
+ local_header_content_type = ['text/plain', 'application/json']
803
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
804
+
805
+ # form parameters
806
+ form_params = {}
807
+
808
+ # http body (model)
809
+ post_body = nil
810
+ auth_names = []
811
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
812
+ :header_params => header_params,
813
+ :query_params => query_params,
814
+ :form_params => form_params,
815
+ :body => post_body,
816
+ :auth_names => auth_names,
817
+ :return_type => 'DynamicMetadata')
818
+ if @api_client.config.debugging
819
+ @api_client.config.logger.debug "API called: SubscriptionsApi#delete_metadata_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
820
+ end
821
+ return data, status_code, headers
822
+ end
823
+
824
+ # Freeze the subscription.
825
+ # {\"nickname\":\"Freeze\",\"request\":\"freezeSubscriptionRequest.html\",\"response\":\"freezeSubscription.html\"}
826
+ # @param subscription_id ID of the subscription.
827
+ # @param request The request
828
+ # @param [Hash] opts the optional parameters
829
+ # @return [SubscriptionPagedMetadata]
830
+ def freeze_subscription(subscription_id, request, opts = {})
831
+ data, _status_code, _headers = freeze_subscription_with_http_info(subscription_id, request, opts)
832
+ return data
833
+ end
834
+
835
+ # Freeze the subscription.
836
+ # {\&quot;nickname\&quot;:\&quot;Freeze\&quot;,\&quot;request\&quot;:\&quot;freezeSubscriptionRequest.html\&quot;,\&quot;response\&quot;:\&quot;freezeSubscription.html\&quot;}
837
+ # @param subscription_id ID of the subscription.
838
+ # @param request The request
839
+ # @param [Hash] opts the optional parameters
840
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
841
+ def freeze_subscription_with_http_info(subscription_id, request, opts = {})
842
+ if @api_client.config.debugging
843
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.freeze_subscription ..."
844
+ end
845
+ # verify the required parameter 'subscription_id' is set
846
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.freeze_subscription" if subscription_id.nil?
847
+ # verify the required parameter 'request' is set
848
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.freeze_subscription" if request.nil?
849
+ # resource path
850
+ local_var_path = "/subscriptions/{subscription-ID}/freeze".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
851
+
852
+ # query parameters
853
+ query_params = {}
854
+
855
+ # header parameters
856
+ header_params = {}
857
+
858
+ # HTTP header 'Accept' (if needed)
859
+ local_header_accept = ['application/json']
860
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
861
+
862
+ # HTTP header 'Content-Type'
863
+ local_header_content_type = ['application/json']
864
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
865
+
866
+ # form parameters
867
+ form_params = {}
868
+
869
+ # http body (model)
870
+ post_body = @api_client.object_to_http_body(request)
871
+ auth_names = []
872
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
873
+ :header_params => header_params,
874
+ :query_params => query_params,
875
+ :form_params => form_params,
876
+ :body => post_body,
877
+ :auth_names => auth_names,
878
+ :return_type => 'SubscriptionPagedMetadata')
879
+ if @api_client.config.debugging
880
+ @api_client.config.logger.debug "API called: SubscriptionsApi#freeze_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
881
+ end
882
+ return data, status_code, headers
883
+ end
884
+
885
+ # Retrieves a collection of all subscriptions. By default 10 values are returned. Records are returned in natural order.
886
+ # {\"nickname\":\"Retrieve all subscriptions\",\"response\":\"getSubscriptionAll.html\"}
887
+ # @param [Hash] opts the optional parameters
888
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
889
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
890
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
891
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
892
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
893
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
894
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded. (default to true)
895
+ # @option opts [String] :metadata
896
+ # @option opts [BOOLEAN] :exclude_service_ended
897
+ # @option opts [Array<String>] :account_id A list of accountIDs to filter subscriptions on
898
+ # @return [SubscriptionPagedMetadata]
899
+ def get_all_subscriptions(opts = {})
900
+ data, _status_code, _headers = get_all_subscriptions_with_http_info(opts)
901
+ return data
902
+ end
903
+
904
+ # Retrieves a collection of all subscriptions. By default 10 values are returned. Records are returned in natural order.
905
+ # {\&quot;nickname\&quot;:\&quot;Retrieve all subscriptions\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionAll.html\&quot;}
906
+ # @param [Hash] opts the optional parameters
907
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
908
+ # @option opts [Integer] :offset The offset from the first subscription to return.
909
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
910
+ # @option opts [String] :order_by Specify a field used to order the result set.
911
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
912
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
913
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded.
914
+ # @option opts [String] :metadata
915
+ # @option opts [BOOLEAN] :exclude_service_ended
916
+ # @option opts [Array<String>] :account_id A list of accountIDs to filter subscriptions on
917
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
918
+ def get_all_subscriptions_with_http_info(opts = {})
919
+ if @api_client.config.debugging
920
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_all_subscriptions ..."
921
+ end
922
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
923
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
924
+ end
925
+ # resource path
926
+ local_var_path = "/subscriptions".sub('{format}','json')
927
+
928
+ # query parameters
929
+ query_params = {}
930
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
931
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
932
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
933
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
934
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
935
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
936
+ query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?
937
+ query_params[:'metadata'] = opts[:'metadata'] if !opts[:'metadata'].nil?
938
+ query_params[:'exclude_service_ended'] = opts[:'exclude_service_ended'] if !opts[:'exclude_service_ended'].nil?
939
+ query_params[:'accountID'] = @api_client.build_collection_param(opts[:'account_id'], :multi) if !opts[:'account_id'].nil?
940
+
941
+ # header parameters
942
+ header_params = {}
943
+
944
+ # HTTP header 'Accept' (if needed)
945
+ local_header_accept = ['application/json']
946
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
947
+
948
+ # HTTP header 'Content-Type'
949
+ local_header_content_type = ['text/plain', 'application/json']
950
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
951
+
952
+ # form parameters
953
+ form_params = {}
954
+
955
+ # http body (model)
956
+ post_body = nil
957
+ auth_names = []
958
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
959
+ :header_params => header_params,
960
+ :query_params => query_params,
961
+ :form_params => form_params,
962
+ :body => post_body,
963
+ :auth_names => auth_names,
964
+ :return_type => 'SubscriptionPagedMetadata')
965
+ if @api_client.config.debugging
966
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_all_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
967
+ end
968
+ return data, status_code, headers
969
+ end
970
+
971
+ # Retrieves a collection of the coupons which can be applied to this subscription.
972
+ # { \"nickname\" : \"Retrieve applicable coupons\",\"response\" : \"getApplicableCoupons.html\" }
973
+ # @param subscription_id ID of the subscription.
974
+ # @param [Hash] opts the optional parameters
975
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
976
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
977
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
978
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
979
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
980
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
981
+ # @return [CouponPagedMetadata]
982
+ def get_applicable_coupons_for_subscription(subscription_id, opts = {})
983
+ data, _status_code, _headers = get_applicable_coupons_for_subscription_with_http_info(subscription_id, opts)
984
+ return data
985
+ end
986
+
987
+ # Retrieves a collection of the coupons which can be applied to this subscription.
988
+ # { \&quot;nickname\&quot; : \&quot;Retrieve applicable coupons\&quot;,\&quot;response\&quot; : \&quot;getApplicableCoupons.html\&quot; }
989
+ # @param subscription_id ID of the subscription.
990
+ # @param [Hash] opts the optional parameters
991
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
992
+ # @option opts [Integer] :offset The offset from the first subscription to return.
993
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
994
+ # @option opts [String] :order_by Specify a field used to order the result set.
995
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
996
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
997
+ # @return [Array<(CouponPagedMetadata, Fixnum, Hash)>] CouponPagedMetadata data, response status code and response headers
998
+ def get_applicable_coupons_for_subscription_with_http_info(subscription_id, opts = {})
999
+ if @api_client.config.debugging
1000
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_applicable_coupons_for_subscription ..."
1001
+ end
1002
+ # verify the required parameter 'subscription_id' is set
1003
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_applicable_coupons_for_subscription" if subscription_id.nil?
1004
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1005
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1006
+ end
1007
+ # resource path
1008
+ local_var_path = "/subscriptions/{subscription-ID}/applicable-coupons".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1009
+
1010
+ # query parameters
1011
+ query_params = {}
1012
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1013
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1014
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1015
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1016
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1017
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1018
+
1019
+ # header parameters
1020
+ header_params = {}
1021
+
1022
+ # HTTP header 'Accept' (if needed)
1023
+ local_header_accept = ['application/json']
1024
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1025
+
1026
+ # HTTP header 'Content-Type'
1027
+ local_header_content_type = ['text/plain', 'application/json']
1028
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1029
+
1030
+ # form parameters
1031
+ form_params = {}
1032
+
1033
+ # http body (model)
1034
+ post_body = nil
1035
+ auth_names = []
1036
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1037
+ :header_params => header_params,
1038
+ :query_params => query_params,
1039
+ :form_params => form_params,
1040
+ :body => post_body,
1041
+ :auth_names => auth_names,
1042
+ :return_type => 'CouponPagedMetadata')
1043
+ if @api_client.config.debugging
1044
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_applicable_coupons_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1045
+ end
1046
+ return data, status_code, headers
1047
+ end
1048
+
1049
+ # Returns all available credit-notes for the specified subscription. By default 10 values are returned. Records are returned in natural order.
1050
+ # {\"nickname\":\"Get available credit\",\"response\":\"getAvailableCreditSubscription.html\"}
1051
+ # @param subscription_id
1052
+ # @param [Hash] opts the optional parameters
1053
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1054
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
1055
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
1056
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to id)
1057
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1058
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1059
+ # @return [CreditNotePagedMetadata]
1060
+ def get_available_credit_subscription(subscription_id, opts = {})
1061
+ data, _status_code, _headers = get_available_credit_subscription_with_http_info(subscription_id, opts)
1062
+ return data
1063
+ end
1064
+
1065
+ # Returns all available credit-notes for the specified subscription. By default 10 values are returned. Records are returned in natural order.
1066
+ # {\&quot;nickname\&quot;:\&quot;Get available credit\&quot;,\&quot;response\&quot;:\&quot;getAvailableCreditSubscription.html\&quot;}
1067
+ # @param subscription_id
1068
+ # @param [Hash] opts the optional parameters
1069
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1070
+ # @option opts [Integer] :offset The offset from the first subscription to return.
1071
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
1072
+ # @option opts [String] :order_by Specify a field used to order the result set.
1073
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1074
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1075
+ # @return [Array<(CreditNotePagedMetadata, Fixnum, Hash)>] CreditNotePagedMetadata data, response status code and response headers
1076
+ def get_available_credit_subscription_with_http_info(subscription_id, opts = {})
1077
+ if @api_client.config.debugging
1078
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_available_credit_subscription ..."
1079
+ end
1080
+ # verify the required parameter 'subscription_id' is set
1081
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_available_credit_subscription" if subscription_id.nil?
1082
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1083
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1084
+ end
1085
+ # resource path
1086
+ local_var_path = "/subscriptions/{subscription-ID}/credit".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1087
+
1088
+ # query parameters
1089
+ query_params = {}
1090
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1091
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1092
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1093
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1094
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1095
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1096
+
1097
+ # header parameters
1098
+ header_params = {}
1099
+
1100
+ # HTTP header 'Accept' (if needed)
1101
+ local_header_accept = ['application/json']
1102
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1103
+
1104
+ # HTTP header 'Content-Type'
1105
+ local_header_content_type = ['text/plain', 'application/json']
1106
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1107
+
1108
+ # form parameters
1109
+ form_params = {}
1110
+
1111
+ # http body (model)
1112
+ post_body = nil
1113
+ auth_names = []
1114
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1115
+ :header_params => header_params,
1116
+ :query_params => query_params,
1117
+ :form_params => form_params,
1118
+ :body => post_body,
1119
+ :auth_names => auth_names,
1120
+ :return_type => 'CreditNotePagedMetadata')
1121
+ if @api_client.config.debugging
1122
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_available_credit_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1123
+ end
1124
+ return data, status_code, headers
1125
+ end
1126
+
1127
+ # Returns all charges for the specified subscription. By default 10 values are returned. Records are returned in natural order.
1128
+ # {\"nickname\":\"Get charges\",\"response\":\"getChargesSubscription.html\"}
1129
+ # @param subscription_id
1130
+ # @param [Hash] opts the optional parameters
1131
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1132
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
1133
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
1134
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
1135
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1136
+ # @option opts [String] :state Ihe direction of any ordering, either ASC or DESC.
1137
+ # @option opts [String] :type Ihe direction of any ordering, either ASC or DESC.
1138
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1139
+ # @return [SubscriptionChargePagedMetadata]
1140
+ def get_charges_on_subscription(subscription_id, opts = {})
1141
+ data, _status_code, _headers = get_charges_on_subscription_with_http_info(subscription_id, opts)
1142
+ return data
1143
+ end
1144
+
1145
+ # Returns all charges for the specified subscription. By default 10 values are returned. Records are returned in natural order.
1146
+ # {\&quot;nickname\&quot;:\&quot;Get charges\&quot;,\&quot;response\&quot;:\&quot;getChargesSubscription.html\&quot;}
1147
+ # @param subscription_id
1148
+ # @param [Hash] opts the optional parameters
1149
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1150
+ # @option opts [Integer] :offset The offset from the first subscription to return.
1151
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
1152
+ # @option opts [String] :order_by Specify a field used to order the result set.
1153
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1154
+ # @option opts [String] :state Ihe direction of any ordering, either ASC or DESC.
1155
+ # @option opts [String] :type Ihe direction of any ordering, either ASC or DESC.
1156
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1157
+ # @return [Array<(SubscriptionChargePagedMetadata, Fixnum, Hash)>] SubscriptionChargePagedMetadata data, response status code and response headers
1158
+ def get_charges_on_subscription_with_http_info(subscription_id, opts = {})
1159
+ if @api_client.config.debugging
1160
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_charges_on_subscription ..."
1161
+ end
1162
+ # verify the required parameter 'subscription_id' is set
1163
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_charges_on_subscription" if subscription_id.nil?
1164
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1165
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1166
+ end
1167
+ if opts[:'state'] && !['Voided', 'Pending', 'AwaitingPayment', 'Paid', 'Failed'].include?(opts[:'state'])
1168
+ fail ArgumentError, 'invalid value for "state", must be one of Voided, Pending, AwaitingPayment, Paid, Failed'
1169
+ end
1170
+ if opts[:'type'] && !['Setup', 'Upgrade', 'Manual', 'ProductRatePlanMigration', 'Arrears', 'Advance', 'Coupon', 'Usage', 'PricingComponent'].include?(opts[:'type'])
1171
+ fail ArgumentError, 'invalid value for "type", must be one of Setup, Upgrade, Manual, ProductRatePlanMigration, Arrears, Advance, Coupon, Usage, PricingComponent'
1172
+ end
1173
+ # resource path
1174
+ local_var_path = "/subscriptions/{subscription-ID}/charges".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1175
+
1176
+ # query parameters
1177
+ query_params = {}
1178
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1179
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1180
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1181
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1182
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1183
+ query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
1184
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
1185
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1186
+
1187
+ # header parameters
1188
+ header_params = {}
1189
+
1190
+ # HTTP header 'Accept' (if needed)
1191
+ local_header_accept = ['application/json']
1192
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1193
+
1194
+ # HTTP header 'Content-Type'
1195
+ local_header_content_type = ['text/plain', 'application/json']
1196
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1197
+
1198
+ # form parameters
1199
+ form_params = {}
1200
+
1201
+ # http body (model)
1202
+ post_body = nil
1203
+ auth_names = []
1204
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1205
+ :header_params => header_params,
1206
+ :query_params => query_params,
1207
+ :form_params => form_params,
1208
+ :body => post_body,
1209
+ :auth_names => auth_names,
1210
+ :return_type => 'SubscriptionChargePagedMetadata')
1211
+ if @api_client.config.debugging
1212
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_charges_on_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1213
+ end
1214
+ return data, status_code, headers
1215
+ end
1216
+
1217
+ # Return all entities whose invoices will be aggregated by the specified subscription By default 10 values are returned. Records are returned in natural order.
1218
+ # {\"nickname\":\"Get Aggregated Entities\",\"response\":\"getAggregatedEntities.html\"}
1219
+ # @param subscription_id
1220
+ # @param [Hash] opts the optional parameters
1221
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1222
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
1223
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
1224
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
1225
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1226
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1227
+ # @return [SubscriptionPagedMetadata]
1228
+ def get_children_of_subscription(subscription_id, opts = {})
1229
+ data, _status_code, _headers = get_children_of_subscription_with_http_info(subscription_id, opts)
1230
+ return data
1231
+ end
1232
+
1233
+ # Return all entities whose invoices will be aggregated by the specified subscription By default 10 values are returned. Records are returned in natural order.
1234
+ # {\&quot;nickname\&quot;:\&quot;Get Aggregated Entities\&quot;,\&quot;response\&quot;:\&quot;getAggregatedEntities.html\&quot;}
1235
+ # @param subscription_id
1236
+ # @param [Hash] opts the optional parameters
1237
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1238
+ # @option opts [Integer] :offset The offset from the first subscription to return.
1239
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
1240
+ # @option opts [String] :order_by Specify a field used to order the result set.
1241
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1242
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1243
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
1244
+ def get_children_of_subscription_with_http_info(subscription_id, opts = {})
1245
+ if @api_client.config.debugging
1246
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_children_of_subscription ..."
1247
+ end
1248
+ # verify the required parameter 'subscription_id' is set
1249
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_children_of_subscription" if subscription_id.nil?
1250
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1251
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1252
+ end
1253
+ # resource path
1254
+ local_var_path = "/subscriptions/{subscription-ID}/children".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1255
+
1256
+ # query parameters
1257
+ query_params = {}
1258
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1259
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1260
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1261
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1262
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1263
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1264
+
1265
+ # header parameters
1266
+ header_params = {}
1267
+
1268
+ # HTTP header 'Accept' (if needed)
1269
+ local_header_accept = ['application/json']
1270
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1271
+
1272
+ # HTTP header 'Content-Type'
1273
+ local_header_content_type = ['text/plain', 'application/json']
1274
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1275
+
1276
+ # form parameters
1277
+ form_params = {}
1278
+
1279
+ # http body (model)
1280
+ post_body = nil
1281
+ auth_names = []
1282
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1283
+ :header_params => header_params,
1284
+ :query_params => query_params,
1285
+ :form_params => form_params,
1286
+ :body => post_body,
1287
+ :auth_names => auth_names,
1288
+ :return_type => 'SubscriptionPagedMetadata')
1289
+ if @api_client.config.debugging
1290
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_children_of_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1291
+ end
1292
+ return data, status_code, headers
1293
+ end
1294
+
1295
+ # Retrieves a collection of the coupons and the unique codes currently applied to the subscription.
1296
+ # {\"nickname\":\"Retrieve coupons\",\"response\":\"getCoupons.html\"}
1297
+ # @param subscription_id ID of the subscription.
1298
+ # @param [Hash] opts the optional parameters
1299
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1300
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
1301
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
1302
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
1303
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1304
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1305
+ # @return [CouponPagedMetadata]
1306
+ def get_coupons_on_subscription(subscription_id, opts = {})
1307
+ data, _status_code, _headers = get_coupons_on_subscription_with_http_info(subscription_id, opts)
1308
+ return data
1309
+ end
1310
+
1311
+ # Retrieves a collection of the coupons and the unique codes currently applied to the subscription.
1312
+ # {\&quot;nickname\&quot;:\&quot;Retrieve coupons\&quot;,\&quot;response\&quot;:\&quot;getCoupons.html\&quot;}
1313
+ # @param subscription_id ID of the subscription.
1314
+ # @param [Hash] opts the optional parameters
1315
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1316
+ # @option opts [Integer] :offset The offset from the first subscription to return.
1317
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
1318
+ # @option opts [String] :order_by Specify a field used to order the result set.
1319
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1320
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1321
+ # @return [Array<(CouponPagedMetadata, Fixnum, Hash)>] CouponPagedMetadata data, response status code and response headers
1322
+ def get_coupons_on_subscription_with_http_info(subscription_id, opts = {})
1323
+ if @api_client.config.debugging
1324
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_coupons_on_subscription ..."
1325
+ end
1326
+ # verify the required parameter 'subscription_id' is set
1327
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_coupons_on_subscription" if subscription_id.nil?
1328
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1329
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1330
+ end
1331
+ # resource path
1332
+ local_var_path = "/subscriptions/{subscription-ID}/coupons".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1333
+
1334
+ # query parameters
1335
+ query_params = {}
1336
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1337
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1338
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1339
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1340
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1341
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1342
+
1343
+ # header parameters
1344
+ header_params = {}
1345
+
1346
+ # HTTP header 'Accept' (if needed)
1347
+ local_header_accept = ['application/json']
1348
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1349
+
1350
+ # HTTP header 'Content-Type'
1351
+ local_header_content_type = ['text/plain', 'application/json']
1352
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1353
+
1354
+ # form parameters
1355
+ form_params = {}
1356
+
1357
+ # http body (model)
1358
+ post_body = nil
1359
+ auth_names = []
1360
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1361
+ :header_params => header_params,
1362
+ :query_params => query_params,
1363
+ :form_params => form_params,
1364
+ :body => post_body,
1365
+ :auth_names => auth_names,
1366
+ :return_type => 'CouponPagedMetadata')
1367
+ if @api_client.config.debugging
1368
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_coupons_on_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1369
+ end
1370
+ return data, status_code, headers
1371
+ end
1372
+
1373
+ # Retrieves a collection of invoice objects of the specified state for the given subscription. By default 10 values are returned. Records are returned in natural order.
1374
+ # {\"nickname\":\"Retrieve invoices by state for subscription\",\"response\":\"getInvoicesForSubscriptionByState.html\"}
1375
+ # @param subscription_id The unique id of the subscription.
1376
+ # @param state The state of the invoices to retrieve.
1377
+ # @param [Hash] opts the optional parameters
1378
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1379
+ # @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0)
1380
+ # @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10)
1381
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
1382
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1383
+ # @return [InvoicePagedMetadata]
1384
+ def get_invoices_for_subscription_by_state(subscription_id, state, opts = {})
1385
+ data, _status_code, _headers = get_invoices_for_subscription_by_state_with_http_info(subscription_id, state, opts)
1386
+ return data
1387
+ end
1388
+
1389
+ # Retrieves a collection of invoice objects of the specified state for the given subscription. By default 10 values are returned. Records are returned in natural order.
1390
+ # {\&quot;nickname\&quot;:\&quot;Retrieve invoices by state for subscription\&quot;,\&quot;response\&quot;:\&quot;getInvoicesForSubscriptionByState.html\&quot;}
1391
+ # @param subscription_id The unique id of the subscription.
1392
+ # @param state The state of the invoices to retrieve.
1393
+ # @param [Hash] opts the optional parameters
1394
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1395
+ # @option opts [Integer] :offset The offset from the first taxation-link to return.
1396
+ # @option opts [Integer] :records The maximum number of taxation-links to return.
1397
+ # @option opts [String] :order_by Specify a field used to order the result set.
1398
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1399
+ # @return [Array<(InvoicePagedMetadata, Fixnum, Hash)>] InvoicePagedMetadata data, response status code and response headers
1400
+ def get_invoices_for_subscription_by_state_with_http_info(subscription_id, state, opts = {})
1401
+ if @api_client.config.debugging
1402
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_invoices_for_subscription_by_state ..."
1403
+ end
1404
+ # verify the required parameter 'subscription_id' is set
1405
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_invoices_for_subscription_by_state" if subscription_id.nil?
1406
+ # verify the required parameter 'state' is set
1407
+ fail ArgumentError, "Missing the required parameter 'state' when calling SubscriptionsApi.get_invoices_for_subscription_by_state" if state.nil?
1408
+ # verify enum value
1409
+ unless ['Paid', 'Unpaid', 'Pending', 'Voided'].include?(state)
1410
+ fail ArgumentError, "invalid value for 'state', must be one of Paid, Unpaid, Pending, Voided"
1411
+ end
1412
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1413
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1414
+ end
1415
+ # resource path
1416
+ local_var_path = "/subscriptions/{subscriptionID}/invoices/{state}".sub('{format}','json').sub('{' + 'subscriptionID' + '}', subscription_id.to_s).sub('{' + 'state' + '}', state.to_s)
1417
+
1418
+ # query parameters
1419
+ query_params = {}
1420
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1421
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1422
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1423
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1424
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1425
+
1426
+ # header parameters
1427
+ header_params = {}
1428
+
1429
+ # HTTP header 'Accept' (if needed)
1430
+ local_header_accept = ['application/json']
1431
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1432
+
1433
+ # HTTP header 'Content-Type'
1434
+ local_header_content_type = ['text/plain', 'application/json']
1435
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1436
+
1437
+ # form parameters
1438
+ form_params = {}
1439
+
1440
+ # http body (model)
1441
+ post_body = nil
1442
+ auth_names = []
1443
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1444
+ :header_params => header_params,
1445
+ :query_params => query_params,
1446
+ :form_params => form_params,
1447
+ :body => post_body,
1448
+ :auth_names => auth_names,
1449
+ :return_type => 'InvoicePagedMetadata')
1450
+ if @api_client.config.debugging
1451
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_invoices_for_subscription_by_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1452
+ end
1453
+ return data, status_code, headers
1454
+ end
1455
+
1456
+ # Retrieve any associated metadata.
1457
+ # {\"nickname\":\"Retrieve on subscription\",\"request\":\"getSubscriptionMetadataRequest.html\",\"response\":\"getSubscriptionMetadataResponse.html\"}
1458
+ # @param subscription_id
1459
+ # @param [Hash] opts the optional parameters
1460
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1461
+ # @return [DynamicMetadata]
1462
+ def get_metadata_for_subscription(subscription_id, opts = {})
1463
+ data, _status_code, _headers = get_metadata_for_subscription_with_http_info(subscription_id, opts)
1464
+ return data
1465
+ end
1466
+
1467
+ # Retrieve any associated metadata.
1468
+ # {\&quot;nickname\&quot;:\&quot;Retrieve on subscription\&quot;,\&quot;request\&quot;:\&quot;getSubscriptionMetadataRequest.html\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionMetadataResponse.html\&quot;}
1469
+ # @param subscription_id
1470
+ # @param [Hash] opts the optional parameters
1471
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1472
+ # @return [Array<(DynamicMetadata, Fixnum, Hash)>] DynamicMetadata data, response status code and response headers
1473
+ def get_metadata_for_subscription_with_http_info(subscription_id, opts = {})
1474
+ if @api_client.config.debugging
1475
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_metadata_for_subscription ..."
1476
+ end
1477
+ # verify the required parameter 'subscription_id' is set
1478
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_metadata_for_subscription" if subscription_id.nil?
1479
+ # resource path
1480
+ local_var_path = "/subscriptions/{subscription-ID}/metadata".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1481
+
1482
+ # query parameters
1483
+ query_params = {}
1484
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1485
+
1486
+ # header parameters
1487
+ header_params = {}
1488
+
1489
+ # HTTP header 'Accept' (if needed)
1490
+ local_header_accept = ['application/json']
1491
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1492
+
1493
+ # HTTP header 'Content-Type'
1494
+ local_header_content_type = ['text/plain', 'application/json']
1495
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1496
+
1497
+ # form parameters
1498
+ form_params = {}
1499
+
1500
+ # http body (model)
1501
+ post_body = nil
1502
+ auth_names = []
1503
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1504
+ :header_params => header_params,
1505
+ :query_params => query_params,
1506
+ :form_params => form_params,
1507
+ :body => post_body,
1508
+ :auth_names => auth_names,
1509
+ :return_type => 'DynamicMetadata')
1510
+ if @api_client.config.debugging
1511
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_metadata_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1512
+ end
1513
+ return data, status_code, headers
1514
+ end
1515
+
1516
+ # Return the parent of the given subscription.
1517
+ # {\"nickname\":\"Get parent\",\"response\":\"getParentSubscription.html\"}
1518
+ # @param subscription_id
1519
+ # @param [Hash] opts the optional parameters
1520
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1521
+ # @return [SubscriptionPagedMetadata]
1522
+ def get_parent_subscription(subscription_id, opts = {})
1523
+ data, _status_code, _headers = get_parent_subscription_with_http_info(subscription_id, opts)
1524
+ return data
1525
+ end
1526
+
1527
+ # Return the parent of the given subscription.
1528
+ # {\&quot;nickname\&quot;:\&quot;Get parent\&quot;,\&quot;response\&quot;:\&quot;getParentSubscription.html\&quot;}
1529
+ # @param subscription_id
1530
+ # @param [Hash] opts the optional parameters
1531
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1532
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
1533
+ def get_parent_subscription_with_http_info(subscription_id, opts = {})
1534
+ if @api_client.config.debugging
1535
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_parent_subscription ..."
1536
+ end
1537
+ # verify the required parameter 'subscription_id' is set
1538
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_parent_subscription" if subscription_id.nil?
1539
+ # resource path
1540
+ local_var_path = "/subscriptions/{subscription-ID}/parent".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1541
+
1542
+ # query parameters
1543
+ query_params = {}
1544
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1545
+
1546
+ # header parameters
1547
+ header_params = {}
1548
+
1549
+ # HTTP header 'Accept' (if needed)
1550
+ local_header_accept = ['application/json']
1551
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1552
+
1553
+ # HTTP header 'Content-Type'
1554
+ local_header_content_type = ['text/plain', 'application/json']
1555
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1556
+
1557
+ # form parameters
1558
+ form_params = {}
1559
+
1560
+ # http body (model)
1561
+ post_body = nil
1562
+ auth_names = []
1563
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1564
+ :header_params => header_params,
1565
+ :query_params => query_params,
1566
+ :form_params => form_params,
1567
+ :body => post_body,
1568
+ :auth_names => auth_names,
1569
+ :return_type => 'SubscriptionPagedMetadata')
1570
+ if @api_client.config.debugging
1571
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_parent_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1572
+ end
1573
+ return data, status_code, headers
1574
+ end
1575
+
1576
+ # Gets the subscription's current pricing-component values.
1577
+ # {\"nickname\":\"Get values\",\"response\":\"getPricingComponentValues.html\"}
1578
+ # @param subscription_id ID of the subscription.
1579
+ # @param [Hash] opts the optional parameters
1580
+ # @return [PricingComponentValuePagedMetadata]
1581
+ def get_pricing_component_values_of_subscription(subscription_id, opts = {})
1582
+ data, _status_code, _headers = get_pricing_component_values_of_subscription_with_http_info(subscription_id, opts)
1583
+ return data
1584
+ end
1585
+
1586
+ # Gets the subscription&#39;s current pricing-component values.
1587
+ # {\&quot;nickname\&quot;:\&quot;Get values\&quot;,\&quot;response\&quot;:\&quot;getPricingComponentValues.html\&quot;}
1588
+ # @param subscription_id ID of the subscription.
1589
+ # @param [Hash] opts the optional parameters
1590
+ # @return [Array<(PricingComponentValuePagedMetadata, Fixnum, Hash)>] PricingComponentValuePagedMetadata data, response status code and response headers
1591
+ def get_pricing_component_values_of_subscription_with_http_info(subscription_id, opts = {})
1592
+ if @api_client.config.debugging
1593
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_pricing_component_values_of_subscription ..."
1594
+ end
1595
+ # verify the required parameter 'subscription_id' is set
1596
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_pricing_component_values_of_subscription" if subscription_id.nil?
1597
+ # resource path
1598
+ local_var_path = "/subscriptions/{subscription-ID}/values".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1599
+
1600
+ # query parameters
1601
+ query_params = {}
1602
+
1603
+ # header parameters
1604
+ header_params = {}
1605
+
1606
+ # HTTP header 'Accept' (if needed)
1607
+ local_header_accept = ['application/json']
1608
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1609
+
1610
+ # HTTP header 'Content-Type'
1611
+ local_header_content_type = ['text/plain', 'application/json']
1612
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1613
+
1614
+ # form parameters
1615
+ form_params = {}
1616
+
1617
+ # http body (model)
1618
+ post_body = nil
1619
+ auth_names = []
1620
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
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 => 'PricingComponentValuePagedMetadata')
1627
+ if @api_client.config.debugging
1628
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_pricing_component_values_of_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1629
+ end
1630
+ return data, status_code, headers
1631
+ end
1632
+
1633
+ # Retrieves a collection of subscriptions, specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order.
1634
+ # {\"nickname\":\"Retrieve by account\",\"response\":\"getSubscriptionByAccount.html\"}
1635
+ # @param account_id
1636
+ # @param [Hash] opts the optional parameters
1637
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1638
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
1639
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
1640
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to id)
1641
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1642
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1643
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded. (default to true)
1644
+ # @return [SubscriptionPagedMetadata]
1645
+ def get_subscription_by_account_id(account_id, opts = {})
1646
+ data, _status_code, _headers = get_subscription_by_account_id_with_http_info(account_id, opts)
1647
+ return data
1648
+ end
1649
+
1650
+ # Retrieves a collection of subscriptions, specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order.
1651
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by account\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByAccount.html\&quot;}
1652
+ # @param account_id
1653
+ # @param [Hash] opts the optional parameters
1654
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1655
+ # @option opts [Integer] :offset The offset from the first subscription to return.
1656
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
1657
+ # @option opts [String] :order_by Specify a field used to order the result set.
1658
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1659
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1660
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded.
1661
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
1662
+ def get_subscription_by_account_id_with_http_info(account_id, opts = {})
1663
+ if @api_client.config.debugging
1664
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_account_id ..."
1665
+ end
1666
+ # verify the required parameter 'account_id' is set
1667
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling SubscriptionsApi.get_subscription_by_account_id" if account_id.nil?
1668
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1669
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1670
+ end
1671
+ # resource path
1672
+ local_var_path = "/subscriptions/account/{account-ID}".sub('{format}','json').sub('{' + 'account-ID' + '}', account_id.to_s)
1673
+
1674
+ # query parameters
1675
+ query_params = {}
1676
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1677
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1678
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1679
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1680
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1681
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1682
+ query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?
1683
+
1684
+ # header parameters
1685
+ header_params = {}
1686
+
1687
+ # HTTP header 'Accept' (if needed)
1688
+ local_header_accept = ['application/json']
1689
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1690
+
1691
+ # HTTP header 'Content-Type'
1692
+ local_header_content_type = ['text/plain', 'application/json']
1693
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1694
+
1695
+ # form parameters
1696
+ form_params = {}
1697
+
1698
+ # http body (model)
1699
+ post_body = nil
1700
+ auth_names = []
1701
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1702
+ :header_params => header_params,
1703
+ :query_params => query_params,
1704
+ :form_params => form_params,
1705
+ :body => post_body,
1706
+ :auth_names => auth_names,
1707
+ :return_type => 'SubscriptionPagedMetadata')
1708
+ if @api_client.config.debugging
1709
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_account_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1710
+ end
1711
+ return data, status_code, headers
1712
+ end
1713
+
1714
+ # Retrieves a single subscription, specified by the ID parameter.
1715
+ # {\"nickname\":\"Retrieve an existing subscription\",\"response\":\"getSubscriptionByID.html\"}
1716
+ # @param subscription_id
1717
+ # @param [Hash] opts the optional parameters
1718
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1719
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1720
+ # @return [SubscriptionPagedMetadata]
1721
+ def get_subscription_by_id(subscription_id, opts = {})
1722
+ data, _status_code, _headers = get_subscription_by_id_with_http_info(subscription_id, opts)
1723
+ return data
1724
+ end
1725
+
1726
+ # Retrieves a single subscription, specified by the ID parameter.
1727
+ # {\&quot;nickname\&quot;:\&quot;Retrieve an existing subscription\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByID.html\&quot;}
1728
+ # @param subscription_id
1729
+ # @param [Hash] opts the optional parameters
1730
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1731
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1732
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
1733
+ def get_subscription_by_id_with_http_info(subscription_id, opts = {})
1734
+ if @api_client.config.debugging
1735
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_id ..."
1736
+ end
1737
+ # verify the required parameter 'subscription_id' is set
1738
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_subscription_by_id" if subscription_id.nil?
1739
+ # resource path
1740
+ local_var_path = "/subscriptions/{subscription-ID}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
1741
+
1742
+ # query parameters
1743
+ query_params = {}
1744
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1745
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1746
+
1747
+ # header parameters
1748
+ header_params = {}
1749
+
1750
+ # HTTP header 'Accept' (if needed)
1751
+ local_header_accept = ['application/json']
1752
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1753
+
1754
+ # HTTP header 'Content-Type'
1755
+ local_header_content_type = ['text/plain', 'application/json']
1756
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1757
+
1758
+ # form parameters
1759
+ form_params = {}
1760
+
1761
+ # http body (model)
1762
+ post_body = nil
1763
+ auth_names = []
1764
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1765
+ :header_params => header_params,
1766
+ :query_params => query_params,
1767
+ :form_params => form_params,
1768
+ :body => post_body,
1769
+ :auth_names => auth_names,
1770
+ :return_type => 'SubscriptionPagedMetadata')
1771
+ if @api_client.config.debugging
1772
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1773
+ end
1774
+ return data, status_code, headers
1775
+ end
1776
+
1777
+ # Retrieves a collection of subscriptions, specified by the product-ID parameter. By default 10 values are returned. Records are returned in natural order.
1778
+ # {\"nickname\":\"Retrieve by product\",\"response\":\"getSubscriptionByProduct.html\"}
1779
+ # @param product_id ID of the product
1780
+ # @param [Hash] opts the optional parameters
1781
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1782
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
1783
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
1784
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to id)
1785
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1786
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1787
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded. (default to true)
1788
+ # @return [SubscriptionPagedMetadata]
1789
+ def get_subscription_by_product_id(product_id, opts = {})
1790
+ data, _status_code, _headers = get_subscription_by_product_id_with_http_info(product_id, opts)
1791
+ return data
1792
+ end
1793
+
1794
+ # Retrieves a collection of subscriptions, specified by the product-ID parameter. By default 10 values are returned. Records are returned in natural order.
1795
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by product\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByProduct.html\&quot;}
1796
+ # @param product_id ID of the product
1797
+ # @param [Hash] opts the optional parameters
1798
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1799
+ # @option opts [Integer] :offset The offset from the first subscription to return.
1800
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
1801
+ # @option opts [String] :order_by Specify a field used to order the result set.
1802
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1803
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1804
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded.
1805
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
1806
+ def get_subscription_by_product_id_with_http_info(product_id, opts = {})
1807
+ if @api_client.config.debugging
1808
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_product_id ..."
1809
+ end
1810
+ # verify the required parameter 'product_id' is set
1811
+ fail ArgumentError, "Missing the required parameter 'product_id' when calling SubscriptionsApi.get_subscription_by_product_id" if product_id.nil?
1812
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1813
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1814
+ end
1815
+ # resource path
1816
+ local_var_path = "/subscriptions/product/{product-ID}".sub('{format}','json').sub('{' + 'product-ID' + '}', product_id.to_s)
1817
+
1818
+ # query parameters
1819
+ query_params = {}
1820
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1821
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1822
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1823
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1824
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1825
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1826
+ query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?
1827
+
1828
+ # header parameters
1829
+ header_params = {}
1830
+
1831
+ # HTTP header 'Accept' (if needed)
1832
+ local_header_accept = ['application/json']
1833
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1834
+
1835
+ # HTTP header 'Content-Type'
1836
+ local_header_content_type = ['text/plain', 'application/json']
1837
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1838
+
1839
+ # form parameters
1840
+ form_params = {}
1841
+
1842
+ # http body (model)
1843
+ post_body = nil
1844
+ auth_names = []
1845
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1846
+ :header_params => header_params,
1847
+ :query_params => query_params,
1848
+ :form_params => form_params,
1849
+ :body => post_body,
1850
+ :auth_names => auth_names,
1851
+ :return_type => 'SubscriptionPagedMetadata')
1852
+ if @api_client.config.debugging
1853
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_product_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1854
+ end
1855
+ return data, status_code, headers
1856
+ end
1857
+
1858
+ # Retrieves a collection of subscriptions, specified by the product-rate-plan-ID parameter. By default 10 values are returned. Records are returned in natural order.
1859
+ # {\"nickname\":\"Retrieve by rate-plan\",\"response\":\"getSubscriptionByProductRatePlan.html\"}
1860
+ # @param product_rate_plan_id
1861
+ # @param [Hash] opts the optional parameters
1862
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1863
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
1864
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
1865
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to id)
1866
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1867
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1868
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded. (default to true)
1869
+ # @return [SubscriptionPagedMetadata]
1870
+ def get_subscription_by_product_rate_plan_id(product_rate_plan_id, opts = {})
1871
+ data, _status_code, _headers = get_subscription_by_product_rate_plan_id_with_http_info(product_rate_plan_id, opts)
1872
+ return data
1873
+ end
1874
+
1875
+ # Retrieves a collection of subscriptions, specified by the product-rate-plan-ID parameter. By default 10 values are returned. Records are returned in natural order.
1876
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by rate-plan\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByProductRatePlan.html\&quot;}
1877
+ # @param product_rate_plan_id
1878
+ # @param [Hash] opts the optional parameters
1879
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1880
+ # @option opts [Integer] :offset The offset from the first subscription to return.
1881
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
1882
+ # @option opts [String] :order_by Specify a field used to order the result set.
1883
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1884
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1885
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded.
1886
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
1887
+ def get_subscription_by_product_rate_plan_id_with_http_info(product_rate_plan_id, opts = {})
1888
+ if @api_client.config.debugging
1889
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_product_rate_plan_id ..."
1890
+ end
1891
+ # verify the required parameter 'product_rate_plan_id' is set
1892
+ fail ArgumentError, "Missing the required parameter 'product_rate_plan_id' when calling SubscriptionsApi.get_subscription_by_product_rate_plan_id" if product_rate_plan_id.nil?
1893
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1894
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1895
+ end
1896
+ # resource path
1897
+ local_var_path = "/subscriptions/product-rate-plan/{product-rate-plan-ID}".sub('{format}','json').sub('{' + 'product-rate-plan-ID' + '}', product_rate_plan_id.to_s)
1898
+
1899
+ # query parameters
1900
+ query_params = {}
1901
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1902
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1903
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1904
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1905
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1906
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1907
+ query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?
1908
+
1909
+ # header parameters
1910
+ header_params = {}
1911
+
1912
+ # HTTP header 'Accept' (if needed)
1913
+ local_header_accept = ['application/json']
1914
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
1915
+
1916
+ # HTTP header 'Content-Type'
1917
+ local_header_content_type = ['text/plain', 'application/json']
1918
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
1919
+
1920
+ # form parameters
1921
+ form_params = {}
1922
+
1923
+ # http body (model)
1924
+ post_body = nil
1925
+ auth_names = []
1926
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1927
+ :header_params => header_params,
1928
+ :query_params => query_params,
1929
+ :form_params => form_params,
1930
+ :body => post_body,
1931
+ :auth_names => auth_names,
1932
+ :return_type => 'SubscriptionPagedMetadata')
1933
+ if @api_client.config.debugging
1934
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_product_rate_plan_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1935
+ end
1936
+ return data, status_code, headers
1937
+ end
1938
+
1939
+ # Retrieves a collection of subscriptions, specified by the state parameter. By default 10 values are returned. Records are returned in natural order.
1940
+ # {\"nickname\":\"Retrieve by state\",\"response\":\"getSubscriptionByState.html\"}
1941
+ # @param state The current state of the subscription, either Provisioned, AwaitingPayment, Paid or Cancelled
1942
+ # @param [Hash] opts the optional parameters
1943
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1944
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
1945
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
1946
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to id)
1947
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
1948
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned. (default to false)
1949
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded. (default to true)
1950
+ # @return [SubscriptionPagedMetadata]
1951
+ def get_subscription_by_state(state, opts = {})
1952
+ data, _status_code, _headers = get_subscription_by_state_with_http_info(state, opts)
1953
+ return data
1954
+ end
1955
+
1956
+ # Retrieves a collection of subscriptions, specified by the state parameter. By default 10 values are returned. Records are returned in natural order.
1957
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by state\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByState.html\&quot;}
1958
+ # @param state The current state of the subscription, either Provisioned, AwaitingPayment, Paid or Cancelled
1959
+ # @param [Hash] opts the optional parameters
1960
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
1961
+ # @option opts [Integer] :offset The offset from the first subscription to return.
1962
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
1963
+ # @option opts [String] :order_by Specify a field used to order the result set.
1964
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
1965
+ # @option opts [BOOLEAN] :include_retired Whether retired subscriptions should be returned.
1966
+ # @option opts [BOOLEAN] :exclude_children Should child subscriptiosn be excluded.
1967
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
1968
+ def get_subscription_by_state_with_http_info(state, opts = {})
1969
+ if @api_client.config.debugging
1970
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_state ..."
1971
+ end
1972
+ # verify the required parameter 'state' is set
1973
+ fail ArgumentError, "Missing the required parameter 'state' when calling SubscriptionsApi.get_subscription_by_state" if state.nil?
1974
+ # verify enum value
1975
+ unless ['Trial', 'Provisioned', 'Paid', 'AwaitingPayment', 'Cancelled', 'Failed', 'Expired'].include?(state)
1976
+ fail ArgumentError, "invalid value for 'state', must be one of Trial, Provisioned, Paid, AwaitingPayment, Cancelled, Failed, Expired"
1977
+ end
1978
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
1979
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
1980
+ end
1981
+ # resource path
1982
+ local_var_path = "/subscriptions/state/{state}".sub('{format}','json').sub('{' + 'state' + '}', state.to_s)
1983
+
1984
+ # query parameters
1985
+ query_params = {}
1986
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
1987
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1988
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
1989
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
1990
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
1991
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
1992
+ query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?
1993
+
1994
+ # header parameters
1995
+ header_params = {}
1996
+
1997
+ # HTTP header 'Accept' (if needed)
1998
+ local_header_accept = ['application/json']
1999
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2000
+
2001
+ # HTTP header 'Content-Type'
2002
+ local_header_content_type = ['text/plain', 'application/json']
2003
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2004
+
2005
+ # form parameters
2006
+ form_params = {}
2007
+
2008
+ # http body (model)
2009
+ post_body = nil
2010
+ auth_names = []
2011
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2012
+ :header_params => header_params,
2013
+ :query_params => query_params,
2014
+ :form_params => form_params,
2015
+ :body => post_body,
2016
+ :auth_names => auth_names,
2017
+ :return_type => 'SubscriptionPagedMetadata')
2018
+ if @api_client.config.debugging
2019
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2020
+ end
2021
+ return data, status_code, headers
2022
+ end
2023
+
2024
+ # Retrieves a single subscription, specified by the version-ID parameter.
2025
+ # {\"nickname\":\"Retrieve by version\",\"response\":\"getSubscriptionByVersionID.html\"}
2026
+ # @param version_id The version-ID of the subscription.
2027
+ # @param [Hash] opts the optional parameters
2028
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2029
+ # @return [SubscriptionPagedMetadata]
2030
+ def get_subscription_by_version_id(version_id, opts = {})
2031
+ data, _status_code, _headers = get_subscription_by_version_id_with_http_info(version_id, opts)
2032
+ return data
2033
+ end
2034
+
2035
+ # Retrieves a single subscription, specified by the version-ID parameter.
2036
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by version\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByVersionID.html\&quot;}
2037
+ # @param version_id The version-ID of the subscription.
2038
+ # @param [Hash] opts the optional parameters
2039
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2040
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
2041
+ def get_subscription_by_version_id_with_http_info(version_id, opts = {})
2042
+ if @api_client.config.debugging
2043
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_version_id ..."
2044
+ end
2045
+ # verify the required parameter 'version_id' is set
2046
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling SubscriptionsApi.get_subscription_by_version_id" if version_id.nil?
2047
+ # resource path
2048
+ local_var_path = "/subscriptions/version/{version-ID}".sub('{format}','json').sub('{' + 'version-ID' + '}', version_id.to_s)
2049
+
2050
+ # query parameters
2051
+ query_params = {}
2052
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2053
+
2054
+ # header parameters
2055
+ header_params = {}
2056
+
2057
+ # HTTP header 'Accept' (if needed)
2058
+ local_header_accept = ['application/json']
2059
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2060
+
2061
+ # HTTP header 'Content-Type'
2062
+ local_header_content_type = ['text/plain', 'application/json']
2063
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2064
+
2065
+ # form parameters
2066
+ form_params = {}
2067
+
2068
+ # http body (model)
2069
+ post_body = nil
2070
+ auth_names = []
2071
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2072
+ :header_params => header_params,
2073
+ :query_params => query_params,
2074
+ :form_params => form_params,
2075
+ :body => post_body,
2076
+ :auth_names => auth_names,
2077
+ :return_type => 'SubscriptionPagedMetadata')
2078
+ if @api_client.config.debugging
2079
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_version_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2080
+ end
2081
+ return data, status_code, headers
2082
+ end
2083
+
2084
+ # Retrieves a collection of subscription objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order.
2085
+ # {\"nickname\":\"Retrieve by initial period-start\",\"response\":\"getSubscriptionByInitialPeriodStart.html\"}
2086
+ # @param lower_threshold The UTC DateTime specifying the start of the result period.
2087
+ # @param upper_threshold The UTC DateTime specifying the end of the result period.
2088
+ # @param [Hash] opts the optional parameters
2089
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2090
+ # @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0)
2091
+ # @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10)
2092
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
2093
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
2094
+ # @return [SubscriptionPagedMetadata]
2095
+ def get_subscriptions_by_initial_period_start(lower_threshold, upper_threshold, opts = {})
2096
+ data, _status_code, _headers = get_subscriptions_by_initial_period_start_with_http_info(lower_threshold, upper_threshold, opts)
2097
+ return data
2098
+ end
2099
+
2100
+ # Retrieves a collection of subscription objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order.
2101
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by initial period-start\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByInitialPeriodStart.html\&quot;}
2102
+ # @param lower_threshold The UTC DateTime specifying the start of the result period.
2103
+ # @param upper_threshold The UTC DateTime specifying the end of the result period.
2104
+ # @param [Hash] opts the optional parameters
2105
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2106
+ # @option opts [Integer] :offset The offset from the first taxation-link to return.
2107
+ # @option opts [Integer] :records The maximum number of taxation-links to return.
2108
+ # @option opts [String] :order_by Specify a field used to order the result set.
2109
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
2110
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
2111
+ def get_subscriptions_by_initial_period_start_with_http_info(lower_threshold, upper_threshold, opts = {})
2112
+ if @api_client.config.debugging
2113
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscriptions_by_initial_period_start ..."
2114
+ end
2115
+ # verify the required parameter 'lower_threshold' is set
2116
+ fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling SubscriptionsApi.get_subscriptions_by_initial_period_start" if lower_threshold.nil?
2117
+ # verify the required parameter 'upper_threshold' is set
2118
+ fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling SubscriptionsApi.get_subscriptions_by_initial_period_start" if upper_threshold.nil?
2119
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
2120
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
2121
+ end
2122
+ # resource path
2123
+ local_var_path = "/subscriptions/initial-period-start/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)
2124
+
2125
+ # query parameters
2126
+ query_params = {}
2127
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2128
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
2129
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
2130
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
2131
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
2132
+
2133
+ # header parameters
2134
+ header_params = {}
2135
+
2136
+ # HTTP header 'Accept' (if needed)
2137
+ local_header_accept = ['application/json']
2138
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2139
+
2140
+ # HTTP header 'Content-Type'
2141
+ local_header_content_type = ['text/plain', 'application/json']
2142
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2143
+
2144
+ # form parameters
2145
+ form_params = {}
2146
+
2147
+ # http body (model)
2148
+ post_body = nil
2149
+ auth_names = []
2150
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2151
+ :header_params => header_params,
2152
+ :query_params => query_params,
2153
+ :form_params => form_params,
2154
+ :body => post_body,
2155
+ :auth_names => auth_names,
2156
+ :return_type => 'SubscriptionPagedMetadata')
2157
+ if @api_client.config.debugging
2158
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions_by_initial_period_start\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2159
+ end
2160
+ return data, status_code, headers
2161
+ end
2162
+
2163
+ # Retrieves a collection of subscription objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order.
2164
+ # {\"nickname\":\"Retrieve by period-end\",\"response\":\"getSubscriptionByPeriodEnd.html\"}
2165
+ # @param lower_threshold The UTC DateTime specifying the start of the result period.
2166
+ # @param upper_threshold The UTC DateTime specifying the end of the result period.
2167
+ # @param [Hash] opts the optional parameters
2168
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2169
+ # @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0)
2170
+ # @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10)
2171
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
2172
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
2173
+ # @return [SubscriptionPagedMetadata]
2174
+ def get_subscriptions_by_period_end(lower_threshold, upper_threshold, opts = {})
2175
+ data, _status_code, _headers = get_subscriptions_by_period_end_with_http_info(lower_threshold, upper_threshold, opts)
2176
+ return data
2177
+ end
2178
+
2179
+ # Retrieves a collection of subscription objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order.
2180
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by period-end\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByPeriodEnd.html\&quot;}
2181
+ # @param lower_threshold The UTC DateTime specifying the start of the result period.
2182
+ # @param upper_threshold The UTC DateTime specifying the end of the result period.
2183
+ # @param [Hash] opts the optional parameters
2184
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2185
+ # @option opts [Integer] :offset The offset from the first taxation-link to return.
2186
+ # @option opts [Integer] :records The maximum number of taxation-links to return.
2187
+ # @option opts [String] :order_by Specify a field used to order the result set.
2188
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
2189
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
2190
+ def get_subscriptions_by_period_end_with_http_info(lower_threshold, upper_threshold, opts = {})
2191
+ if @api_client.config.debugging
2192
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscriptions_by_period_end ..."
2193
+ end
2194
+ # verify the required parameter 'lower_threshold' is set
2195
+ fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling SubscriptionsApi.get_subscriptions_by_period_end" if lower_threshold.nil?
2196
+ # verify the required parameter 'upper_threshold' is set
2197
+ fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling SubscriptionsApi.get_subscriptions_by_period_end" if upper_threshold.nil?
2198
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
2199
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
2200
+ end
2201
+ # resource path
2202
+ local_var_path = "/subscriptions/period-end/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)
2203
+
2204
+ # query parameters
2205
+ query_params = {}
2206
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2207
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
2208
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
2209
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
2210
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
2211
+
2212
+ # header parameters
2213
+ header_params = {}
2214
+
2215
+ # HTTP header 'Accept' (if needed)
2216
+ local_header_accept = ['application/json']
2217
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2218
+
2219
+ # HTTP header 'Content-Type'
2220
+ local_header_content_type = ['text/plain', 'application/json']
2221
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2222
+
2223
+ # form parameters
2224
+ form_params = {}
2225
+
2226
+ # http body (model)
2227
+ post_body = nil
2228
+ auth_names = []
2229
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2230
+ :header_params => header_params,
2231
+ :query_params => query_params,
2232
+ :form_params => form_params,
2233
+ :body => post_body,
2234
+ :auth_names => auth_names,
2235
+ :return_type => 'SubscriptionPagedMetadata')
2236
+ if @api_client.config.debugging
2237
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions_by_period_end\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2238
+ end
2239
+ return data, status_code, headers
2240
+ end
2241
+
2242
+ # Retrieves a collection of subscription objects with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order.
2243
+ # {\"nickname\":\"Retrieve by period-start\",\"response\":\"getSubscriptionByPeriodStart.html\"}
2244
+ # @param lower_threshold The UTC DateTime specifying the start of the result period.
2245
+ # @param upper_threshold The UTC DateTime specifying the end of the result period.
2246
+ # @param [Hash] opts the optional parameters
2247
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2248
+ # @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0)
2249
+ # @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10)
2250
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
2251
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
2252
+ # @return [SubscriptionPagedMetadata]
2253
+ def get_subscriptions_by_period_start(lower_threshold, upper_threshold, opts = {})
2254
+ data, _status_code, _headers = get_subscriptions_by_period_start_with_http_info(lower_threshold, upper_threshold, opts)
2255
+ return data
2256
+ end
2257
+
2258
+ # Retrieves a collection of subscription objects with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order.
2259
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by period-start\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionByPeriodStart.html\&quot;}
2260
+ # @param lower_threshold The UTC DateTime specifying the start of the result period.
2261
+ # @param upper_threshold The UTC DateTime specifying the end of the result period.
2262
+ # @param [Hash] opts the optional parameters
2263
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2264
+ # @option opts [Integer] :offset The offset from the first taxation-link to return.
2265
+ # @option opts [Integer] :records The maximum number of taxation-links to return.
2266
+ # @option opts [String] :order_by Specify a field used to order the result set.
2267
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
2268
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
2269
+ def get_subscriptions_by_period_start_with_http_info(lower_threshold, upper_threshold, opts = {})
2270
+ if @api_client.config.debugging
2271
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscriptions_by_period_start ..."
2272
+ end
2273
+ # verify the required parameter 'lower_threshold' is set
2274
+ fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling SubscriptionsApi.get_subscriptions_by_period_start" if lower_threshold.nil?
2275
+ # verify the required parameter 'upper_threshold' is set
2276
+ fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling SubscriptionsApi.get_subscriptions_by_period_start" if upper_threshold.nil?
2277
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
2278
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
2279
+ end
2280
+ # resource path
2281
+ local_var_path = "/subscriptions/period-start/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)
2282
+
2283
+ # query parameters
2284
+ query_params = {}
2285
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2286
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
2287
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
2288
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
2289
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
2290
+
2291
+ # header parameters
2292
+ header_params = {}
2293
+
2294
+ # HTTP header 'Accept' (if needed)
2295
+ local_header_accept = ['application/json']
2296
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2297
+
2298
+ # HTTP header 'Content-Type'
2299
+ local_header_content_type = ['text/plain', 'application/json']
2300
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2301
+
2302
+ # form parameters
2303
+ form_params = {}
2304
+
2305
+ # http body (model)
2306
+ post_body = nil
2307
+ auth_names = []
2308
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2309
+ :header_params => header_params,
2310
+ :query_params => query_params,
2311
+ :form_params => form_params,
2312
+ :body => post_body,
2313
+ :auth_names => auth_names,
2314
+ :return_type => 'SubscriptionPagedMetadata')
2315
+ if @api_client.config.debugging
2316
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions_by_period_start\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2317
+ end
2318
+ return data, status_code, headers
2319
+ end
2320
+
2321
+ # Retrieves a collection of subscription objects whose successful periods count falls within the range specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order.
2322
+ # {\"nickname\":\"Retrieve by successful period\",\"response\":\"getSubscriptionBySuccessfulPeriods.html\"}
2323
+ # @param lower_threshold The lower threshold of the range
2324
+ # @param upper_threshold The upper threshold of the range.
2325
+ # @param [Hash] opts the optional parameters
2326
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2327
+ # @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0)
2328
+ # @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10)
2329
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
2330
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
2331
+ # @return [SubscriptionPagedMetadata]
2332
+ def get_subscriptions_by_successful_periods(lower_threshold, upper_threshold, opts = {})
2333
+ data, _status_code, _headers = get_subscriptions_by_successful_periods_with_http_info(lower_threshold, upper_threshold, opts)
2334
+ return data
2335
+ end
2336
+
2337
+ # Retrieves a collection of subscription objects whose successful periods count falls within the range specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order.
2338
+ # {\&quot;nickname\&quot;:\&quot;Retrieve by successful period\&quot;,\&quot;response\&quot;:\&quot;getSubscriptionBySuccessfulPeriods.html\&quot;}
2339
+ # @param lower_threshold The lower threshold of the range
2340
+ # @param upper_threshold The upper threshold of the range.
2341
+ # @param [Hash] opts the optional parameters
2342
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2343
+ # @option opts [Integer] :offset The offset from the first taxation-link to return.
2344
+ # @option opts [Integer] :records The maximum number of taxation-links to return.
2345
+ # @option opts [String] :order_by Specify a field used to order the result set.
2346
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
2347
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
2348
+ def get_subscriptions_by_successful_periods_with_http_info(lower_threshold, upper_threshold, opts = {})
2349
+ if @api_client.config.debugging
2350
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscriptions_by_successful_periods ..."
2351
+ end
2352
+ # verify the required parameter 'lower_threshold' is set
2353
+ fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling SubscriptionsApi.get_subscriptions_by_successful_periods" if lower_threshold.nil?
2354
+ # verify the required parameter 'upper_threshold' is set
2355
+ fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling SubscriptionsApi.get_subscriptions_by_successful_periods" if upper_threshold.nil?
2356
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
2357
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
2358
+ end
2359
+ # resource path
2360
+ local_var_path = "/subscriptions/successful-periods/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)
2361
+
2362
+ # query parameters
2363
+ query_params = {}
2364
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2365
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
2366
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
2367
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
2368
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
2369
+
2370
+ # header parameters
2371
+ header_params = {}
2372
+
2373
+ # HTTP header 'Accept' (if needed)
2374
+ local_header_accept = ['application/json']
2375
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2376
+
2377
+ # HTTP header 'Content-Type'
2378
+ local_header_content_type = ['text/plain', 'application/json']
2379
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2380
+
2381
+ # form parameters
2382
+ form_params = {}
2383
+
2384
+ # http body (model)
2385
+ post_body = nil
2386
+ auth_names = []
2387
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2388
+ :header_params => header_params,
2389
+ :query_params => query_params,
2390
+ :form_params => form_params,
2391
+ :body => post_body,
2392
+ :auth_names => auth_names,
2393
+ :return_type => 'SubscriptionPagedMetadata')
2394
+ if @api_client.config.debugging
2395
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions_by_successful_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2396
+ end
2397
+ return data, status_code, headers
2398
+ end
2399
+
2400
+ #
2401
+ # { \"nickname\" : \"\",\"response\" : \"\"}
2402
+ # @param query_string The query string used to search.
2403
+ # @param [Hash] opts the optional parameters
2404
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2405
+ # @option opts [Integer] :offset The starting index of the search results. (default to 0)
2406
+ # @option opts [Integer] :records The number of search results to return. (default to 10)
2407
+ # @option opts [String] :format The response format, either JSON or XML. (default to JSON)
2408
+ # @option opts [BOOLEAN] :wildcard Toggle if we search for full words or whether a wildcard is used. (default to false)
2409
+ # @option opts [BOOLEAN] :entity Is an entity returned with the search results. (default to false)
2410
+ # @return [SwaggerTypeListSubs]
2411
+ def get_swagger_subscription(query_string, opts = {})
2412
+ data, _status_code, _headers = get_swagger_subscription_with_http_info(query_string, opts)
2413
+ return data
2414
+ end
2415
+
2416
+ #
2417
+ # { \&quot;nickname\&quot; : \&quot;\&quot;,\&quot;response\&quot; : \&quot;\&quot;}
2418
+ # @param query_string The query string used to search.
2419
+ # @param [Hash] opts the optional parameters
2420
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2421
+ # @option opts [Integer] :offset The starting index of the search results.
2422
+ # @option opts [Integer] :records The number of search results to return.
2423
+ # @option opts [String] :format The response format, either JSON or XML.
2424
+ # @option opts [BOOLEAN] :wildcard Toggle if we search for full words or whether a wildcard is used.
2425
+ # @option opts [BOOLEAN] :entity Is an entity returned with the search results.
2426
+ # @return [Array<(SwaggerTypeListSubs, Fixnum, Hash)>] SwaggerTypeListSubs data, response status code and response headers
2427
+ def get_swagger_subscription_with_http_info(query_string, opts = {})
2428
+ if @api_client.config.debugging
2429
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_swagger_subscription ..."
2430
+ end
2431
+ # verify the required parameter 'query_string' is set
2432
+ fail ArgumentError, "Missing the required parameter 'query_string' when calling SubscriptionsApi.get_swagger_subscription" if query_string.nil?
2433
+ # resource path
2434
+ local_var_path = "/subscriptions/swagger-end-point/{query-string}".sub('{format}','json').sub('{' + 'query-string' + '}', query_string.to_s)
2435
+
2436
+ # query parameters
2437
+ query_params = {}
2438
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2439
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
2440
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
2441
+ query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
2442
+ query_params[:'wildcard'] = opts[:'wildcard'] if !opts[:'wildcard'].nil?
2443
+ query_params[:'entity'] = opts[:'entity'] if !opts[:'entity'].nil?
2444
+
2445
+ # header parameters
2446
+ header_params = {}
2447
+
2448
+ # HTTP header 'Accept' (if needed)
2449
+ local_header_accept = ['application/json']
2450
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2451
+
2452
+ # HTTP header 'Content-Type'
2453
+ local_header_content_type = ['text/plain', 'application/json']
2454
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2455
+
2456
+ # form parameters
2457
+ form_params = {}
2458
+
2459
+ # http body (model)
2460
+ post_body = nil
2461
+ auth_names = []
2462
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2463
+ :header_params => header_params,
2464
+ :query_params => query_params,
2465
+ :form_params => form_params,
2466
+ :body => post_body,
2467
+ :auth_names => auth_names,
2468
+ :return_type => 'SwaggerTypeListSubs')
2469
+ if @api_client.config.debugging
2470
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_swagger_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2471
+ end
2472
+ return data, status_code, headers
2473
+ end
2474
+
2475
+ # Retrieves a collection timer amendments for the specified subscription.. By default 10 values are returned. Records are returned in natural order.
2476
+ # {\"nickname\":\"Get Timers\",\"response\":\"getTimersforSubscription.html\"}
2477
+ # @param subscription_id
2478
+ # @param [Hash] opts the optional parameters
2479
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2480
+ # @option opts [Integer] :offset The offset from the first subscription to return. (default to 0)
2481
+ # @option opts [Integer] :records The maximum number of subscriptions to return. (default to 10)
2482
+ # @option opts [String] :order_by Specify a field used to order the result set. (default to created)
2483
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC)
2484
+ # @option opts [BOOLEAN] :include_retired Whether retired timers should be returned. (default to false)
2485
+ # @option opts [String] :state The state of the timer amendment
2486
+ # @option opts [String] :event The type of timer event
2487
+ # @return [TimerAmendment]
2488
+ def get_timers_for_subscription(subscription_id, opts = {})
2489
+ data, _status_code, _headers = get_timers_for_subscription_with_http_info(subscription_id, opts)
2490
+ return data
2491
+ end
2492
+
2493
+ # Retrieves a collection timer amendments for the specified subscription.. By default 10 values are returned. Records are returned in natural order.
2494
+ # {\&quot;nickname\&quot;:\&quot;Get Timers\&quot;,\&quot;response\&quot;:\&quot;getTimersforSubscription.html\&quot;}
2495
+ # @param subscription_id
2496
+ # @param [Hash] opts the optional parameters
2497
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2498
+ # @option opts [Integer] :offset The offset from the first subscription to return.
2499
+ # @option opts [Integer] :records The maximum number of subscriptions to return.
2500
+ # @option opts [String] :order_by Specify a field used to order the result set.
2501
+ # @option opts [String] :order Ihe direction of any ordering, either ASC or DESC.
2502
+ # @option opts [BOOLEAN] :include_retired Whether retired timers should be returned.
2503
+ # @option opts [String] :state The state of the timer amendment
2504
+ # @option opts [String] :event The type of timer event
2505
+ # @return [Array<(TimerAmendment, Fixnum, Hash)>] TimerAmendment data, response status code and response headers
2506
+ def get_timers_for_subscription_with_http_info(subscription_id, opts = {})
2507
+ if @api_client.config.debugging
2508
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_timers_for_subscription ..."
2509
+ end
2510
+ # verify the required parameter 'subscription_id' is set
2511
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_timers_for_subscription" if subscription_id.nil?
2512
+ if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
2513
+ fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
2514
+ end
2515
+ if opts[:'state'] && !['Pending', 'Succeeded', 'Failed', 'Discarded'].include?(opts[:'state'])
2516
+ fail ArgumentError, 'invalid value for "state", must be one of Pending, Succeeded, Failed, Discarded'
2517
+ end
2518
+ if opts[:'event'] && !['TrialExpiry', 'SubscriptionExpiry', 'PeriodEnd'].include?(opts[:'event'])
2519
+ fail ArgumentError, 'invalid value for "event", must be one of TrialExpiry, SubscriptionExpiry, PeriodEnd'
2520
+ end
2521
+ # resource path
2522
+ local_var_path = "/subscriptions/{subscription-ID}/timer".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
2523
+
2524
+ # query parameters
2525
+ query_params = {}
2526
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2527
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
2528
+ query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
2529
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
2530
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
2531
+ query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
2532
+ query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
2533
+ query_params[:'event'] = opts[:'event'] if !opts[:'event'].nil?
2534
+
2535
+ # header parameters
2536
+ header_params = {}
2537
+
2538
+ # HTTP header 'Accept' (if needed)
2539
+ local_header_accept = ['application/json']
2540
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2541
+
2542
+ # HTTP header 'Content-Type'
2543
+ local_header_content_type = ['text/plain', 'application/json']
2544
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2545
+
2546
+ # form parameters
2547
+ form_params = {}
2548
+
2549
+ # http body (model)
2550
+ post_body = nil
2551
+ auth_names = []
2552
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2553
+ :header_params => header_params,
2554
+ :query_params => query_params,
2555
+ :form_params => form_params,
2556
+ :body => post_body,
2557
+ :auth_names => auth_names,
2558
+ :return_type => 'TimerAmendment')
2559
+ if @api_client.config.debugging
2560
+ @api_client.config.logger.debug "API called: SubscriptionsApi#get_timers_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2561
+ end
2562
+ return data, status_code, headers
2563
+ end
2564
+
2565
+ # Import a subscription.
2566
+ # {\"nickname\":\"Import\",\"request\":\"importSubscriptionRequest.html\",\"response\":\"importSubscription.html\"}
2567
+ # @param request The request
2568
+ # @param [Hash] opts the optional parameters
2569
+ # @return [SubscriptionPagedMetadata]
2570
+ def import_subscription(request, opts = {})
2571
+ data, _status_code, _headers = import_subscription_with_http_info(request, opts)
2572
+ return data
2573
+ end
2574
+
2575
+ # Import a subscription.
2576
+ # {\&quot;nickname\&quot;:\&quot;Import\&quot;,\&quot;request\&quot;:\&quot;importSubscriptionRequest.html\&quot;,\&quot;response\&quot;:\&quot;importSubscription.html\&quot;}
2577
+ # @param request The request
2578
+ # @param [Hash] opts the optional parameters
2579
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
2580
+ def import_subscription_with_http_info(request, opts = {})
2581
+ if @api_client.config.debugging
2582
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.import_subscription ..."
2583
+ end
2584
+ # verify the required parameter 'request' is set
2585
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.import_subscription" if request.nil?
2586
+ # resource path
2587
+ local_var_path = "/subscriptions/import".sub('{format}','json')
2588
+
2589
+ # query parameters
2590
+ query_params = {}
2591
+
2592
+ # header parameters
2593
+ header_params = {}
2594
+
2595
+ # HTTP header 'Accept' (if needed)
2596
+ local_header_accept = ['application/json']
2597
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2598
+
2599
+ # HTTP header 'Content-Type'
2600
+ local_header_content_type = ['application/json']
2601
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2602
+
2603
+ # form parameters
2604
+ form_params = {}
2605
+
2606
+ # http body (model)
2607
+ post_body = @api_client.object_to_http_body(request)
2608
+ auth_names = []
2609
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
2610
+ :header_params => header_params,
2611
+ :query_params => query_params,
2612
+ :form_params => form_params,
2613
+ :body => post_body,
2614
+ :auth_names => auth_names,
2615
+ :return_type => 'SubscriptionPagedMetadata')
2616
+ if @api_client.config.debugging
2617
+ @api_client.config.logger.debug "API called: SubscriptionsApi#import_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2618
+ end
2619
+ return data, status_code, headers
2620
+ end
2621
+
2622
+ # Invoice any outstanding charges for the subscription.
2623
+ # {\"nickname\":\"Invoice Charges\",\"request\":\"invoiceChargesRequest.html\",\"response\":\"invoiceCharges.html\"}
2624
+ # @param subscription_id ID of the subscription.
2625
+ # @param charge The charge request
2626
+ # @param [Hash] opts the optional parameters
2627
+ # @return [InvoicePagedMetadata]
2628
+ def invoice_charges_on_subscription(subscription_id, charge, opts = {})
2629
+ data, _status_code, _headers = invoice_charges_on_subscription_with_http_info(subscription_id, charge, opts)
2630
+ return data
2631
+ end
2632
+
2633
+ # Invoice any outstanding charges for the subscription.
2634
+ # {\&quot;nickname\&quot;:\&quot;Invoice Charges\&quot;,\&quot;request\&quot;:\&quot;invoiceChargesRequest.html\&quot;,\&quot;response\&quot;:\&quot;invoiceCharges.html\&quot;}
2635
+ # @param subscription_id ID of the subscription.
2636
+ # @param charge The charge request
2637
+ # @param [Hash] opts the optional parameters
2638
+ # @return [Array<(InvoicePagedMetadata, Fixnum, Hash)>] InvoicePagedMetadata data, response status code and response headers
2639
+ def invoice_charges_on_subscription_with_http_info(subscription_id, charge, opts = {})
2640
+ if @api_client.config.debugging
2641
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.invoice_charges_on_subscription ..."
2642
+ end
2643
+ # verify the required parameter 'subscription_id' is set
2644
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.invoice_charges_on_subscription" if subscription_id.nil?
2645
+ # verify the required parameter 'charge' is set
2646
+ fail ArgumentError, "Missing the required parameter 'charge' when calling SubscriptionsApi.invoice_charges_on_subscription" if charge.nil?
2647
+ # resource path
2648
+ local_var_path = "/subscriptions/{subscription-ID}/invoice-charges".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
2649
+
2650
+ # query parameters
2651
+ query_params = {}
2652
+
2653
+ # header parameters
2654
+ header_params = {}
2655
+
2656
+ # HTTP header 'Accept' (if needed)
2657
+ local_header_accept = ['application/json']
2658
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2659
+
2660
+ # HTTP header 'Content-Type'
2661
+ local_header_content_type = ['application/json']
2662
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2663
+
2664
+ # form parameters
2665
+ form_params = {}
2666
+
2667
+ # http body (model)
2668
+ post_body = @api_client.object_to_http_body(charge)
2669
+ auth_names = []
2670
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
2671
+ :header_params => header_params,
2672
+ :query_params => query_params,
2673
+ :form_params => form_params,
2674
+ :body => post_body,
2675
+ :auth_names => auth_names,
2676
+ :return_type => 'InvoicePagedMetadata')
2677
+ if @api_client.config.debugging
2678
+ @api_client.config.logger.debug "API called: SubscriptionsApi#invoice_charges_on_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2679
+ end
2680
+ return data, status_code, headers
2681
+ end
2682
+
2683
+ # Migrate the subscription to a new plan.
2684
+ # {\"nickname\":\"Migrate\",\"request\":\"migrateSubscriptionRequest.html\", \"response\":\"migrateSubscription.html\"}
2685
+ # @param subscription_id ID of the subscription.
2686
+ # @param request The migration request
2687
+ # @param [Hash] opts the optional parameters
2688
+ # @return [SubscriptionPagedMetadata]
2689
+ def migrate_subscription(subscription_id, request, opts = {})
2690
+ data, _status_code, _headers = migrate_subscription_with_http_info(subscription_id, request, opts)
2691
+ return data
2692
+ end
2693
+
2694
+ # Migrate the subscription to a new plan.
2695
+ # {\&quot;nickname\&quot;:\&quot;Migrate\&quot;,\&quot;request\&quot;:\&quot;migrateSubscriptionRequest.html\&quot;, \&quot;response\&quot;:\&quot;migrateSubscription.html\&quot;}
2696
+ # @param subscription_id ID of the subscription.
2697
+ # @param request The migration request
2698
+ # @param [Hash] opts the optional parameters
2699
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
2700
+ def migrate_subscription_with_http_info(subscription_id, request, opts = {})
2701
+ if @api_client.config.debugging
2702
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.migrate_subscription ..."
2703
+ end
2704
+ # verify the required parameter 'subscription_id' is set
2705
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.migrate_subscription" if subscription_id.nil?
2706
+ # verify the required parameter 'request' is set
2707
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.migrate_subscription" if request.nil?
2708
+ # resource path
2709
+ local_var_path = "/subscriptions/{subscription-ID}/migrate".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
2710
+
2711
+ # query parameters
2712
+ query_params = {}
2713
+
2714
+ # header parameters
2715
+ header_params = {}
2716
+
2717
+ # HTTP header 'Accept' (if needed)
2718
+ local_header_accept = ['application/json']
2719
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2720
+
2721
+ # HTTP header 'Content-Type'
2722
+ local_header_content_type = ['application/json']
2723
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2724
+
2725
+ # form parameters
2726
+ form_params = {}
2727
+
2728
+ # http body (model)
2729
+ post_body = @api_client.object_to_http_body(request)
2730
+ auth_names = []
2731
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
2732
+ :header_params => header_params,
2733
+ :query_params => query_params,
2734
+ :form_params => form_params,
2735
+ :body => post_body,
2736
+ :auth_names => auth_names,
2737
+ :return_type => 'SubscriptionPagedMetadata')
2738
+ if @api_client.config.debugging
2739
+ @api_client.config.logger.debug "API called: SubscriptionsApi#migrate_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2740
+ end
2741
+ return data, status_code, headers
2742
+ end
2743
+
2744
+ # Removes the coupon from the subscription.
2745
+ # {\"nickname\":\"Remove coupon\",\"response\":\"removeCouponResponse.html\"}
2746
+ # @param subscription_id
2747
+ # @param coupon_code
2748
+ # @param [Hash] opts the optional parameters
2749
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2750
+ # @return [CouponPagedMetadata]
2751
+ def remove_coupon_from_subscription(subscription_id, coupon_code, opts = {})
2752
+ data, _status_code, _headers = remove_coupon_from_subscription_with_http_info(subscription_id, coupon_code, opts)
2753
+ return data
2754
+ end
2755
+
2756
+ # Removes the coupon from the subscription.
2757
+ # {\&quot;nickname\&quot;:\&quot;Remove coupon\&quot;,\&quot;response\&quot;:\&quot;removeCouponResponse.html\&quot;}
2758
+ # @param subscription_id
2759
+ # @param coupon_code
2760
+ # @param [Hash] opts the optional parameters
2761
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2762
+ # @return [Array<(CouponPagedMetadata, Fixnum, Hash)>] CouponPagedMetadata data, response status code and response headers
2763
+ def remove_coupon_from_subscription_with_http_info(subscription_id, coupon_code, opts = {})
2764
+ if @api_client.config.debugging
2765
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.remove_coupon_from_subscription ..."
2766
+ end
2767
+ # verify the required parameter 'subscription_id' is set
2768
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.remove_coupon_from_subscription" if subscription_id.nil?
2769
+ # verify the required parameter 'coupon_code' is set
2770
+ fail ArgumentError, "Missing the required parameter 'coupon_code' when calling SubscriptionsApi.remove_coupon_from_subscription" if coupon_code.nil?
2771
+ # resource path
2772
+ local_var_path = "/subscriptions/{subscription-ID}/coupons/{coupon-code}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'coupon-code' + '}', coupon_code.to_s)
2773
+
2774
+ # query parameters
2775
+ query_params = {}
2776
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2777
+
2778
+ # header parameters
2779
+ header_params = {}
2780
+
2781
+ # HTTP header 'Accept' (if needed)
2782
+ local_header_accept = ['application/json']
2783
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2784
+
2785
+ # HTTP header 'Content-Type'
2786
+ local_header_content_type = ['text/plain', 'application/json']
2787
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2788
+
2789
+ # form parameters
2790
+ form_params = {}
2791
+
2792
+ # http body (model)
2793
+ post_body = nil
2794
+ auth_names = []
2795
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
2796
+ :header_params => header_params,
2797
+ :query_params => query_params,
2798
+ :form_params => form_params,
2799
+ :body => post_body,
2800
+ :auth_names => auth_names,
2801
+ :return_type => 'CouponPagedMetadata')
2802
+ if @api_client.config.debugging
2803
+ @api_client.config.logger.debug "API called: SubscriptionsApi#remove_coupon_from_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2804
+ end
2805
+ return data, status_code, headers
2806
+ end
2807
+
2808
+ # Decrease the amount of credit available to the specified subscription.
2809
+ # {\"nickname\":\"Remove Credit\",\"response\":\"removeCreditForSubscription.html\"}
2810
+ # @param subscription_id
2811
+ # @param value &lt;p&gt;Either a credit note ID or a currency value.&lt;/p&gt;&lt;p&gt;If a credit note ID is provided any remaining credit will be removed.&lt;/p&gt;&lt;p&gt;If a decimal is provided this value will be removed from any credit available to the subscription. For example if the subscription is in USD setting the value as 10 will reduce credit by $10 (USD), setting 9.86 would reduce the credit by $9.86 (USD). The value will be reduced from any credit available.&lt;/p&gt;
2812
+ # @param [Hash] opts the optional parameters
2813
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2814
+ # @return [CreditNotePagedMetadata]
2815
+ def remove_credit_from_subscription(subscription_id, value, opts = {})
2816
+ data, _status_code, _headers = remove_credit_from_subscription_with_http_info(subscription_id, value, opts)
2817
+ return data
2818
+ end
2819
+
2820
+ # Decrease the amount of credit available to the specified subscription.
2821
+ # {\&quot;nickname\&quot;:\&quot;Remove Credit\&quot;,\&quot;response\&quot;:\&quot;removeCreditForSubscription.html\&quot;}
2822
+ # @param subscription_id
2823
+ # @param value &lt;p&gt;Either a credit note ID or a currency value.&lt;/p&gt;&lt;p&gt;If a credit note ID is provided any remaining credit will be removed.&lt;/p&gt;&lt;p&gt;If a decimal is provided this value will be removed from any credit available to the subscription. For example if the subscription is in USD setting the value as 10 will reduce credit by $10 (USD), setting 9.86 would reduce the credit by $9.86 (USD). The value will be reduced from any credit available.&lt;/p&gt;
2824
+ # @param [Hash] opts the optional parameters
2825
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2826
+ # @return [Array<(CreditNotePagedMetadata, Fixnum, Hash)>] CreditNotePagedMetadata data, response status code and response headers
2827
+ def remove_credit_from_subscription_with_http_info(subscription_id, value, opts = {})
2828
+ if @api_client.config.debugging
2829
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.remove_credit_from_subscription ..."
2830
+ end
2831
+ # verify the required parameter 'subscription_id' is set
2832
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.remove_credit_from_subscription" if subscription_id.nil?
2833
+ # verify the required parameter 'value' is set
2834
+ fail ArgumentError, "Missing the required parameter 'value' when calling SubscriptionsApi.remove_credit_from_subscription" if value.nil?
2835
+ # resource path
2836
+ local_var_path = "/subscriptions/{subscription-ID}/credit/{value}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'value' + '}', value.to_s)
2837
+
2838
+ # query parameters
2839
+ query_params = {}
2840
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2841
+
2842
+ # header parameters
2843
+ header_params = {}
2844
+
2845
+ # HTTP header 'Accept' (if needed)
2846
+ local_header_accept = ['application/json']
2847
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2848
+
2849
+ # HTTP header 'Content-Type'
2850
+ local_header_content_type = ['text/plain', 'application/json']
2851
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2852
+
2853
+ # form parameters
2854
+ form_params = {}
2855
+
2856
+ # http body (model)
2857
+ post_body = nil
2858
+ auth_names = []
2859
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
2860
+ :header_params => header_params,
2861
+ :query_params => query_params,
2862
+ :form_params => form_params,
2863
+ :body => post_body,
2864
+ :auth_names => auth_names,
2865
+ :return_type => 'CreditNotePagedMetadata')
2866
+ if @api_client.config.debugging
2867
+ @api_client.config.logger.debug "API called: SubscriptionsApi#remove_credit_from_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2868
+ end
2869
+ return data, status_code, headers
2870
+ end
2871
+
2872
+ # Removes the specified payment method for the given subscription.
2873
+ # {\"nickname\":\"Remove payment-method\",\"response\":\"removePaymentMethod.html\",\"request\":\"removePaymentMethod.request.html\"}
2874
+ # @param subscription_id
2875
+ # @param payment_method_id
2876
+ # @param [Hash] opts the optional parameters
2877
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2878
+ # @return [PaymentMethodPagedMetadata]
2879
+ def remove_payment_method_from_subscription(subscription_id, payment_method_id, opts = {})
2880
+ data, _status_code, _headers = remove_payment_method_from_subscription_with_http_info(subscription_id, payment_method_id, opts)
2881
+ return data
2882
+ end
2883
+
2884
+ # Removes the specified payment method for the given subscription.
2885
+ # {\&quot;nickname\&quot;:\&quot;Remove payment-method\&quot;,\&quot;response\&quot;:\&quot;removePaymentMethod.html\&quot;,\&quot;request\&quot;:\&quot;removePaymentMethod.request.html\&quot;}
2886
+ # @param subscription_id
2887
+ # @param payment_method_id
2888
+ # @param [Hash] opts the optional parameters
2889
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2890
+ # @return [Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>] PaymentMethodPagedMetadata data, response status code and response headers
2891
+ def remove_payment_method_from_subscription_with_http_info(subscription_id, payment_method_id, opts = {})
2892
+ if @api_client.config.debugging
2893
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.remove_payment_method_from_subscription ..."
2894
+ end
2895
+ # verify the required parameter 'subscription_id' is set
2896
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.remove_payment_method_from_subscription" if subscription_id.nil?
2897
+ # verify the required parameter 'payment_method_id' is set
2898
+ fail ArgumentError, "Missing the required parameter 'payment_method_id' when calling SubscriptionsApi.remove_payment_method_from_subscription" if payment_method_id.nil?
2899
+ # resource path
2900
+ local_var_path = "/subscriptions/{subscription-ID}/payment-methods/{payment-method-ID}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'payment-method-ID' + '}', payment_method_id.to_s)
2901
+
2902
+ # query parameters
2903
+ query_params = {}
2904
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2905
+
2906
+ # header parameters
2907
+ header_params = {}
2908
+
2909
+ # HTTP header 'Accept' (if needed)
2910
+ local_header_accept = ['application/json']
2911
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2912
+
2913
+ # HTTP header 'Content-Type'
2914
+ local_header_content_type = ['text/plain', 'application/json']
2915
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2916
+
2917
+ # form parameters
2918
+ form_params = {}
2919
+
2920
+ # http body (model)
2921
+ post_body = nil
2922
+ auth_names = []
2923
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
2924
+ :header_params => header_params,
2925
+ :query_params => query_params,
2926
+ :form_params => form_params,
2927
+ :body => post_body,
2928
+ :auth_names => auth_names,
2929
+ :return_type => 'PaymentMethodPagedMetadata')
2930
+ if @api_client.config.debugging
2931
+ @api_client.config.logger.debug "API called: SubscriptionsApi#remove_payment_method_from_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2932
+ end
2933
+ return data, status_code, headers
2934
+ end
2935
+
2936
+ # Discards from the subscription any scheduled changes in the value of the specified pricing-component.
2937
+ # {\"nickname\":\"Discard value changes\",\"response\":\"removePricingComponentValueChange.html\"}
2938
+ # @param subscription_id
2939
+ # @param pricing_component
2940
+ # @param [Hash] opts the optional parameters
2941
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2942
+ # @return [PaymentMethodPagedMetadata]
2943
+ def remove_pricing_component_value_change_from_subscription(subscription_id, pricing_component, opts = {})
2944
+ data, _status_code, _headers = remove_pricing_component_value_change_from_subscription_with_http_info(subscription_id, pricing_component, opts)
2945
+ return data
2946
+ end
2947
+
2948
+ # Discards from the subscription any scheduled changes in the value of the specified pricing-component.
2949
+ # {\&quot;nickname\&quot;:\&quot;Discard value changes\&quot;,\&quot;response\&quot;:\&quot;removePricingComponentValueChange.html\&quot;}
2950
+ # @param subscription_id
2951
+ # @param pricing_component
2952
+ # @param [Hash] opts the optional parameters
2953
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
2954
+ # @return [Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>] PaymentMethodPagedMetadata data, response status code and response headers
2955
+ def remove_pricing_component_value_change_from_subscription_with_http_info(subscription_id, pricing_component, opts = {})
2956
+ if @api_client.config.debugging
2957
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.remove_pricing_component_value_change_from_subscription ..."
2958
+ end
2959
+ # verify the required parameter 'subscription_id' is set
2960
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.remove_pricing_component_value_change_from_subscription" if subscription_id.nil?
2961
+ # verify the required parameter 'pricing_component' is set
2962
+ fail ArgumentError, "Missing the required parameter 'pricing_component' when calling SubscriptionsApi.remove_pricing_component_value_change_from_subscription" if pricing_component.nil?
2963
+ # resource path
2964
+ local_var_path = "/subscriptions/{subscription-ID}/values/{pricing-component}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'pricing-component' + '}', pricing_component.to_s)
2965
+
2966
+ # query parameters
2967
+ query_params = {}
2968
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
2969
+
2970
+ # header parameters
2971
+ header_params = {}
2972
+
2973
+ # HTTP header 'Accept' (if needed)
2974
+ local_header_accept = ['application/json']
2975
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
2976
+
2977
+ # HTTP header 'Content-Type'
2978
+ local_header_content_type = ['text/plain', 'application/json']
2979
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
2980
+
2981
+ # form parameters
2982
+ form_params = {}
2983
+
2984
+ # http body (model)
2985
+ post_body = nil
2986
+ auth_names = []
2987
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
2988
+ :header_params => header_params,
2989
+ :query_params => query_params,
2990
+ :form_params => form_params,
2991
+ :body => post_body,
2992
+ :auth_names => auth_names,
2993
+ :return_type => 'PaymentMethodPagedMetadata')
2994
+ if @api_client.config.debugging
2995
+ @api_client.config.logger.debug "API called: SubscriptionsApi#remove_pricing_component_value_change_from_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2996
+ end
2997
+ return data, status_code, headers
2998
+ end
2999
+
3000
+ # Resume the frozen subscription.
3001
+ # {\"nickname\":\"Resume\",\"request\":\"resumeSubscriptionRequest.html\",\"response\":\"resumeSubscription.html\"}
3002
+ # @param subscription_id ID of the subscription.
3003
+ # @param request The request
3004
+ # @param [Hash] opts the optional parameters
3005
+ # @return [SubscriptionPagedMetadata]
3006
+ def resume_subscription(subscription_id, request, opts = {})
3007
+ data, _status_code, _headers = resume_subscription_with_http_info(subscription_id, request, opts)
3008
+ return data
3009
+ end
3010
+
3011
+ # Resume the frozen subscription.
3012
+ # {\&quot;nickname\&quot;:\&quot;Resume\&quot;,\&quot;request\&quot;:\&quot;resumeSubscriptionRequest.html\&quot;,\&quot;response\&quot;:\&quot;resumeSubscription.html\&quot;}
3013
+ # @param subscription_id ID of the subscription.
3014
+ # @param request The request
3015
+ # @param [Hash] opts the optional parameters
3016
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
3017
+ def resume_subscription_with_http_info(subscription_id, request, opts = {})
3018
+ if @api_client.config.debugging
3019
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.resume_subscription ..."
3020
+ end
3021
+ # verify the required parameter 'subscription_id' is set
3022
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.resume_subscription" if subscription_id.nil?
3023
+ # verify the required parameter 'request' is set
3024
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.resume_subscription" if request.nil?
3025
+ # resource path
3026
+ local_var_path = "/subscriptions/{subscription-ID}/resume".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
3027
+
3028
+ # query parameters
3029
+ query_params = {}
3030
+
3031
+ # header parameters
3032
+ header_params = {}
3033
+
3034
+ # HTTP header 'Accept' (if needed)
3035
+ local_header_accept = ['application/json']
3036
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
3037
+
3038
+ # HTTP header 'Content-Type'
3039
+ local_header_content_type = ['application/json']
3040
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
3041
+
3042
+ # form parameters
3043
+ form_params = {}
3044
+
3045
+ # http body (model)
3046
+ post_body = @api_client.object_to_http_body(request)
3047
+ auth_names = []
3048
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
3049
+ :header_params => header_params,
3050
+ :query_params => query_params,
3051
+ :form_params => form_params,
3052
+ :body => post_body,
3053
+ :auth_names => auth_names,
3054
+ :return_type => 'SubscriptionPagedMetadata')
3055
+ if @api_client.config.debugging
3056
+ @api_client.config.logger.debug "API called: SubscriptionsApi#resume_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3057
+ end
3058
+ return data, status_code, headers
3059
+ end
3060
+
3061
+ # Revives a cancelled subscription and returns it to its previous state
3062
+ # {\"nickname\":\"Revive subscription\",\"request\":\"reviveSubscriptionRequest.html\", \"response\":\"reviveSubscription.html\"}
3063
+ # @param subscription_id
3064
+ # @param request The revive request
3065
+ # @param [Hash] opts the optional parameters
3066
+ # @return [SubscriptionPagedMetadata]
3067
+ def revive_subscription(subscription_id, request, opts = {})
3068
+ data, _status_code, _headers = revive_subscription_with_http_info(subscription_id, request, opts)
3069
+ return data
3070
+ end
3071
+
3072
+ # Revives a cancelled subscription and returns it to its previous state
3073
+ # {\&quot;nickname\&quot;:\&quot;Revive subscription\&quot;,\&quot;request\&quot;:\&quot;reviveSubscriptionRequest.html\&quot;, \&quot;response\&quot;:\&quot;reviveSubscription.html\&quot;}
3074
+ # @param subscription_id
3075
+ # @param request The revive request
3076
+ # @param [Hash] opts the optional parameters
3077
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
3078
+ def revive_subscription_with_http_info(subscription_id, request, opts = {})
3079
+ if @api_client.config.debugging
3080
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.revive_subscription ..."
3081
+ end
3082
+ # verify the required parameter 'subscription_id' is set
3083
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.revive_subscription" if subscription_id.nil?
3084
+ # verify the required parameter 'request' is set
3085
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.revive_subscription" if request.nil?
3086
+ # resource path
3087
+ local_var_path = "/subscriptions/{subscription-ID}/revive".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
3088
+
3089
+ # query parameters
3090
+ query_params = {}
3091
+
3092
+ # header parameters
3093
+ header_params = {}
3094
+
3095
+ # HTTP header 'Accept' (if needed)
3096
+ local_header_accept = ['application/json']
3097
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
3098
+
3099
+ # HTTP header 'Content-Type'
3100
+ local_header_content_type = ['application/json']
3101
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
3102
+
3103
+ # form parameters
3104
+ form_params = {}
3105
+
3106
+ # http body (model)
3107
+ post_body = @api_client.object_to_http_body(request)
3108
+ auth_names = []
3109
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
3110
+ :header_params => header_params,
3111
+ :query_params => query_params,
3112
+ :form_params => form_params,
3113
+ :body => post_body,
3114
+ :auth_names => auth_names,
3115
+ :return_type => 'SubscriptionPagedMetadata')
3116
+ if @api_client.config.debugging
3117
+ @api_client.config.logger.debug "API called: SubscriptionsApi#revive_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3118
+ end
3119
+ return data, status_code, headers
3120
+ end
3121
+
3122
+ # Remove any existing metadata keys and create the provided data.
3123
+ # {\"nickname\":\"Set on subscription\",\"request\":\"setSubscriptionMetadataRequest.html\",\"response\":\"setSubscriptionMetadataResponse.html\"}
3124
+ # @param metadata
3125
+ # @param subscription_id
3126
+ # @param [Hash] opts the optional parameters
3127
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
3128
+ # @return [DynamicMetadata]
3129
+ def set_metadata_for_subscription(metadata, subscription_id, opts = {})
3130
+ data, _status_code, _headers = set_metadata_for_subscription_with_http_info(metadata, subscription_id, opts)
3131
+ return data
3132
+ end
3133
+
3134
+ # Remove any existing metadata keys and create the provided data.
3135
+ # {\&quot;nickname\&quot;:\&quot;Set on subscription\&quot;,\&quot;request\&quot;:\&quot;setSubscriptionMetadataRequest.html\&quot;,\&quot;response\&quot;:\&quot;setSubscriptionMetadataResponse.html\&quot;}
3136
+ # @param metadata
3137
+ # @param subscription_id
3138
+ # @param [Hash] opts the optional parameters
3139
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
3140
+ # @return [Array<(DynamicMetadata, Fixnum, Hash)>] DynamicMetadata data, response status code and response headers
3141
+ def set_metadata_for_subscription_with_http_info(metadata, subscription_id, opts = {})
3142
+ if @api_client.config.debugging
3143
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.set_metadata_for_subscription ..."
3144
+ end
3145
+ # verify the required parameter 'metadata' is set
3146
+ fail ArgumentError, "Missing the required parameter 'metadata' when calling SubscriptionsApi.set_metadata_for_subscription" if metadata.nil?
3147
+ # verify the required parameter 'subscription_id' is set
3148
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.set_metadata_for_subscription" if subscription_id.nil?
3149
+ # resource path
3150
+ local_var_path = "/subscriptions/{subscription-ID}/metadata".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
3151
+
3152
+ # query parameters
3153
+ query_params = {}
3154
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
3155
+
3156
+ # header parameters
3157
+ header_params = {}
3158
+
3159
+ # HTTP header 'Accept' (if needed)
3160
+ local_header_accept = ['application/json']
3161
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
3162
+
3163
+ # HTTP header 'Content-Type'
3164
+ local_header_content_type = ['application/json']
3165
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
3166
+
3167
+ # form parameters
3168
+ form_params = {}
3169
+
3170
+ # http body (model)
3171
+ post_body = @api_client.object_to_http_body(metadata)
3172
+ auth_names = []
3173
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
3174
+ :header_params => header_params,
3175
+ :query_params => query_params,
3176
+ :form_params => form_params,
3177
+ :body => post_body,
3178
+ :auth_names => auth_names,
3179
+ :return_type => 'DynamicMetadata')
3180
+ if @api_client.config.debugging
3181
+ @api_client.config.logger.debug "API called: SubscriptionsApi#set_metadata_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3182
+ end
3183
+ return data, status_code, headers
3184
+ end
3185
+
3186
+ # Sets upon this subscription a new value for the specified pricing-component without performing an upgrade.
3187
+ # {\"nickname\":\"Set values\",\"request\":\"setPricingComponentValuesRequest.html\",\"response\":\"setPricingComponentValues.html\"}
3188
+ # @param subscription_id ID of the subscription.
3189
+ # @param pricing_component_value The pricing-component-value request
3190
+ # @param [Hash] opts the optional parameters
3191
+ # @return [PricingComponentValuePagedMetadata]
3192
+ def set_pricing_component_value_on_subscription(subscription_id, pricing_component_value, opts = {})
3193
+ data, _status_code, _headers = set_pricing_component_value_on_subscription_with_http_info(subscription_id, pricing_component_value, opts)
3194
+ return data
3195
+ end
3196
+
3197
+ # Sets upon this subscription a new value for the specified pricing-component without performing an upgrade.
3198
+ # {\&quot;nickname\&quot;:\&quot;Set values\&quot;,\&quot;request\&quot;:\&quot;setPricingComponentValuesRequest.html\&quot;,\&quot;response\&quot;:\&quot;setPricingComponentValues.html\&quot;}
3199
+ # @param subscription_id ID of the subscription.
3200
+ # @param pricing_component_value The pricing-component-value request
3201
+ # @param [Hash] opts the optional parameters
3202
+ # @return [Array<(PricingComponentValuePagedMetadata, Fixnum, Hash)>] PricingComponentValuePagedMetadata data, response status code and response headers
3203
+ def set_pricing_component_value_on_subscription_with_http_info(subscription_id, pricing_component_value, opts = {})
3204
+ if @api_client.config.debugging
3205
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.set_pricing_component_value_on_subscription ..."
3206
+ end
3207
+ # verify the required parameter 'subscription_id' is set
3208
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.set_pricing_component_value_on_subscription" if subscription_id.nil?
3209
+ # verify the required parameter 'pricing_component_value' is set
3210
+ fail ArgumentError, "Missing the required parameter 'pricing_component_value' when calling SubscriptionsApi.set_pricing_component_value_on_subscription" if pricing_component_value.nil?
3211
+ # resource path
3212
+ local_var_path = "/subscriptions/{subscription-ID}/pricing-component-values".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
3213
+
3214
+ # query parameters
3215
+ query_params = {}
3216
+
3217
+ # header parameters
3218
+ header_params = {}
3219
+
3220
+ # HTTP header 'Accept' (if needed)
3221
+ local_header_accept = ['application/json']
3222
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
3223
+
3224
+ # HTTP header 'Content-Type'
3225
+ local_header_content_type = ['application/json']
3226
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
3227
+
3228
+ # form parameters
3229
+ form_params = {}
3230
+
3231
+ # http body (model)
3232
+ post_body = @api_client.object_to_http_body(pricing_component_value)
3233
+ auth_names = []
3234
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
3235
+ :header_params => header_params,
3236
+ :query_params => query_params,
3237
+ :form_params => form_params,
3238
+ :body => post_body,
3239
+ :auth_names => auth_names,
3240
+ :return_type => 'PricingComponentValuePagedMetadata')
3241
+ if @api_client.config.debugging
3242
+ @api_client.config.logger.debug "API called: SubscriptionsApi#set_pricing_component_value_on_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3243
+ end
3244
+ return data, status_code, headers
3245
+ end
3246
+
3247
+ # Upgrades/downgrades this subscription to some new value for the specified pricing-component.
3248
+ # {\"nickname\":\"Set value\",\"request\":\"setPricingComponentValueRequest.html\",\"response\":\"setPricingComponentValue.html\"}
3249
+ # @param subscription_id
3250
+ # @param pricing_component Name or ID of the pricing-component.
3251
+ # @param value The pricing-component-value request
3252
+ # @param [Hash] opts the optional parameters
3253
+ # @return [PricingComponentValueResponsePagedMetadata]
3254
+ def set_pricing_component_value_on_subscription_v2(subscription_id, pricing_component, value, opts = {})
3255
+ data, _status_code, _headers = set_pricing_component_value_on_subscription_v2_with_http_info(subscription_id, pricing_component, value, opts)
3256
+ return data
3257
+ end
3258
+
3259
+ # Upgrades/downgrades this subscription to some new value for the specified pricing-component.
3260
+ # {\&quot;nickname\&quot;:\&quot;Set value\&quot;,\&quot;request\&quot;:\&quot;setPricingComponentValueRequest.html\&quot;,\&quot;response\&quot;:\&quot;setPricingComponentValue.html\&quot;}
3261
+ # @param subscription_id
3262
+ # @param pricing_component Name or ID of the pricing-component.
3263
+ # @param value The pricing-component-value request
3264
+ # @param [Hash] opts the optional parameters
3265
+ # @return [Array<(PricingComponentValueResponsePagedMetadata, Fixnum, Hash)>] PricingComponentValueResponsePagedMetadata data, response status code and response headers
3266
+ def set_pricing_component_value_on_subscription_v2_with_http_info(subscription_id, pricing_component, value, opts = {})
3267
+ if @api_client.config.debugging
3268
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.set_pricing_component_value_on_subscription_v2 ..."
3269
+ end
3270
+ # verify the required parameter 'subscription_id' is set
3271
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.set_pricing_component_value_on_subscription_v2" if subscription_id.nil?
3272
+ # verify the required parameter 'pricing_component' is set
3273
+ fail ArgumentError, "Missing the required parameter 'pricing_component' when calling SubscriptionsApi.set_pricing_component_value_on_subscription_v2" if pricing_component.nil?
3274
+ # verify the required parameter 'value' is set
3275
+ fail ArgumentError, "Missing the required parameter 'value' when calling SubscriptionsApi.set_pricing_component_value_on_subscription_v2" if value.nil?
3276
+ # resource path
3277
+ local_var_path = "/subscriptions/{subscription-ID}/values/{pricing-component}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'pricing-component' + '}', pricing_component.to_s)
3278
+
3279
+ # query parameters
3280
+ query_params = {}
3281
+
3282
+ # header parameters
3283
+ header_params = {}
3284
+
3285
+ # HTTP header 'Accept' (if needed)
3286
+ local_header_accept = ['application/json']
3287
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
3288
+
3289
+ # HTTP header 'Content-Type'
3290
+ local_header_content_type = ['application/json']
3291
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
3292
+
3293
+ # form parameters
3294
+ form_params = {}
3295
+
3296
+ # http body (model)
3297
+ post_body = @api_client.object_to_http_body(value)
3298
+ auth_names = []
3299
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
3300
+ :header_params => header_params,
3301
+ :query_params => query_params,
3302
+ :form_params => form_params,
3303
+ :body => post_body,
3304
+ :auth_names => auth_names,
3305
+ :return_type => 'PricingComponentValueResponsePagedMetadata')
3306
+ if @api_client.config.debugging
3307
+ @api_client.config.logger.debug "API called: SubscriptionsApi#set_pricing_component_value_on_subscription_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3308
+ end
3309
+ return data, status_code, headers
3310
+ end
3311
+
3312
+ # Update a subscription.
3313
+ # {\"nickname\":\"Update a subscription\",\"request\":\"updateSubscriptionRequest.html\",\"response\":\"updateSubscriptionResponse.html\"}
3314
+ # @param subscription The subscription object to be updated.
3315
+ # @param [Hash] opts the optional parameters
3316
+ # @return [SubscriptionPagedMetadata]
3317
+ def update_subscription(subscription, opts = {})
3318
+ data, _status_code, _headers = update_subscription_with_http_info(subscription, opts)
3319
+ return data
3320
+ end
3321
+
3322
+ # Update a subscription.
3323
+ # {\&quot;nickname\&quot;:\&quot;Update a subscription\&quot;,\&quot;request\&quot;:\&quot;updateSubscriptionRequest.html\&quot;,\&quot;response\&quot;:\&quot;updateSubscriptionResponse.html\&quot;}
3324
+ # @param subscription The subscription object to be updated.
3325
+ # @param [Hash] opts the optional parameters
3326
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
3327
+ def update_subscription_with_http_info(subscription, opts = {})
3328
+ if @api_client.config.debugging
3329
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.update_subscription ..."
3330
+ end
3331
+ # verify the required parameter 'subscription' is set
3332
+ fail ArgumentError, "Missing the required parameter 'subscription' when calling SubscriptionsApi.update_subscription" if subscription.nil?
3333
+ # resource path
3334
+ local_var_path = "/subscriptions".sub('{format}','json')
3335
+
3336
+ # query parameters
3337
+ query_params = {}
3338
+
3339
+ # header parameters
3340
+ header_params = {}
3341
+
3342
+ # HTTP header 'Accept' (if needed)
3343
+ local_header_accept = ['text/xml', 'application/xml', 'application/json']
3344
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
3345
+
3346
+ # HTTP header 'Content-Type'
3347
+ local_header_content_type = ['application/json']
3348
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
3349
+
3350
+ # form parameters
3351
+ form_params = {}
3352
+
3353
+ # http body (model)
3354
+ post_body = @api_client.object_to_http_body(subscription)
3355
+ auth_names = []
3356
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
3357
+ :header_params => header_params,
3358
+ :query_params => query_params,
3359
+ :form_params => form_params,
3360
+ :body => post_body,
3361
+ :auth_names => auth_names,
3362
+ :return_type => 'SubscriptionPagedMetadata')
3363
+ if @api_client.config.debugging
3364
+ @api_client.config.logger.debug "API called: SubscriptionsApi#update_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3365
+ end
3366
+ return data, status_code, headers
3367
+ end
3368
+
3369
+ # Update a subscription (V2).
3370
+ # {\"nickname\":\"Update subscription (V2)\",\"response\":\"updateSubscriptionViaHelper.html\",\"request\":\"updateSubscriptionViaHelper.request.html\"}
3371
+ # @param request
3372
+ # @param [Hash] opts the optional parameters
3373
+ # @return [SubscriptionPagedMetadata]
3374
+ def update_subscription_v2(request, opts = {})
3375
+ data, _status_code, _headers = update_subscription_v2_with_http_info(request, opts)
3376
+ return data
3377
+ end
3378
+
3379
+ # Update a subscription (V2).
3380
+ # {\&quot;nickname\&quot;:\&quot;Update subscription (V2)\&quot;,\&quot;response\&quot;:\&quot;updateSubscriptionViaHelper.html\&quot;,\&quot;request\&quot;:\&quot;updateSubscriptionViaHelper.request.html\&quot;}
3381
+ # @param request
3382
+ # @param [Hash] opts the optional parameters
3383
+ # @return [Array<(SubscriptionPagedMetadata, Fixnum, Hash)>] SubscriptionPagedMetadata data, response status code and response headers
3384
+ def update_subscription_v2_with_http_info(request, opts = {})
3385
+ if @api_client.config.debugging
3386
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.update_subscription_v2 ..."
3387
+ end
3388
+ # verify the required parameter 'request' is set
3389
+ fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.update_subscription_v2" if request.nil?
3390
+ # resource path
3391
+ local_var_path = "/subscriptions/update".sub('{format}','json')
3392
+
3393
+ # query parameters
3394
+ query_params = {}
3395
+
3396
+ # header parameters
3397
+ header_params = {}
3398
+
3399
+ # HTTP header 'Accept' (if needed)
3400
+ local_header_accept = ['application/json']
3401
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
3402
+
3403
+ # HTTP header 'Content-Type'
3404
+ local_header_content_type = ['application/json']
3405
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
3406
+
3407
+ # form parameters
3408
+ form_params = {}
3409
+
3410
+ # http body (model)
3411
+ post_body = @api_client.object_to_http_body(request)
3412
+ auth_names = []
3413
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
3414
+ :header_params => header_params,
3415
+ :query_params => query_params,
3416
+ :form_params => form_params,
3417
+ :body => post_body,
3418
+ :auth_names => auth_names,
3419
+ :return_type => 'SubscriptionPagedMetadata')
3420
+ if @api_client.config.debugging
3421
+ @api_client.config.logger.debug "API called: SubscriptionsApi#update_subscription_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3422
+ end
3423
+ return data, status_code, headers
3424
+ end
3425
+
3426
+ # Update any existing metadata key-values and insert any new key-values, no keys will be removed.
3427
+ # {\"nickname\":\"Upsert on subscription\",\"request\":\"upsertSubscriptionMetadataRequest.html\",\"response\":\"upsertSubscriptionMetadataResponse.html\"}
3428
+ # @param metadata
3429
+ # @param subscription_id
3430
+ # @param [Hash] opts the optional parameters
3431
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
3432
+ # @return [DynamicMetadata]
3433
+ def upsert_metadata_for_subscription(metadata, subscription_id, opts = {})
3434
+ data, _status_code, _headers = upsert_metadata_for_subscription_with_http_info(metadata, subscription_id, opts)
3435
+ return data
3436
+ end
3437
+
3438
+ # Update any existing metadata key-values and insert any new key-values, no keys will be removed.
3439
+ # {\&quot;nickname\&quot;:\&quot;Upsert on subscription\&quot;,\&quot;request\&quot;:\&quot;upsertSubscriptionMetadataRequest.html\&quot;,\&quot;response\&quot;:\&quot;upsertSubscriptionMetadataResponse.html\&quot;}
3440
+ # @param metadata
3441
+ # @param subscription_id
3442
+ # @param [Hash] opts the optional parameters
3443
+ # @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls.
3444
+ # @return [Array<(DynamicMetadata, Fixnum, Hash)>] DynamicMetadata data, response status code and response headers
3445
+ def upsert_metadata_for_subscription_with_http_info(metadata, subscription_id, opts = {})
3446
+ if @api_client.config.debugging
3447
+ @api_client.config.logger.debug "Calling API: SubscriptionsApi.upsert_metadata_for_subscription ..."
3448
+ end
3449
+ # verify the required parameter 'metadata' is set
3450
+ fail ArgumentError, "Missing the required parameter 'metadata' when calling SubscriptionsApi.upsert_metadata_for_subscription" if metadata.nil?
3451
+ # verify the required parameter 'subscription_id' is set
3452
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.upsert_metadata_for_subscription" if subscription_id.nil?
3453
+ # resource path
3454
+ local_var_path = "/subscriptions/{subscription-ID}/metadata".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)
3455
+
3456
+ # query parameters
3457
+ query_params = {}
3458
+ query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
3459
+
3460
+ # header parameters
3461
+ header_params = {}
3462
+
3463
+ # HTTP header 'Accept' (if needed)
3464
+ local_header_accept = ['application/json']
3465
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
3466
+
3467
+ # HTTP header 'Content-Type'
3468
+ local_header_content_type = ['application/json']
3469
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
3470
+
3471
+ # form parameters
3472
+ form_params = {}
3473
+
3474
+ # http body (model)
3475
+ post_body = @api_client.object_to_http_body(metadata)
3476
+ auth_names = []
3477
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
3478
+ :header_params => header_params,
3479
+ :query_params => query_params,
3480
+ :form_params => form_params,
3481
+ :body => post_body,
3482
+ :auth_names => auth_names,
3483
+ :return_type => 'DynamicMetadata')
3484
+ if @api_client.config.debugging
3485
+ @api_client.config.logger.debug "API called: SubscriptionsApi#upsert_metadata_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3486
+ end
3487
+ return data, status_code, headers
3488
+ end
3489
+ end
3490
+ end