rakuten_trading 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +455 -0
  4. data/Rakefile +8 -0
  5. data/docs/CfdOrderBody.md +9 -0
  6. data/docs/CfdOrderBody1.md +9 -0
  7. data/docs/CfdTrade.md +28 -0
  8. data/docs/InlineResponse200.md +22 -0
  9. data/docs/InlineResponse2001.md +9 -0
  10. data/docs/InlineResponse2001Candlesticks.md +12 -0
  11. data/docs/InlineResponse2002.md +14 -0
  12. data/docs/InlineResponse2003.md +15 -0
  13. data/docs/InlineResponse2004.md +9 -0
  14. data/docs/InlineResponse2005.md +8 -0
  15. data/docs/InlineResponse2006.md +19 -0
  16. data/docs/InlineResponse2007.md +18 -0
  17. data/docs/Order.md +9 -0
  18. data/docs/OrderData.md +18 -0
  19. data/docs/OrderDetail.md +33 -0
  20. data/docs/OrderResponse.md +29 -0
  21. data/docs/PrivateApi.md +518 -0
  22. data/docs/PublicApi.md +304 -0
  23. data/docs/Trade.md +12 -0
  24. data/git_push.sh +55 -0
  25. data/lib/rakuten_trading/api/private_api.rb +537 -0
  26. data/lib/rakuten_trading/api/public_api.rb +315 -0
  27. data/lib/rakuten_trading/api_client.rb +388 -0
  28. data/lib/rakuten_trading/api_error.rb +57 -0
  29. data/lib/rakuten_trading/configuration.rb +212 -0
  30. data/lib/rakuten_trading/models/cfd_order_body.rb +224 -0
  31. data/lib/rakuten_trading/models/cfd_order_body_1.rb +224 -0
  32. data/lib/rakuten_trading/models/cfd_trade.rb +417 -0
  33. data/lib/rakuten_trading/models/inline_response_200.rb +357 -0
  34. data/lib/rakuten_trading/models/inline_response_200_1.rb +226 -0
  35. data/lib/rakuten_trading/models/inline_response_200_1_candlesticks.rb +251 -0
  36. data/lib/rakuten_trading/models/inline_response_200_2.rb +275 -0
  37. data/lib/rakuten_trading/models/inline_response_200_3.rb +281 -0
  38. data/lib/rakuten_trading/models/inline_response_200_4.rb +226 -0
  39. data/lib/rakuten_trading/models/inline_response_200_5.rb +217 -0
  40. data/lib/rakuten_trading/models/inline_response_200_6.rb +327 -0
  41. data/lib/rakuten_trading/models/inline_response_200_7.rb +317 -0
  42. data/lib/rakuten_trading/models/order.rb +224 -0
  43. data/lib/rakuten_trading/models/order_data.rb +337 -0
  44. data/lib/rakuten_trading/models/order_detail.rb +440 -0
  45. data/lib/rakuten_trading/models/order_response.rb +427 -0
  46. data/lib/rakuten_trading/models/trade.rb +253 -0
  47. data/lib/rakuten_trading/version.rb +14 -0
  48. data/lib/rakuten_trading.rb +57 -0
  49. data/rakuten_trading.gemspec +38 -0
  50. data/rakuten_trading_api.yml +1256 -0
  51. data/spec/api/private_api_spec.rb +151 -0
  52. data/spec/api/public_api_spec.rb +94 -0
  53. data/spec/api_client_spec.rb +225 -0
  54. data/spec/base_object_spec.rb +109 -0
  55. data/spec/configuration_spec.rb +41 -0
  56. data/spec/models/cfd_order_body_1_spec.rb +52 -0
  57. data/spec/models/cfd_order_body_spec.rb +52 -0
  58. data/spec/models/cfd_trade_spec.rb +166 -0
  59. data/spec/models/inline_response_200_1_candlesticks_spec.rb +70 -0
  60. data/spec/models/inline_response_200_1_spec.rb +52 -0
  61. data/spec/models/inline_response_200_2_spec.rb +82 -0
  62. data/spec/models/inline_response_200_3_spec.rb +88 -0
  63. data/spec/models/inline_response_200_4_spec.rb +52 -0
  64. data/spec/models/inline_response_200_5_spec.rb +46 -0
  65. data/spec/models/inline_response_200_6_spec.rb +112 -0
  66. data/spec/models/inline_response_200_7_spec.rb +106 -0
  67. data/spec/models/inline_response_200_spec.rb +130 -0
  68. data/spec/models/order_data_spec.rb +106 -0
  69. data/spec/models/order_detail_spec.rb +196 -0
  70. data/spec/models/order_response_spec.rb +172 -0
  71. data/spec/models/order_spec.rb +52 -0
  72. data/spec/models/trade_spec.rb +70 -0
  73. data/spec/spec_helper.rb +110 -0
  74. metadata +201 -0
@@ -0,0 +1,537 @@
1
+ =begin
2
+ #API(証拠金取引所)
3
+
4
+ #本APIを利用することにより、取り扱っている銘柄一覧の取得、ローソク足データの取得、板の取得、歩値の取得、注文、残高照会といった操作を行う事ができます。 ## 留意事項 - APIキーはお客様のアカウント情報と紐付いております。もし第三者がお客様のAPIキーを知った場合、遠隔で売買注文の操作が可能となります。APIキーを第三者へ渡す事はセキュリティリスクを鑑みお控えください。 - 他社が提供するAPI機能を使用した自動売買取引ツールは、ご自身の判断と責任でご利用ください。 - リクエストパラメーターやレスポンスの日時についてはミリ秒のtimestamp(Unix Time)を用います。 - 日時の範囲検索は「以上・未満」で検索します。
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.54
10
+ =end
11
+
12
+ module RakutenTrading
13
+ class PrivateApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # 残高一覧取得
20
+ # アカウントの資産情報(各通貨の保有量)を取得します。
21
+ # @param [Hash] opts the optional parameters
22
+ # @return [Array<InlineResponse2005>]
23
+ def get_asset(opts = {})
24
+ data, _status_code, _headers = get_asset_with_http_info(opts)
25
+ data
26
+ end
27
+
28
+ # 残高一覧取得
29
+ # アカウントの資産情報(各通貨の保有量)を取得します。
30
+ # @param [Hash] opts the optional parameters
31
+ # @return [Array<(Array<InlineResponse2005>, Integer, Hash)>] Array<InlineResponse2005> data, response status code and response headers
32
+ def get_asset_with_http_info(opts = {})
33
+ if @api_client.config.debugging
34
+ @api_client.config.logger.debug 'Calling API: PrivateApi.get_asset ...'
35
+ end
36
+ # resource path
37
+ local_var_path = '/asset'
38
+
39
+ # query parameters
40
+ query_params = opts[:query_params] || {}
41
+
42
+ # header parameters
43
+ header_params = opts[:header_params] || {}
44
+ # HTTP header 'Accept' (if needed)
45
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
46
+
47
+ # form parameters
48
+ form_params = opts[:form_params] || {}
49
+
50
+ # http body (model)
51
+ post_body = opts[:body]
52
+
53
+ return_type = opts[:return_type] || 'Array<InlineResponse2005>'
54
+
55
+ auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
56
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
57
+ :header_params => header_params,
58
+ :query_params => query_params,
59
+ :form_params => form_params,
60
+ :body => post_body,
61
+ :auth_names => auth_names,
62
+ :return_type => return_type)
63
+
64
+ if @api_client.config.debugging
65
+ @api_client.config.logger.debug "API called: PrivateApi#get_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
66
+ end
67
+ return data, status_code, headers
68
+ end
69
+ # 約定履歴取得
70
+ # 指定された条件に基づくCFD取引の約定履歴(トレード)を取得します。これにより、ユーザーは過去の取引データを分析することができます。
71
+ # @param symbol_id シンボルID
72
+ # @param [Hash] opts the optional parameters
73
+ # @option opts [Array<Integer>] :id 約定IDの配列
74
+ # @option opts [Integer] :date_from 取得開始日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。
75
+ # @option opts [Integer] :date_to 取得終了日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。
76
+ # @option opts [String] :order_behavior 注文の挙動(OPEN, CLOSE)
77
+ # @option opts [String] :trade_behavior トレードの挙動(OPEN, CLOSE)
78
+ # @option opts [String] :order_side 売買方向(SELL, BUY)
79
+ # @option opts [Array<String>] :order_pattern 注文パターン(NORMAL, OCO, IFD, IFD_OCO, LOSS_CUT, CLOSE_ALL)
80
+ # @option opts [Array<String>] :order_type 執行条件(MARKET, LIMIT, STOP)
81
+ # @option opts [String] :trade_action 約定アクション(MAKER, TAKER)
82
+ # @option opts [Array<Integer>] :order_id 注文IDの配列
83
+ # @option opts [Array<Integer>] :position_id 建玉IDの配列
84
+ # @option opts [Integer] :size 取得件数。デフォルトは30、最大は500。 (default to 30)
85
+ # @return [Array<CfdTrade>]
86
+ def get_cfd_trades(symbol_id, opts = {})
87
+ data, _status_code, _headers = get_cfd_trades_with_http_info(symbol_id, opts)
88
+ data
89
+ end
90
+
91
+ # 約定履歴取得
92
+ # 指定された条件に基づくCFD取引の約定履歴(トレード)を取得します。これにより、ユーザーは過去の取引データを分析することができます。
93
+ # @param symbol_id シンボルID
94
+ # @param [Hash] opts the optional parameters
95
+ # @option opts [Array<Integer>] :id 約定IDの配列
96
+ # @option opts [Integer] :date_from 取得開始日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。
97
+ # @option opts [Integer] :date_to 取得終了日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。
98
+ # @option opts [String] :order_behavior 注文の挙動(OPEN, CLOSE)
99
+ # @option opts [String] :trade_behavior トレードの挙動(OPEN, CLOSE)
100
+ # @option opts [String] :order_side 売買方向(SELL, BUY)
101
+ # @option opts [Array<String>] :order_pattern 注文パターン(NORMAL, OCO, IFD, IFD_OCO, LOSS_CUT, CLOSE_ALL)
102
+ # @option opts [Array<String>] :order_type 執行条件(MARKET, LIMIT, STOP)
103
+ # @option opts [String] :trade_action 約定アクション(MAKER, TAKER)
104
+ # @option opts [Array<Integer>] :order_id 注文IDの配列
105
+ # @option opts [Array<Integer>] :position_id 建玉IDの配列
106
+ # @option opts [Integer] :size 取得件数。デフォルトは30、最大は500。
107
+ # @return [Array<(Array<CfdTrade>, Integer, Hash)>] Array<CfdTrade> data, response status code and response headers
108
+ def get_cfd_trades_with_http_info(symbol_id, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: PrivateApi.get_cfd_trades ...'
111
+ end
112
+ # verify the required parameter 'symbol_id' is set
113
+ if @api_client.config.client_side_validation && symbol_id.nil?
114
+ fail ArgumentError, "Missing the required parameter 'symbol_id' when calling PrivateApi.get_cfd_trades"
115
+ end
116
+ # resource path
117
+ local_var_path = '/cfd/trade'
118
+
119
+ # query parameters
120
+ query_params = opts[:query_params] || {}
121
+ query_params[:'symbolId'] = symbol_id
122
+ query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if !opts[:'id'].nil?
123
+ query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
124
+ query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
125
+ query_params[:'orderBehavior'] = opts[:'order_behavior'] if !opts[:'order_behavior'].nil?
126
+ query_params[:'tradeBehavior'] = opts[:'trade_behavior'] if !opts[:'trade_behavior'].nil?
127
+ query_params[:'orderSide'] = opts[:'order_side'] if !opts[:'order_side'].nil?
128
+ query_params[:'orderPattern'] = @api_client.build_collection_param(opts[:'order_pattern'], :multi) if !opts[:'order_pattern'].nil?
129
+ query_params[:'orderType'] = @api_client.build_collection_param(opts[:'order_type'], :multi) if !opts[:'order_type'].nil?
130
+ query_params[:'tradeAction'] = opts[:'trade_action'] if !opts[:'trade_action'].nil?
131
+ query_params[:'orderId'] = @api_client.build_collection_param(opts[:'order_id'], :multi) if !opts[:'order_id'].nil?
132
+ query_params[:'positionId'] = @api_client.build_collection_param(opts[:'position_id'], :multi) if !opts[:'position_id'].nil?
133
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
134
+
135
+ # header parameters
136
+ header_params = opts[:header_params] || {}
137
+ # HTTP header 'Accept' (if needed)
138
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
139
+
140
+ # form parameters
141
+ form_params = opts[:form_params] || {}
142
+
143
+ # http body (model)
144
+ post_body = opts[:body]
145
+
146
+ return_type = opts[:return_type] || 'Array<CfdTrade>'
147
+
148
+ auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
149
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
150
+ :header_params => header_params,
151
+ :query_params => query_params,
152
+ :form_params => form_params,
153
+ :body => post_body,
154
+ :auth_names => auth_names,
155
+ :return_type => return_type)
156
+
157
+ if @api_client.config.debugging
158
+ @api_client.config.logger.debug "API called: PrivateApi#get_cfd_trades\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
159
+ end
160
+ return data, status_code, headers
161
+ end
162
+ # 証拠金関連項目取得
163
+ # 口座の証拠金関連情報を取得します。これには建玉評価損益、必要証拠金、証拠金維持率などが含まれます。
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [InlineResponse2006]
166
+ def get_equitydata(opts = {})
167
+ data, _status_code, _headers = get_equitydata_with_http_info(opts)
168
+ data
169
+ end
170
+
171
+ # 証拠金関連項目取得
172
+ # 口座の証拠金関連情報を取得します。これには建玉評価損益、必要証拠金、証拠金維持率などが含まれます。
173
+ # @param [Hash] opts the optional parameters
174
+ # @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers
175
+ def get_equitydata_with_http_info(opts = {})
176
+ if @api_client.config.debugging
177
+ @api_client.config.logger.debug 'Calling API: PrivateApi.get_equitydata ...'
178
+ end
179
+ # resource path
180
+ local_var_path = '/cfd/equitydata'
181
+
182
+ # query parameters
183
+ query_params = opts[:query_params] || {}
184
+
185
+ # header parameters
186
+ header_params = opts[:header_params] || {}
187
+ # HTTP header 'Accept' (if needed)
188
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
189
+
190
+ # form parameters
191
+ form_params = opts[:form_params] || {}
192
+
193
+ # http body (model)
194
+ post_body = opts[:body]
195
+
196
+ return_type = opts[:return_type] || 'InlineResponse2006'
197
+
198
+ auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
199
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
200
+ :header_params => header_params,
201
+ :query_params => query_params,
202
+ :form_params => form_params,
203
+ :body => post_body,
204
+ :auth_names => auth_names,
205
+ :return_type => return_type)
206
+
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug "API called: PrivateApi#get_equitydata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
209
+ end
210
+ return data, status_code, headers
211
+ end
212
+ # 注文一覧取得
213
+ # 指定された条件にマッチする注文一覧を取得します。このエンドポイントを通じて、特定のシンボル、注文タイプ、または期間に関する注文の詳細情報を照会することができます。
214
+ # @param symbol_id シンボルID
215
+ # @param [Hash] opts the optional parameters
216
+ # @option opts [Array<Integer>] :id 注文IDの配列
217
+ # @option opts [Integer] :date_from 取得開始日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。
218
+ # @option opts [Integer] :date_to 取得終了日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。
219
+ # @option opts [String] :order_behavior 注文の挙動(OPEN, CLOSE)
220
+ # @option opts [String] :order_side 売買方向(SELL, BUY)
221
+ # @option opts [Array<String>] :order_pattern 注文パターン(NORMAL, OCO, IFD, IFD_OCO)
222
+ # @option opts [Array<String>] :order_type 執行条件(MARKET, LIMIT, STOP)
223
+ # @option opts [Array<String>] :close_behavior 決済挙動(CROSS, FIFO)
224
+ # @option opts [Array<String>] :order_status 注文ステータス(WORKING_ORDER, PARTIAL_FILL)
225
+ # @option opts [BOOLEAN] :post_only メイカー注文のみ許可
226
+ # @option opts [Integer] :size 取得件数。デフォルトは30、最大は500。 (default to 30)
227
+ # @return [Array<OrderDetail>]
228
+ def get_order(symbol_id, opts = {})
229
+ data, _status_code, _headers = get_order_with_http_info(symbol_id, opts)
230
+ data
231
+ end
232
+
233
+ # 注文一覧取得
234
+ # 指定された条件にマッチする注文一覧を取得します。このエンドポイントを通じて、特定のシンボル、注文タイプ、または期間に関する注文の詳細情報を照会することができます。
235
+ # @param symbol_id シンボルID
236
+ # @param [Hash] opts the optional parameters
237
+ # @option opts [Array<Integer>] :id 注文IDの配列
238
+ # @option opts [Integer] :date_from 取得開始日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。
239
+ # @option opts [Integer] :date_to 取得終了日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。
240
+ # @option opts [String] :order_behavior 注文の挙動(OPEN, CLOSE)
241
+ # @option opts [String] :order_side 売買方向(SELL, BUY)
242
+ # @option opts [Array<String>] :order_pattern 注文パターン(NORMAL, OCO, IFD, IFD_OCO)
243
+ # @option opts [Array<String>] :order_type 執行条件(MARKET, LIMIT, STOP)
244
+ # @option opts [Array<String>] :close_behavior 決済挙動(CROSS, FIFO)
245
+ # @option opts [Array<String>] :order_status 注文ステータス(WORKING_ORDER, PARTIAL_FILL)
246
+ # @option opts [BOOLEAN] :post_only メイカー注文のみ許可
247
+ # @option opts [Integer] :size 取得件数。デフォルトは30、最大は500。
248
+ # @return [Array<(Array<OrderDetail>, Integer, Hash)>] Array<OrderDetail> data, response status code and response headers
249
+ def get_order_with_http_info(symbol_id, opts = {})
250
+ if @api_client.config.debugging
251
+ @api_client.config.logger.debug 'Calling API: PrivateApi.get_order ...'
252
+ end
253
+ # verify the required parameter 'symbol_id' is set
254
+ if @api_client.config.client_side_validation && symbol_id.nil?
255
+ fail ArgumentError, "Missing the required parameter 'symbol_id' when calling PrivateApi.get_order"
256
+ end
257
+ # resource path
258
+ local_var_path = '/cfd/order'
259
+
260
+ # query parameters
261
+ query_params = opts[:query_params] || {}
262
+ query_params[:'symbolId'] = symbol_id
263
+ query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if !opts[:'id'].nil?
264
+ query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
265
+ query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
266
+ query_params[:'orderBehavior'] = opts[:'order_behavior'] if !opts[:'order_behavior'].nil?
267
+ query_params[:'orderSide'] = opts[:'order_side'] if !opts[:'order_side'].nil?
268
+ query_params[:'orderPattern'] = @api_client.build_collection_param(opts[:'order_pattern'], :multi) if !opts[:'order_pattern'].nil?
269
+ query_params[:'orderType'] = @api_client.build_collection_param(opts[:'order_type'], :multi) if !opts[:'order_type'].nil?
270
+ query_params[:'closeBehavior'] = @api_client.build_collection_param(opts[:'close_behavior'], :multi) if !opts[:'close_behavior'].nil?
271
+ query_params[:'orderStatus'] = @api_client.build_collection_param(opts[:'order_status'], :multi) if !opts[:'order_status'].nil?
272
+ query_params[:'postOnly'] = opts[:'post_only'] if !opts[:'post_only'].nil?
273
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
274
+
275
+ # header parameters
276
+ header_params = opts[:header_params] || {}
277
+ # HTTP header 'Accept' (if needed)
278
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
279
+
280
+ # form parameters
281
+ form_params = opts[:form_params] || {}
282
+
283
+ # http body (model)
284
+ post_body = opts[:body]
285
+
286
+ return_type = opts[:return_type] || 'Array<OrderDetail>'
287
+
288
+ auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
289
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
290
+ :header_params => header_params,
291
+ :query_params => query_params,
292
+ :form_params => form_params,
293
+ :body => post_body,
294
+ :auth_names => auth_names,
295
+ :return_type => return_type)
296
+
297
+ if @api_client.config.debugging
298
+ @api_client.config.logger.debug "API called: PrivateApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
299
+ end
300
+ return data, status_code, headers
301
+ end
302
+ # 建玉一覧取得
303
+ # @param [Hash] opts the optional parameters
304
+ # @option opts [Integer] :symbol_id シンボルID。特定の銘柄に対する建玉のみを取得したい場合に指定します。
305
+ # @option opts [Array<Integer>] :id 建玉ID。特定の建玉情報のみを取得したい場合に指定します。
306
+ # @option opts [Integer] :date_from 取得開始日時。指定日時以上の建玉を検索します。
307
+ # @option opts [Integer] :date_to 取得終了日時。指定日時未満の建玉を検索します。
308
+ # @return [Array<InlineResponse2007>]
309
+ def get_position(opts = {})
310
+ data, _status_code, _headers = get_position_with_http_info(opts)
311
+ data
312
+ end
313
+
314
+ # 建玉一覧取得
315
+ # @param [Hash] opts the optional parameters
316
+ # @option opts [Integer] :symbol_id シンボルID。特定の銘柄に対する建玉のみを取得したい場合に指定します。
317
+ # @option opts [Array<Integer>] :id 建玉ID。特定の建玉情報のみを取得したい場合に指定します。
318
+ # @option opts [Integer] :date_from 取得開始日時。指定日時以上の建玉を検索します。
319
+ # @option opts [Integer] :date_to 取得終了日時。指定日時未満の建玉を検索します。
320
+ # @return [Array<(Array<InlineResponse2007>, Integer, Hash)>] Array<InlineResponse2007> data, response status code and response headers
321
+ def get_position_with_http_info(opts = {})
322
+ if @api_client.config.debugging
323
+ @api_client.config.logger.debug 'Calling API: PrivateApi.get_position ...'
324
+ end
325
+ # resource path
326
+ local_var_path = '/cfd/position'
327
+
328
+ # query parameters
329
+ query_params = opts[:query_params] || {}
330
+ query_params[:'symbolId'] = opts[:'symbol_id'] if !opts[:'symbol_id'].nil?
331
+ query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if !opts[:'id'].nil?
332
+ query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
333
+ query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
334
+
335
+ # header parameters
336
+ header_params = opts[:header_params] || {}
337
+ # HTTP header 'Accept' (if needed)
338
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
339
+
340
+ # form parameters
341
+ form_params = opts[:form_params] || {}
342
+
343
+ # http body (model)
344
+ post_body = opts[:body]
345
+
346
+ return_type = opts[:return_type] || 'Array<InlineResponse2007>'
347
+
348
+ auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
349
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
350
+ :header_params => header_params,
351
+ :query_params => query_params,
352
+ :form_params => form_params,
353
+ :body => post_body,
354
+ :auth_names => auth_names,
355
+ :return_type => return_type)
356
+
357
+ if @api_client.config.debugging
358
+ @api_client.config.logger.debug "API called: PrivateApi#get_position\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
359
+ end
360
+ return data, status_code, headers
361
+ end
362
+ # 注文
363
+ # @param body
364
+ # @param [Hash] opts the optional parameters
365
+ # @return [Array<OrderResponse>]
366
+ def order(body, opts = {})
367
+ data, _status_code, _headers = order_with_http_info(body, opts)
368
+ data
369
+ end
370
+
371
+ # 注文
372
+ # @param body
373
+ # @param [Hash] opts the optional parameters
374
+ # @return [Array<(Array<OrderResponse>, Integer, Hash)>] Array<OrderResponse> data, response status code and response headers
375
+ def order_with_http_info(body, opts = {})
376
+ if @api_client.config.debugging
377
+ @api_client.config.logger.debug 'Calling API: PrivateApi.order ...'
378
+ end
379
+ # verify the required parameter 'body' is set
380
+ if @api_client.config.client_side_validation && body.nil?
381
+ fail ArgumentError, "Missing the required parameter 'body' when calling PrivateApi.order"
382
+ end
383
+ # resource path
384
+ local_var_path = '/cfd/order'
385
+
386
+ # query parameters
387
+ query_params = opts[:query_params] || {}
388
+
389
+ # header parameters
390
+ header_params = opts[:header_params] || {}
391
+ # HTTP header 'Accept' (if needed)
392
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
393
+ # HTTP header 'Content-Type'
394
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
395
+
396
+ # form parameters
397
+ form_params = opts[:form_params] || {}
398
+
399
+ # http body (model)
400
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
401
+
402
+ return_type = opts[:return_type] || 'Array<OrderResponse>'
403
+
404
+ auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
405
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
406
+ :header_params => header_params,
407
+ :query_params => query_params,
408
+ :form_params => form_params,
409
+ :body => post_body,
410
+ :auth_names => auth_names,
411
+ :return_type => return_type)
412
+
413
+ if @api_client.config.debugging
414
+ @api_client.config.logger.debug "API called: PrivateApi#order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
415
+ end
416
+ return data, status_code, headers
417
+ end
418
+ # 注文訂正
419
+ # @param body
420
+ # @param [Hash] opts the optional parameters
421
+ # @return [Array<OrderResponse>]
422
+ def order_amend(body, opts = {})
423
+ data, _status_code, _headers = order_amend_with_http_info(body, opts)
424
+ data
425
+ end
426
+
427
+ # 注文訂正
428
+ # @param body
429
+ # @param [Hash] opts the optional parameters
430
+ # @return [Array<(Array<OrderResponse>, Integer, Hash)>] Array<OrderResponse> data, response status code and response headers
431
+ def order_amend_with_http_info(body, opts = {})
432
+ if @api_client.config.debugging
433
+ @api_client.config.logger.debug 'Calling API: PrivateApi.order_amend ...'
434
+ end
435
+ # verify the required parameter 'body' is set
436
+ if @api_client.config.client_side_validation && body.nil?
437
+ fail ArgumentError, "Missing the required parameter 'body' when calling PrivateApi.order_amend"
438
+ end
439
+ # resource path
440
+ local_var_path = '/cfd/order'
441
+
442
+ # query parameters
443
+ query_params = opts[:query_params] || {}
444
+
445
+ # header parameters
446
+ header_params = opts[:header_params] || {}
447
+ # HTTP header 'Accept' (if needed)
448
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
449
+ # HTTP header 'Content-Type'
450
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
451
+
452
+ # form parameters
453
+ form_params = opts[:form_params] || {}
454
+
455
+ # http body (model)
456
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
457
+
458
+ return_type = opts[:return_type] || 'Array<OrderResponse>'
459
+
460
+ auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
461
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
462
+ :header_params => header_params,
463
+ :query_params => query_params,
464
+ :form_params => form_params,
465
+ :body => post_body,
466
+ :auth_names => auth_names,
467
+ :return_type => return_type)
468
+
469
+ if @api_client.config.debugging
470
+ @api_client.config.logger.debug "API called: PrivateApi#order_amend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
471
+ end
472
+ return data, status_code, headers
473
+ end
474
+ # 注文取消
475
+ # @param symbol_id シンボルID
476
+ # @param id 注文ID
477
+ # @param [Hash] opts the optional parameters
478
+ # @return [Array<OrderResponse>]
479
+ def order_cancel(symbol_id, id, opts = {})
480
+ data, _status_code, _headers = order_cancel_with_http_info(symbol_id, id, opts)
481
+ data
482
+ end
483
+
484
+ # 注文取消
485
+ # @param symbol_id シンボルID
486
+ # @param id 注文ID
487
+ # @param [Hash] opts the optional parameters
488
+ # @return [Array<(Array<OrderResponse>, Integer, Hash)>] Array<OrderResponse> data, response status code and response headers
489
+ def order_cancel_with_http_info(symbol_id, id, opts = {})
490
+ if @api_client.config.debugging
491
+ @api_client.config.logger.debug 'Calling API: PrivateApi.order_cancel ...'
492
+ end
493
+ # verify the required parameter 'symbol_id' is set
494
+ if @api_client.config.client_side_validation && symbol_id.nil?
495
+ fail ArgumentError, "Missing the required parameter 'symbol_id' when calling PrivateApi.order_cancel"
496
+ end
497
+ # verify the required parameter 'id' is set
498
+ if @api_client.config.client_side_validation && id.nil?
499
+ fail ArgumentError, "Missing the required parameter 'id' when calling PrivateApi.order_cancel"
500
+ end
501
+ # resource path
502
+ local_var_path = '/cfd/order'
503
+
504
+ # query parameters
505
+ query_params = opts[:query_params] || {}
506
+ query_params[:'symbolId'] = symbol_id
507
+ query_params[:'id'] = id
508
+
509
+ # header parameters
510
+ header_params = opts[:header_params] || {}
511
+ # HTTP header 'Accept' (if needed)
512
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
513
+
514
+ # form parameters
515
+ form_params = opts[:form_params] || {}
516
+
517
+ # http body (model)
518
+ post_body = opts[:body]
519
+
520
+ return_type = opts[:return_type] || 'Array<OrderResponse>'
521
+
522
+ auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
523
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
524
+ :header_params => header_params,
525
+ :query_params => query_params,
526
+ :form_params => form_params,
527
+ :body => post_body,
528
+ :auth_names => auth_names,
529
+ :return_type => return_type)
530
+
531
+ if @api_client.config.debugging
532
+ @api_client.config.logger.debug "API called: PrivateApi#order_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
533
+ end
534
+ return data, status_code, headers
535
+ end
536
+ end
537
+ end