Class: RakutenTrading::PrivateApi

Inherits:
Object
  • Object
show all
Defined in:
lib/rakuten_trading/api/private_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PrivateApi

Returns a new instance of PrivateApi.



16
17
18
# File 'lib/rakuten_trading/api/private_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/rakuten_trading/api/private_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#get_asset(opts = {}) ⇒ Array<InlineResponse2005>

残高一覧取得 アカウントの資産情報(各通貨の保有量)を取得します。

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



23
24
25
26
# File 'lib/rakuten_trading/api/private_api.rb', line 23

def get_asset(opts = {})
  data, _status_code, _headers = get_asset_with_http_info(opts)
  data
end

#get_asset_with_http_info(opts = {}) ⇒ Array<(Array<InlineResponse2005>, Integer, Hash)>

残高一覧取得 アカウントの資産情報(各通貨の保有量)を取得します。

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<InlineResponse2005>, Integer, Hash)>)

    Array<InlineResponse2005> data, response status code and response headers



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/rakuten_trading/api/private_api.rb', line 32

def get_asset_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PrivateApi.get_asset ...'
  end
  # resource path
  local_var_path = '/asset'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Array<InlineResponse2005>' 

  auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PrivateApi#get_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_cfd_trades(symbol_id, opts = {}) ⇒ Array<CfdTrade>

約定履歴取得 指定された条件に基づくCFD取引の約定履歴(トレード)を取得します。これにより、ユーザーは過去の取引データを分析することができます。

Parameters:

  • symbol_id

    シンボルID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (Array<Integer>)

    約定IDの配列

  • :date_from (Integer)

    取得開始日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。

  • :date_to (Integer)

    取得終了日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。

  • :order_behavior (String)

    注文の挙動(OPEN, CLOSE)

  • :trade_behavior (String)

    トレードの挙動(OPEN, CLOSE)

  • :order_side (String)

    売買方向(SELL, BUY)

  • :order_pattern (Array<String>)

    注文パターン(NORMAL, OCO, IFD, IFD_OCO, LOSS_CUT, CLOSE_ALL)

  • :order_type (Array<String>)

    執行条件(MARKET, LIMIT, STOP)

  • :trade_action (String)

    約定アクション(MAKER, TAKER)

  • :order_id (Array<Integer>)

    注文IDの配列

  • :position_id (Array<Integer>)

    建玉IDの配列

  • :size (Integer)

    取得件数。デフォルトは30、最大は500。 (default to 30)

Returns:



86
87
88
89
# File 'lib/rakuten_trading/api/private_api.rb', line 86

def get_cfd_trades(symbol_id, opts = {})
  data, _status_code, _headers = get_cfd_trades_with_http_info(symbol_id, opts)
  data
end

#get_cfd_trades_with_http_info(symbol_id, opts = {}) ⇒ Array<(Array<CfdTrade>, Integer, Hash)>

約定履歴取得 指定された条件に基づくCFD取引の約定履歴(トレード)を取得します。これにより、ユーザーは過去の取引データを分析することができます。

Parameters:

  • symbol_id

    シンボルID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (Array<Integer>)

    約定IDの配列

  • :date_from (Integer)

    取得開始日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。

  • :date_to (Integer)

    取得終了日時(作成日時)。UNIXタイムスタンプ(ミリ秒)で指定。直近48時間。

  • :order_behavior (String)

    注文の挙動(OPEN, CLOSE)

  • :trade_behavior (String)

    トレードの挙動(OPEN, CLOSE)

  • :order_side (String)

    売買方向(SELL, BUY)

  • :order_pattern (Array<String>)

    注文パターン(NORMAL, OCO, IFD, IFD_OCO, LOSS_CUT, CLOSE_ALL)

  • :order_type (Array<String>)

    執行条件(MARKET, LIMIT, STOP)

  • :trade_action (String)

    約定アクション(MAKER, TAKER)

  • :order_id (Array<Integer>)

    注文IDの配列

  • :position_id (Array<Integer>)

    建玉IDの配列

  • :size (Integer)

    取得件数。デフォルトは30、最大は500。

Returns:

  • (Array<(Array<CfdTrade>, Integer, Hash)>)

    Array<CfdTrade> data, response status code and response headers



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/rakuten_trading/api/private_api.rb', line 108

def get_cfd_trades_with_http_info(symbol_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PrivateApi.get_cfd_trades ...'
  end
  # verify the required parameter 'symbol_id' is set
  if @api_client.config.client_side_validation && symbol_id.nil?
    fail ArgumentError, "Missing the required parameter 'symbol_id' when calling PrivateApi.get_cfd_trades"
  end
  # resource path
  local_var_path = '/cfd/trade'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbolId'] = symbol_id
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if !opts[:'id'].nil?
  query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
  query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
  query_params[:'orderBehavior'] = opts[:'order_behavior'] if !opts[:'order_behavior'].nil?
  query_params[:'tradeBehavior'] = opts[:'trade_behavior'] if !opts[:'trade_behavior'].nil?
  query_params[:'orderSide'] = opts[:'order_side'] if !opts[:'order_side'].nil?
  query_params[:'orderPattern'] = @api_client.build_collection_param(opts[:'order_pattern'], :multi) if !opts[:'order_pattern'].nil?
  query_params[:'orderType'] = @api_client.build_collection_param(opts[:'order_type'], :multi) if !opts[:'order_type'].nil?
  query_params[:'tradeAction'] = opts[:'trade_action'] if !opts[:'trade_action'].nil?
  query_params[:'orderId'] = @api_client.build_collection_param(opts[:'order_id'], :multi) if !opts[:'order_id'].nil?
  query_params[:'positionId'] = @api_client.build_collection_param(opts[:'position_id'], :multi) if !opts[:'position_id'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Array<CfdTrade>' 

  auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PrivateApi#get_cfd_trades\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_equitydata(opts = {}) ⇒ InlineResponse2006

証拠金関連項目取得 口座の証拠金関連情報を取得します。これには建玉評価損益、必要証拠金、証拠金維持率などが含まれます。

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



166
167
168
169
# File 'lib/rakuten_trading/api/private_api.rb', line 166

def get_equitydata(opts = {})
  data, _status_code, _headers = get_equitydata_with_http_info(opts)
  data
end

#get_equitydata_with_http_info(opts = {}) ⇒ Array<(InlineResponse2006, Integer, Hash)>

証拠金関連項目取得 口座の証拠金関連情報を取得します。これには建玉評価損益、必要証拠金、証拠金維持率などが含まれます。

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2006, Integer, Hash)>)

    InlineResponse2006 data, response status code and response headers



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/rakuten_trading/api/private_api.rb', line 175

def get_equitydata_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PrivateApi.get_equitydata ...'
  end
  # resource path
  local_var_path = '/cfd/equitydata'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'InlineResponse2006' 

  auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PrivateApi#get_equitydata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_order(symbol_id, opts = {}) ⇒ Array<OrderDetail>

注文一覧取得 指定された条件にマッチする注文一覧を取得します。このエンドポイントを通じて、特定のシンボル、注文タイプ、または期間に関する注文の詳細情報を照会することができます。

Parameters:

  • symbol_id

    シンボルID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (Array<Integer>)

    注文IDの配列

  • :date_from (Integer)

    取得開始日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。

  • :date_to (Integer)

    取得終了日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。

  • :order_behavior (String)

    注文の挙動(OPEN, CLOSE)

  • :order_side (String)

    売買方向(SELL, BUY)

  • :order_pattern (Array<String>)

    注文パターン(NORMAL, OCO, IFD, IFD_OCO)

  • :order_type (Array<String>)

    執行条件(MARKET, LIMIT, STOP)

  • :close_behavior (Array<String>)

    決済挙動(CROSS, FIFO)

  • :order_status (Array<String>)

    注文ステータス(WORKING_ORDER, PARTIAL_FILL)

  • :post_only (BOOLEAN)

    メイカー注文のみ許可

  • :size (Integer)

    取得件数。デフォルトは30、最大は500。 (default to 30)

Returns:



228
229
230
231
# File 'lib/rakuten_trading/api/private_api.rb', line 228

def get_order(symbol_id, opts = {})
  data, _status_code, _headers = get_order_with_http_info(symbol_id, opts)
  data
end

#get_order_with_http_info(symbol_id, opts = {}) ⇒ Array<(Array<OrderDetail>, Integer, Hash)>

注文一覧取得 指定された条件にマッチする注文一覧を取得します。このエンドポイントを通じて、特定のシンボル、注文タイプ、または期間に関する注文の詳細情報を照会することができます。

Parameters:

  • symbol_id

    シンボルID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (Array<Integer>)

    注文IDの配列

  • :date_from (Integer)

    取得開始日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。

  • :date_to (Integer)

    取得終了日時(注文成立日時)。UNIXタイムスタンプ(ミリ秒)で指定。

  • :order_behavior (String)

    注文の挙動(OPEN, CLOSE)

  • :order_side (String)

    売買方向(SELL, BUY)

  • :order_pattern (Array<String>)

    注文パターン(NORMAL, OCO, IFD, IFD_OCO)

  • :order_type (Array<String>)

    執行条件(MARKET, LIMIT, STOP)

  • :close_behavior (Array<String>)

    決済挙動(CROSS, FIFO)

  • :order_status (Array<String>)

    注文ステータス(WORKING_ORDER, PARTIAL_FILL)

  • :post_only (BOOLEAN)

    メイカー注文のみ許可

  • :size (Integer)

    取得件数。デフォルトは30、最大は500。

Returns:

  • (Array<(Array<OrderDetail>, Integer, Hash)>)

    Array<OrderDetail> data, response status code and response headers



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/rakuten_trading/api/private_api.rb', line 249

def get_order_with_http_info(symbol_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PrivateApi.get_order ...'
  end
  # verify the required parameter 'symbol_id' is set
  if @api_client.config.client_side_validation && symbol_id.nil?
    fail ArgumentError, "Missing the required parameter 'symbol_id' when calling PrivateApi.get_order"
  end
  # resource path
  local_var_path = '/cfd/order'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbolId'] = symbol_id
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if !opts[:'id'].nil?
  query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
  query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
  query_params[:'orderBehavior'] = opts[:'order_behavior'] if !opts[:'order_behavior'].nil?
  query_params[:'orderSide'] = opts[:'order_side'] if !opts[:'order_side'].nil?
  query_params[:'orderPattern'] = @api_client.build_collection_param(opts[:'order_pattern'], :multi) if !opts[:'order_pattern'].nil?
  query_params[:'orderType'] = @api_client.build_collection_param(opts[:'order_type'], :multi) if !opts[:'order_type'].nil?
  query_params[:'closeBehavior'] = @api_client.build_collection_param(opts[:'close_behavior'], :multi) if !opts[:'close_behavior'].nil?
  query_params[:'orderStatus'] = @api_client.build_collection_param(opts[:'order_status'], :multi) if !opts[:'order_status'].nil?
  query_params[:'postOnly'] = opts[:'post_only'] if !opts[:'post_only'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Array<OrderDetail>' 

  auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PrivateApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_position(opts = {}) ⇒ Array<InlineResponse2007>

建玉一覧取得

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :symbol_id (Integer)

    シンボルID。特定の銘柄に対する建玉のみを取得したい場合に指定します。

  • :id (Array<Integer>)

    建玉ID。特定の建玉情報のみを取得したい場合に指定します。

  • :date_from (Integer)

    取得開始日時。指定日時以上の建玉を検索します。

  • :date_to (Integer)

    取得終了日時。指定日時未満の建玉を検索します。

Returns:



309
310
311
312
# File 'lib/rakuten_trading/api/private_api.rb', line 309

def get_position(opts = {})
  data, _status_code, _headers = get_position_with_http_info(opts)
  data
end

#get_position_with_http_info(opts = {}) ⇒ Array<(Array<InlineResponse2007>, Integer, Hash)>

建玉一覧取得

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :symbol_id (Integer)

    シンボルID。特定の銘柄に対する建玉のみを取得したい場合に指定します。

  • :id (Array<Integer>)

    建玉ID。特定の建玉情報のみを取得したい場合に指定します。

  • :date_from (Integer)

    取得開始日時。指定日時以上の建玉を検索します。

  • :date_to (Integer)

    取得終了日時。指定日時未満の建玉を検索します。

Returns:

  • (Array<(Array<InlineResponse2007>, Integer, Hash)>)

    Array<InlineResponse2007> data, response status code and response headers



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/rakuten_trading/api/private_api.rb', line 321

def get_position_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PrivateApi.get_position ...'
  end
  # resource path
  local_var_path = '/cfd/position'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbolId'] = opts[:'symbol_id'] if !opts[:'symbol_id'].nil?
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if !opts[:'id'].nil?
  query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
  query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Array<InlineResponse2007>' 

  auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PrivateApi#get_position\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#order(body, opts = {}) ⇒ Array<OrderResponse>

注文

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



366
367
368
369
# File 'lib/rakuten_trading/api/private_api.rb', line 366

def order(body, opts = {})
  data, _status_code, _headers = order_with_http_info(body, opts)
  data
end

#order_amend(body, opts = {}) ⇒ Array<OrderResponse>

注文訂正

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



422
423
424
425
# File 'lib/rakuten_trading/api/private_api.rb', line 422

def order_amend(body, opts = {})
  data, _status_code, _headers = order_amend_with_http_info(body, opts)
  data
end

#order_amend_with_http_info(body, opts = {}) ⇒ Array<(Array<OrderResponse>, Integer, Hash)>

注文訂正

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<OrderResponse>, Integer, Hash)>)

    Array<OrderResponse> data, response status code and response headers



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'lib/rakuten_trading/api/private_api.rb', line 431

def order_amend_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PrivateApi.order_amend ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PrivateApi.order_amend"
  end
  # resource path
  local_var_path = '/cfd/order'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  return_type = opts[:return_type] || 'Array<OrderResponse>' 

  auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PrivateApi#order_amend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#order_cancel(symbol_id, id, opts = {}) ⇒ Array<OrderResponse>

注文取消

Parameters:

  • symbol_id

    シンボルID

  • id

    注文ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



479
480
481
482
# File 'lib/rakuten_trading/api/private_api.rb', line 479

def order_cancel(symbol_id, id, opts = {})
  data, _status_code, _headers = order_cancel_with_http_info(symbol_id, id, opts)
  data
end

#order_cancel_with_http_info(symbol_id, id, opts = {}) ⇒ Array<(Array<OrderResponse>, Integer, Hash)>

注文取消

Parameters:

  • symbol_id

    シンボルID

  • id

    注文ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<OrderResponse>, Integer, Hash)>)

    Array<OrderResponse> data, response status code and response headers



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/rakuten_trading/api/private_api.rb', line 489

def order_cancel_with_http_info(symbol_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PrivateApi.order_cancel ...'
  end
  # verify the required parameter 'symbol_id' is set
  if @api_client.config.client_side_validation && symbol_id.nil?
    fail ArgumentError, "Missing the required parameter 'symbol_id' when calling PrivateApi.order_cancel"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PrivateApi.order_cancel"
  end
  # resource path
  local_var_path = '/cfd/order'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbolId'] = symbol_id
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Array<OrderResponse>' 

  auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PrivateApi#order_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#order_with_http_info(body, opts = {}) ⇒ Array<(Array<OrderResponse>, Integer, Hash)>

注文

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<OrderResponse>, Integer, Hash)>)

    Array<OrderResponse> data, response status code and response headers



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/rakuten_trading/api/private_api.rb', line 375

def order_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PrivateApi.order ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PrivateApi.order"
  end
  # resource path
  local_var_path = '/cfd/order'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  return_type = opts[:return_type] || 'Array<OrderResponse>' 

  auth_names = opts[:auth_names] || ['ApiKeyAuth', 'SignatureAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PrivateApi#order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end