Commit 8b65ac32 authored by Sergey Gernyak's avatar Sergey Gernyak

DOCS: enums for placeOrders method

parent d5043af6
......@@ -5,9 +5,7 @@ require "betfair_api_ng_rails/railtie" if defined?(Rails)
require 'redis'
module BetfairApiNgRails
module Api
autoload :BaseProvider, 'betfair_api_ng_rails/api/base_provider'
autoload :BaseRequester, 'betfair_api_ng_rails/api/base_requester'
autoload :FormatterFactory, 'betfair_api_ng_rails/api/formatter_factory'
......@@ -21,27 +19,20 @@ module BetfairApiNgRails
autoload :Hashalator, 'betfair_api_ng_rails/api/hashalator'
module Caching
autoload :Helper, 'betfair_api_ng_rails/api/caching/helper'
autoload :ResponseCache, 'betfair_api_ng_rails/api/caching/response_cache'
end
module Logs
autoload :FileLogger, 'betfair_api_ng_rails/api/logs/file_logger'
autoload :ConsoleLogger, 'betfair_api_ng_rails/api/logs/console_logger'
end
module Formatters
autoload :JsTreeFormatter, 'betfair_api_ng_rails/api/formatters/js_tree_formatter'
end
module Data
autoload :Base, 'betfair_api_ng_rails/api/data/base'
autoload :Constants, 'betfair_api_ng_rails/api/data/constants'
autoload :Competition, 'betfair_api_ng_rails/api/data/competition'
......@@ -70,17 +61,13 @@ module BetfairApiNgRails
autoload :ExBestOffersOverrides, 'betfair_api_ng_rails/api/data/ex_best_offers_overrides'
module Concerns
autoload :Hashable, 'betfair_api_ng_rails/api/data/concerns/hashable'
autoload :Attributable, 'betfair_api_ng_rails/api/data/concerns/attributable'
autoload :Jsonable, 'betfair_api_ng_rails/api/data/concerns/jsonable'
end
end
module Enums
autoload :MarketProjection, 'betfair_api_ng_rails/api/enums/market_projection'
autoload :PriceData, 'betfair_api_ng_rails/api/enums/price_data'
autoload :MatchProjection, 'betfair_api_ng_rails/api/enums/match_projection'
......@@ -105,24 +92,18 @@ module BetfairApiNgRails
autoload :BetStatus, 'betfair_api_ng_rails/api/enums/bet_status'
module Concerns
autoload :Enumable, 'betfair_api_ng_rails/api/enums/concerns/enumable'
end
end
module Http
autoload :Requester, 'betfair_api_ng_rails/api/http/requester'
autoload :Responser, 'betfair_api_ng_rails/api/http/responser'
autoload :Factory, 'betfair_api_ng_rails/api/http/factory'
autoload :ProxyRequester, 'betfair_api_ng_rails/api/http/proxy_requester'
end
module Parsers
autoload :Base, 'betfair_api_ng_rails/api/parsers/base'
autoload :ListCompetitions, 'betfair_api_ng_rails/api/parsers/list_competitions'
autoload :ListEventTypes, 'betfair_api_ng_rails/api/parsers/list_event_types'
......@@ -133,20 +114,16 @@ module BetfairApiNgRails
autoload :ListMarketTypes, 'betfair_api_ng_rails/api/parsers/list_market_types'
autoload :ListMarketCatalogue, 'betfair_api_ng_rails/api/parsers/list_market_catalogue'
autoload :ListMarketBook, 'betfair_api_ng_rails/api/parsers/list_market_book'
end
module ConnectionExt
autoload :ErrorHandling, 'betfair_api_ng_rails/api/connection_ext/error_handling'
autoload :SsoidRefreshing, 'betfair_api_ng_rails/api/connection_ext/ssoid_refreshing'
autoload :Parsing, 'betfair_api_ng_rails/api/connection_ext/parsing'
autoload :Formatting, 'betfair_api_ng_rails/api/connection_ext/formatting'
autoload :Logging, 'betfair_api_ng_rails/api/connection_ext/logging'
autoload :Caching, 'betfair_api_ng_rails/api/connection_ext/caching'
end
end
include Api::Data
......@@ -169,5 +146,4 @@ module BetfairApiNgRails
def self.connection=(value)
@connection = value
end
end
module BetfairApiNgRails
module Api
module Enums
#
# Error code of execution report
#
# Includes:
# ERROR_IN_MATCHER - The matcher is not healthy
# PROCESSED_WITH_ERRORS - The order itself has been accepted, but at least one (possibly all) actions have generated errors
# BET_ACTION_ERROR - There is an error with an action that has caused the entire order to be rejected
# INVALID_ACCOUNT_STATE - Order rejected due to the account's status (suspended, inactive, dup cards)
# INVALID_WALLET_STATUS - Order rejected due to the account's wallet's status
# INSUFFICIENT_FUNDS - Account has exceeded its exposure limit or available to bet limit
# LOSS_LIMIT_EXCEEDED - The account has exceed the self imposed loss limit
# MARKET_SUSPENDED - Market is suspended
# MARKET_NOT_OPEN_FOR_BETTING - Market is not open for betting. It is either not yet active, suspended or closed awaiting settlement.
# DUPLICATE_TRANSACTION - duplicate customer referece data submitted
# INVALID_ORDER - Order cannot be accepted by the matcher due to the combination of actions. For example, bets being edited are not on the same market, or order includes both edits and placement
# INVALID_MARKET_ID - Market doesn't exist
# PERMISSION_DENIED - Business rules do not allow order to be placed
# DUPLICATE_BETIDS - duplicate bet ids found
# NO_ACTION_REQUIRED - Order hasn't been passed to matcher as system detected there will be no state change
# SERVICE_UNAVAILABLE - The requested service is unavailable
# REJECTED_BY_REGULATOR - The regulator rejected the order. On the Italian Exchange this error will occur if more than 50 bets are sent in a single placeOrders request.
class ExecutionReportErrorCode
extend Api::Enums::Concerns::Enumable
......@@ -25,4 +46,4 @@ module BetfairApiNgRails
end
end
end
end
\ No newline at end of file
end
module BetfairApiNgRails
module Api
module Enums
#
# Status of execution report
#
# Includes:
# SUCCESS - Order processed successfully
# FAILURE - Order failed.
# PROCESSED_WITH_ERRORS - The order itself has been accepted, but at least one (possibly all)
# actions have generated errors. This error only occurs for replaceOrders,
# cancelOrders and updateOrders operations. The placeOrders operation will not return
# PROCESSED_WITH_ERRORS status as it is an atomic operation.
# TIMEOUT - Order timed out.
class ExecutionReportStatus
extend Api::Enums::Concerns::Enumable
......@@ -12,4 +23,4 @@ module BetfairApiNgRails
end
end
end
end
\ No newline at end of file
end
module BetfairApiNgRails
module Api
module Enums
#
# Indicates cause of failure
#
# Includes:
# INVALID_BET_SIZE - bet size is invalid for your currency or your regulator
# INVALID_RUNNER - Runner does not exist, includes vacant traps in greyhound racing
# BET_TAKEN_OR_LAPSED - Bet cannot be cancelled or modified as it has already been taken or has lapsed Includes attempts to cancel/modify market on close BSP bets and cancelling limit on close BSP bets
# BET_IN_PROGRESS - No result was received from the matcher in a timeout configured for the system
# RUNNER_REMOVED - Runner has been removed from the event
# MARKET_NOT_OPEN_FOR_BETTING - Attempt to edit a bet on a market that has closed.
# LOSS_LIMIT_EXCEEDED - The action has caused the account to exceed the self imposed loss limit
# MARKET_NOT_OPEN_FOR_BSP_BETTING - Market now closed to bsp betting. Turned in-play or has been reconciled
# INVALID_PRICE_EDIT - Attempt to edit down the price of a bsp limit on close lay bet, or edit up the price of a limit on close back bet
# INVALID_ODDS - Odds not on price ladder - either edit or placement
# INSUFFICIENT_FUNDS - Insufficient funds available to cover the bet action. Either the exposure limit or available to bet limit would be exceeded
# INVALID_PERSISTENCE_TYPE - Invalid persistence type for this market, e.g. KEEP for a non bsp market
# ERROR_IN_MATCHER - A problem with the matcher prevented this action completing successfully
# INVALID_BACK_LAY_COMBINATION - The order contains a back and a lay for the same runner at overlapping prices. This would guarantee a self match. This also applies to BSP limit on close bets
# ERROR_IN_ORDER - The action failed because the parent order failed
# INVALID_BID_TYPE - Bid type is mandatory
# INVALID_BET_ID - Bet for id supplied has not been found
# CANCELLED_NOT_PLACED - Bet cancelled but replacement bet was not placed
# RELATED_ACTION_FAILED - Action failed due to the failure of a action on which this action is dependent
# NO_ACTION_REQUIRED - the action does not result in any state change. eg changing a persistence to it's current value
class InstructionReportErrorCode
extend Api::Enums::Concerns::Enumable
......@@ -28,4 +52,4 @@ module BetfairApiNgRails
end
end
end
end
\ No newline at end of file
end
module BetfairApiNgRails
module Api
module Enums
#
# Indicates whether the command succeeded or failed
#
# Includes:
# SUCCESS
# FAILURE
# TIMEOUT
class InstructionReportStatus
extend Api::Enums::Concerns::Enumable
......@@ -11,4 +18,4 @@ module BetfairApiNgRails
end
end
end
end
\ No newline at end of file
end
module BetfairApiNgRails
module Api
module Enums
#
# Either EXECUTABLE (an unmatched amount remains) or EXECUTION_COMPLETE (no unmatched amount remains).
#
# Includes:
# EXECUTION_COMPLETE - An order that does not have any remaining unmatched portion.
# EXECUTABLE - An order that has a remaining unmatched portion.
class OrderStatus
extend Api::Enums::Concerns::Enumable
......@@ -10,4 +16,4 @@ module BetfairApiNgRails
end
end
end
end
\ No newline at end of file
end
module BetfairApiNgRails
module Api
module Enums
#
# The type of bet (e.g standard limited-liability Exchange bet (LIMIT), a standard BSP bet (MARKET_ON_CLOSE), or
# a minimum-accepted-price BSP bet (LIMIT_ON_CLOSE)). If the bet has a OrderType of MARKET_ON_CLOSE and
# a persistenceType of MARKET_ON_CLOSE then it is a bet which has transitioned from LIMIT to MARKET_ON_CLOSE.
# Only available at BET groupBy level
#
# Includes:
# LIMIT - A normal exchange limit order for immediate execution
# LIMIT_ON_CLOSE - Limit order for the auction (SP)
# MARKET_ON_CLOSE - Market order for the auction (SP)
class OrderType
extend Api::Enums::Concerns::Enumable
enumify "LIMIT",
"LIMIT_ON_CLOSE",
"MARKET_ON_CLOSE"
end
end
end
end
\ No newline at end of file
end
module BetfairApiNgRails
module Api
module Enums
#
# The turn in play persistence state of the order at bet placement time.
#
# Includes:
# LAPSE - Lapse the order when the market is turned in-play
# PERSIST - Persist the order to in-play. The bet will be place automatically into the in-play market at the start of the event.
# MARKET_ON_CLOSE - Put the order into the auction (SP) at turn-in-play
class PersistenceType
extend Api::Enums::Concerns::Enumable
......@@ -11,4 +18,4 @@ module BetfairApiNgRails
end
end
end
end
\ No newline at end of file
end
module BetfairApiNgRails
module Api
module Enums
#
# Indicates if the bet is a Back or a LAY
#
# Includes:
# BACK - To back a team, horse or outcome is to bet on the selection to win.
# LAY - To lay a team, horse, or outcome is to bet on the selection to lose.
class Side
extend Api::Enums::Concerns::Enumable
enumify "BACK",
"LAY"
end
end
end
end
\ No newline at end of file
end
......@@ -26,7 +26,7 @@ module BetfairApiNgRails
run_request __method__, { market_id: market_id, instructions: instructions, customer_ref: customer_ref }
end
private
private
def run_request(method, params, data)
BetfairApiNgRails.connection.request build_request_type(method), params.merge(data)
......@@ -35,7 +35,6 @@ module BetfairApiNgRails
def build_request_type(name)
name.to_s.camelize(:lower)
end
end
end
end
\ No newline at end of file
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment