payjpv2 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +33 -0
- data/.github/workflows/release.yml +46 -0
- data/.gitignore +39 -0
- data/.rspec +2 -0
- data/.rubocop.yml +111 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +94 -0
- data/README.md +399 -0
- data/Rakefile +10 -0
- data/docs/ApplePayConfigRequest.md +18 -0
- data/docs/BalanceListResponse.md +24 -0
- data/docs/BalanceResponse.md +40 -0
- data/docs/BalanceState.md +15 -0
- data/docs/BalanceURLResponse.md +22 -0
- data/docs/BalancesApi.md +235 -0
- data/docs/BankInfoResponse.md +28 -0
- data/docs/CaptureMethod.md +15 -0
- data/docs/CardConfigRequest.md +18 -0
- data/docs/CheckoutSessionCreateRequest.md +52 -0
- data/docs/CheckoutSessionCustomerDetailsAddressResponse.md +28 -0
- data/docs/CheckoutSessionCustomerDetailsResponse.md +24 -0
- data/docs/CheckoutSessionDetailsResponse.md +66 -0
- data/docs/CheckoutSessionLineItemDataResponse.md +34 -0
- data/docs/CheckoutSessionLineItemListResponse.md +24 -0
- data/docs/CheckoutSessionListResponse.md +24 -0
- data/docs/CheckoutSessionMode.md +15 -0
- data/docs/CheckoutSessionPaymentMethodOptionsCardRequest.md +20 -0
- data/docs/CheckoutSessionPaymentMethodOptionsRequest.md +18 -0
- data/docs/CheckoutSessionStatus.md +15 -0
- data/docs/CheckoutSessionSubmitType.md +15 -0
- data/docs/CheckoutSessionUIMode.md +15 -0
- data/docs/CheckoutSessionUpdateRequest.md +18 -0
- data/docs/CheckoutSessionsApi.md +373 -0
- data/docs/Country.md +15 -0
- data/docs/Currency.md +15 -0
- data/docs/CustomerCreateRequest.md +26 -0
- data/docs/CustomerCreation.md +15 -0
- data/docs/CustomerListResponse.md +24 -0
- data/docs/CustomerResponse.md +34 -0
- data/docs/CustomerUpdateRequest.md +24 -0
- data/docs/CustomersApi.md +443 -0
- data/docs/DisplayPreferenceRequest.md +18 -0
- data/docs/ErrorResponse.md +28 -0
- data/docs/EventListResponse.md +24 -0
- data/docs/EventResponse.md +32 -0
- data/docs/EventsApi.md +159 -0
- data/docs/LineItemRequest.md +22 -0
- data/docs/Locale.md +15 -0
- data/docs/MetadataValue.md +15 -0
- data/docs/PayPayConfigRequest.md +18 -0
- data/docs/PaymentDisputeListResponse.md +24 -0
- data/docs/PaymentDisputeReason.md +15 -0
- data/docs/PaymentDisputeResponse.md +42 -0
- data/docs/PaymentDisputeStatus.md +15 -0
- data/docs/PaymentDisputesApi.md +157 -0
- data/docs/PaymentFlowCancelRequest.md +18 -0
- data/docs/PaymentFlowCancellationReason.md +15 -0
- data/docs/PaymentFlowCaptureRequest.md +18 -0
- data/docs/PaymentFlowConfirmRequest.md +28 -0
- data/docs/PaymentFlowCreateRequest.md +38 -0
- data/docs/PaymentFlowDataRequest.md +22 -0
- data/docs/PaymentFlowListResponse.md +24 -0
- data/docs/PaymentFlowPaymentMethodOptionsCardRequest.md +20 -0
- data/docs/PaymentFlowPaymentMethodOptionsRequest.md +18 -0
- data/docs/PaymentFlowResponse.md +62 -0
- data/docs/PaymentFlowStatus.md +15 -0
- data/docs/PaymentFlowUpdateRequest.md +32 -0
- data/docs/PaymentFlowsApi.md +599 -0
- data/docs/PaymentMethodApplePayCreateRequest.md +26 -0
- data/docs/PaymentMethodApplePayUpdateRequest.md +22 -0
- data/docs/PaymentMethodAttachRequest.md +18 -0
- data/docs/PaymentMethodBillingAddressRequest.md +28 -0
- data/docs/PaymentMethodBillingAddressResponse.md +28 -0
- data/docs/PaymentMethodBillingDetailsRequest.md +24 -0
- data/docs/PaymentMethodBillingDetailsResponse.md +24 -0
- data/docs/PaymentMethodCardBillingDetailsRequest.md +24 -0
- data/docs/PaymentMethodCardCreateRequest.md +26 -0
- data/docs/PaymentMethodCardDetailsResponse.md +28 -0
- data/docs/PaymentMethodCardResponse.md +38 -0
- data/docs/PaymentMethodCardUpdateRequest.md +22 -0
- data/docs/PaymentMethodConfigurationDetailsResponse.md +32 -0
- data/docs/PaymentMethodConfigurationDisplayPreference.md +20 -0
- data/docs/PaymentMethodConfigurationListResponse.md +24 -0
- data/docs/PaymentMethodConfigurationSettingResponse.md +20 -0
- data/docs/PaymentMethodConfigurationUpdateRequest.md +26 -0
- data/docs/PaymentMethodConfigurationsApi.md +225 -0
- data/docs/PaymentMethodCreateCardDetailsRequest.md +24 -0
- data/docs/PaymentMethodCreateRequest.md +82 -0
- data/docs/PaymentMethodListResponse.md +24 -0
- data/docs/PaymentMethodPayPayCreateRequest.md +24 -0
- data/docs/PaymentMethodPayPayResponse.md +36 -0
- data/docs/PaymentMethodPayPayUpdateRequest.md +22 -0
- data/docs/PaymentMethodResponse.md +38 -0
- data/docs/PaymentMethodTypes.md +15 -0
- data/docs/PaymentMethodUpdateRequest.md +82 -0
- data/docs/PaymentMethodsApi.md +507 -0
- data/docs/PaymentRefundCreateRequest.md +24 -0
- data/docs/PaymentRefundListResponse.md +24 -0
- data/docs/PaymentRefundReason.md +15 -0
- data/docs/PaymentRefundResponse.md +36 -0
- data/docs/PaymentRefundStatus.md +15 -0
- data/docs/PaymentRefundUpdateRequest.md +18 -0
- data/docs/PaymentRefundsApi.md +295 -0
- data/docs/PaymentTransactionListResponse.md +24 -0
- data/docs/PaymentTransactionResponse.md +42 -0
- data/docs/PaymentTransactionType.md +15 -0
- data/docs/PaymentTransactionsApi.md +159 -0
- data/docs/PriceCreateRequest.md +32 -0
- data/docs/PriceDetailsResponse.md +42 -0
- data/docs/PriceListResponse.md +24 -0
- data/docs/PriceType.md +15 -0
- data/docs/PriceUpdateRequest.md +24 -0
- data/docs/PricesApi.md +297 -0
- data/docs/ProductCreateRequest.md +28 -0
- data/docs/ProductDeletedResponse.md +22 -0
- data/docs/ProductDetailsResponse.md +32 -0
- data/docs/ProductListResponse.md +24 -0
- data/docs/ProductUpdateRequest.md +28 -0
- data/docs/ProductsApi.md +365 -0
- data/docs/SetupFlowCancelRequest.md +18 -0
- data/docs/SetupFlowCancellationReason.md +15 -0
- data/docs/SetupFlowCreateRequest.md +28 -0
- data/docs/SetupFlowDataRequest.md +20 -0
- data/docs/SetupFlowListResponse.md +24 -0
- data/docs/SetupFlowPaymentMethodOptionsCardRequest.md +18 -0
- data/docs/SetupFlowPaymentMethodOptionsRequest.md +18 -0
- data/docs/SetupFlowResponse.md +50 -0
- data/docs/SetupFlowStatus.md +15 -0
- data/docs/SetupFlowUpdateRequest.md +26 -0
- data/docs/SetupFlowsApi.md +371 -0
- data/docs/StatementItemResponse.md +24 -0
- data/docs/StatementListResponse.md +24 -0
- data/docs/StatementResponse.md +38 -0
- data/docs/StatementSubject.md +15 -0
- data/docs/StatementType.md +15 -0
- data/docs/StatementURLResponse.md +22 -0
- data/docs/StatementsApi.md +231 -0
- data/docs/TaxRateCreateRequest.md +30 -0
- data/docs/TaxRateDetailsResponse.md +34 -0
- data/docs/TaxRateListResponse.md +24 -0
- data/docs/TaxRateUpdateRequest.md +26 -0
- data/docs/TaxRatesApi.md +295 -0
- data/docs/TermListResponse.md +24 -0
- data/docs/TermResponse.md +28 -0
- data/docs/TermsApi.md +157 -0
- data/docs/Usage.md +15 -0
- data/example.rb +157 -0
- data/lib/payjpv2/api/balances_api.rb +223 -0
- data/lib/payjpv2/api/checkout_sessions_api.rb +360 -0
- data/lib/payjpv2/api/customers_api.rb +420 -0
- data/lib/payjpv2/api/events_api.rb +157 -0
- data/lib/payjpv2/api/payment_disputes_api.rb +155 -0
- data/lib/payjpv2/api/payment_flows_api.rb +561 -0
- data/lib/payjpv2/api/payment_method_configurations_api.rb +221 -0
- data/lib/payjpv2/api/payment_methods_api.rb +476 -0
- data/lib/payjpv2/api/payment_refunds_api.rb +286 -0
- data/lib/payjpv2/api/payment_transactions_api.rb +157 -0
- data/lib/payjpv2/api/prices_api.rb +288 -0
- data/lib/payjpv2/api/products_api.rb +346 -0
- data/lib/payjpv2/api/setup_flows_api.rb +348 -0
- data/lib/payjpv2/api/statements_api.rb +219 -0
- data/lib/payjpv2/api/tax_rates_api.rb +286 -0
- data/lib/payjpv2/api/terms_api.rb +155 -0
- data/lib/payjpv2/api_client.rb +410 -0
- data/lib/payjpv2/api_error.rb +58 -0
- data/lib/payjpv2/configuration.rb +315 -0
- data/lib/payjpv2/models/apple_pay_config_request.rb +206 -0
- data/lib/payjpv2/models/balance_list_response.rb +306 -0
- data/lib/payjpv2/models/balance_response.rb +453 -0
- data/lib/payjpv2/models/balance_state.rb +41 -0
- data/lib/payjpv2/models/balance_url_response.rb +283 -0
- data/lib/payjpv2/models/bank_info_response.rb +328 -0
- data/lib/payjpv2/models/capture_method.rb +40 -0
- data/lib/payjpv2/models/card_config_request.rb +206 -0
- data/lib/payjpv2/models/checkout_session_create_request.rb +430 -0
- data/lib/payjpv2/models/checkout_session_customer_details_address_response.rb +269 -0
- data/lib/payjpv2/models/checkout_session_customer_details_response.rb +245 -0
- data/lib/payjpv2/models/checkout_session_details_response.rb +627 -0
- data/lib/payjpv2/models/checkout_session_line_item_data_response.rb +405 -0
- data/lib/payjpv2/models/checkout_session_line_item_list_response.rb +306 -0
- data/lib/payjpv2/models/checkout_session_list_response.rb +306 -0
- data/lib/payjpv2/models/checkout_session_mode.rb +40 -0
- data/lib/payjpv2/models/checkout_session_payment_method_options_card_request.rb +258 -0
- data/lib/payjpv2/models/checkout_session_payment_method_options_request.rb +206 -0
- data/lib/payjpv2/models/checkout_session_status.rb +41 -0
- data/lib/payjpv2/models/checkout_session_submit_type.rb +42 -0
- data/lib/payjpv2/models/checkout_session_ui_mode.rb +39 -0
- data/lib/payjpv2/models/checkout_session_update_request.rb +208 -0
- data/lib/payjpv2/models/country.rb +39 -0
- data/lib/payjpv2/models/currency.rb +39 -0
- data/lib/payjpv2/models/customer_create_request.rb +295 -0
- data/lib/payjpv2/models/customer_creation.rb +40 -0
- data/lib/payjpv2/models/customer_list_response.rb +306 -0
- data/lib/payjpv2/models/customer_response.rb +387 -0
- data/lib/payjpv2/models/customer_update_request.rb +266 -0
- data/lib/payjpv2/models/display_preference_request.rb +240 -0
- data/lib/payjpv2/models/error_response.rb +291 -0
- data/lib/payjpv2/models/event_list_response.rb +307 -0
- data/lib/payjpv2/models/event_response.rb +395 -0
- data/lib/payjpv2/models/line_item_request.rb +252 -0
- data/lib/payjpv2/models/locale.rb +40 -0
- data/lib/payjpv2/models/metadata_value.rb +105 -0
- data/lib/payjpv2/models/pay_pay_config_request.rb +206 -0
- data/lib/payjpv2/models/payment_dispute_list_response.rb +307 -0
- data/lib/payjpv2/models/payment_dispute_reason.rb +53 -0
- data/lib/payjpv2/models/payment_dispute_response.rb +485 -0
- data/lib/payjpv2/models/payment_dispute_status.rb +46 -0
- data/lib/payjpv2/models/payment_flow_cancel_request.rb +238 -0
- data/lib/payjpv2/models/payment_flow_cancellation_reason.rb +46 -0
- data/lib/payjpv2/models/payment_flow_capture_request.rb +224 -0
- data/lib/payjpv2/models/payment_flow_confirm_request.rb +280 -0
- data/lib/payjpv2/models/payment_flow_create_request.rb +366 -0
- data/lib/payjpv2/models/payment_flow_data_request.rb +250 -0
- data/lib/payjpv2/models/payment_flow_list_response.rb +307 -0
- data/lib/payjpv2/models/payment_flow_payment_method_options_card_request.rb +258 -0
- data/lib/payjpv2/models/payment_flow_payment_method_options_request.rb +206 -0
- data/lib/payjpv2/models/payment_flow_response.rb +623 -0
- data/lib/payjpv2/models/payment_flow_status.rb +45 -0
- data/lib/payjpv2/models/payment_flow_update_request.rb +298 -0
- data/lib/payjpv2/models/payment_method_apple_pay_create_request.rb +294 -0
- data/lib/payjpv2/models/payment_method_apple_pay_update_request.rb +262 -0
- data/lib/payjpv2/models/payment_method_attach_request.rb +218 -0
- data/lib/payjpv2/models/payment_method_billing_address_request.rb +256 -0
- data/lib/payjpv2/models/payment_method_billing_address_response.rb +268 -0
- data/lib/payjpv2/models/payment_method_billing_details_request.rb +236 -0
- data/lib/payjpv2/models/payment_method_billing_details_response.rb +254 -0
- data/lib/payjpv2/models/payment_method_card_billing_details_request.rb +237 -0
- data/lib/payjpv2/models/payment_method_card_create_request.rb +306 -0
- data/lib/payjpv2/models/payment_method_card_details_response.rb +318 -0
- data/lib/payjpv2/models/payment_method_card_response.rb +440 -0
- data/lib/payjpv2/models/payment_method_card_update_request.rb +262 -0
- data/lib/payjpv2/models/payment_method_configuration_details_response.rb +383 -0
- data/lib/payjpv2/models/payment_method_configuration_display_preference.rb +258 -0
- data/lib/payjpv2/models/payment_method_configuration_list_response.rb +306 -0
- data/lib/payjpv2/models/payment_method_configuration_setting_response.rb +216 -0
- data/lib/payjpv2/models/payment_method_configuration_update_request.rb +246 -0
- data/lib/payjpv2/models/payment_method_create_card_details_request.rb +310 -0
- data/lib/payjpv2/models/payment_method_create_request.rb +57 -0
- data/lib/payjpv2/models/payment_method_list_response.rb +306 -0
- data/lib/payjpv2/models/payment_method_pay_pay_create_request.rb +272 -0
- data/lib/payjpv2/models/payment_method_pay_pay_response.rb +418 -0
- data/lib/payjpv2/models/payment_method_pay_pay_update_request.rb +262 -0
- data/lib/payjpv2/models/payment_method_response.rb +104 -0
- data/lib/payjpv2/models/payment_method_types.rb +41 -0
- data/lib/payjpv2/models/payment_method_update_request.rb +57 -0
- data/lib/payjpv2/models/payment_refund_create_request.rb +286 -0
- data/lib/payjpv2/models/payment_refund_list_response.rb +307 -0
- data/lib/payjpv2/models/payment_refund_reason.rb +41 -0
- data/lib/payjpv2/models/payment_refund_response.rb +429 -0
- data/lib/payjpv2/models/payment_refund_status.rb +43 -0
- data/lib/payjpv2/models/payment_refund_update_request.rb +208 -0
- data/lib/payjpv2/models/payment_transaction_list_response.rb +307 -0
- data/lib/payjpv2/models/payment_transaction_response.rb +508 -0
- data/lib/payjpv2/models/payment_transaction_type.rb +42 -0
- data/lib/payjpv2/models/price_create_request.rb +342 -0
- data/lib/payjpv2/models/price_details_response.rb +485 -0
- data/lib/payjpv2/models/price_list_response.rb +306 -0
- data/lib/payjpv2/models/price_type.rb +39 -0
- data/lib/payjpv2/models/price_update_request.rb +238 -0
- data/lib/payjpv2/models/product_create_request.rb +270 -0
- data/lib/payjpv2/models/product_deleted_response.rb +273 -0
- data/lib/payjpv2/models/product_details_response.rb +353 -0
- data/lib/payjpv2/models/product_list_response.rb +306 -0
- data/lib/payjpv2/models/product_update_request.rb +256 -0
- data/lib/payjpv2/models/setup_flow_cancel_request.rb +228 -0
- data/lib/payjpv2/models/setup_flow_cancellation_reason.rb +41 -0
- data/lib/payjpv2/models/setup_flow_create_request.rb +282 -0
- data/lib/payjpv2/models/setup_flow_data_request.rb +218 -0
- data/lib/payjpv2/models/setup_flow_list_response.rb +306 -0
- data/lib/payjpv2/models/setup_flow_payment_method_options_card_request.rb +238 -0
- data/lib/payjpv2/models/setup_flow_payment_method_options_request.rb +206 -0
- data/lib/payjpv2/models/setup_flow_response.rb +521 -0
- data/lib/payjpv2/models/setup_flow_status.rb +44 -0
- data/lib/payjpv2/models/setup_flow_update_request.rb +272 -0
- data/lib/payjpv2/models/statement_item_response.rb +297 -0
- data/lib/payjpv2/models/statement_list_response.rb +306 -0
- data/lib/payjpv2/models/statement_response.rb +431 -0
- data/lib/payjpv2/models/statement_subject.rb +55 -0
- data/lib/payjpv2/models/statement_type.rb +43 -0
- data/lib/payjpv2/models/statement_url_response.rb +283 -0
- data/lib/payjpv2/models/tax_rate_create_request.rb +336 -0
- data/lib/payjpv2/models/tax_rate_details_response.rb +397 -0
- data/lib/payjpv2/models/tax_rate_list_response.rb +306 -0
- data/lib/payjpv2/models/tax_rate_update_request.rb +270 -0
- data/lib/payjpv2/models/term_list_response.rb +306 -0
- data/lib/payjpv2/models/term_response.rb +349 -0
- data/lib/payjpv2/models/usage.rb +40 -0
- data/lib/payjpv2/version.rb +15 -0
- data/lib/payjpv2.rb +176 -0
- data/payjpv2.gemspec +45 -0
- data/spec/api/balances_api_spec.rb +142 -0
- data/spec/api/checkout_sessions_api_spec.rb +206 -0
- data/spec/api/customers_api_spec.rb +239 -0
- data/spec/api/events_api_spec.rb +106 -0
- data/spec/api/payment_disputes_api_spec.rb +105 -0
- data/spec/api/payment_flows_api_spec.rb +310 -0
- data/spec/api/payment_method_configurations_api_spec.rb +137 -0
- data/spec/api/payment_methods_api_spec.rb +270 -0
- data/spec/api/payment_refunds_api_spec.rb +170 -0
- data/spec/api/payment_transactions_api_spec.rb +106 -0
- data/spec/api/prices_api_spec.rb +171 -0
- data/spec/api/products_api_spec.rb +203 -0
- data/spec/api/setup_flows_api_spec.rb +204 -0
- data/spec/api/statements_api_spec.rb +140 -0
- data/spec/api/tax_rates_api_spec.rb +170 -0
- data/spec/api/terms_api_spec.rb +105 -0
- data/spec/models/apple_pay_config_request_spec.rb +36 -0
- data/spec/models/balance_list_response_spec.rb +58 -0
- data/spec/models/balance_response_spec.rb +106 -0
- data/spec/models/balance_state_spec.rb +30 -0
- data/spec/models/balance_url_response_spec.rb +52 -0
- data/spec/models/bank_info_response_spec.rb +66 -0
- data/spec/models/capture_method_spec.rb +30 -0
- data/spec/models/card_config_request_spec.rb +36 -0
- data/spec/models/checkout_session_create_request_spec.rb +138 -0
- data/spec/models/checkout_session_customer_details_address_response_spec.rb +66 -0
- data/spec/models/checkout_session_customer_details_response_spec.rb +54 -0
- data/spec/models/checkout_session_details_response_spec.rb +184 -0
- data/spec/models/checkout_session_line_item_data_response_spec.rb +88 -0
- data/spec/models/checkout_session_line_item_list_response_spec.rb +58 -0
- data/spec/models/checkout_session_list_response_spec.rb +58 -0
- data/spec/models/checkout_session_mode_spec.rb +30 -0
- data/spec/models/checkout_session_payment_method_options_card_request_spec.rb +50 -0
- data/spec/models/checkout_session_payment_method_options_request_spec.rb +36 -0
- data/spec/models/checkout_session_status_spec.rb +30 -0
- data/spec/models/checkout_session_submit_type_spec.rb +30 -0
- data/spec/models/checkout_session_ui_mode_spec.rb +30 -0
- data/spec/models/checkout_session_update_request_spec.rb +36 -0
- data/spec/models/country_spec.rb +30 -0
- data/spec/models/currency_spec.rb +30 -0
- data/spec/models/customer_create_request_spec.rb +60 -0
- data/spec/models/customer_creation_spec.rb +30 -0
- data/spec/models/customer_list_response_spec.rb +58 -0
- data/spec/models/customer_response_spec.rb +88 -0
- data/spec/models/customer_update_request_spec.rb +54 -0
- data/spec/models/display_preference_request_spec.rb +40 -0
- data/spec/models/error_response_spec.rb +66 -0
- data/spec/models/event_list_response_spec.rb +58 -0
- data/spec/models/event_response_spec.rb +82 -0
- data/spec/models/line_item_request_spec.rb +48 -0
- data/spec/models/locale_spec.rb +30 -0
- data/spec/models/metadata_value_spec.rb +21 -0
- data/spec/models/pay_pay_config_request_spec.rb +36 -0
- data/spec/models/payment_dispute_list_response_spec.rb +58 -0
- data/spec/models/payment_dispute_reason_spec.rb +30 -0
- data/spec/models/payment_dispute_response_spec.rb +112 -0
- data/spec/models/payment_dispute_status_spec.rb +30 -0
- data/spec/models/payment_flow_cancel_request_spec.rb +40 -0
- data/spec/models/payment_flow_cancellation_reason_spec.rb +30 -0
- data/spec/models/payment_flow_capture_request_spec.rb +36 -0
- data/spec/models/payment_flow_confirm_request_spec.rb +66 -0
- data/spec/models/payment_flow_create_request_spec.rb +96 -0
- data/spec/models/payment_flow_data_request_spec.rb +48 -0
- data/spec/models/payment_flow_list_response_spec.rb +58 -0
- data/spec/models/payment_flow_payment_method_options_card_request_spec.rb +50 -0
- data/spec/models/payment_flow_payment_method_options_request_spec.rb +36 -0
- data/spec/models/payment_flow_response_spec.rb +172 -0
- data/spec/models/payment_flow_status_spec.rb +30 -0
- data/spec/models/payment_flow_update_request_spec.rb +78 -0
- data/spec/models/payment_method_apple_pay_create_request_spec.rb +64 -0
- data/spec/models/payment_method_apple_pay_update_request_spec.rb +52 -0
- data/spec/models/payment_method_attach_request_spec.rb +36 -0
- data/spec/models/payment_method_billing_address_request_spec.rb +66 -0
- data/spec/models/payment_method_billing_address_response_spec.rb +66 -0
- data/spec/models/payment_method_billing_details_request_spec.rb +54 -0
- data/spec/models/payment_method_billing_details_response_spec.rb +54 -0
- data/spec/models/payment_method_card_billing_details_request_spec.rb +54 -0
- data/spec/models/payment_method_card_create_request_spec.rb +64 -0
- data/spec/models/payment_method_card_details_response_spec.rb +66 -0
- data/spec/models/payment_method_card_response_spec.rb +104 -0
- data/spec/models/payment_method_card_update_request_spec.rb +52 -0
- data/spec/models/payment_method_configuration_details_response_spec.rb +82 -0
- data/spec/models/payment_method_configuration_display_preference_spec.rb +50 -0
- data/spec/models/payment_method_configuration_list_response_spec.rb +58 -0
- data/spec/models/payment_method_configuration_setting_response_spec.rb +42 -0
- data/spec/models/payment_method_configuration_update_request_spec.rb +60 -0
- data/spec/models/payment_method_create_card_details_request_spec.rb +54 -0
- data/spec/models/payment_method_create_request_spec.rb +44 -0
- data/spec/models/payment_method_list_response_spec.rb +58 -0
- data/spec/models/payment_method_pay_pay_create_request_spec.rb +58 -0
- data/spec/models/payment_method_pay_pay_response_spec.rb +98 -0
- data/spec/models/payment_method_pay_pay_update_request_spec.rb +52 -0
- data/spec/models/payment_method_response_spec.rb +21 -0
- data/spec/models/payment_method_types_spec.rb +30 -0
- data/spec/models/payment_method_update_request_spec.rb +44 -0
- data/spec/models/payment_refund_create_request_spec.rb +54 -0
- data/spec/models/payment_refund_list_response_spec.rb +58 -0
- data/spec/models/payment_refund_reason_spec.rb +30 -0
- data/spec/models/payment_refund_response_spec.rb +94 -0
- data/spec/models/payment_refund_status_spec.rb +30 -0
- data/spec/models/payment_refund_update_request_spec.rb +36 -0
- data/spec/models/payment_transaction_list_response_spec.rb +58 -0
- data/spec/models/payment_transaction_response_spec.rb +112 -0
- data/spec/models/payment_transaction_type_spec.rb +30 -0
- data/spec/models/price_create_request_spec.rb +78 -0
- data/spec/models/price_details_response_spec.rb +112 -0
- data/spec/models/price_list_response_spec.rb +58 -0
- data/spec/models/price_type_spec.rb +30 -0
- data/spec/models/price_update_request_spec.rb +54 -0
- data/spec/models/product_create_request_spec.rb +66 -0
- data/spec/models/product_deleted_response_spec.rb +52 -0
- data/spec/models/product_details_response_spec.rb +82 -0
- data/spec/models/product_list_response_spec.rb +58 -0
- data/spec/models/product_update_request_spec.rb +66 -0
- data/spec/models/setup_flow_cancel_request_spec.rb +36 -0
- data/spec/models/setup_flow_cancellation_reason_spec.rb +30 -0
- data/spec/models/setup_flow_create_request_spec.rb +70 -0
- data/spec/models/setup_flow_data_request_spec.rb +42 -0
- data/spec/models/setup_flow_list_response_spec.rb +58 -0
- data/spec/models/setup_flow_payment_method_options_card_request_spec.rb +40 -0
- data/spec/models/setup_flow_payment_method_options_request_spec.rb +36 -0
- data/spec/models/setup_flow_response_spec.rb +136 -0
- data/spec/models/setup_flow_status_spec.rb +30 -0
- data/spec/models/setup_flow_update_request_spec.rb +64 -0
- data/spec/models/statement_item_response_spec.rb +54 -0
- data/spec/models/statement_list_response_spec.rb +58 -0
- data/spec/models/statement_response_spec.rb +100 -0
- data/spec/models/statement_subject_spec.rb +30 -0
- data/spec/models/statement_type_spec.rb +30 -0
- data/spec/models/statement_url_response_spec.rb +52 -0
- data/spec/models/tax_rate_create_request_spec.rb +72 -0
- data/spec/models/tax_rate_details_response_spec.rb +88 -0
- data/spec/models/tax_rate_list_response_spec.rb +58 -0
- data/spec/models/tax_rate_update_request_spec.rb +60 -0
- data/spec/models/term_list_response_spec.rb +58 -0
- data/spec/models/term_response_spec.rb +70 -0
- data/spec/models/usage_spec.rb +30 -0
- data/spec/spec_helper.rb +111 -0
- metadata +651 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PAY.JP API v2
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module PAYJPv2
|
|
16
|
+
class PricesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create Price
|
|
23
|
+
# @param price_create_request [PriceCreateRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
26
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
27
|
+
# @return [PriceDetailsResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
28
|
+
def create_price(price_create_request, opts = {})
|
|
29
|
+
if @api_client.config.debugging
|
|
30
|
+
@api_client.config.logger.debug 'Calling API: PricesApi.create_price ...'
|
|
31
|
+
end
|
|
32
|
+
# verify the required parameter 'price_create_request' is set
|
|
33
|
+
if @api_client.config.client_side_validation && price_create_request.nil?
|
|
34
|
+
raise ArgumentError, "Missing the required parameter 'price_create_request' when calling PricesApi.create_price"
|
|
35
|
+
end
|
|
36
|
+
# resource path
|
|
37
|
+
local_var_path = '/v2/prices'
|
|
38
|
+
|
|
39
|
+
# query parameters
|
|
40
|
+
query_params = opts[:query_params] || {}
|
|
41
|
+
|
|
42
|
+
# header parameters
|
|
43
|
+
header_params = opts[:header_params] || {}
|
|
44
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
47
|
+
# HTTP header 'Content-Type'
|
|
48
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
49
|
+
if !content_type.nil?
|
|
50
|
+
header_params['Content-Type'] = content_type
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# form parameters
|
|
54
|
+
form_params = opts[:form_params] || {}
|
|
55
|
+
|
|
56
|
+
# http body (model)
|
|
57
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(price_create_request)
|
|
58
|
+
|
|
59
|
+
# return_type
|
|
60
|
+
return_type = opts[:debug_return_type] || 'PriceDetailsResponse'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:operation => :"PricesApi.create_price",
|
|
67
|
+
:header_params => header_params,
|
|
68
|
+
:query_params => query_params,
|
|
69
|
+
:form_params => form_params,
|
|
70
|
+
:body => post_body,
|
|
71
|
+
:auth_names => auth_names,
|
|
72
|
+
:return_type => return_type
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
76
|
+
if @api_client.config.debugging
|
|
77
|
+
@api_client.config.logger.debug "API called: PricesApi#create_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if opts[:include_http_info]
|
|
81
|
+
[data, status_code, headers]
|
|
82
|
+
else
|
|
83
|
+
data
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Get All Prices
|
|
88
|
+
# @param [Hash] opts the optional parameters
|
|
89
|
+
# @option opts [Integer] :limit 取得するデータの最大件数 (default to 10)
|
|
90
|
+
# @option opts [String] :starting_after このIDより後のデータを取得
|
|
91
|
+
# @option opts [String] :ending_before このIDより前のデータを取得
|
|
92
|
+
# @option opts [Array<String>] :lookup_keys 価格を動的に取得するために使用される検索キー
|
|
93
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
94
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
95
|
+
# @return [PriceListResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
96
|
+
def get_all_prices(opts = {})
|
|
97
|
+
if @api_client.config.debugging
|
|
98
|
+
@api_client.config.logger.debug 'Calling API: PricesApi.get_all_prices ...'
|
|
99
|
+
end
|
|
100
|
+
if @api_client.config.client_side_validation && !opts[:limit].nil? && opts[:limit] > 100
|
|
101
|
+
raise ArgumentError, 'invalid value for "opts[:limit]" when calling PricesApi.get_all_prices, must be smaller than or equal to 100.'
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if @api_client.config.client_side_validation && !opts[:limit].nil? && opts[:limit] < 1
|
|
105
|
+
raise ArgumentError, 'invalid value for "opts[:limit]" when calling PricesApi.get_all_prices, must be greater than or equal to 1.'
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# resource path
|
|
109
|
+
local_var_path = '/v2/prices'
|
|
110
|
+
|
|
111
|
+
# query parameters
|
|
112
|
+
query_params = opts[:query_params] || {}
|
|
113
|
+
query_params[:limit] = opts[:limit] if !opts[:limit].nil?
|
|
114
|
+
query_params[:starting_after] = opts[:starting_after] if !opts[:starting_after].nil?
|
|
115
|
+
query_params[:ending_before] = opts[:ending_before] if !opts[:ending_before].nil?
|
|
116
|
+
query_params[:lookup_keys] = @api_client.build_collection_param(opts[:lookup_keys], :multi) if !opts[:lookup_keys].nil?
|
|
117
|
+
|
|
118
|
+
# header parameters
|
|
119
|
+
header_params = opts[:header_params] || {}
|
|
120
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
123
|
+
|
|
124
|
+
# form parameters
|
|
125
|
+
form_params = opts[:form_params] || {}
|
|
126
|
+
|
|
127
|
+
# http body (model)
|
|
128
|
+
post_body = opts[:debug_body]
|
|
129
|
+
|
|
130
|
+
# return_type
|
|
131
|
+
return_type = opts[:debug_return_type] || 'PriceListResponse'
|
|
132
|
+
|
|
133
|
+
# auth_names
|
|
134
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
135
|
+
|
|
136
|
+
new_options = opts.merge(
|
|
137
|
+
:operation => :"PricesApi.get_all_prices",
|
|
138
|
+
:header_params => header_params,
|
|
139
|
+
:query_params => query_params,
|
|
140
|
+
:form_params => form_params,
|
|
141
|
+
:body => post_body,
|
|
142
|
+
:auth_names => auth_names,
|
|
143
|
+
:return_type => return_type
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
147
|
+
if @api_client.config.debugging
|
|
148
|
+
@api_client.config.logger.debug "API called: PricesApi#get_all_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if opts[:include_http_info]
|
|
152
|
+
[data, status_code, headers]
|
|
153
|
+
else
|
|
154
|
+
data
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Get Price
|
|
159
|
+
# @param price_id [String]
|
|
160
|
+
# @param [Hash] opts the optional parameters
|
|
161
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
162
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
163
|
+
# @return [PriceDetailsResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
164
|
+
def get_price(price_id, opts = {})
|
|
165
|
+
if @api_client.config.debugging
|
|
166
|
+
@api_client.config.logger.debug 'Calling API: PricesApi.get_price ...'
|
|
167
|
+
end
|
|
168
|
+
# verify the required parameter 'price_id' is set
|
|
169
|
+
if @api_client.config.client_side_validation && price_id.nil?
|
|
170
|
+
raise ArgumentError, "Missing the required parameter 'price_id' when calling PricesApi.get_price"
|
|
171
|
+
end
|
|
172
|
+
# resource path
|
|
173
|
+
local_var_path = '/v2/prices/{price_id}'.sub('{' + 'price_id' + '}', CGI.escape(price_id.to_s))
|
|
174
|
+
|
|
175
|
+
# query parameters
|
|
176
|
+
query_params = opts[:query_params] || {}
|
|
177
|
+
|
|
178
|
+
# header parameters
|
|
179
|
+
header_params = opts[:header_params] || {}
|
|
180
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
181
|
+
# HTTP header 'Accept' (if needed)
|
|
182
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
183
|
+
|
|
184
|
+
# form parameters
|
|
185
|
+
form_params = opts[:form_params] || {}
|
|
186
|
+
|
|
187
|
+
# http body (model)
|
|
188
|
+
post_body = opts[:debug_body]
|
|
189
|
+
|
|
190
|
+
# return_type
|
|
191
|
+
return_type = opts[:debug_return_type] || 'PriceDetailsResponse'
|
|
192
|
+
|
|
193
|
+
# auth_names
|
|
194
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
195
|
+
|
|
196
|
+
new_options = opts.merge(
|
|
197
|
+
:operation => :"PricesApi.get_price",
|
|
198
|
+
:header_params => header_params,
|
|
199
|
+
:query_params => query_params,
|
|
200
|
+
:form_params => form_params,
|
|
201
|
+
:body => post_body,
|
|
202
|
+
:auth_names => auth_names,
|
|
203
|
+
:return_type => return_type
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
207
|
+
if @api_client.config.debugging
|
|
208
|
+
@api_client.config.logger.debug "API called: PricesApi#get_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if opts[:include_http_info]
|
|
212
|
+
[data, status_code, headers]
|
|
213
|
+
else
|
|
214
|
+
data
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Update Price
|
|
219
|
+
# @param price_id [String]
|
|
220
|
+
# @param price_update_request [PriceUpdateRequest]
|
|
221
|
+
# @param [Hash] opts the optional parameters
|
|
222
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
223
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
224
|
+
# @return [PriceDetailsResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
225
|
+
def update_price(price_id, price_update_request, opts = {})
|
|
226
|
+
if @api_client.config.debugging
|
|
227
|
+
@api_client.config.logger.debug 'Calling API: PricesApi.update_price ...'
|
|
228
|
+
end
|
|
229
|
+
# verify the required parameter 'price_id' is set
|
|
230
|
+
if @api_client.config.client_side_validation && price_id.nil?
|
|
231
|
+
raise ArgumentError, "Missing the required parameter 'price_id' when calling PricesApi.update_price"
|
|
232
|
+
end
|
|
233
|
+
# verify the required parameter 'price_update_request' is set
|
|
234
|
+
if @api_client.config.client_side_validation && price_update_request.nil?
|
|
235
|
+
raise ArgumentError, "Missing the required parameter 'price_update_request' when calling PricesApi.update_price"
|
|
236
|
+
end
|
|
237
|
+
# resource path
|
|
238
|
+
local_var_path = '/v2/prices/{price_id}'.sub('{' + 'price_id' + '}', CGI.escape(price_id.to_s))
|
|
239
|
+
|
|
240
|
+
# query parameters
|
|
241
|
+
query_params = opts[:query_params] || {}
|
|
242
|
+
|
|
243
|
+
# header parameters
|
|
244
|
+
header_params = opts[:header_params] || {}
|
|
245
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
246
|
+
# HTTP header 'Accept' (if needed)
|
|
247
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
248
|
+
# HTTP header 'Content-Type'
|
|
249
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
250
|
+
if !content_type.nil?
|
|
251
|
+
header_params['Content-Type'] = content_type
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# form parameters
|
|
255
|
+
form_params = opts[:form_params] || {}
|
|
256
|
+
|
|
257
|
+
# http body (model)
|
|
258
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(price_update_request)
|
|
259
|
+
|
|
260
|
+
# return_type
|
|
261
|
+
return_type = opts[:debug_return_type] || 'PriceDetailsResponse'
|
|
262
|
+
|
|
263
|
+
# auth_names
|
|
264
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
265
|
+
|
|
266
|
+
new_options = opts.merge(
|
|
267
|
+
:operation => :"PricesApi.update_price",
|
|
268
|
+
:header_params => header_params,
|
|
269
|
+
:query_params => query_params,
|
|
270
|
+
:form_params => form_params,
|
|
271
|
+
:body => post_body,
|
|
272
|
+
:auth_names => auth_names,
|
|
273
|
+
:return_type => return_type
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
277
|
+
if @api_client.config.debugging
|
|
278
|
+
@api_client.config.logger.debug "API called: PricesApi#update_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if opts[:include_http_info]
|
|
282
|
+
[data, status_code, headers]
|
|
283
|
+
else
|
|
284
|
+
data
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
end
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PAY.JP API v2
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module PAYJPv2
|
|
16
|
+
class ProductsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create Product
|
|
23
|
+
# @param product_create_request [ProductCreateRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
26
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
27
|
+
# @return [ProductDetailsResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
28
|
+
def create_product(product_create_request, opts = {})
|
|
29
|
+
if @api_client.config.debugging
|
|
30
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.create_product ...'
|
|
31
|
+
end
|
|
32
|
+
# verify the required parameter 'product_create_request' is set
|
|
33
|
+
if @api_client.config.client_side_validation && product_create_request.nil?
|
|
34
|
+
raise ArgumentError, "Missing the required parameter 'product_create_request' when calling ProductsApi.create_product"
|
|
35
|
+
end
|
|
36
|
+
# resource path
|
|
37
|
+
local_var_path = '/v2/products'
|
|
38
|
+
|
|
39
|
+
# query parameters
|
|
40
|
+
query_params = opts[:query_params] || {}
|
|
41
|
+
|
|
42
|
+
# header parameters
|
|
43
|
+
header_params = opts[:header_params] || {}
|
|
44
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
47
|
+
# HTTP header 'Content-Type'
|
|
48
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
49
|
+
if !content_type.nil?
|
|
50
|
+
header_params['Content-Type'] = content_type
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# form parameters
|
|
54
|
+
form_params = opts[:form_params] || {}
|
|
55
|
+
|
|
56
|
+
# http body (model)
|
|
57
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(product_create_request)
|
|
58
|
+
|
|
59
|
+
# return_type
|
|
60
|
+
return_type = opts[:debug_return_type] || 'ProductDetailsResponse'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:operation => :"ProductsApi.create_product",
|
|
67
|
+
:header_params => header_params,
|
|
68
|
+
:query_params => query_params,
|
|
69
|
+
:form_params => form_params,
|
|
70
|
+
:body => post_body,
|
|
71
|
+
:auth_names => auth_names,
|
|
72
|
+
:return_type => return_type
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
76
|
+
if @api_client.config.debugging
|
|
77
|
+
@api_client.config.logger.debug "API called: ProductsApi#create_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if opts[:include_http_info]
|
|
81
|
+
[data, status_code, headers]
|
|
82
|
+
else
|
|
83
|
+
data
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Delete Product
|
|
88
|
+
# @param product_id [String]
|
|
89
|
+
# @param [Hash] opts the optional parameters
|
|
90
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
91
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
92
|
+
# @return [ProductDeletedResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
93
|
+
def delete_product(product_id, opts = {})
|
|
94
|
+
if @api_client.config.debugging
|
|
95
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.delete_product ...'
|
|
96
|
+
end
|
|
97
|
+
# verify the required parameter 'product_id' is set
|
|
98
|
+
if @api_client.config.client_side_validation && product_id.nil?
|
|
99
|
+
raise ArgumentError, "Missing the required parameter 'product_id' when calling ProductsApi.delete_product"
|
|
100
|
+
end
|
|
101
|
+
# resource path
|
|
102
|
+
local_var_path = '/v2/products/{product_id}'.sub('{' + 'product_id' + '}', CGI.escape(product_id.to_s))
|
|
103
|
+
|
|
104
|
+
# query parameters
|
|
105
|
+
query_params = opts[:query_params] || {}
|
|
106
|
+
|
|
107
|
+
# header parameters
|
|
108
|
+
header_params = opts[:header_params] || {}
|
|
109
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
110
|
+
# HTTP header 'Accept' (if needed)
|
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
112
|
+
|
|
113
|
+
# form parameters
|
|
114
|
+
form_params = opts[:form_params] || {}
|
|
115
|
+
|
|
116
|
+
# http body (model)
|
|
117
|
+
post_body = opts[:debug_body]
|
|
118
|
+
|
|
119
|
+
# return_type
|
|
120
|
+
return_type = opts[:debug_return_type] || 'ProductDeletedResponse'
|
|
121
|
+
|
|
122
|
+
# auth_names
|
|
123
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
124
|
+
|
|
125
|
+
new_options = opts.merge(
|
|
126
|
+
:operation => :"ProductsApi.delete_product",
|
|
127
|
+
:header_params => header_params,
|
|
128
|
+
:query_params => query_params,
|
|
129
|
+
:form_params => form_params,
|
|
130
|
+
:body => post_body,
|
|
131
|
+
:auth_names => auth_names,
|
|
132
|
+
:return_type => return_type
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
136
|
+
if @api_client.config.debugging
|
|
137
|
+
@api_client.config.logger.debug "API called: ProductsApi#delete_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if opts[:include_http_info]
|
|
141
|
+
[data, status_code, headers]
|
|
142
|
+
else
|
|
143
|
+
data
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Get All Products
|
|
148
|
+
# @param [Hash] opts the optional parameters
|
|
149
|
+
# @option opts [Integer] :limit 取得するデータの最大件数 (default to 10)
|
|
150
|
+
# @option opts [String] :starting_after このIDより後のデータを取得
|
|
151
|
+
# @option opts [String] :ending_before このIDより前のデータを取得
|
|
152
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
153
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
154
|
+
# @return [ProductListResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
155
|
+
def get_all_products(opts = {})
|
|
156
|
+
if @api_client.config.debugging
|
|
157
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.get_all_products ...'
|
|
158
|
+
end
|
|
159
|
+
if @api_client.config.client_side_validation && !opts[:limit].nil? && opts[:limit] > 100
|
|
160
|
+
raise ArgumentError, 'invalid value for "opts[:limit]" when calling ProductsApi.get_all_products, must be smaller than or equal to 100.'
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if @api_client.config.client_side_validation && !opts[:limit].nil? && opts[:limit] < 1
|
|
164
|
+
raise ArgumentError, 'invalid value for "opts[:limit]" when calling ProductsApi.get_all_products, must be greater than or equal to 1.'
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# resource path
|
|
168
|
+
local_var_path = '/v2/products'
|
|
169
|
+
|
|
170
|
+
# query parameters
|
|
171
|
+
query_params = opts[:query_params] || {}
|
|
172
|
+
query_params[:limit] = opts[:limit] if !opts[:limit].nil?
|
|
173
|
+
query_params[:starting_after] = opts[:starting_after] if !opts[:starting_after].nil?
|
|
174
|
+
query_params[:ending_before] = opts[:ending_before] if !opts[:ending_before].nil?
|
|
175
|
+
|
|
176
|
+
# header parameters
|
|
177
|
+
header_params = opts[:header_params] || {}
|
|
178
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
179
|
+
# HTTP header 'Accept' (if needed)
|
|
180
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
181
|
+
|
|
182
|
+
# form parameters
|
|
183
|
+
form_params = opts[:form_params] || {}
|
|
184
|
+
|
|
185
|
+
# http body (model)
|
|
186
|
+
post_body = opts[:debug_body]
|
|
187
|
+
|
|
188
|
+
# return_type
|
|
189
|
+
return_type = opts[:debug_return_type] || 'ProductListResponse'
|
|
190
|
+
|
|
191
|
+
# auth_names
|
|
192
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
193
|
+
|
|
194
|
+
new_options = opts.merge(
|
|
195
|
+
:operation => :"ProductsApi.get_all_products",
|
|
196
|
+
:header_params => header_params,
|
|
197
|
+
:query_params => query_params,
|
|
198
|
+
:form_params => form_params,
|
|
199
|
+
:body => post_body,
|
|
200
|
+
:auth_names => auth_names,
|
|
201
|
+
:return_type => return_type
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
205
|
+
if @api_client.config.debugging
|
|
206
|
+
@api_client.config.logger.debug "API called: ProductsApi#get_all_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if opts[:include_http_info]
|
|
210
|
+
[data, status_code, headers]
|
|
211
|
+
else
|
|
212
|
+
data
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Get Product
|
|
217
|
+
# @param product_id [String]
|
|
218
|
+
# @param [Hash] opts the optional parameters
|
|
219
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
220
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
221
|
+
# @return [ProductDetailsResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
222
|
+
def get_product(product_id, opts = {})
|
|
223
|
+
if @api_client.config.debugging
|
|
224
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.get_product ...'
|
|
225
|
+
end
|
|
226
|
+
# verify the required parameter 'product_id' is set
|
|
227
|
+
if @api_client.config.client_side_validation && product_id.nil?
|
|
228
|
+
raise ArgumentError, "Missing the required parameter 'product_id' when calling ProductsApi.get_product"
|
|
229
|
+
end
|
|
230
|
+
# resource path
|
|
231
|
+
local_var_path = '/v2/products/{product_id}'.sub('{' + 'product_id' + '}', CGI.escape(product_id.to_s))
|
|
232
|
+
|
|
233
|
+
# query parameters
|
|
234
|
+
query_params = opts[:query_params] || {}
|
|
235
|
+
|
|
236
|
+
# header parameters
|
|
237
|
+
header_params = opts[:header_params] || {}
|
|
238
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
239
|
+
# HTTP header 'Accept' (if needed)
|
|
240
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
241
|
+
|
|
242
|
+
# form parameters
|
|
243
|
+
form_params = opts[:form_params] || {}
|
|
244
|
+
|
|
245
|
+
# http body (model)
|
|
246
|
+
post_body = opts[:debug_body]
|
|
247
|
+
|
|
248
|
+
# return_type
|
|
249
|
+
return_type = opts[:debug_return_type] || 'ProductDetailsResponse'
|
|
250
|
+
|
|
251
|
+
# auth_names
|
|
252
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
253
|
+
|
|
254
|
+
new_options = opts.merge(
|
|
255
|
+
:operation => :"ProductsApi.get_product",
|
|
256
|
+
:header_params => header_params,
|
|
257
|
+
:query_params => query_params,
|
|
258
|
+
:form_params => form_params,
|
|
259
|
+
:body => post_body,
|
|
260
|
+
:auth_names => auth_names,
|
|
261
|
+
:return_type => return_type
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
265
|
+
if @api_client.config.debugging
|
|
266
|
+
@api_client.config.logger.debug "API called: ProductsApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if opts[:include_http_info]
|
|
270
|
+
[data, status_code, headers]
|
|
271
|
+
else
|
|
272
|
+
data
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Update Product
|
|
277
|
+
# @param product_id [String]
|
|
278
|
+
# @param product_update_request [ProductUpdateRequest]
|
|
279
|
+
# @param [Hash] opts the optional parameters
|
|
280
|
+
# @option opts [String] :idempotency_key Idempotency key for the request
|
|
281
|
+
# @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
|
|
282
|
+
# @return [ProductDetailsResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
|
|
283
|
+
def update_product(product_id, product_update_request, opts = {})
|
|
284
|
+
if @api_client.config.debugging
|
|
285
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.update_product ...'
|
|
286
|
+
end
|
|
287
|
+
# verify the required parameter 'product_id' is set
|
|
288
|
+
if @api_client.config.client_side_validation && product_id.nil?
|
|
289
|
+
raise ArgumentError, "Missing the required parameter 'product_id' when calling ProductsApi.update_product"
|
|
290
|
+
end
|
|
291
|
+
# verify the required parameter 'product_update_request' is set
|
|
292
|
+
if @api_client.config.client_side_validation && product_update_request.nil?
|
|
293
|
+
raise ArgumentError, "Missing the required parameter 'product_update_request' when calling ProductsApi.update_product"
|
|
294
|
+
end
|
|
295
|
+
# resource path
|
|
296
|
+
local_var_path = '/v2/products/{product_id}'.sub('{' + 'product_id' + '}', CGI.escape(product_id.to_s))
|
|
297
|
+
|
|
298
|
+
# query parameters
|
|
299
|
+
query_params = opts[:query_params] || {}
|
|
300
|
+
|
|
301
|
+
# header parameters
|
|
302
|
+
header_params = opts[:header_params] || {}
|
|
303
|
+
header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
|
|
304
|
+
# HTTP header 'Accept' (if needed)
|
|
305
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
306
|
+
# HTTP header 'Content-Type'
|
|
307
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
308
|
+
if !content_type.nil?
|
|
309
|
+
header_params['Content-Type'] = content_type
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# form parameters
|
|
313
|
+
form_params = opts[:form_params] || {}
|
|
314
|
+
|
|
315
|
+
# http body (model)
|
|
316
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(product_update_request)
|
|
317
|
+
|
|
318
|
+
# return_type
|
|
319
|
+
return_type = opts[:debug_return_type] || 'ProductDetailsResponse'
|
|
320
|
+
|
|
321
|
+
# auth_names
|
|
322
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
|
|
323
|
+
|
|
324
|
+
new_options = opts.merge(
|
|
325
|
+
:operation => :"ProductsApi.update_product",
|
|
326
|
+
:header_params => header_params,
|
|
327
|
+
:query_params => query_params,
|
|
328
|
+
:form_params => form_params,
|
|
329
|
+
:body => post_body,
|
|
330
|
+
:auth_names => auth_names,
|
|
331
|
+
:return_type => return_type
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
335
|
+
if @api_client.config.debugging
|
|
336
|
+
@api_client.config.logger.debug "API called: ProductsApi#update_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
if opts[:include_http_info]
|
|
340
|
+
[data, status_code, headers]
|
|
341
|
+
else
|
|
342
|
+
data
|
|
343
|
+
end
|
|
344
|
+
end
|
|
345
|
+
end
|
|
346
|
+
end
|