bf_ruby2 1.2016.229
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/README.md +824 -0
- data/bf_ruby2-1.0.0.gem +0 -0
- data/bf_ruby2.gemspec +55 -0
- data/docs/APIConfigurationPagedMetadata.md +14 -0
- data/docs/APIQuote.md +36 -0
- data/docs/APIQuotePagedMetadata.md +14 -0
- data/docs/APIQuoteResponseQuantity.md +25 -0
- data/docs/Account.md +21 -0
- data/docs/AccountLTVResultPagedMetadata.md +14 -0
- data/docs/AccountPagedMetadata.md +14 -0
- data/docs/AccountPaymentsResultPagedMetadata.md +14 -0
- data/docs/AccountsApi.md +1021 -0
- data/docs/AddChargeRequest.md +23 -0
- data/docs/AddCouponCodeRequest.md +11 -0
- data/docs/AddPaymentMethodRequest.md +8 -0
- data/docs/AddTaxationStrategyRequest.md +11 -0
- data/docs/Address.md +23 -0
- data/docs/AddressPagedMetadata.md +14 -0
- data/docs/AddressesApi.md +104 -0
- data/docs/AggregatingComponent.md +17 -0
- data/docs/Amendment.md +19 -0
- data/docs/AmendmentDiscardAmendment.md +20 -0
- data/docs/AmendmentPagedMetadata.md +14 -0
- data/docs/AmendmentPriceNTimePagedMetadata.md +14 -0
- data/docs/AmendmentsApi.md +639 -0
- data/docs/AnalyticsApi.md +641 -0
- data/docs/AuditEntry.md +17 -0
- data/docs/AuditEntryPagedMetadata.md +14 -0
- data/docs/AuditlogsApi.md +308 -0
- data/docs/AuthCaptureRequest.md +17 -0
- data/docs/AuthorizeNetTokenPagedMetadata.md +14 -0
- data/docs/BFError.md +11 -0
- data/docs/BFPermission.md +17 -0
- data/docs/BFPermissionPagedMetadata.md +14 -0
- data/docs/BankAccountVerificationPagedMetadata.md +14 -0
- data/docs/BillforwardManagedPaymentsResultPagedMetadata.md +14 -0
- data/docs/BillingEntityBase.md +8 -0
- data/docs/BraintreeAuthCaptureRequest.md +19 -0
- data/docs/BraintreeCaptureRequest.md +20 -0
- data/docs/BraintreeTokenPagedMetadata.md +14 -0
- data/docs/CancelSubscriptionRequest.md +14 -0
- data/docs/CancellationAmendment.md +24 -0
- data/docs/CassChurnResultPagedMetadata.md +14 -0
- data/docs/CassPaymentResultPagedMetadata.md +14 -0
- data/docs/CassUpgradeResultPagedMetadata.md +14 -0
- data/docs/ChargesApi.md +408 -0
- data/docs/Client.md +21 -0
- data/docs/ClientPagedMetadata.md +14 -0
- data/docs/ClientsApi.md +215 -0
- data/docs/ComponentChange.md +20 -0
- data/docs/ComponentCost.md +9 -0
- data/docs/CompoundUsage.md +11 -0
- data/docs/CompoundUsageSession.md +11 -0
- data/docs/ConfigurationsApi.md +221 -0
- data/docs/Coupon.md +32 -0
- data/docs/CouponBook.md +21 -0
- data/docs/CouponBookDefinition.md +24 -0
- data/docs/CouponBookDefinitionPagedMetadata.md +14 -0
- data/docs/CouponBookPagedMetadata.md +14 -0
- data/docs/CouponDefinition.md +26 -0
- data/docs/CouponDefinitionPagedMetadata.md +14 -0
- data/docs/CouponDiscount.md +18 -0
- data/docs/CouponDiscountEstimate.md +13 -0
- data/docs/CouponInstance.md +26 -0
- data/docs/CouponInstanceExistingValue.md +15 -0
- data/docs/CouponInstancePagedMetadata.md +14 -0
- data/docs/CouponModifierBase.md +22 -0
- data/docs/CouponModifierBasePagedMetadata.md +14 -0
- data/docs/CouponPagedMetadata.md +14 -0
- data/docs/CouponRule.md +24 -0
- data/docs/CouponRulePagedMetadata.md +14 -0
- data/docs/CouponUniqueCodesRequest.md +11 -0
- data/docs/CouponUniqueCodesResponse.md +10 -0
- data/docs/CouponUniqueCodesResponsePagedMetadata.md +14 -0
- data/docs/CouponWrapperResponse.md +13 -0
- data/docs/CouponbookApi.md +496 -0
- data/docs/CouponbookdefinitionApi.md +329 -0
- data/docs/CoupondefinitionApi.md +267 -0
- data/docs/CouponinstanceApi.md +578 -0
- data/docs/CouponmodifierApi.md +369 -0
- data/docs/CouponruleApi.md +269 -0
- data/docs/CouponsApi.md +456 -0
- data/docs/CreateAccountProfileRequest.md +20 -0
- data/docs/CreateAccountRequest.md +13 -0
- data/docs/CreateAddressRequest.md +17 -0
- data/docs/CreateAggregatingComponentRequest.md +10 -0
- data/docs/CreateAggregatingSubscriptionRequest.md +21 -0
- data/docs/CreateProfileAddressRequest.md +16 -0
- data/docs/CreateSubscriptionBatchRequest.md +10 -0
- data/docs/CreateSubscriptionChargeAmendment.md +29 -0
- data/docs/CreateSubscriptionRequest.md +26 -0
- data/docs/CreditAccountRequest.md +13 -0
- data/docs/CreditNote.md +21 -0
- data/docs/CreditNotePagedMetadata.md +14 -0
- data/docs/CreditSubscriptionRequest.md +12 -0
- data/docs/CreditnotesApi.md +339 -0
- data/docs/CybersourceTokenPagedMetadata.md +14 -0
- data/docs/CybersourcetokensApi.md +259 -0
- data/docs/DataSynchronisationAppConfigurationPagedMetadata.md +14 -0
- data/docs/DataSynchronisationConfiguration.md +20 -0
- data/docs/DataSynchronisationConfigurationPagedMetadata.md +14 -0
- data/docs/DataSynchronizationJobPagedMetadata.md +14 -0
- data/docs/DebtsResultPagedMetadata.md +14 -0
- data/docs/DunningLine.md +18 -0
- data/docs/DunningLinePagedMetadata.md +14 -0
- data/docs/DunninglinesApi.md +328 -0
- data/docs/DynamicMetadata.md +7 -0
- data/docs/Email.md +35 -0
- data/docs/EmailPagedMetadata.md +14 -0
- data/docs/EmailProvider.md +18 -0
- data/docs/EmailProviderPagedMetadata.md +14 -0
- data/docs/EmailSubscription.md +20 -0
- data/docs/EmailSubscriptionPagedMetadata.md +14 -0
- data/docs/EmailprovidersApi.md +221 -0
- data/docs/EmailsApi.md +164 -0
- data/docs/EmailsubscriptionsApi.md +273 -0
- data/docs/EndTrialAmendment.md +19 -0
- data/docs/Event.md +15 -0
- data/docs/EventData.md +9 -0
- data/docs/FileSham.md +7 -0
- data/docs/FixedTerm.md +24 -0
- data/docs/FixedTermDefinitionPagedMetadata.md +14 -0
- data/docs/FixedTermExpiryAmendment.md +20 -0
- data/docs/FixedTermPagedMetadata.md +14 -0
- data/docs/FixedtermdefinitionsApi.md +104 -0
- data/docs/FixedtermsApi.md +56 -0
- data/docs/FlatPricingComponent.md +32 -0
- data/docs/ImportInvoiceLine.md +16 -0
- data/docs/InsertableBillingEntity.md +21 -0
- data/docs/Invoice.md +54 -0
- data/docs/InvoiceChargeRequest.md +11 -0
- data/docs/InvoiceLine.md +38 -0
- data/docs/InvoiceLinePayment.md +36 -0
- data/docs/InvoiceLinePaymentPagedMetadata.md +14 -0
- data/docs/InvoiceNextExecutionAttemptAmendment.md +21 -0
- data/docs/InvoiceOutstandingChargesAmendment.md +20 -0
- data/docs/InvoicePagedMetadata.md +14 -0
- data/docs/InvoicePayment.md +22 -0
- data/docs/InvoiceRecalculationAmendment.md +23 -0
- data/docs/InvoiceRecalculationRequest.md +12 -0
- data/docs/InvoicesApi.md +2474 -0
- data/docs/IssueInvoiceAmendment.md +20 -0
- data/docs/MetadataApi.md +210 -0
- data/docs/MetadataKeyValuesPagedMetadata.md +14 -0
- data/docs/MigrationRequest.md +16 -0
- data/docs/ModelAlias.md +14 -0
- data/docs/MutableBillingEntity.md +27 -0
- data/docs/Notification.md +27 -0
- data/docs/NotificationPagedMetadata.md +14 -0
- data/docs/NotificationsApi.md +370 -0
- data/docs/Organization.md +21 -0
- data/docs/OrganizationPagedMetadata.md +14 -0
- data/docs/OrganizationsApi.md +378 -0
- data/docs/Password.md +14 -0
- data/docs/PasswordPagedMetadata.md +14 -0
- data/docs/PasswordResetRequest.md +8 -0
- data/docs/PasswordsApi.md +56 -0
- data/docs/PauseRequest.md +9 -0
- data/docs/Payment.md +24 -0
- data/docs/PaymentMethod.md +32 -0
- data/docs/PaymentMethodPagedMetadata.md +14 -0
- data/docs/PaymentMethodSubscriptionLink.md +17 -0
- data/docs/PaymentMethodSubscriptionLinkPagedMetadata.md +14 -0
- data/docs/PaymentPagedMetadata.md +14 -0
- data/docs/PaymentRetryRequest.md +9 -0
- data/docs/PaymentmethodsApi.md +445 -0
- data/docs/PaymentmethodsubscriptionlinksApi.md +107 -0
- data/docs/PaymentsApi.md +464 -0
- data/docs/PendingComponentValueChange.md +11 -0
- data/docs/Period.md +16 -0
- data/docs/PeriodPagedMetadata.md +14 -0
- data/docs/PeriodsApi.md +125 -0
- data/docs/PermissionActionEntityPagedMetadata.md +14 -0
- data/docs/PermissionResourceEntityPagedMetadata.md +14 -0
- data/docs/PermissionsApi.md +322 -0
- data/docs/PriceCalculationPagedMetadata.md +14 -0
- data/docs/PricingComponent.md +32 -0
- data/docs/PricingComponentCouponModifier.md +22 -0
- data/docs/PricingComponentMigrationValue.md +12 -0
- data/docs/PricingComponentPagedMetadata.md +14 -0
- data/docs/PricingComponentQuantityRequest.md +10 -0
- data/docs/PricingComponentTier.md +19 -0
- data/docs/PricingComponentTierPagedMetadata.md +14 -0
- data/docs/PricingComponentValue.md +20 -0
- data/docs/PricingComponentValueChangeAmendment.md +22 -0
- data/docs/PricingComponentValueChangePagedMetadata.md +14 -0
- data/docs/PricingComponentValueMigrationAmendmentMapping.md +16 -0
- data/docs/PricingComponentValuePagedMetadata.md +14 -0
- data/docs/PricingComponentValueRequest.md +12 -0
- data/docs/PricingComponentValueResponsePagedMetadata.md +14 -0
- data/docs/PricingcalculatorApi.md +152 -0
- data/docs/PricingcomponentsApi.md +339 -0
- data/docs/PricingcomponenttiersApi.md +281 -0
- data/docs/PricingcomponentvaluechangesApi.md +345 -0
- data/docs/PricingcomponentvaluesApi.md +287 -0
- data/docs/Product.md +25 -0
- data/docs/ProductCouponModifier.md +22 -0
- data/docs/ProductPagedMetadata.md +14 -0
- data/docs/ProductPaymentsResultPagedMetadata.md +14 -0
- data/docs/ProductRatePlan.md +39 -0
- data/docs/ProductRatePlanMigrationAmendment.md +27 -0
- data/docs/ProductRatePlanPagedMetadata.md +14 -0
- data/docs/ProductRatePlanPaymentsResultPagedMetadata.md +14 -0
- data/docs/ProductrateplansApi.md +786 -0
- data/docs/ProductsApi.md +493 -0
- data/docs/Profile.md +25 -0
- data/docs/ProfilePagedMetadata.md +14 -0
- data/docs/ProfilesApi.md +287 -0
- data/docs/QuoteRequest.md +24 -0
- data/docs/QuoteRequestValue.md +11 -0
- data/docs/QuotesApi.md +56 -0
- data/docs/RecalculateChargeRequest.md +15 -0
- data/docs/Receipt.md +36 -0
- data/docs/ReceiptPagedMetadata.md +14 -0
- data/docs/ReceiptsApi.md +421 -0
- data/docs/Refund.md +35 -0
- data/docs/RefundPagedMetadata.md +14 -0
- data/docs/RefundsApi.md +432 -0
- data/docs/ResumeRequest.md +10 -0
- data/docs/ResumeSubscriptionAmendment.md +19 -0
- data/docs/RevenueAttribution.md +31 -0
- data/docs/RevenueAttributionPagedMetadata.md +14 -0
- data/docs/ReviveSubscriptionRequest.md +8 -0
- data/docs/Role.md +19 -0
- data/docs/RolePagedMetadata.md +14 -0
- data/docs/RolesApi.md +327 -0
- data/docs/RuleSatisfaction.md +11 -0
- data/docs/SearchApi.md +70 -0
- data/docs/SearchResultPagedMetadata.md +14 -0
- data/docs/ServiceEndAmendment.md +19 -0
- data/docs/StripeACHTokenPagedMetadata.md +14 -0
- data/docs/StripeAuthCaptureRequest.md +20 -0
- data/docs/StripeObject.md +7 -0
- data/docs/StripeTokenPagedMetadata.md +14 -0
- data/docs/Subscription.md +47 -0
- data/docs/SubscriptionCancellationPagedMetadata.md +14 -0
- data/docs/SubscriptionCharge.md +32 -0
- data/docs/SubscriptionChargePagedMetadata.md +14 -0
- data/docs/SubscriptionLTVResultPagedMetadata.md +14 -0
- data/docs/SubscriptionPagedMetadata.md +14 -0
- data/docs/SubscriptionsApi.md +2841 -0
- data/docs/SwaggerTypeList.md +9 -0
- data/docs/SwaggerTypeListInv.md +8 -0
- data/docs/SwaggerTypeListSubs.md +9 -0
- data/docs/SynchAppConfigsApi.md +208 -0
- data/docs/SynchConfigsApi.md +317 -0
- data/docs/SynchJobsApi.md +421 -0
- data/docs/TaxationLinkPagedMetadata.md +14 -0
- data/docs/TaxationStrategyPagedMetadata.md +14 -0
- data/docs/TaxationlinksApi.md +339 -0
- data/docs/TaxationstrategiesApi.md +514 -0
- data/docs/TieredPricingComponent.md +32 -0
- data/docs/TieredVolumePricingComponent.md +32 -0
- data/docs/TimeApi.md +56 -0
- data/docs/TimeRequest.md +16 -0
- data/docs/TimeResponse.md +18 -0
- data/docs/TimeResponsePagedMetadata.md +14 -0
- data/docs/TimeZone.md +11 -0
- data/docs/TimerAmendment.md +26 -0
- data/docs/TokenizationApi.md +340 -0
- data/docs/TokenizationPreAuthPagedMetadata.md +14 -0
- data/docs/TrustCommerceTokenPagedMetadata.md +14 -0
- data/docs/UnitDiscount.md +11 -0
- data/docs/UnitOfMeasure.md +16 -0
- data/docs/UnitOfMeasureCouponModifier.md +22 -0
- data/docs/UnitOfMeasurePagedMetadata.md +14 -0
- data/docs/UnitofmeasureApi.md +215 -0
- data/docs/UpdateAddressRequest.md +18 -0
- data/docs/UpdateComponentValueAmendment.md +23 -0
- data/docs/UpdateProfileRequest.md +22 -0
- data/docs/UpdateRoleRequest.md +13 -0
- data/docs/UpdateSubscriptionRequest.md +16 -0
- data/docs/Usage.md +26 -0
- data/docs/UsageApi.md +296 -0
- data/docs/UsagePagedMetadata.md +14 -0
- data/docs/UsagePeriodPagedMetadata.md +14 -0
- data/docs/UsageRoundingStrategyPagedMetadata.md +14 -0
- data/docs/UsageSession.md +21 -0
- data/docs/UsageSessionPagedMetadata.md +14 -0
- data/docs/UsageperiodsApi.md +194 -0
- data/docs/UsageroundingstrategiesApi.md +228 -0
- data/docs/UsagesessionsApi.md +224 -0
- data/docs/User.md +21 -0
- data/docs/UserCreationRequest.md +17 -0
- data/docs/UserCreationResponsePagedMetadata.md +14 -0
- data/docs/UserPagedMetadata.md +14 -0
- data/docs/Username.md +13 -0
- data/docs/UsernamePagedMetadata.md +14 -0
- data/docs/UsernamesApi.md +56 -0
- data/docs/UsersApi.md +564 -0
- data/docs/VaultedgatewaysApi.md +648 -0
- data/docs/WebhookPagedMetadata.md +14 -0
- data/docs/WebhooksApi.md +366 -0
- data/git_push.sh +67 -0
- data/lib/bf_ruby2/api/accounts_api.rb +1257 -0
- data/lib/bf_ruby2/api/addresses_api.rb +148 -0
- data/lib/bf_ruby2/api/amendments_api.rb +819 -0
- data/lib/bf_ruby2/api/analytics_api.rb +815 -0
- data/lib/bf_ruby2/api/auditlogs_api.rb +410 -0
- data/lib/bf_ruby2/api/charges_api.rb +527 -0
- data/lib/bf_ruby2/api/clients_api.rb +282 -0
- data/lib/bf_ruby2/api/configurations_api.rb +298 -0
- data/lib/bf_ruby2/api/couponbook_api.rb +619 -0
- data/lib/bf_ruby2/api/couponbookdefinition_api.rb +420 -0
- data/lib/bf_ruby2/api/coupondefinition_api.rb +342 -0
- data/lib/bf_ruby2/api/couponinstance_api.rb +737 -0
- data/lib/bf_ruby2/api/couponmodifier_api.rb +456 -0
- data/lib/bf_ruby2/api/couponrule_api.rb +342 -0
- data/lib/bf_ruby2/api/coupons_api.rb +580 -0
- data/lib/bf_ruby2/api/creditnotes_api.rb +438 -0
- data/lib/bf_ruby2/api/cybersourcetokens_api.rb +330 -0
- data/lib/bf_ruby2/api/dunninglines_api.rb +422 -0
- data/lib/bf_ruby2/api/emailproviders_api.rb +288 -0
- data/lib/bf_ruby2/api/emails_api.rb +214 -0
- data/lib/bf_ruby2/api/emailsubscriptions_api.rb +364 -0
- data/lib/bf_ruby2/api/fixedtermdefinitions_api.rb +148 -0
- data/lib/bf_ruby2/api/fixedterms_api.rb +91 -0
- data/lib/bf_ruby2/api/invoices_api.rb +3066 -0
- data/lib/bf_ruby2/api/metadata_api.rb +266 -0
- data/lib/bf_ruby2/api/notifications_api.rb +480 -0
- data/lib/bf_ruby2/api/organizations_api.rb +476 -0
- data/lib/bf_ruby2/api/passwords_api.rb +91 -0
- data/lib/bf_ruby2/api/paymentmethods_api.rb +565 -0
- data/lib/bf_ruby2/api/paymentmethodsubscriptionlinks_api.rb +153 -0
- data/lib/bf_ruby2/api/payments_api.rb +601 -0
- data/lib/bf_ruby2/api/periods_api.rb +180 -0
- data/lib/bf_ruby2/api/permissions_api.rb +408 -0
- data/lib/bf_ruby2/api/pricingcalculator_api.rb +205 -0
- data/lib/bf_ruby2/api/pricingcomponents_api.rb +438 -0
- data/lib/bf_ruby2/api/pricingcomponenttiers_api.rb +369 -0
- data/lib/bf_ruby2/api/pricingcomponentvaluechanges_api.rb +447 -0
- data/lib/bf_ruby2/api/pricingcomponentvalues_api.rb +378 -0
- data/lib/bf_ruby2/api/productrateplans_api.rb +971 -0
- data/lib/bf_ruby2/api/products_api.rb +611 -0
- data/lib/bf_ruby2/api/profiles_api.rb +375 -0
- data/lib/bf_ruby2/api/quotes_api.rb +91 -0
- data/lib/bf_ruby2/api/receipts_api.rb +559 -0
- data/lib/bf_ruby2/api/refunds_api.rb +540 -0
- data/lib/bf_ruby2/api/roles_api.rb +421 -0
- data/lib/bf_ruby2/api/search_api.rb +109 -0
- data/lib/bf_ruby2/api/subscriptions_api.rb +3490 -0
- data/lib/bf_ruby2/api/synch_app_configs_api.rb +272 -0
- data/lib/bf_ruby2/api/synch_configs_api.rb +403 -0
- data/lib/bf_ruby2/api/synch_jobs_api.rb +535 -0
- data/lib/bf_ruby2/api/taxationlinks_api.rb +438 -0
- data/lib/bf_ruby2/api/taxationstrategies_api.rb +660 -0
- data/lib/bf_ruby2/api/time_api.rb +91 -0
- data/lib/bf_ruby2/api/tokenization_api.rb +431 -0
- data/lib/bf_ruby2/api/unitofmeasure_api.rb +282 -0
- data/lib/bf_ruby2/api/usage_api.rb +389 -0
- data/lib/bf_ruby2/api/usageperiods_api.rb +267 -0
- data/lib/bf_ruby2/api/usageroundingstrategies_api.rb +304 -0
- data/lib/bf_ruby2/api/usagesessions_api.rb +298 -0
- data/lib/bf_ruby2/api/usernames_api.rb +91 -0
- data/lib/bf_ruby2/api/users_api.rb +692 -0
- data/lib/bf_ruby2/api/vaultedgateways_api.rb +787 -0
- data/lib/bf_ruby2/api/webhooks_api.rb +461 -0
- data/lib/bf_ruby2/api_client.rb +378 -0
- data/lib/bf_ruby2/api_error.rb +47 -0
- data/lib/bf_ruby2/configuration.rb +207 -0
- data/lib/bf_ruby2/models/account.rb +335 -0
- data/lib/bf_ruby2/models/account_ltv_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/account_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/account_payments_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/add_charge_request.rb +414 -0
- data/lib/bf_ruby2/models/add_coupon_code_request.rb +231 -0
- data/lib/bf_ruby2/models/add_payment_method_request.rb +200 -0
- data/lib/bf_ruby2/models/add_taxation_strategy_request.rb +230 -0
- data/lib/bf_ruby2/models/address.rb +359 -0
- data/lib/bf_ruby2/models/address_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/aggregating_component.rb +294 -0
- data/lib/bf_ruby2/models/amendment.rb +374 -0
- data/lib/bf_ruby2/models/amendment_discard_amendment.rb +385 -0
- data/lib/bf_ruby2/models/amendment_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/amendment_price_n_time_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/api_configuration_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/api_quote.rb +525 -0
- data/lib/bf_ruby2/models/api_quote_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/api_quote_response_quantity.rb +405 -0
- data/lib/bf_ruby2/models/audit_entry.rb +359 -0
- data/lib/bf_ruby2/models/audit_entry_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/auth_capture_request.rb +337 -0
- data/lib/bf_ruby2/models/authorize_net_token_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/bank_account_verification_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/bf_error.rb +265 -0
- data/lib/bf_ruby2/models/bf_permission.rb +337 -0
- data/lib/bf_ruby2/models/bf_permission_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/billforward_managed_payments_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/billing_entity_base.rb +200 -0
- data/lib/bf_ruby2/models/braintree_auth_capture_request.rb +358 -0
- data/lib/bf_ruby2/models/braintree_capture_request.rb +327 -0
- data/lib/bf_ruby2/models/braintree_token_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/cancel_subscription_request.rb +301 -0
- data/lib/bf_ruby2/models/cancellation_amendment.rb +451 -0
- data/lib/bf_ruby2/models/cass_churn_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/cass_payment_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/cass_upgrade_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/client.rb +342 -0
- data/lib/bf_ruby2/models/client_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/component_change.rb +373 -0
- data/lib/bf_ruby2/models/component_cost.rb +208 -0
- data/lib/bf_ruby2/models/compound_usage.rb +234 -0
- data/lib/bf_ruby2/models/compound_usage_session.rb +233 -0
- data/lib/bf_ruby2/models/coupon.rb +484 -0
- data/lib/bf_ruby2/models/coupon_book.rb +342 -0
- data/lib/bf_ruby2/models/coupon_book_definition.rb +417 -0
- data/lib/bf_ruby2/models/coupon_book_definition_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/coupon_book_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/coupon_definition.rb +454 -0
- data/lib/bf_ruby2/models/coupon_definition_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/coupon_discount.rb +298 -0
- data/lib/bf_ruby2/models/coupon_discount_estimate.rb +258 -0
- data/lib/bf_ruby2/models/coupon_instance.rb +426 -0
- data/lib/bf_ruby2/models/coupon_instance_existing_value.rb +272 -0
- data/lib/bf_ruby2/models/coupon_instance_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/coupon_modifier_base.rb +410 -0
- data/lib/bf_ruby2/models/coupon_modifier_base_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/coupon_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/coupon_rule.rb +470 -0
- data/lib/bf_ruby2/models/coupon_rule_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/coupon_unique_codes_request.rb +232 -0
- data/lib/bf_ruby2/models/coupon_unique_codes_response.rb +219 -0
- data/lib/bf_ruby2/models/coupon_unique_codes_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/coupon_wrapper_response.rb +250 -0
- data/lib/bf_ruby2/models/create_account_profile_request.rb +323 -0
- data/lib/bf_ruby2/models/create_account_request.rb +248 -0
- data/lib/bf_ruby2/models/create_address_request.rb +298 -0
- data/lib/bf_ruby2/models/create_aggregating_component_request.rb +221 -0
- data/lib/bf_ruby2/models/create_aggregating_subscription_request.rb +393 -0
- data/lib/bf_ruby2/models/create_profile_address_request.rb +287 -0
- data/lib/bf_ruby2/models/create_subscription_batch_request.rb +222 -0
- data/lib/bf_ruby2/models/create_subscription_charge_amendment.rb +514 -0
- data/lib/bf_ruby2/models/create_subscription_request.rb +444 -0
- data/lib/bf_ruby2/models/credit_account_request.rb +252 -0
- data/lib/bf_ruby2/models/credit_note.rb +368 -0
- data/lib/bf_ruby2/models/credit_note_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/credit_subscription_request.rb +241 -0
- data/lib/bf_ruby2/models/cybersource_token_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/data_synchronisation_app_configuration_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/data_synchronisation_configuration.rb +362 -0
- data/lib/bf_ruby2/models/data_synchronisation_configuration_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/data_synchronization_job_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/debts_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/dunning_line.rb +354 -0
- data/lib/bf_ruby2/models/dunning_line_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/dynamic_metadata.rb +190 -0
- data/lib/bf_ruby2/models/email.rb +518 -0
- data/lib/bf_ruby2/models/email_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/email_provider.rb +302 -0
- data/lib/bf_ruby2/models/email_provider_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/email_subscription.rb +364 -0
- data/lib/bf_ruby2/models/email_subscription_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/end_trial_amendment.rb +374 -0
- data/lib/bf_ruby2/models/event.rb +272 -0
- data/lib/bf_ruby2/models/event_data.rb +212 -0
- data/lib/bf_ruby2/models/file_sham.rb +190 -0
- data/lib/bf_ruby2/models/fixed_term.rb +419 -0
- data/lib/bf_ruby2/models/fixed_term_definition_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/fixed_term_expiry_amendment.rb +385 -0
- data/lib/bf_ruby2/models/fixed_term_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/flat_pricing_component.rb +546 -0
- data/lib/bf_ruby2/models/import_invoice_line.rb +271 -0
- data/lib/bf_ruby2/models/insertable_billing_entity.rb +384 -0
- data/lib/bf_ruby2/models/invoice.rb +746 -0
- data/lib/bf_ruby2/models/invoice_charge_request.rb +267 -0
- data/lib/bf_ruby2/models/invoice_line.rb +575 -0
- data/lib/bf_ruby2/models/invoice_line_payment.rb +539 -0
- data/lib/bf_ruby2/models/invoice_line_payment_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/invoice_next_execution_attempt_amendment.rb +398 -0
- data/lib/bf_ruby2/models/invoice_outstanding_charges_amendment.rb +385 -0
- data/lib/bf_ruby2/models/invoice_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/invoice_payment.rb +384 -0
- data/lib/bf_ruby2/models/invoice_recalculation_amendment.rb +444 -0
- data/lib/bf_ruby2/models/invoice_recalculation_request.rb +293 -0
- data/lib/bf_ruby2/models/issue_invoice_amendment.rb +385 -0
- data/lib/bf_ruby2/models/metadata_key_values_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/migration_request.rb +332 -0
- data/lib/bf_ruby2/models/model_alias.rb +266 -0
- data/lib/bf_ruby2/models/mutable_billing_entity.rb +472 -0
- data/lib/bf_ruby2/models/notification.rb +472 -0
- data/lib/bf_ruby2/models/notification_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/organization.rb +349 -0
- data/lib/bf_ruby2/models/organization_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/password.rb +266 -0
- data/lib/bf_ruby2/models/password_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/password_reset_request.rb +201 -0
- data/lib/bf_ruby2/models/pause_request.rb +210 -0
- data/lib/bf_ruby2/models/payment.rb +417 -0
- data/lib/bf_ruby2/models/payment_method.rb +487 -0
- data/lib/bf_ruby2/models/payment_method_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/payment_method_subscription_link.rb +291 -0
- data/lib/bf_ruby2/models/payment_method_subscription_link_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/payment_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/payment_retry_request.rb +210 -0
- data/lib/bf_ruby2/models/pending_component_value_change.rb +226 -0
- data/lib/bf_ruby2/models/period.rb +330 -0
- data/lib/bf_ruby2/models/period_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/permission_action_entity_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/permission_resource_entity_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/price_calculation_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/pricing_component.rb +546 -0
- data/lib/bf_ruby2/models/pricing_component_coupon_modifier.rb +410 -0
- data/lib/bf_ruby2/models/pricing_component_migration_value.rb +242 -0
- data/lib/bf_ruby2/models/pricing_component_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/pricing_component_quantity_request.rb +220 -0
- data/lib/bf_ruby2/models/pricing_component_tier.rb +346 -0
- data/lib/bf_ruby2/models/pricing_component_tier_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/pricing_component_value.rb +323 -0
- data/lib/bf_ruby2/models/pricing_component_value_change_amendment.rb +419 -0
- data/lib/bf_ruby2/models/pricing_component_value_change_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/pricing_component_value_migration_amendment_mapping.rb +283 -0
- data/lib/bf_ruby2/models/pricing_component_value_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/pricing_component_value_request.rb +288 -0
- data/lib/bf_ruby2/models/pricing_component_value_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/product.rb +435 -0
- data/lib/bf_ruby2/models/product_coupon_modifier.rb +410 -0
- data/lib/bf_ruby2/models/product_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/product_payments_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/product_rate_plan.rb +658 -0
- data/lib/bf_ruby2/models/product_rate_plan_migration_amendment.rb +483 -0
- data/lib/bf_ruby2/models/product_rate_plan_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/product_rate_plan_payments_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/profile.rb +378 -0
- data/lib/bf_ruby2/models/profile_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/quote_request.rb +431 -0
- data/lib/bf_ruby2/models/quote_request_value.rb +232 -0
- data/lib/bf_ruby2/models/recalculate_charge_request.rb +318 -0
- data/lib/bf_ruby2/models/receipt.rb +535 -0
- data/lib/bf_ruby2/models/receipt_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/refund.rb +535 -0
- data/lib/bf_ruby2/models/refund_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/resume_request.rb +222 -0
- data/lib/bf_ruby2/models/resume_subscription_amendment.rb +374 -0
- data/lib/bf_ruby2/models/revenue_attribution.rb +451 -0
- data/lib/bf_ruby2/models/revenue_attribution_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/revive_subscription_request.rb +200 -0
- data/lib/bf_ruby2/models/role.rb +318 -0
- data/lib/bf_ruby2/models/role_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/rule_satisfaction.rb +234 -0
- data/lib/bf_ruby2/models/search_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/service_end_amendment.rb +374 -0
- data/lib/bf_ruby2/models/stripe_ach_token_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/stripe_auth_capture_request.rb +367 -0
- data/lib/bf_ruby2/models/stripe_object.rb +190 -0
- data/lib/bf_ruby2/models/stripe_token_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/subscription.rb +681 -0
- data/lib/bf_ruby2/models/subscription_cancellation_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/subscription_charge.rb +529 -0
- data/lib/bf_ruby2/models/subscription_charge_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/subscription_ltv_result_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/subscription_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/swagger_type_list.rb +210 -0
- data/lib/bf_ruby2/models/swagger_type_list_inv.rb +201 -0
- data/lib/bf_ruby2/models/swagger_type_list_subs.rb +212 -0
- data/lib/bf_ruby2/models/taxation_link_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/taxation_strategy_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/tiered_pricing_component.rb +546 -0
- data/lib/bf_ruby2/models/tiered_volume_pricing_component.rb +546 -0
- data/lib/bf_ruby2/models/time_request.rb +323 -0
- data/lib/bf_ruby2/models/time_response.rb +345 -0
- data/lib/bf_ruby2/models/time_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/time_zone.rb +226 -0
- data/lib/bf_ruby2/models/timer_amendment.rb +485 -0
- data/lib/bf_ruby2/models/tokenization_pre_auth_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/trust_commerce_token_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/unit_discount.rb +226 -0
- data/lib/bf_ruby2/models/unit_of_measure.rb +286 -0
- data/lib/bf_ruby2/models/unit_of_measure_coupon_modifier.rb +410 -0
- data/lib/bf_ruby2/models/unit_of_measure_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/update_address_request.rb +303 -0
- data/lib/bf_ruby2/models/update_component_value_amendment.rb +418 -0
- data/lib/bf_ruby2/models/update_profile_request.rb +342 -0
- data/lib/bf_ruby2/models/update_role_request.rb +253 -0
- data/lib/bf_ruby2/models/update_subscription_request.rb +328 -0
- data/lib/bf_ruby2/models/usage.rb +423 -0
- data/lib/bf_ruby2/models/usage_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/usage_period_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/usage_rounding_strategy_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/usage_session.rb +368 -0
- data/lib/bf_ruby2/models/usage_session_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/user.rb +352 -0
- data/lib/bf_ruby2/models/user_creation_request.rb +302 -0
- data/lib/bf_ruby2/models/user_creation_response_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/user_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/username.rb +253 -0
- data/lib/bf_ruby2/models/username_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/models/webhook_paged_metadata.rb +269 -0
- data/lib/bf_ruby2/version.rb +26 -0
- data/lib/bf_ruby2.rb +340 -0
- data/setup.scratch.rb +33 -0
- data/spec/api/accounts_api_spec.rb +318 -0
- data/spec/api/addresses_api_spec.rb +70 -0
- data/spec/api/amendments_api_spec.rb +220 -0
- data/spec/api/analytics_api_spec.rb +220 -0
- data/spec/api/auditlogs_api_spec.rb +131 -0
- data/spec/api/charges_api_spec.rb +156 -0
- data/spec/api/clients_api_spec.rb +100 -0
- data/spec/api/configurations_api_spec.rb +103 -0
- data/spec/api/couponbook_api_spec.rb +175 -0
- data/spec/api/couponbookdefinition_api_spec.rb +131 -0
- data/spec/api/coupondefinition_api_spec.rb +113 -0
- data/spec/api/couponinstance_api_spec.rb +203 -0
- data/spec/api/couponmodifier_api_spec.rb +138 -0
- data/spec/api/couponrule_api_spec.rb +113 -0
- data/spec/api/coupons_api_spec.rb +168 -0
- data/spec/api/creditnotes_api_spec.rb +135 -0
- data/spec/api/cybersourcetokens_api_spec.rb +109 -0
- data/spec/api/dunninglines_api_spec.rb +131 -0
- data/spec/api/emailproviders_api_spec.rb +102 -0
- data/spec/api/emails_api_spec.rb +85 -0
- data/spec/api/emailsubscriptions_api_spec.rb +115 -0
- data/spec/api/fixedtermdefinitions_api_spec.rb +70 -0
- data/spec/api/fixedterms_api_spec.rb +58 -0
- data/spec/api/invoices_api_spec.rb +727 -0
- data/spec/api/metadata_api_spec.rb +96 -0
- data/spec/api/notifications_api_spec.rb +148 -0
- data/spec/api/organizations_api_spec.rb +143 -0
- data/spec/api/passwords_api_spec.rb +58 -0
- data/spec/api/paymentmethods_api_spec.rb +163 -0
- data/spec/api/paymentmethodsubscriptionlinks_api_spec.rb +71 -0
- data/spec/api/payments_api_spec.rb +172 -0
- data/spec/api/periods_api_spec.rb +79 -0
- data/spec/api/permissions_api_spec.rb +127 -0
- data/spec/api/pricingcalculator_api_spec.rb +82 -0
- data/spec/api/pricingcomponents_api_spec.rb +136 -0
- data/spec/api/pricingcomponenttiers_api_spec.rb +120 -0
- data/spec/api/pricingcomponentvaluechanges_api_spec.rb +138 -0
- data/spec/api/pricingcomponentvalues_api_spec.rb +123 -0
- data/spec/api/productrateplans_api_spec.rb +254 -0
- data/spec/api/products_api_spec.rb +173 -0
- data/spec/api/profiles_api_spec.rb +122 -0
- data/spec/api/quotes_api_spec.rb +58 -0
- data/spec/api/receipts_api_spec.rb +164 -0
- data/spec/api/refunds_api_spec.rb +156 -0
- data/spec/api/roles_api_spec.rb +129 -0
- data/spec/api/search_api_spec.rb +64 -0
- data/spec/api/subscriptions_api_spec.rb +809 -0
- data/spec/api/synch_app_configs_api_spec.rb +96 -0
- data/spec/api/synch_configs_api_spec.rb +125 -0
- data/spec/api/synch_jobs_api_spec.rb +151 -0
- data/spec/api/taxationlinks_api_spec.rb +136 -0
- data/spec/api/taxationstrategies_api_spec.rb +185 -0
- data/spec/api/time_api_spec.rb +58 -0
- data/spec/api/tokenization_api_spec.rb +138 -0
- data/spec/api/unitofmeasure_api_spec.rb +100 -0
- data/spec/api/usage_api_spec.rb +125 -0
- data/spec/api/usageperiods_api_spec.rb +99 -0
- data/spec/api/usageroundingstrategies_api_spec.rb +106 -0
- data/spec/api/usagesessions_api_spec.rb +104 -0
- data/spec/api/usernames_api_spec.rb +58 -0
- data/spec/api/users_api_spec.rb +187 -0
- data/spec/api/vaultedgateways_api_spec.rb +206 -0
- data/spec/api/webhooks_api_spec.rb +138 -0
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +53 -0
- data/spec/models/account_ltv_result_paged_metadata_spec.rb +89 -0
- data/spec/models/account_paged_metadata_spec.rb +89 -0
- data/spec/models/account_payments_result_paged_metadata_spec.rb +89 -0
- data/spec/models/account_spec.rb +131 -0
- data/spec/models/add_charge_request_spec.rb +155 -0
- data/spec/models/add_coupon_code_request_spec.rb +71 -0
- data/spec/models/add_payment_method_request_spec.rb +53 -0
- data/spec/models/add_taxation_strategy_request_spec.rb +71 -0
- data/spec/models/address_paged_metadata_spec.rb +89 -0
- data/spec/models/address_spec.rb +143 -0
- data/spec/models/aggregating_component_spec.rb +107 -0
- data/spec/models/amendment_discard_amendment_spec.rb +137 -0
- data/spec/models/amendment_paged_metadata_spec.rb +89 -0
- data/spec/models/amendment_price_n_time_paged_metadata_spec.rb +89 -0
- data/spec/models/amendment_spec.rb +131 -0
- data/spec/models/api_configuration_paged_metadata_spec.rb +89 -0
- data/spec/models/api_quote_paged_metadata_spec.rb +89 -0
- data/spec/models/api_quote_response_quantity_spec.rb +159 -0
- data/spec/models/api_quote_spec.rb +225 -0
- data/spec/models/audit_entry_paged_metadata_spec.rb +89 -0
- data/spec/models/audit_entry_spec.rb +119 -0
- data/spec/models/auth_capture_request_spec.rb +115 -0
- data/spec/models/authorize_net_token_paged_metadata_spec.rb +89 -0
- data/spec/models/bank_account_verification_paged_metadata_spec.rb +89 -0
- data/spec/models/bf_error_spec.rb +75 -0
- data/spec/models/bf_permission_paged_metadata_spec.rb +89 -0
- data/spec/models/bf_permission_spec.rb +115 -0
- data/spec/models/billforward_managed_payments_result_paged_metadata_spec.rb +89 -0
- data/spec/models/billing_entity_base_spec.rb +53 -0
- data/spec/models/braintree_auth_capture_request_spec.rb +127 -0
- data/spec/models/braintree_capture_request_spec.rb +125 -0
- data/spec/models/braintree_token_paged_metadata_spec.rb +89 -0
- data/spec/models/cancel_subscription_request_spec.rb +97 -0
- data/spec/models/cancellation_amendment_spec.rb +169 -0
- data/spec/models/cass_churn_result_paged_metadata_spec.rb +89 -0
- data/spec/models/cass_payment_result_paged_metadata_spec.rb +89 -0
- data/spec/models/cass_upgrade_result_paged_metadata_spec.rb +89 -0
- data/spec/models/client_paged_metadata_spec.rb +89 -0
- data/spec/models/client_spec.rb +131 -0
- data/spec/models/component_change_spec.rb +133 -0
- data/spec/models/component_cost_spec.rb +59 -0
- data/spec/models/compound_usage_session_spec.rb +71 -0
- data/spec/models/compound_usage_spec.rb +71 -0
- data/spec/models/coupon_book_definition_paged_metadata_spec.rb +89 -0
- data/spec/models/coupon_book_definition_spec.rb +157 -0
- data/spec/models/coupon_book_paged_metadata_spec.rb +89 -0
- data/spec/models/coupon_book_spec.rb +131 -0
- data/spec/models/coupon_definition_paged_metadata_spec.rb +89 -0
- data/spec/models/coupon_definition_spec.rb +173 -0
- data/spec/models/coupon_discount_estimate_spec.rb +83 -0
- data/spec/models/coupon_discount_spec.rb +113 -0
- data/spec/models/coupon_instance_existing_value_spec.rb +95 -0
- data/spec/models/coupon_instance_paged_metadata_spec.rb +89 -0
- data/spec/models/coupon_instance_spec.rb +165 -0
- data/spec/models/coupon_modifier_base_paged_metadata_spec.rb +89 -0
- data/spec/models/coupon_modifier_base_spec.rb +149 -0
- data/spec/models/coupon_paged_metadata_spec.rb +89 -0
- data/spec/models/coupon_rule_paged_metadata_spec.rb +89 -0
- data/spec/models/coupon_rule_spec.rb +173 -0
- data/spec/models/coupon_spec.rb +201 -0
- data/spec/models/coupon_unique_codes_request_spec.rb +71 -0
- data/spec/models/coupon_unique_codes_response_paged_metadata_spec.rb +89 -0
- data/spec/models/coupon_unique_codes_response_spec.rb +65 -0
- data/spec/models/coupon_wrapper_response_spec.rb +83 -0
- data/spec/models/create_account_profile_request_spec.rb +125 -0
- data/spec/models/create_account_request_spec.rb +83 -0
- data/spec/models/create_address_request_spec.rb +107 -0
- data/spec/models/create_aggregating_component_request_spec.rb +65 -0
- data/spec/models/create_aggregating_subscription_request_spec.rb +143 -0
- data/spec/models/create_profile_address_request_spec.rb +101 -0
- data/spec/models/create_subscription_batch_request_spec.rb +65 -0
- data/spec/models/create_subscription_charge_amendment_spec.rb +203 -0
- data/spec/models/create_subscription_request_spec.rb +173 -0
- data/spec/models/credit_account_request_spec.rb +83 -0
- data/spec/models/credit_note_paged_metadata_spec.rb +89 -0
- data/spec/models/credit_note_spec.rb +135 -0
- data/spec/models/credit_subscription_request_spec.rb +77 -0
- data/spec/models/cybersource_token_paged_metadata_spec.rb +89 -0
- data/spec/models/data_synchronisation_app_configuration_paged_metadata_spec.rb +89 -0
- data/spec/models/data_synchronisation_configuration_paged_metadata_spec.rb +89 -0
- data/spec/models/data_synchronisation_configuration_spec.rb +129 -0
- data/spec/models/data_synchronization_job_paged_metadata_spec.rb +89 -0
- data/spec/models/debts_result_paged_metadata_spec.rb +89 -0
- data/spec/models/dunning_line_paged_metadata_spec.rb +89 -0
- data/spec/models/dunning_line_spec.rb +121 -0
- data/spec/models/dynamic_metadata_spec.rb +47 -0
- data/spec/models/email_paged_metadata_spec.rb +89 -0
- data/spec/models/email_provider_paged_metadata_spec.rb +89 -0
- data/spec/models/email_provider_spec.rb +113 -0
- data/spec/models/email_spec.rb +223 -0
- data/spec/models/email_subscription_paged_metadata_spec.rb +89 -0
- data/spec/models/email_subscription_spec.rb +133 -0
- data/spec/models/end_trial_amendment_spec.rb +131 -0
- data/spec/models/event_data_spec.rb +59 -0
- data/spec/models/event_spec.rb +95 -0
- data/spec/models/file_sham_spec.rb +47 -0
- data/spec/models/fixed_term_definition_paged_metadata_spec.rb +89 -0
- data/spec/models/fixed_term_expiry_amendment_spec.rb +137 -0
- data/spec/models/fixed_term_paged_metadata_spec.rb +89 -0
- data/spec/models/fixed_term_spec.rb +157 -0
- data/spec/models/flat_pricing_component_spec.rb +221 -0
- data/spec/models/import_invoice_line_spec.rb +101 -0
- data/spec/models/insertable_billing_entity_spec.rb +139 -0
- data/spec/models/invoice_charge_request_spec.rb +75 -0
- data/spec/models/invoice_line_payment_paged_metadata_spec.rb +89 -0
- data/spec/models/invoice_line_payment_spec.rb +225 -0
- data/spec/models/invoice_line_spec.rb +245 -0
- data/spec/models/invoice_next_execution_attempt_amendment_spec.rb +143 -0
- data/spec/models/invoice_outstanding_charges_amendment_spec.rb +137 -0
- data/spec/models/invoice_paged_metadata_spec.rb +89 -0
- data/spec/models/invoice_payment_spec.rb +141 -0
- data/spec/models/invoice_recalculation_amendment_spec.rb +163 -0
- data/spec/models/invoice_recalculation_request_spec.rb +85 -0
- data/spec/models/invoice_spec.rb +341 -0
- data/spec/models/issue_invoice_amendment_spec.rb +137 -0
- data/spec/models/metadata_key_values_paged_metadata_spec.rb +89 -0
- data/spec/models/migration_request_spec.rb +109 -0
- data/spec/models/model_alias_spec.rb +89 -0
- data/spec/models/mutable_billing_entity_spec.rb +183 -0
- data/spec/models/notification_paged_metadata_spec.rb +89 -0
- data/spec/models/notification_spec.rb +183 -0
- data/spec/models/organization_paged_metadata_spec.rb +89 -0
- data/spec/models/organization_spec.rb +131 -0
- data/spec/models/password_paged_metadata_spec.rb +89 -0
- data/spec/models/password_reset_request_spec.rb +53 -0
- data/spec/models/password_spec.rb +89 -0
- data/spec/models/pause_request_spec.rb +59 -0
- data/spec/models/payment_method_paged_metadata_spec.rb +89 -0
- data/spec/models/payment_method_spec.rb +205 -0
- data/spec/models/payment_method_subscription_link_paged_metadata_spec.rb +89 -0
- data/spec/models/payment_method_subscription_link_spec.rb +107 -0
- data/spec/models/payment_paged_metadata_spec.rb +89 -0
- data/spec/models/payment_retry_request_spec.rb +59 -0
- data/spec/models/payment_spec.rb +157 -0
- data/spec/models/pending_component_value_change_spec.rb +71 -0
- data/spec/models/period_paged_metadata_spec.rb +89 -0
- data/spec/models/period_spec.rb +109 -0
- data/spec/models/permission_action_entity_paged_metadata_spec.rb +89 -0
- data/spec/models/permission_resource_entity_paged_metadata_spec.rb +89 -0
- data/spec/models/price_calculation_paged_metadata_spec.rb +89 -0
- data/spec/models/pricing_component_coupon_modifier_spec.rb +149 -0
- data/spec/models/pricing_component_migration_value_spec.rb +77 -0
- data/spec/models/pricing_component_paged_metadata_spec.rb +89 -0
- data/spec/models/pricing_component_quantity_request_spec.rb +65 -0
- data/spec/models/pricing_component_spec.rb +221 -0
- data/spec/models/pricing_component_tier_paged_metadata_spec.rb +89 -0
- data/spec/models/pricing_component_tier_spec.rb +123 -0
- data/spec/models/pricing_component_value_change_amendment_spec.rb +153 -0
- data/spec/models/pricing_component_value_change_paged_metadata_spec.rb +89 -0
- data/spec/models/pricing_component_value_migration_amendment_mapping_spec.rb +101 -0
- data/spec/models/pricing_component_value_paged_metadata_spec.rb +89 -0
- data/spec/models/pricing_component_value_request_spec.rb +85 -0
- data/spec/models/pricing_component_value_response_paged_metadata_spec.rb +89 -0
- data/spec/models/pricing_component_value_spec.rb +125 -0
- data/spec/models/product_coupon_modifier_spec.rb +149 -0
- data/spec/models/product_paged_metadata_spec.rb +89 -0
- data/spec/models/product_payments_result_paged_metadata_spec.rb +89 -0
- data/spec/models/product_rate_plan_migration_amendment_spec.rb +187 -0
- data/spec/models/product_rate_plan_paged_metadata_spec.rb +89 -0
- data/spec/models/product_rate_plan_payments_result_paged_metadata_spec.rb +89 -0
- data/spec/models/product_rate_plan_spec.rb +275 -0
- data/spec/models/product_spec.rb +167 -0
- data/spec/models/profile_paged_metadata_spec.rb +89 -0
- data/spec/models/profile_spec.rb +155 -0
- data/spec/models/quote_request_spec.rb +161 -0
- data/spec/models/quote_request_value_spec.rb +71 -0
- data/spec/models/recalculate_charge_request_spec.rb +103 -0
- data/spec/models/receipt_paged_metadata_spec.rb +89 -0
- data/spec/models/receipt_spec.rb +237 -0
- data/spec/models/refund_paged_metadata_spec.rb +89 -0
- data/spec/models/refund_spec.rb +227 -0
- data/spec/models/resume_request_spec.rb +65 -0
- data/spec/models/resume_subscription_amendment_spec.rb +131 -0
- data/spec/models/revenue_attribution_paged_metadata_spec.rb +89 -0
- data/spec/models/revenue_attribution_spec.rb +191 -0
- data/spec/models/revive_subscription_request_spec.rb +53 -0
- data/spec/models/role_paged_metadata_spec.rb +89 -0
- data/spec/models/role_spec.rb +119 -0
- data/spec/models/rule_satisfaction_spec.rb +71 -0
- data/spec/models/search_result_paged_metadata_spec.rb +89 -0
- data/spec/models/service_end_amendment_spec.rb +131 -0
- data/spec/models/stripe_ach_token_paged_metadata_spec.rb +89 -0
- data/spec/models/stripe_auth_capture_request_spec.rb +133 -0
- data/spec/models/stripe_object_spec.rb +47 -0
- data/spec/models/stripe_token_paged_metadata_spec.rb +89 -0
- data/spec/models/subscription_cancellation_paged_metadata_spec.rb +89 -0
- data/spec/models/subscription_charge_paged_metadata_spec.rb +89 -0
- data/spec/models/subscription_charge_spec.rb +217 -0
- data/spec/models/subscription_ltv_result_paged_metadata_spec.rb +89 -0
- data/spec/models/subscription_paged_metadata_spec.rb +89 -0
- data/spec/models/subscription_spec.rb +303 -0
- data/spec/models/swagger_type_list_inv_spec.rb +53 -0
- data/spec/models/swagger_type_list_spec.rb +59 -0
- data/spec/models/swagger_type_list_subs_spec.rb +59 -0
- data/spec/models/taxation_link_paged_metadata_spec.rb +89 -0
- data/spec/models/taxation_strategy_paged_metadata_spec.rb +89 -0
- data/spec/models/tiered_pricing_component_spec.rb +221 -0
- data/spec/models/tiered_volume_pricing_component_spec.rb +221 -0
- data/spec/models/time_request_spec.rb +105 -0
- data/spec/models/time_response_paged_metadata_spec.rb +89 -0
- data/spec/models/time_response_spec.rb +117 -0
- data/spec/models/time_zone_spec.rb +71 -0
- data/spec/models/timer_amendment_spec.rb +189 -0
- data/spec/models/tokenization_pre_auth_paged_metadata_spec.rb +89 -0
- data/spec/models/trust_commerce_token_paged_metadata_spec.rb +89 -0
- data/spec/models/unit_discount_spec.rb +71 -0
- data/spec/models/unit_of_measure_coupon_modifier_spec.rb +149 -0
- data/spec/models/unit_of_measure_paged_metadata_spec.rb +89 -0
- data/spec/models/unit_of_measure_spec.rb +101 -0
- data/spec/models/update_address_request_spec.rb +113 -0
- data/spec/models/update_component_value_amendment_spec.rb +155 -0
- data/spec/models/update_profile_request_spec.rb +137 -0
- data/spec/models/update_role_request_spec.rb +83 -0
- data/spec/models/update_subscription_request_spec.rb +109 -0
- data/spec/models/usage_paged_metadata_spec.rb +89 -0
- data/spec/models/usage_period_paged_metadata_spec.rb +89 -0
- data/spec/models/usage_rounding_strategy_paged_metadata_spec.rb +89 -0
- data/spec/models/usage_session_paged_metadata_spec.rb +89 -0
- data/spec/models/usage_session_spec.rb +135 -0
- data/spec/models/usage_spec.rb +165 -0
- data/spec/models/user_creation_request_spec.rb +107 -0
- data/spec/models/user_creation_response_paged_metadata_spec.rb +89 -0
- data/spec/models/user_paged_metadata_spec.rb +89 -0
- data/spec/models/user_spec.rb +131 -0
- data/spec/models/username_paged_metadata_spec.rb +89 -0
- data/spec/models/username_spec.rb +83 -0
- data/spec/models/webhook_paged_metadata_spec.rb +89 -0
- data/spec/spec_helper.rb +122 -0
- metadata +1401 -0
@@ -0,0 +1,378 @@
|
|
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 'date'
|
25
|
+
require 'json'
|
26
|
+
require 'logger'
|
27
|
+
require 'tempfile'
|
28
|
+
require 'typhoeus'
|
29
|
+
require 'uri'
|
30
|
+
|
31
|
+
module BillForward
|
32
|
+
class ApiClient
|
33
|
+
# The Configuration object holding settings to be used in the API client.
|
34
|
+
attr_accessor :config
|
35
|
+
|
36
|
+
# Defines the headers to be used in HTTP requests of all API calls by default.
|
37
|
+
#
|
38
|
+
# @return [Hash]
|
39
|
+
attr_accessor :default_headers
|
40
|
+
|
41
|
+
# Initializes the ApiClient
|
42
|
+
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
43
|
+
def initialize(config = Configuration.default)
|
44
|
+
@config = config
|
45
|
+
@user_agent = "Swagger-Codegen/#{VERSION}/ruby"
|
46
|
+
@default_headers = {
|
47
|
+
'Content-Type' => "application/json",
|
48
|
+
'User-Agent' => @user_agent
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.default
|
53
|
+
@@default ||= ApiClient.new
|
54
|
+
end
|
55
|
+
|
56
|
+
# Call an API with given options.
|
57
|
+
#
|
58
|
+
# @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
|
59
|
+
# the data deserialized from response body (could be nil), response status code and response headers.
|
60
|
+
def call_api(http_method, path, opts = {})
|
61
|
+
request = build_request(http_method, path, opts)
|
62
|
+
response = request.run
|
63
|
+
|
64
|
+
if @config.debugging
|
65
|
+
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
66
|
+
end
|
67
|
+
|
68
|
+
unless response.success?
|
69
|
+
fail ApiError.new(:code => response.code,
|
70
|
+
:response_headers => response.headers,
|
71
|
+
:response_body => response.body),
|
72
|
+
response.status_message
|
73
|
+
end
|
74
|
+
|
75
|
+
if opts[:return_type]
|
76
|
+
data = deserialize(response, opts[:return_type])
|
77
|
+
else
|
78
|
+
data = nil
|
79
|
+
end
|
80
|
+
return data, response.code, response.headers
|
81
|
+
end
|
82
|
+
|
83
|
+
# Builds the HTTP request
|
84
|
+
#
|
85
|
+
# @param [String] http_method HTTP method/verb (e.g. POST)
|
86
|
+
# @param [String] path URL path (e.g. /account/new)
|
87
|
+
# @option opts [Hash] :header_params Header parameters
|
88
|
+
# @option opts [Hash] :query_params Query parameters
|
89
|
+
# @option opts [Hash] :form_params Query parameters
|
90
|
+
# @option opts [Object] :body HTTP body (JSON/XML)
|
91
|
+
# @return [Typhoeus::Request] A Typhoeus Request
|
92
|
+
def build_request(http_method, path, opts = {})
|
93
|
+
url = build_request_url(path)
|
94
|
+
http_method = http_method.to_sym.downcase
|
95
|
+
|
96
|
+
header_params = @default_headers.merge(opts[:header_params] || {})
|
97
|
+
query_params = opts[:query_params] || {}
|
98
|
+
form_params = opts[:form_params] || {}
|
99
|
+
|
100
|
+
|
101
|
+
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
102
|
+
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
103
|
+
|
104
|
+
req_opts = {
|
105
|
+
:method => http_method,
|
106
|
+
:headers => header_params,
|
107
|
+
:params => query_params,
|
108
|
+
:params_encoding => @config.params_encoding,
|
109
|
+
:timeout => @config.timeout,
|
110
|
+
:ssl_verifypeer => @config.verify_ssl,
|
111
|
+
:ssl_verifyhost => _verify_ssl_host,
|
112
|
+
:sslcert => @config.cert_file,
|
113
|
+
:sslkey => @config.key_file,
|
114
|
+
:verbose => @config.debugging
|
115
|
+
}
|
116
|
+
|
117
|
+
# set custom cert, if provided
|
118
|
+
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
119
|
+
|
120
|
+
if [:post, :patch, :put, :delete].include?(http_method)
|
121
|
+
req_body = build_request_body(header_params, form_params, opts[:body])
|
122
|
+
req_opts.update :body => req_body
|
123
|
+
if @config.debugging
|
124
|
+
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
Typhoeus::Request.new(url, req_opts)
|
129
|
+
end
|
130
|
+
|
131
|
+
# Check if the given MIME is a JSON MIME.
|
132
|
+
# JSON MIME examples:
|
133
|
+
# application/json
|
134
|
+
# application/json; charset=UTF8
|
135
|
+
# APPLICATION/JSON
|
136
|
+
# @param [String] mime MIME
|
137
|
+
# @return [Boolean] True if the MIME is applicaton/json
|
138
|
+
def json_mime?(mime)
|
139
|
+
!(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
|
140
|
+
end
|
141
|
+
|
142
|
+
# Deserialize the response to the given return type.
|
143
|
+
#
|
144
|
+
# @param [Response] response HTTP response
|
145
|
+
# @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
|
146
|
+
def deserialize(response, return_type)
|
147
|
+
body = response.body
|
148
|
+
return nil if body.nil? || body.empty?
|
149
|
+
|
150
|
+
# return response body directly for String return type
|
151
|
+
return body if return_type == 'String'
|
152
|
+
|
153
|
+
# handle file downloading - save response body into a tmp file and return the File instance
|
154
|
+
return download_file(response) if return_type == 'File'
|
155
|
+
|
156
|
+
# ensuring a default content type
|
157
|
+
content_type = response.headers['Content-Type'] || 'application/json'
|
158
|
+
|
159
|
+
fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
|
160
|
+
|
161
|
+
begin
|
162
|
+
data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
|
163
|
+
rescue JSON::ParserError => e
|
164
|
+
if %w(String Date DateTime).include?(return_type)
|
165
|
+
data = body
|
166
|
+
else
|
167
|
+
raise e
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
convert_to_type data, return_type
|
172
|
+
end
|
173
|
+
|
174
|
+
# Convert data to the given return type.
|
175
|
+
# @param [Object] data Data to be converted
|
176
|
+
# @param [String] return_type Return type
|
177
|
+
# @return [Mixed] Data in a particular type
|
178
|
+
def convert_to_type(data, return_type)
|
179
|
+
return nil if data.nil?
|
180
|
+
case return_type
|
181
|
+
when 'String'
|
182
|
+
data.to_s
|
183
|
+
when 'Integer'
|
184
|
+
data.to_i
|
185
|
+
when 'Float'
|
186
|
+
data.to_f
|
187
|
+
when 'BOOLEAN'
|
188
|
+
data == true
|
189
|
+
when 'DateTime'
|
190
|
+
# parse date time (expecting ISO 8601 format)
|
191
|
+
DateTime.parse data
|
192
|
+
when 'Date'
|
193
|
+
# parse date time (expecting ISO 8601 format)
|
194
|
+
Date.parse data
|
195
|
+
when 'Object'
|
196
|
+
# generic object (usually a Hash), return directly
|
197
|
+
data
|
198
|
+
when /\AArray<(.+)>\z/
|
199
|
+
# e.g. Array<Pet>
|
200
|
+
sub_type = $1
|
201
|
+
data.map {|item| convert_to_type(item, sub_type) }
|
202
|
+
when /\AHash\<String, (.+)\>\z/
|
203
|
+
# e.g. Hash<String, Integer>
|
204
|
+
sub_type = $1
|
205
|
+
{}.tap do |hash|
|
206
|
+
data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
|
207
|
+
end
|
208
|
+
else
|
209
|
+
# models, e.g. Pet
|
210
|
+
BillForward.const_get(return_type).new.tap do |model|
|
211
|
+
model.build_from_hash data
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
# Save response body into a file in (the defined) temporary folder, using the filename
|
217
|
+
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
218
|
+
#
|
219
|
+
# @see Configuration#temp_folder_path
|
220
|
+
# @return [Tempfile] the file downloaded
|
221
|
+
def download_file(response)
|
222
|
+
content_disposition = response.headers['Content-Disposition']
|
223
|
+
if content_disposition and content_disposition =~ /filename=/i
|
224
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
225
|
+
prefix = sanitize_filename(filename)
|
226
|
+
else
|
227
|
+
prefix = 'download-'
|
228
|
+
end
|
229
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
230
|
+
|
231
|
+
tempfile = nil
|
232
|
+
encoding = response.body.encoding
|
233
|
+
Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) do |file|
|
234
|
+
file.write(response.body)
|
235
|
+
tempfile = file
|
236
|
+
end
|
237
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
238
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
239
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
240
|
+
"explicitly with `tempfile.delete`"
|
241
|
+
tempfile
|
242
|
+
end
|
243
|
+
|
244
|
+
# Sanitize filename by removing path.
|
245
|
+
# e.g. ../../sun.gif becomes sun.gif
|
246
|
+
#
|
247
|
+
# @param [String] filename the filename to be sanitized
|
248
|
+
# @return [String] the sanitized filename
|
249
|
+
def sanitize_filename(filename)
|
250
|
+
filename.gsub(/.*[\/\\]/, '')
|
251
|
+
end
|
252
|
+
|
253
|
+
def build_request_url(path)
|
254
|
+
# Add leading and trailing slashes to path
|
255
|
+
path = "/#{path}".gsub(/\/+/, '/')
|
256
|
+
URI.encode(@config.base_url + path)
|
257
|
+
end
|
258
|
+
|
259
|
+
# Builds the HTTP request body
|
260
|
+
#
|
261
|
+
# @param [Hash] header_params Header parameters
|
262
|
+
# @param [Hash] form_params Query parameters
|
263
|
+
# @param [Object] body HTTP body (JSON/XML)
|
264
|
+
# @return [String] HTTP body data in the form of string
|
265
|
+
def build_request_body(header_params, form_params, body)
|
266
|
+
# http form
|
267
|
+
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
268
|
+
header_params['Content-Type'] == 'multipart/form-data'
|
269
|
+
data = {}
|
270
|
+
form_params.each do |key, value|
|
271
|
+
case value
|
272
|
+
when File, Array, nil
|
273
|
+
# let typhoeus handle File, Array and nil parameters
|
274
|
+
data[key] = value
|
275
|
+
else
|
276
|
+
data[key] = value.to_s
|
277
|
+
end
|
278
|
+
end
|
279
|
+
elsif body
|
280
|
+
data = body.is_a?(String) ? body : body.to_json
|
281
|
+
else
|
282
|
+
data = nil
|
283
|
+
end
|
284
|
+
data
|
285
|
+
end
|
286
|
+
|
287
|
+
# Update hearder and query params based on authentication settings.
|
288
|
+
#
|
289
|
+
# @param [Hash] header_params Header parameters
|
290
|
+
# @param [Hash] query_params Query parameters
|
291
|
+
# @param [String] auth_names Authentication scheme name
|
292
|
+
def update_params_for_auth!(header_params, query_params, auth_names)
|
293
|
+
Array(auth_names).each do |auth_name|
|
294
|
+
auth_setting = @config.auth_settings[auth_name]
|
295
|
+
next unless auth_setting
|
296
|
+
case auth_setting[:in]
|
297
|
+
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
298
|
+
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
299
|
+
else fail ArgumentError, 'Authentication token must be in `query` of `header`'
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
# Sets user agent in HTTP header
|
305
|
+
#
|
306
|
+
# @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
|
307
|
+
def user_agent=(user_agent)
|
308
|
+
@user_agent = user_agent
|
309
|
+
@default_headers['User-Agent'] = @user_agent
|
310
|
+
end
|
311
|
+
|
312
|
+
# Return Accept header based on an array of accepts provided.
|
313
|
+
# @param [Array] accepts array for Accept
|
314
|
+
# @return [String] the Accept header (e.g. application/json)
|
315
|
+
def select_header_accept(accepts)
|
316
|
+
return nil if accepts.nil? || accepts.empty?
|
317
|
+
# use JSON when present, otherwise use all of the provided
|
318
|
+
json_accept = accepts.find { |s| json_mime?(s) }
|
319
|
+
return json_accept || accepts.join(',')
|
320
|
+
end
|
321
|
+
|
322
|
+
# Return Content-Type header based on an array of content types provided.
|
323
|
+
# @param [Array] content_types array for Content-Type
|
324
|
+
# @return [String] the Content-Type header (e.g. application/json)
|
325
|
+
def select_header_content_type(content_types)
|
326
|
+
# use application/json by default
|
327
|
+
return 'application/json' if content_types.nil? || content_types.empty?
|
328
|
+
# use JSON when present, otherwise use the first one
|
329
|
+
json_content_type = content_types.find { |s| json_mime?(s) }
|
330
|
+
return json_content_type || content_types.first
|
331
|
+
end
|
332
|
+
|
333
|
+
# Convert object (array, hash, object, etc) to JSON string.
|
334
|
+
# @param [Object] model object to be converted into JSON string
|
335
|
+
# @return [String] JSON string representation of the object
|
336
|
+
def object_to_http_body(model)
|
337
|
+
return model if model.nil? || model.is_a?(String)
|
338
|
+
local_body = nil
|
339
|
+
if model.is_a?(Array)
|
340
|
+
local_body = model.map{|m| object_to_hash(m) }
|
341
|
+
else
|
342
|
+
local_body = object_to_hash(model)
|
343
|
+
end
|
344
|
+
local_body.to_json
|
345
|
+
end
|
346
|
+
|
347
|
+
# Convert object(non-array) to hash.
|
348
|
+
# @param [Object] obj object to be converted into JSON string
|
349
|
+
# @return [String] JSON string representation of the object
|
350
|
+
def object_to_hash(obj)
|
351
|
+
if obj.respond_to?(:to_hash)
|
352
|
+
obj.to_hash
|
353
|
+
else
|
354
|
+
obj
|
355
|
+
end
|
356
|
+
end
|
357
|
+
|
358
|
+
# Build parameter value according to the given collection format.
|
359
|
+
# @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
|
360
|
+
def build_collection_param(param, collection_format)
|
361
|
+
case collection_format
|
362
|
+
when :csv
|
363
|
+
param.join(',')
|
364
|
+
when :ssv
|
365
|
+
param.join(' ')
|
366
|
+
when :tsv
|
367
|
+
param.join("\t")
|
368
|
+
when :pipes
|
369
|
+
param.join('|')
|
370
|
+
when :multi
|
371
|
+
# return the array directly as typhoeus will handle it as expected
|
372
|
+
param
|
373
|
+
else
|
374
|
+
fail "unknown collection format: #{collection_format.inspect}"
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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
|
+
module BillForward
|
25
|
+
class ApiError < StandardError
|
26
|
+
attr_reader :code, :response_headers, :response_body
|
27
|
+
|
28
|
+
# Usage examples:
|
29
|
+
# ApiError.new
|
30
|
+
# ApiError.new("message")
|
31
|
+
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
32
|
+
# ApiError.new(:code => 404, :message => "Not Found")
|
33
|
+
def initialize(arg = nil)
|
34
|
+
if arg.is_a? Hash
|
35
|
+
arg.each do |k, v|
|
36
|
+
if k.to_s == 'message'
|
37
|
+
super v
|
38
|
+
else
|
39
|
+
instance_variable_set "@#{k}", v
|
40
|
+
end
|
41
|
+
end
|
42
|
+
else
|
43
|
+
super arg
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,207 @@
|
|
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 Configuration
|
28
|
+
# Defines url scheme
|
29
|
+
attr_accessor :scheme
|
30
|
+
|
31
|
+
# Defines url host
|
32
|
+
attr_accessor :host
|
33
|
+
|
34
|
+
# Defines url base path
|
35
|
+
attr_accessor :base_path
|
36
|
+
|
37
|
+
# Defines API keys used with API Key authentications.
|
38
|
+
#
|
39
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
40
|
+
#
|
41
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
42
|
+
# config.api_key['api_key'] = 'xxx'
|
43
|
+
attr_accessor :api_key
|
44
|
+
|
45
|
+
# Defines API key prefixes used with API Key authentications.
|
46
|
+
#
|
47
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
48
|
+
#
|
49
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
50
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
51
|
+
attr_accessor :api_key_prefix
|
52
|
+
|
53
|
+
# Defines the username used with HTTP basic authentication.
|
54
|
+
#
|
55
|
+
# @return [String]
|
56
|
+
attr_accessor :username
|
57
|
+
|
58
|
+
# Defines the password used with HTTP basic authentication.
|
59
|
+
#
|
60
|
+
# @return [String]
|
61
|
+
attr_accessor :password
|
62
|
+
|
63
|
+
# Defines the access token (Bearer) used with OAuth2.
|
64
|
+
attr_accessor :access_token
|
65
|
+
|
66
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
67
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
68
|
+
# Default to false.
|
69
|
+
#
|
70
|
+
# @return [true, false]
|
71
|
+
attr_accessor :debugging
|
72
|
+
|
73
|
+
# Defines the logger used for debugging.
|
74
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
75
|
+
#
|
76
|
+
# @return [#debug]
|
77
|
+
attr_accessor :logger
|
78
|
+
|
79
|
+
# Defines the temporary folder to store downloaded files
|
80
|
+
# (for API endpoints that have file response).
|
81
|
+
# Default to use `Tempfile`.
|
82
|
+
#
|
83
|
+
# @return [String]
|
84
|
+
attr_accessor :temp_folder_path
|
85
|
+
|
86
|
+
# The time limit for HTTP request in seconds.
|
87
|
+
# Default to 0 (never times out).
|
88
|
+
attr_accessor :timeout
|
89
|
+
|
90
|
+
### TLS/SSL setting
|
91
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
92
|
+
# Default to true.
|
93
|
+
#
|
94
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
95
|
+
#
|
96
|
+
# @return [true, false]
|
97
|
+
attr_accessor :verify_ssl
|
98
|
+
|
99
|
+
### TLS/SSL setting
|
100
|
+
# Set this to false to skip verifying SSL host name
|
101
|
+
# Default to true.
|
102
|
+
#
|
103
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
104
|
+
#
|
105
|
+
# @return [true, false]
|
106
|
+
attr_accessor :verify_ssl_host
|
107
|
+
|
108
|
+
### TLS/SSL setting
|
109
|
+
# Set this to customize the certificate file to verify the peer.
|
110
|
+
#
|
111
|
+
# @return [String] the path to the certificate file
|
112
|
+
#
|
113
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
114
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
115
|
+
attr_accessor :ssl_ca_cert
|
116
|
+
|
117
|
+
### TLS/SSL setting
|
118
|
+
# Client certificate file (for client certificate)
|
119
|
+
attr_accessor :cert_file
|
120
|
+
|
121
|
+
### TLS/SSL setting
|
122
|
+
# Client private key file (for client certificate)
|
123
|
+
attr_accessor :key_file
|
124
|
+
|
125
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
126
|
+
# Default to nil.
|
127
|
+
#
|
128
|
+
# @see The params_encoding option of Ethon. Related source code:
|
129
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
130
|
+
attr_accessor :params_encoding
|
131
|
+
|
132
|
+
attr_accessor :inject_format
|
133
|
+
|
134
|
+
attr_accessor :force_ending_format
|
135
|
+
|
136
|
+
def initialize
|
137
|
+
@scheme = 'https'
|
138
|
+
@host = 'localhost:8080'
|
139
|
+
@base_path = '/RestAPI'
|
140
|
+
@api_key = {}
|
141
|
+
@api_key_prefix = {}
|
142
|
+
@timeout = 0
|
143
|
+
@verify_ssl = true
|
144
|
+
@verify_ssl_host = true
|
145
|
+
@params_encoding = nil
|
146
|
+
@cert_file = nil
|
147
|
+
@key_file = nil
|
148
|
+
@debugging = false
|
149
|
+
@inject_format = false
|
150
|
+
@force_ending_format = false
|
151
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
152
|
+
|
153
|
+
yield(self) if block_given?
|
154
|
+
end
|
155
|
+
|
156
|
+
# The default Configuration object.
|
157
|
+
def self.default
|
158
|
+
@@default ||= Configuration.new
|
159
|
+
end
|
160
|
+
|
161
|
+
def configure
|
162
|
+
yield(self) if block_given?
|
163
|
+
end
|
164
|
+
|
165
|
+
def scheme=(scheme)
|
166
|
+
# remove :// from scheme
|
167
|
+
@scheme = scheme.sub(/:\/\//, '')
|
168
|
+
end
|
169
|
+
|
170
|
+
def host=(host)
|
171
|
+
# remove http(s):// and anything after a slash
|
172
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
173
|
+
end
|
174
|
+
|
175
|
+
def base_path=(base_path)
|
176
|
+
# Add leading and trailing slashes to base_path
|
177
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
178
|
+
@base_path = "" if @base_path == "/"
|
179
|
+
end
|
180
|
+
|
181
|
+
def base_url
|
182
|
+
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
183
|
+
URI.encode(url)
|
184
|
+
end
|
185
|
+
|
186
|
+
# Gets API key (with prefix if set).
|
187
|
+
# @param [String] param_name the parameter name of API key auth
|
188
|
+
def api_key_with_prefix(param_name)
|
189
|
+
if @api_key_prefix[param_name]
|
190
|
+
"#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
|
191
|
+
else
|
192
|
+
@api_key[param_name]
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# Gets Basic Auth token string
|
197
|
+
def basic_auth_token
|
198
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns Auth Settings hash for api client.
|
202
|
+
def auth_settings
|
203
|
+
{
|
204
|
+
}
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|