kabustation_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +188 -0
- data/Rakefile +10 -0
- data/docs/ApiSoftLimitResponse.md +32 -0
- data/docs/AuthApi.md +72 -0
- data/docs/BoardSuccess.md +142 -0
- data/docs/BoardSuccessBuy1.md +24 -0
- data/docs/BoardSuccessBuy10.md +20 -0
- data/docs/BoardSuccessBuy2.md +20 -0
- data/docs/BoardSuccessBuy3.md +20 -0
- data/docs/BoardSuccessBuy4.md +20 -0
- data/docs/BoardSuccessBuy5.md +20 -0
- data/docs/BoardSuccessBuy6.md +20 -0
- data/docs/BoardSuccessBuy7.md +20 -0
- data/docs/BoardSuccessBuy8.md +20 -0
- data/docs/BoardSuccessBuy9.md +20 -0
- data/docs/BoardSuccessSell1.md +24 -0
- data/docs/BoardSuccessSell10.md +20 -0
- data/docs/BoardSuccessSell2.md +20 -0
- data/docs/BoardSuccessSell3.md +20 -0
- data/docs/BoardSuccessSell4.md +20 -0
- data/docs/BoardSuccessSell5.md +20 -0
- data/docs/BoardSuccessSell6.md +20 -0
- data/docs/BoardSuccessSell7.md +20 -0
- data/docs/BoardSuccessSell8.md +20 -0
- data/docs/BoardSuccessSell9.md +20 -0
- data/docs/ErrorResponse.md +20 -0
- data/docs/ExchangeResponse.md +28 -0
- data/docs/InfoApi.md +924 -0
- data/docs/MarginPremiumResponse.md +22 -0
- data/docs/MarginPremiumResponseDayTrade.md +26 -0
- data/docs/MarginPremiumResponseGeneralMargin.md +26 -0
- data/docs/OrderApi.md +275 -0
- data/docs/OrderSuccess.md +20 -0
- data/docs/OrdersSuccess.md +58 -0
- data/docs/OrdersSuccessDetailsInner.md +44 -0
- data/docs/Positions.md +20 -0
- data/docs/PositionsDeriv.md +20 -0
- data/docs/PositionsSuccess.md +58 -0
- data/docs/PrimaryExchangeResponse.md +20 -0
- data/docs/RankingByCategoryResponse.md +22 -0
- data/docs/RankingByCategoryResponseRankingInner.md +34 -0
- data/docs/RankingByMarginResponse.md +22 -0
- data/docs/RankingByMarginResponseRankingInner.md +36 -0
- data/docs/RankingByTickCountResponse.md +22 -0
- data/docs/RankingByTickCountResponseRankingInner.md +46 -0
- data/docs/RankingByTradeValueResponse.md +22 -0
- data/docs/RankingByTradeValueResponseRankingInner.md +42 -0
- data/docs/RankingByTradeVolumeResponse.md +22 -0
- data/docs/RankingByTradeVolumeResponseRankingInner.md +42 -0
- data/docs/RankingDefaultResponse.md +22 -0
- data/docs/RankingDefaultResponseRankingInner.md +42 -0
- data/docs/RankingGet200Response.md +57 -0
- data/docs/RegistSuccess.md +18 -0
- data/docs/RegisterApi.md +206 -0
- data/docs/RegulationsResponse.md +20 -0
- data/docs/RegulationsResponseRegulationsInfoInner.md +30 -0
- data/docs/RequestCancelOrder.md +20 -0
- data/docs/RequestRegister.md +18 -0
- data/docs/RequestRegisterSymbolsInner.md +20 -0
- data/docs/RequestSendOrder.md +52 -0
- data/docs/RequestSendOrderDerivFuture.md +42 -0
- data/docs/RequestSendOrderDerivFutureReverseLimitOrder.md +24 -0
- data/docs/RequestSendOrderDerivOption.md +42 -0
- data/docs/RequestSendOrderReverseLimitOrder.md +26 -0
- data/docs/RequestToken.md +18 -0
- data/docs/RequestUnregister.md +18 -0
- data/docs/SymbolNameSuccess.md +20 -0
- data/docs/SymbolSuccess.md +64 -0
- data/docs/TokenSuccess.md +20 -0
- data/docs/UnregisterAllSuccess.md +18 -0
- data/docs/WalletApi.md +535 -0
- data/docs/WalletCashSuccess.md +22 -0
- data/docs/WalletFutureSuccess.md +22 -0
- data/docs/WalletMarginSuccess.md +24 -0
- data/docs/WalletOptionSuccess.md +22 -0
- data/git_push.sh +57 -0
- data/kabustation_client.gemspec +39 -0
- data/lib/kabustation_client/api/auth_api.rb +90 -0
- data/lib/kabustation_client/api/info_api.rb +1044 -0
- data/lib/kabustation_client/api/order_api.rb +322 -0
- data/lib/kabustation_client/api/register_api.rb +236 -0
- data/lib/kabustation_client/api/wallet_api.rb +558 -0
- data/lib/kabustation_client/api_client.rb +393 -0
- data/lib/kabustation_client/api_error.rb +58 -0
- data/lib/kabustation_client/configuration.rb +295 -0
- data/lib/kabustation_client/models/api_soft_limit_response.rb +285 -0
- data/lib/kabustation_client/models/board_success.rb +816 -0
- data/lib/kabustation_client/models/board_success_buy1.rb +246 -0
- data/lib/kabustation_client/models/board_success_buy10.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy2.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy3.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy4.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy5.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy6.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy7.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy8.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy9.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell1.rb +246 -0
- data/lib/kabustation_client/models/board_success_sell10.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell2.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell3.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell4.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell5.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell6.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell7.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell8.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell9.rb +226 -0
- data/lib/kabustation_client/models/error_response.rb +225 -0
- data/lib/kabustation_client/models/exchange_response.rb +265 -0
- data/lib/kabustation_client/models/margin_premium_response.rb +233 -0
- data/lib/kabustation_client/models/margin_premium_response_day_trade.rb +256 -0
- data/lib/kabustation_client/models/margin_premium_response_general_margin.rb +256 -0
- data/lib/kabustation_client/models/order_success.rb +225 -0
- data/lib/kabustation_client/models/orders_success.rb +417 -0
- data/lib/kabustation_client/models/orders_success_details_inner.rb +345 -0
- data/lib/kabustation_client/models/positions.rb +225 -0
- data/lib/kabustation_client/models/positions_deriv.rb +225 -0
- data/lib/kabustation_client/models/positions_success.rb +415 -0
- data/lib/kabustation_client/models/primary_exchange_response.rb +225 -0
- data/lib/kabustation_client/models/ranking_by_category_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_category_response_ranking_inner.rb +295 -0
- data/lib/kabustation_client/models/ranking_by_margin_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_margin_response_ranking_inner.rb +305 -0
- data/lib/kabustation_client/models/ranking_by_tick_count_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_tick_count_response_ranking_inner.rb +355 -0
- data/lib/kabustation_client/models/ranking_by_trade_value_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_trade_value_response_ranking_inner.rb +335 -0
- data/lib/kabustation_client/models/ranking_by_trade_volume_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_trade_volume_response_ranking_inner.rb +335 -0
- data/lib/kabustation_client/models/ranking_default_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_default_response_ranking_inner.rb +335 -0
- data/lib/kabustation_client/models/ranking_get200_response.rb +109 -0
- data/lib/kabustation_client/models/regist_success.rb +217 -0
- data/lib/kabustation_client/models/regulations_response.rb +227 -0
- data/lib/kabustation_client/models/regulations_response_regulations_info_inner.rb +275 -0
- data/lib/kabustation_client/models/request_cancel_order.rb +239 -0
- data/lib/kabustation_client/models/request_register.rb +216 -0
- data/lib/kabustation_client/models/request_register_symbols_inner.rb +225 -0
- data/lib/kabustation_client/models/request_send_order.rb +470 -0
- data/lib/kabustation_client/models/request_send_order_deriv_future.rb +406 -0
- data/lib/kabustation_client/models/request_send_order_deriv_future_reverse_limit_order.rb +274 -0
- data/lib/kabustation_client/models/request_send_order_deriv_option.rb +406 -0
- data/lib/kabustation_client/models/request_send_order_reverse_limit_order.rb +291 -0
- data/lib/kabustation_client/models/request_token.rb +222 -0
- data/lib/kabustation_client/models/request_unregister.rb +217 -0
- data/lib/kabustation_client/models/symbol_name_success.rb +225 -0
- data/lib/kabustation_client/models/symbol_success.rb +445 -0
- data/lib/kabustation_client/models/token_success.rb +225 -0
- data/lib/kabustation_client/models/unregister_all_success.rb +215 -0
- data/lib/kabustation_client/models/wallet_cash_success.rb +235 -0
- data/lib/kabustation_client/models/wallet_future_success.rb +235 -0
- data/lib/kabustation_client/models/wallet_margin_success.rb +245 -0
- data/lib/kabustation_client/models/wallet_option_success.rb +235 -0
- data/lib/kabustation_client/version.rb +15 -0
- data/lib/kabustation_client.rb +112 -0
- data/spec/api/auth_api_spec.rb +47 -0
- data/spec/api/info_api_spec.rb +222 -0
- data/spec/api/order_api_spec.rb +87 -0
- data/spec/api/register_api_spec.rb +73 -0
- data/spec/api/wallet_api_spec.rb +135 -0
- data/spec/models/api_soft_limit_response_spec.rb +78 -0
- data/spec/models/board_success_buy10_spec.rb +42 -0
- data/spec/models/board_success_buy1_spec.rb +54 -0
- data/spec/models/board_success_buy2_spec.rb +42 -0
- data/spec/models/board_success_buy3_spec.rb +42 -0
- data/spec/models/board_success_buy4_spec.rb +42 -0
- data/spec/models/board_success_buy5_spec.rb +42 -0
- data/spec/models/board_success_buy6_spec.rb +42 -0
- data/spec/models/board_success_buy7_spec.rb +42 -0
- data/spec/models/board_success_buy8_spec.rb +42 -0
- data/spec/models/board_success_buy9_spec.rb +42 -0
- data/spec/models/board_success_sell10_spec.rb +42 -0
- data/spec/models/board_success_sell1_spec.rb +54 -0
- data/spec/models/board_success_sell2_spec.rb +42 -0
- data/spec/models/board_success_sell3_spec.rb +42 -0
- data/spec/models/board_success_sell4_spec.rb +42 -0
- data/spec/models/board_success_sell5_spec.rb +42 -0
- data/spec/models/board_success_sell6_spec.rb +42 -0
- data/spec/models/board_success_sell7_spec.rb +42 -0
- data/spec/models/board_success_sell8_spec.rb +42 -0
- data/spec/models/board_success_sell9_spec.rb +42 -0
- data/spec/models/board_success_spec.rb +408 -0
- data/spec/models/error_response_spec.rb +42 -0
- data/spec/models/exchange_response_spec.rb +66 -0
- data/spec/models/margin_premium_response_day_trade_spec.rb +60 -0
- data/spec/models/margin_premium_response_general_margin_spec.rb +60 -0
- data/spec/models/margin_premium_response_spec.rb +48 -0
- data/spec/models/order_success_spec.rb +42 -0
- data/spec/models/orders_success_details_inner_spec.rb +114 -0
- data/spec/models/orders_success_spec.rb +156 -0
- data/spec/models/positions_deriv_spec.rb +42 -0
- data/spec/models/positions_spec.rb +42 -0
- data/spec/models/positions_success_spec.rb +156 -0
- data/spec/models/primary_exchange_response_spec.rb +42 -0
- data/spec/models/ranking_by_category_response_ranking_inner_spec.rb +84 -0
- data/spec/models/ranking_by_category_response_spec.rb +48 -0
- data/spec/models/ranking_by_margin_response_ranking_inner_spec.rb +90 -0
- data/spec/models/ranking_by_margin_response_spec.rb +48 -0
- data/spec/models/ranking_by_tick_count_response_ranking_inner_spec.rb +120 -0
- data/spec/models/ranking_by_tick_count_response_spec.rb +48 -0
- data/spec/models/ranking_by_trade_value_response_ranking_inner_spec.rb +108 -0
- data/spec/models/ranking_by_trade_value_response_spec.rb +48 -0
- data/spec/models/ranking_by_trade_volume_response_ranking_inner_spec.rb +108 -0
- data/spec/models/ranking_by_trade_volume_response_spec.rb +48 -0
- data/spec/models/ranking_default_response_ranking_inner_spec.rb +108 -0
- data/spec/models/ranking_default_response_spec.rb +48 -0
- data/spec/models/ranking_get200_response_spec.rb +32 -0
- data/spec/models/regist_success_spec.rb +36 -0
- data/spec/models/regulations_response_regulations_info_inner_spec.rb +72 -0
- data/spec/models/regulations_response_spec.rb +42 -0
- data/spec/models/request_cancel_order_spec.rb +42 -0
- data/spec/models/request_register_spec.rb +36 -0
- data/spec/models/request_register_symbols_inner_spec.rb +42 -0
- data/spec/models/request_send_order_deriv_future_reverse_limit_order_spec.rb +54 -0
- data/spec/models/request_send_order_deriv_future_spec.rb +108 -0
- data/spec/models/request_send_order_deriv_option_spec.rb +108 -0
- data/spec/models/request_send_order_reverse_limit_order_spec.rb +60 -0
- data/spec/models/request_send_order_spec.rb +138 -0
- data/spec/models/request_token_spec.rb +36 -0
- data/spec/models/request_unregister_spec.rb +36 -0
- data/spec/models/symbol_name_success_spec.rb +42 -0
- data/spec/models/symbol_success_spec.rb +174 -0
- data/spec/models/token_success_spec.rb +42 -0
- data/spec/models/unregister_all_success_spec.rb +36 -0
- data/spec/models/wallet_cash_success_spec.rb +48 -0
- data/spec/models/wallet_future_success_spec.rb +48 -0
- data/spec/models/wallet_margin_success_spec.rb +54 -0
- data/spec/models/wallet_option_success_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +387 -0
@@ -0,0 +1,295 @@
|
|
1
|
+
=begin
|
2
|
+
#kabuステーションAPI
|
3
|
+
|
4
|
+
## 定義情報 REST APIのコード一覧、エンドポイントは下記リンク参照 - [REST APIコード一覧](../ptal/error.html)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.5
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module KabustationClient
|
14
|
+
class Configuration
|
15
|
+
# Defines url scheme
|
16
|
+
attr_accessor :scheme
|
17
|
+
|
18
|
+
# Defines url host
|
19
|
+
attr_accessor :host
|
20
|
+
|
21
|
+
# Defines url base path
|
22
|
+
attr_accessor :base_path
|
23
|
+
|
24
|
+
# Define server configuration index
|
25
|
+
attr_accessor :server_index
|
26
|
+
|
27
|
+
# Define server operation configuration index
|
28
|
+
attr_accessor :server_operation_index
|
29
|
+
|
30
|
+
# Default server variables
|
31
|
+
attr_accessor :server_variables
|
32
|
+
|
33
|
+
# Default server operation variables
|
34
|
+
attr_accessor :server_operation_variables
|
35
|
+
|
36
|
+
# Defines API keys used with API Key authentications.
|
37
|
+
#
|
38
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
39
|
+
#
|
40
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
41
|
+
# config.api_key['api_key'] = 'xxx'
|
42
|
+
attr_accessor :api_key
|
43
|
+
|
44
|
+
# Defines API key prefixes used with API Key authentications.
|
45
|
+
#
|
46
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
47
|
+
#
|
48
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
49
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
50
|
+
attr_accessor :api_key_prefix
|
51
|
+
|
52
|
+
# Defines the username used with HTTP basic authentication.
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
attr_accessor :username
|
56
|
+
|
57
|
+
# Defines the password used with HTTP basic authentication.
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
attr_accessor :password
|
61
|
+
|
62
|
+
# Defines the access token (Bearer) used with OAuth2.
|
63
|
+
attr_accessor :access_token
|
64
|
+
|
65
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
66
|
+
# Overrides the access_token if set
|
67
|
+
# @return [Proc]
|
68
|
+
attr_accessor :access_token_getter
|
69
|
+
|
70
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
71
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
72
|
+
# Default to false.
|
73
|
+
attr_accessor :return_binary_data
|
74
|
+
|
75
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
76
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
77
|
+
# Default to false.
|
78
|
+
#
|
79
|
+
# @return [true, false]
|
80
|
+
attr_accessor :debugging
|
81
|
+
|
82
|
+
# Defines the logger used for debugging.
|
83
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
84
|
+
#
|
85
|
+
# @return [#debug]
|
86
|
+
attr_accessor :logger
|
87
|
+
|
88
|
+
# Defines the temporary folder to store downloaded files
|
89
|
+
# (for API endpoints that have file response).
|
90
|
+
# Default to use `Tempfile`.
|
91
|
+
#
|
92
|
+
# @return [String]
|
93
|
+
attr_accessor :temp_folder_path
|
94
|
+
|
95
|
+
# The time limit for HTTP request in seconds.
|
96
|
+
# Default to 0 (never times out).
|
97
|
+
attr_accessor :timeout
|
98
|
+
|
99
|
+
# Set this to false to skip client side validation in the operation.
|
100
|
+
# Default to true.
|
101
|
+
# @return [true, false]
|
102
|
+
attr_accessor :client_side_validation
|
103
|
+
|
104
|
+
### TLS/SSL setting
|
105
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
106
|
+
# Default to true.
|
107
|
+
#
|
108
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
109
|
+
#
|
110
|
+
# @return [true, false]
|
111
|
+
attr_accessor :verify_ssl
|
112
|
+
|
113
|
+
### TLS/SSL setting
|
114
|
+
# Set this to false to skip verifying SSL host name
|
115
|
+
# Default to true.
|
116
|
+
#
|
117
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
118
|
+
#
|
119
|
+
# @return [true, false]
|
120
|
+
attr_accessor :verify_ssl_host
|
121
|
+
|
122
|
+
### TLS/SSL setting
|
123
|
+
# Set this to customize the certificate file to verify the peer.
|
124
|
+
#
|
125
|
+
# @return [String] the path to the certificate file
|
126
|
+
#
|
127
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
128
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
129
|
+
attr_accessor :ssl_ca_cert
|
130
|
+
|
131
|
+
### TLS/SSL setting
|
132
|
+
# Client certificate file (for client certificate)
|
133
|
+
attr_accessor :cert_file
|
134
|
+
|
135
|
+
### TLS/SSL setting
|
136
|
+
# Client private key file (for client certificate)
|
137
|
+
attr_accessor :key_file
|
138
|
+
|
139
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
140
|
+
# Default to nil.
|
141
|
+
#
|
142
|
+
# @see The params_encoding option of Ethon. Related source code:
|
143
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
144
|
+
attr_accessor :params_encoding
|
145
|
+
|
146
|
+
|
147
|
+
attr_accessor :inject_format
|
148
|
+
|
149
|
+
attr_accessor :force_ending_format
|
150
|
+
|
151
|
+
def initialize
|
152
|
+
@scheme = 'http'
|
153
|
+
@host = 'localhost:18080'
|
154
|
+
@base_path = '/kabusapi'
|
155
|
+
@server_index = nil
|
156
|
+
@server_operation_index = {}
|
157
|
+
@server_variables = {}
|
158
|
+
@server_operation_variables = {}
|
159
|
+
@api_key = {}
|
160
|
+
@api_key_prefix = {}
|
161
|
+
@client_side_validation = true
|
162
|
+
@verify_ssl = true
|
163
|
+
@verify_ssl_host = true
|
164
|
+
@cert_file = nil
|
165
|
+
@key_file = nil
|
166
|
+
@timeout = 0
|
167
|
+
@params_encoding = nil
|
168
|
+
@debugging = false
|
169
|
+
@inject_format = false
|
170
|
+
@force_ending_format = false
|
171
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
172
|
+
|
173
|
+
yield(self) if block_given?
|
174
|
+
end
|
175
|
+
|
176
|
+
# The default Configuration object.
|
177
|
+
def self.default
|
178
|
+
@@default ||= Configuration.new
|
179
|
+
end
|
180
|
+
|
181
|
+
def configure
|
182
|
+
yield(self) if block_given?
|
183
|
+
end
|
184
|
+
|
185
|
+
def scheme=(scheme)
|
186
|
+
# remove :// from scheme
|
187
|
+
@scheme = scheme.sub(/:\/\//, '')
|
188
|
+
end
|
189
|
+
|
190
|
+
def host=(host)
|
191
|
+
# remove http(s):// and anything after a slash
|
192
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
193
|
+
end
|
194
|
+
|
195
|
+
def base_path=(base_path)
|
196
|
+
# Add leading and trailing slashes to base_path
|
197
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
198
|
+
@base_path = '' if @base_path == '/'
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns base URL for specified operation based on server settings
|
202
|
+
def base_url(operation = nil)
|
203
|
+
if operation_server_settings.key?(operation) then
|
204
|
+
index = server_operation_index.fetch(operation, server_index)
|
205
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
206
|
+
else
|
207
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
# Gets API key (with prefix if set).
|
212
|
+
# @param [String] param_name the parameter name of API key auth
|
213
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
214
|
+
key = @api_key[param_name]
|
215
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
216
|
+
if @api_key_prefix[param_name]
|
217
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
218
|
+
else
|
219
|
+
key
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
224
|
+
def access_token_with_refresh
|
225
|
+
return access_token if access_token_getter.nil?
|
226
|
+
access_token_getter.call
|
227
|
+
end
|
228
|
+
|
229
|
+
# Gets Basic Auth token string
|
230
|
+
def basic_auth_token
|
231
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
232
|
+
end
|
233
|
+
|
234
|
+
# Returns Auth Settings hash for api client.
|
235
|
+
def auth_settings
|
236
|
+
{
|
237
|
+
}
|
238
|
+
end
|
239
|
+
|
240
|
+
# Returns an array of Server setting
|
241
|
+
def server_settings
|
242
|
+
[
|
243
|
+
{
|
244
|
+
url: "http://localhost:18080/kabusapi",
|
245
|
+
description: "本番用",
|
246
|
+
},
|
247
|
+
{
|
248
|
+
url: "http://localhost:18081/kabusapi",
|
249
|
+
description: "検証用",
|
250
|
+
}
|
251
|
+
]
|
252
|
+
end
|
253
|
+
|
254
|
+
def operation_server_settings
|
255
|
+
{
|
256
|
+
}
|
257
|
+
end
|
258
|
+
|
259
|
+
# Returns URL based on server settings
|
260
|
+
#
|
261
|
+
# @param index array index of the server settings
|
262
|
+
# @param variables hash of variable and the corresponding value
|
263
|
+
def server_url(index, variables = {}, servers = nil)
|
264
|
+
servers = server_settings if servers == nil
|
265
|
+
|
266
|
+
# check array index out of bound
|
267
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
268
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
269
|
+
end
|
270
|
+
|
271
|
+
server = servers[index]
|
272
|
+
url = server[:url]
|
273
|
+
|
274
|
+
return url unless server.key? :variables
|
275
|
+
|
276
|
+
# go through variable and assign a value
|
277
|
+
server[:variables].each do |name, variable|
|
278
|
+
if variables.key?(name)
|
279
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
280
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
281
|
+
else
|
282
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
283
|
+
end
|
284
|
+
else
|
285
|
+
# use default value
|
286
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
url
|
291
|
+
end
|
292
|
+
|
293
|
+
|
294
|
+
end
|
295
|
+
end
|
@@ -0,0 +1,285 @@
|
|
1
|
+
=begin
|
2
|
+
#kabuステーションAPI
|
3
|
+
|
4
|
+
## 定義情報 REST APIのコード一覧、エンドポイントは下記リンク参照 - [REST APIコード一覧](../ptal/error.html)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.5
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module KabustationClient
|
17
|
+
class ApiSoftLimitResponse
|
18
|
+
# 現物のワンショット上限<br>※単位は万円
|
19
|
+
attr_accessor :stock
|
20
|
+
|
21
|
+
# 信用のワンショット上限<br>※単位は万円
|
22
|
+
attr_accessor :margin
|
23
|
+
|
24
|
+
# 先物のワンショット上限<br>※単位は枚
|
25
|
+
attr_accessor :future
|
26
|
+
|
27
|
+
# ミニ先物のワンショット上限<br>※単位は枚
|
28
|
+
attr_accessor :future_mini
|
29
|
+
|
30
|
+
# マイクロ先物のワンショット上限<br>※単位は枚
|
31
|
+
attr_accessor :future_micro
|
32
|
+
|
33
|
+
# オプションのワンショット上限<br>※単位は枚
|
34
|
+
attr_accessor :option
|
35
|
+
|
36
|
+
# ミニオプションのワンショット上限<br>※単位は枚
|
37
|
+
attr_accessor :mini_option
|
38
|
+
|
39
|
+
# kabuステーションのバージョン
|
40
|
+
attr_accessor :kabu_s_version
|
41
|
+
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
|
+
def self.attribute_map
|
44
|
+
{
|
45
|
+
:'stock' => :'Stock',
|
46
|
+
:'margin' => :'Margin',
|
47
|
+
:'future' => :'Future',
|
48
|
+
:'future_mini' => :'FutureMini',
|
49
|
+
:'future_micro' => :'FutureMicro',
|
50
|
+
:'option' => :'Option',
|
51
|
+
:'mini_option' => :'MiniOption',
|
52
|
+
:'kabu_s_version' => :'KabuSVersion'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Returns all the JSON keys this model knows about
|
57
|
+
def self.acceptable_attributes
|
58
|
+
attribute_map.values
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute type mapping.
|
62
|
+
def self.openapi_types
|
63
|
+
{
|
64
|
+
:'stock' => :'Float',
|
65
|
+
:'margin' => :'Float',
|
66
|
+
:'future' => :'Float',
|
67
|
+
:'future_mini' => :'Float',
|
68
|
+
:'future_micro' => :'Float',
|
69
|
+
:'option' => :'Float',
|
70
|
+
:'mini_option' => :'Float',
|
71
|
+
:'kabu_s_version' => :'String'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# List of attributes with nullable: true
|
76
|
+
def self.openapi_nullable
|
77
|
+
Set.new([
|
78
|
+
])
|
79
|
+
end
|
80
|
+
|
81
|
+
# Initializes the object
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
def initialize(attributes = {})
|
84
|
+
if (!attributes.is_a?(Hash))
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KabustationClient::ApiSoftLimitResponse` initialize method"
|
86
|
+
end
|
87
|
+
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
90
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KabustationClient::ApiSoftLimitResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
92
|
+
end
|
93
|
+
h[k.to_sym] = v
|
94
|
+
}
|
95
|
+
|
96
|
+
if attributes.key?(:'stock')
|
97
|
+
self.stock = attributes[:'stock']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'margin')
|
101
|
+
self.margin = attributes[:'margin']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'future')
|
105
|
+
self.future = attributes[:'future']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'future_mini')
|
109
|
+
self.future_mini = attributes[:'future_mini']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'future_micro')
|
113
|
+
self.future_micro = attributes[:'future_micro']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'option')
|
117
|
+
self.option = attributes[:'option']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'mini_option')
|
121
|
+
self.mini_option = attributes[:'mini_option']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'kabu_s_version')
|
125
|
+
self.kabu_s_version = attributes[:'kabu_s_version']
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
130
|
+
# @return Array for valid properties with the reasons
|
131
|
+
def list_invalid_properties
|
132
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
133
|
+
invalid_properties = Array.new
|
134
|
+
invalid_properties
|
135
|
+
end
|
136
|
+
|
137
|
+
# Check to see if the all the properties in the model are valid
|
138
|
+
# @return true if the model is valid
|
139
|
+
def valid?
|
140
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
141
|
+
true
|
142
|
+
end
|
143
|
+
|
144
|
+
# Checks equality by comparing each attribute.
|
145
|
+
# @param [Object] Object to be compared
|
146
|
+
def ==(o)
|
147
|
+
return true if self.equal?(o)
|
148
|
+
self.class == o.class &&
|
149
|
+
stock == o.stock &&
|
150
|
+
margin == o.margin &&
|
151
|
+
future == o.future &&
|
152
|
+
future_mini == o.future_mini &&
|
153
|
+
future_micro == o.future_micro &&
|
154
|
+
option == o.option &&
|
155
|
+
mini_option == o.mini_option &&
|
156
|
+
kabu_s_version == o.kabu_s_version
|
157
|
+
end
|
158
|
+
|
159
|
+
# @see the `==` method
|
160
|
+
# @param [Object] Object to be compared
|
161
|
+
def eql?(o)
|
162
|
+
self == o
|
163
|
+
end
|
164
|
+
|
165
|
+
# Calculates hash code according to all attributes.
|
166
|
+
# @return [Integer] Hash code
|
167
|
+
def hash
|
168
|
+
[stock, margin, future, future_mini, future_micro, option, mini_option, kabu_s_version].hash
|
169
|
+
end
|
170
|
+
|
171
|
+
# Builds the object from hash
|
172
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
173
|
+
# @return [Object] Returns the model itself
|
174
|
+
def self.build_from_hash(attributes)
|
175
|
+
return nil unless attributes.is_a?(Hash)
|
176
|
+
attributes = attributes.transform_keys(&:to_sym)
|
177
|
+
transformed_hash = {}
|
178
|
+
openapi_types.each_pair do |key, type|
|
179
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
180
|
+
transformed_hash["#{key}"] = nil
|
181
|
+
elsif type =~ /\AArray<(.*)>/i
|
182
|
+
# check to ensure the input is an array given that the attribute
|
183
|
+
# is documented as an array but the input is not
|
184
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
185
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
186
|
+
end
|
187
|
+
elsif !attributes[attribute_map[key]].nil?
|
188
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
189
|
+
end
|
190
|
+
end
|
191
|
+
new(transformed_hash)
|
192
|
+
end
|
193
|
+
|
194
|
+
# Deserializes the data based on type
|
195
|
+
# @param string type Data type
|
196
|
+
# @param string value Value to be deserialized
|
197
|
+
# @return [Object] Deserialized data
|
198
|
+
def self._deserialize(type, value)
|
199
|
+
case type.to_sym
|
200
|
+
when :Time
|
201
|
+
Time.parse(value)
|
202
|
+
when :Date
|
203
|
+
Date.parse(value)
|
204
|
+
when :String
|
205
|
+
value.to_s
|
206
|
+
when :Integer
|
207
|
+
value.to_i
|
208
|
+
when :Float
|
209
|
+
value.to_f
|
210
|
+
when :Boolean
|
211
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
212
|
+
true
|
213
|
+
else
|
214
|
+
false
|
215
|
+
end
|
216
|
+
when :Object
|
217
|
+
# generic object (usually a Hash), return directly
|
218
|
+
value
|
219
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
220
|
+
inner_type = Regexp.last_match[:inner_type]
|
221
|
+
value.map { |v| _deserialize(inner_type, v) }
|
222
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
223
|
+
k_type = Regexp.last_match[:k_type]
|
224
|
+
v_type = Regexp.last_match[:v_type]
|
225
|
+
{}.tap do |hash|
|
226
|
+
value.each do |k, v|
|
227
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
else # model
|
231
|
+
# models (e.g. Pet) or oneOf
|
232
|
+
klass = KabustationClient.const_get(type)
|
233
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the string representation of the object
|
238
|
+
# @return [String] String presentation of the object
|
239
|
+
def to_s
|
240
|
+
to_hash.to_s
|
241
|
+
end
|
242
|
+
|
243
|
+
# to_body is an alias to to_hash (backward compatibility)
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_body
|
246
|
+
to_hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Returns the object in the form of hash
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_hash
|
252
|
+
hash = {}
|
253
|
+
self.class.attribute_map.each_pair do |attr, param|
|
254
|
+
value = self.send(attr)
|
255
|
+
if value.nil?
|
256
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
257
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
258
|
+
end
|
259
|
+
|
260
|
+
hash[param] = _to_hash(value)
|
261
|
+
end
|
262
|
+
hash
|
263
|
+
end
|
264
|
+
|
265
|
+
# Outputs non-array value in the form of hash
|
266
|
+
# For object, use to_hash. Otherwise, just return the value
|
267
|
+
# @param [Object] value Any valid value
|
268
|
+
# @return [Hash] Returns the value in the form of hash
|
269
|
+
def _to_hash(value)
|
270
|
+
if value.is_a?(Array)
|
271
|
+
value.compact.map { |v| _to_hash(v) }
|
272
|
+
elsif value.is_a?(Hash)
|
273
|
+
{}.tap do |hash|
|
274
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
275
|
+
end
|
276
|
+
elsif value.respond_to? :to_hash
|
277
|
+
value.to_hash
|
278
|
+
else
|
279
|
+
value
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
end
|
284
|
+
|
285
|
+
end
|