class TinkoffInvestClient::SandboxApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

sandbox_clear_post(opts = {}) click to toggle source

Удаление всех позиций Удаление всех позиций клиента @param [Hash] opts the optional parameters @option opts [String] :broker_account_id Номер счета (по умолчанию - Тинькофф) @return [Empty]

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 27
def sandbox_clear_post(opts = {})
  data, _status_code, _headers = sandbox_clear_post_with_http_info(opts)
  data
end
sandbox_clear_post_with_http_info(opts = {}) click to toggle source

Удаление всех позиций Удаление всех позиций клиента @param [Hash] opts the optional parameters @option opts [String] :broker_account_id Номер счета (по умолчанию - Тинькофф) @return [Array<(Empty, Integer, Hash)>] Empty data, response status code and response headers

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 37
def sandbox_clear_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SandboxApi.sandbox_clear_post ...'
  end
  # resource path
  local_var_path = '/sandbox/clear'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'brokerAccountId'] = opts[:'broker_account_id'] if !opts[:'broker_account_id'].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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Empty'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['sso_auth']

  new_options = opts.merge(
    :operation => :"SandboxApi.sandbox_clear_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SandboxApi#sandbox_clear_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sandbox_currencies_balance_post(sandbox_set_currency_balance_request, opts = {}) click to toggle source

Выставление баланса по валютным позициям @param sandbox_set_currency_balance_request [SandboxSetCurrencyBalanceRequest] Запрос на выставление баланса по валютным позициям @param [Hash] opts the optional parameters @option opts [String] :broker_account_id Номер счета (по умолчанию - Тинькофф) @return [Empty]

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 87
def sandbox_currencies_balance_post(sandbox_set_currency_balance_request, opts = {})
  data, _status_code, _headers = sandbox_currencies_balance_post_with_http_info(sandbox_set_currency_balance_request, opts)
  data
end
sandbox_currencies_balance_post_with_http_info(sandbox_set_currency_balance_request, opts = {}) click to toggle source

Выставление баланса по валютным позициям @param sandbox_set_currency_balance_request [SandboxSetCurrencyBalanceRequest] Запрос на выставление баланса по валютным позициям @param [Hash] opts the optional parameters @option opts [String] :broker_account_id Номер счета (по умолчанию - Тинькофф) @return [Array<(Empty, Integer, Hash)>] Empty data, response status code and response headers

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 97
def sandbox_currencies_balance_post_with_http_info(sandbox_set_currency_balance_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SandboxApi.sandbox_currencies_balance_post ...'
  end
  # verify the required parameter 'sandbox_set_currency_balance_request' is set
  if @api_client.config.client_side_validation && sandbox_set_currency_balance_request.nil?
    fail ArgumentError, "Missing the required parameter 'sandbox_set_currency_balance_request' when calling SandboxApi.sandbox_currencies_balance_post"
  end
  # resource path
  local_var_path = '/sandbox/currencies/balance'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'brokerAccountId'] = opts[:'broker_account_id'] if !opts[:'broker_account_id'].nil?

  # 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[:debug_body] || @api_client.object_to_http_body(sandbox_set_currency_balance_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Empty'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['sso_auth']

  new_options = opts.merge(
    :operation => :"SandboxApi.sandbox_currencies_balance_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SandboxApi#sandbox_currencies_balance_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sandbox_positions_balance_post(sandbox_set_position_balance_request, opts = {}) click to toggle source

Выставление баланса по инструментным позициям @param sandbox_set_position_balance_request [SandboxSetPositionBalanceRequest] Запрос на выставление баланса по инструментным позициям @param [Hash] opts the optional parameters @option opts [String] :broker_account_id Номер счета (по умолчанию - Тинькофф) @return [Empty]

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 153
def sandbox_positions_balance_post(sandbox_set_position_balance_request, opts = {})
  data, _status_code, _headers = sandbox_positions_balance_post_with_http_info(sandbox_set_position_balance_request, opts)
  data
end
sandbox_positions_balance_post_with_http_info(sandbox_set_position_balance_request, opts = {}) click to toggle source

Выставление баланса по инструментным позициям @param sandbox_set_position_balance_request [SandboxSetPositionBalanceRequest] Запрос на выставление баланса по инструментным позициям @param [Hash] opts the optional parameters @option opts [String] :broker_account_id Номер счета (по умолчанию - Тинькофф) @return [Array<(Empty, Integer, Hash)>] Empty data, response status code and response headers

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 163
def sandbox_positions_balance_post_with_http_info(sandbox_set_position_balance_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SandboxApi.sandbox_positions_balance_post ...'
  end
  # verify the required parameter 'sandbox_set_position_balance_request' is set
  if @api_client.config.client_side_validation && sandbox_set_position_balance_request.nil?
    fail ArgumentError, "Missing the required parameter 'sandbox_set_position_balance_request' when calling SandboxApi.sandbox_positions_balance_post"
  end
  # resource path
  local_var_path = '/sandbox/positions/balance'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'brokerAccountId'] = opts[:'broker_account_id'] if !opts[:'broker_account_id'].nil?

  # 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[:debug_body] || @api_client.object_to_http_body(sandbox_set_position_balance_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Empty'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['sso_auth']

  new_options = opts.merge(
    :operation => :"SandboxApi.sandbox_positions_balance_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SandboxApi#sandbox_positions_balance_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sandbox_register_post(opts = {}) click to toggle source

Регистрация клиента в sandbox Создание счета и валютных позиций для клиента @param [Hash] opts the optional parameters @option opts [SandboxRegisterRequest] :sandbox_register_request Запрос на создание счета и выставление баланса по валютным позициям @return [SandboxRegisterResponse]

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 219
def sandbox_register_post(opts = {})
  data, _status_code, _headers = sandbox_register_post_with_http_info(opts)
  data
end
sandbox_register_post_with_http_info(opts = {}) click to toggle source

Регистрация клиента в sandbox Создание счета и валютных позиций для клиента @param [Hash] opts the optional parameters @option opts [SandboxRegisterRequest] :sandbox_register_request Запрос на создание счета и выставление баланса по валютным позициям @return [Array<(SandboxRegisterResponse, Integer, Hash)>] SandboxRegisterResponse data, response status code and response headers

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 229
def sandbox_register_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SandboxApi.sandbox_register_post ...'
  end
  # resource path
  local_var_path = '/sandbox/register'

  # 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[:debug_body] || @api_client.object_to_http_body(opts[:'sandbox_register_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'SandboxRegisterResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['sso_auth']

  new_options = opts.merge(
    :operation => :"SandboxApi.sandbox_register_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SandboxApi#sandbox_register_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sandbox_remove_post(opts = {}) click to toggle source

Удаление счета Удаление счета клиента @param [Hash] opts the optional parameters @option opts [String] :broker_account_id Номер счета (по умолчанию - Тинькофф) @return [Empty]

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 280
def sandbox_remove_post(opts = {})
  data, _status_code, _headers = sandbox_remove_post_with_http_info(opts)
  data
end
sandbox_remove_post_with_http_info(opts = {}) click to toggle source

Удаление счета Удаление счета клиента @param [Hash] opts the optional parameters @option opts [String] :broker_account_id Номер счета (по умолчанию - Тинькофф) @return [Array<(Empty, Integer, Hash)>] Empty data, response status code and response headers

# File lib/tinkoff_invest_client/api/sandbox_api.rb, line 290
def sandbox_remove_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SandboxApi.sandbox_remove_post ...'
  end
  # resource path
  local_var_path = '/sandbox/remove'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'brokerAccountId'] = opts[:'broker_account_id'] if !opts[:'broker_account_id'].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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Empty'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['sso_auth']

  new_options = opts.merge(
    :operation => :"SandboxApi.sandbox_remove_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SandboxApi#sandbox_remove_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end