aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Edgecumbe <git@esotericnonsense.com>2019-10-27 00:32:48 +0200
committerDaniel Edgecumbe <git@esotericnonsense.com>2019-10-27 00:32:52 +0200
commitd95e8fbfad8c83cc798c648d6e8e178e592477d4 (patch)
tree5387f78387750b4146ff74b70fd7e51d1b6a9d8b
parent967a733afbb5fad2307a22011b1afd4665dac0b0 (diff)
Various changes in preparation for the publishing of the crate.
Add GPLv3 license, headers, dual licensing opportunities, fix the generation scripts, etc.
-rw-r--r--.gitignore1
-rw-r--r--Cargo.toml7
-rw-r--r--LICENSE15
-rw-r--r--LICENSE.AGPLv3661
-rw-r--r--README.md12
-rw-r--r--TODO.md6
-rw-r--r--genapi/.gitignore6
-rw-r--r--genapi/SportsAPING.xml3277
-rw-r--r--genapi/SportsAPING.xml.SHA256SUM1
-rw-r--r--genapi/SportsAPING.xml.patch11
-rwxr-xr-xgenapi/main.py21
-rwxr-xr-xgenapi/main.sh79
-rw-r--r--src/json_rpc.rs16
-rw-r--r--src/lib.rs16
14 files changed, 837 insertions, 3292 deletions
diff --git a/.gitignore b/.gitignore
index 358cfbb..53eaa21 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
/target
**/*.rs.bk
-src/generated_api.rs
diff --git a/Cargo.toml b/Cargo.toml
index ab93c5a..2dc2872 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,12 @@
[package]
-name = "betfair"
+name = "botfair"
version = "0.1.0"
+description = "rust bindings for Betfair's SportsAPING"
+keywords = ["betfair", "jsonrpc", "aping", "sports", "betting"]
+repository = "https://git.esotericnonsense.com/pub/botfair.git"
authors = ["Daniel Edgecumbe <git@esotericnonsense.com>"]
+readme = "README.md"
+license = "AGPL-3.0-only"
edition = "2018"
[dependencies]
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d8fb236
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,15 @@
+For open source software, botfair is subject to the GNU AGPLv3, contained
+in the document LICENSE.AGPLv3 which should be distributed with the software.
+
+This means that you need to licence your software under the same terms. In
+particular, this means that software that makes use of this library must
+make available its' source code to the users of said software, whether that
+software is interacted with over a network or by the end users directly.
+
+For closed source software, exceptions may be made at the discretion of the
+author.
+
+For paid support, licensing queries, or general banter, please use the below
+contact details:
+
+Daniel Edgecumbe botfair@esotericnonsense.com
diff --git a/LICENSE.AGPLv3 b/LICENSE.AGPLv3
new file mode 100644
index 0000000..be3f7b2
--- /dev/null
+++ b/LICENSE.AGPLv3
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<https://www.gnu.org/licenses/>.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..20fa896
--- /dev/null
+++ b/README.md
@@ -0,0 +1,12 @@
+# botfair
+
+Rust bindings for the Betfair SportsAPING.
+
+To re-generate the bindings from the Betfair XML documentation, you will need
+to `cd genapi; ./main.sh` which fetches the documentation from Betfair's
+servers and runs a python script on them to generate the Rust bindings.
+
+If you just want to use the bindings, this is not necessary as the result is
+already present in the crate.
+
+This is a work in progress, more information coming soon.
diff --git a/TODO.md b/TODO.md
index 750d78d..b52e868 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1 +1,7 @@
if all struct fields are optional, derive default
+keepalive support
+
+fix the issue with the API docs being inaccurate:
+
+- <parameter mandatory="true" name="adjustmentFactor" type="double">
++ <parameter name="adjustmentFactor" type="double">
diff --git a/genapi/.gitignore b/genapi/.gitignore
index 10d4102..f752a06 100644
--- a/genapi/.gitignore
+++ b/genapi/.gitignore
@@ -1,5 +1,3 @@
-env/*
.mypy_cache/*
-
-# Ignore generated rust files
-*.rs
+SportsAPING.xml
+SportsAPING.patched.xml
diff --git a/genapi/SportsAPING.xml b/genapi/SportsAPING.xml
deleted file mode 100644
index 6f8b1bd..0000000
--- a/genapi/SportsAPING.xml
+++ /dev/null
@@ -1,3277 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface name="SportsAPING" owner="BDP" version="1.0.0" date="now()" namespace="com.betfair.sports.api"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <description>APING</description>
- <operation name="listEventTypes" since="1.0.0">
- <description>Returns a list of Event Types (i.e. Sports) associated with the markets selected by the
- MarketFilter.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="filter" type="MarketFilter">
- <description>The filter to select desired markets. All markets that match the criteria in the filter
- are selected.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(EventTypeResult)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listCompetitions" since="1.0.0">
- <description>Returns a list of Competitions (i.e., World Cup 2013) associated with the markets selected by the
- MarketFilter. Currently only Football markets have an associated competition.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="filter" type="MarketFilter">
- <description>The filter to select desired markets. All markets that match the criteria in the filter
- are selected.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(CompetitionResult)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listTimeRanges" since="1.0.0">
- <description>Returns a list of time ranges in the granularity specified in the request (i.e. 3PM to 4PM, Aug
- 14th to Aug 15th) associated with the markets selected by the MarketFilter.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="filter" type="MarketFilter">
- <description>The filter to select desired markets. All markets that match the criteria in the filter
- are selected.
- </description>
- </parameter>
- <parameter mandatory="true" name="granularity" type="TimeGranularity">
- <description>The granularity of time periods that correspond to markets selected by the market
- filter.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(TimeRangeResult)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listEvents" since="1.0.0">
- <description>Returns a list of Events (i.e, Reading vs. Man United) associated with the markets selected by the
- MarketFilter.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="filter" type="MarketFilter">
- <description>The filter to select desired markets. All markets that match the criteria in the filter
- are selected.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(EventResult)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listMarketTypes" since="1.0.0">
- <description>Returns a list of market types (i.e. MATCH_ODDS, NEXT_GOAL) associated with the markets selected by
- the MarketFilter. The market types are always the same, regardless of locale.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="filter" type="MarketFilter">
- <description>The filter to select desired markets. All markets that match the criteria in the filter
- are selected.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(MarketTypeResult)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listCountries" since="1.0.0">
- <description>Returns a list of Countries associated with the markets selected by the MarketFilter.</description>
- <parameters>
- <request>
- <parameter mandatory="true" name="filter" type="MarketFilter">
- <description>The filter to select desired markets. All markets that match the criteria in the filter
- are selected.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(CountryCodeResult)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listVenues" since="1.0.0">
- <description>Returns a list of Venues (i.e. Cheltenham, Ascot) associated with the markets selected by the
- MarketFilter. Currently, only Horse Racing markets are associated with a Venue.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="filter" type="MarketFilter">
- <description>The filter to select desired markets. All markets that match the criteria in the filter
- are selected.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(VenueResult)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listMarketCatalogue" since="1.0.0">
- <description>Returns a list of information about markets that does not change (or changes very rarely). You use
- listMarketCatalogue to retrieve the name of the market, the names of selections and other information about
- markets.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="filter" type="MarketFilter">
- <description>The filter to select desired markets. All markets that match the criteria in the filter
- are selected.
- </description>
- </parameter>
- <parameter name="marketProjection" type="set(MarketProjection)">
- <description>The type and amount of data returned about the market.</description>
- </parameter>
- <parameter name="sort" type="MarketSort">
- <description>The order of the results. Will default to RANK if not passed</description>
- </parameter>
- <parameter mandatory="true" name="maxResults" type="i32">
- <description>limit on the total number of results returned, must be greater than 0 and less than or
- equal to 1000
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(MarketCatalogue)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listMarketBook" since="1.0.0">
- <description>Returns a list of dynamic data about markets. Dynamic data includes prices, the status of the
- market, the status of selections, the traded volume, and the status of any orders you have placed in the
- market.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketIds" type="list(MarketId)">
- <description>One or more market ids. The number of markets returned depends on the amount of data
- you request via the price projection.
- </description>
- </parameter>
- <parameter name="priceProjection" type="PriceProjection">
- <description>The projection of price data you want to receive in the response.</description>
- </parameter>
- <parameter name="orderProjection" type="OrderProjection">
- <description>The orders you want to receive in the response.</description>
- </parameter>
- <parameter name="matchProjection" type="MatchProjection">
- <description>If you ask for orders, specifies the representation of matches.</description>
- </parameter>
- <parameter name="includeOverallPosition" type="bool" mandatory="false">
- <description>
- If you ask for orders, returns matches for each selection. Defaults to true if unspecified.
- </description>
- </parameter>
- <parameter name="partitionMatchedByStrategyRef" type="bool" mandatory="false">
- <description>
- If you ask for orders, returns the breakdown of matches by strategy for each selection.
- Groups matches with no strategy in an empty string bucket. Defaults to false if unspecified.
- </description>
- </parameter>
- <parameter name="customerStrategyRefs" type="set(string)" mandatory="false">
- <description>
- If you ask for orders, restricts the results to orders matching any of the specified set of customer defined strategies.
- Also filters which matches by strategy for runners are returned, if partitionMatchedByStrategyRef is true.
- An empty set will be treated as if the parameter has been omitted (or null passed).
- </description>
- </parameter>
- <parameter name="currencyCode" type="string">
- <description>A Betfair standard currency code. If not specified, the default currency code is
- used.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- <parameter name="matchedSince" type="dateTime" mandatory="false">
- <description>
- If you ask for orders, restricts the results to orders that have at least one fragment matched since
- the specified date (all matched fragments of such an order will be returned even if some were matched before the specified date).
- All EXECUTABLE orders will be returned regardless of matched date.
- </description>
- </parameter>
- <parameter name="betIds" type="set(BetId)" mandatory="false">
- <description>
- If you ask for orders, restricts the results to orders with the specified bet IDs.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(MarketBook)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listRunnerBook" since="1.0.0">
- <description>Returns a list of dynamic data about a market and a specified runner. Dynamic data includes prices, the status of the
- market, the status of selections, the traded volume, and the status of any orders you have placed in the
- market.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketId" type="MarketId">
- <description>The unique id for the market.</description>
- </parameter>
- <parameter mandatory="true" name="selectionId" type="SelectionId">
- <description>The unique id for the selection in the market.</description>
- </parameter>
- <parameter name="handicap" type="double" mandatory="false">
- <description>
- If specified, the handicap is used in conjunction with the selectionId to pick which runner
- to return prices for
- </description>
- </parameter>
- <parameter name="priceProjection" type="PriceProjection">
- <description>The projection of price data you want to receive in the response.</description>
- </parameter>
- <parameter name="orderProjection" type="OrderProjection">
- <description>The orders you want to receive in the response.</description>
- </parameter>
- <parameter name="matchProjection" type="MatchProjection">
- <description>If you ask for orders, specifies the representation of matches.</description>
- </parameter>
- <parameter name="includeOverallPosition" type="bool" mandatory="false">
- <description>
- If you ask for orders, returns matches for each selection. Defaults to true if unspecified.
- </description>
- </parameter>
- <parameter name="partitionMatchedByStrategyRef" type="bool" mandatory="false">
- <description>
- If you ask for orders, returns the breakdown of matches by strategy for each selection.
- Groups matches with no strategy in an empty string bucket. Defaults to false if unspecified.
- </description>
- </parameter>
- <parameter name="customerStrategyRefs" type="set(string)" mandatory="false">
- <description>
- If you ask for orders, restricts the results to orders matching any of the specified set of customer defined strategies.
- Also filters which matches by strategy for runners are returned, if partitionMatchedByStrategyRef is true.
- An empty set will be treated as if the parameter has been omitted (or null passed).
- </description>
- </parameter>
- <parameter name="currencyCode" type="string">
- <description>A Betfair standard currency code. If not specified, the default currency code is
- used.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the response. If not specified, the default is returned.
- </description>
- </parameter>
- <parameter name="matchedSince" type="dateTime" mandatory="false">
- <description>
- If you ask for orders, restricts the results to orders that have at least one fragment matched since
- the specified date (all matched fragments of such an order will be returned even if some were matched before the specified date).
- All EXECUTABLE orders will be returned regardless of matched date.
- </description>
- </parameter>
- <parameter name="betIds" type="set(BetId)" mandatory="false">
- <description>
- If you ask for orders, restricts the results to orders with the specified bet IDs.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(MarketBook)">
- <description>output data</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listCurrentOrders" since="1.0.0">
- <description>Returns a list of your current orders. Optionally you can filter and sort your current orders using
- the
- various parameters, setting none of the parameters will return all of your current orders, up to a maximum
- of 1000 bets, ordered BY_BET and sorted
- EARLIEST_TO_LATEST. To retrieve more than 1000 orders, you need to make use of the fromRecord and
- recordCount parameters.
- </description>
- <parameters>
- <request>
- <parameter name="betIds" type="set(BetId)">
- <description>
- Optionally restricts the results to the specified bet IDs.
- </description>
- </parameter>
- <parameter name="marketIds" type="set(MarketId)">
- <description>
- Optionally restricts the results to the specified market IDs.
- </description>
- </parameter>
- <parameter name="orderProjection" type="OrderProjection">
- <description>
- Optionally restricts the results to the specified order status.
- </description>
- </parameter>
- <parameter name="customerOrderRefs" type="set(CustomerOrderRef)">
- <description>
- Optionally restricts the results to the specified customer order references.
- </description>
- </parameter>
- <parameter name="customerStrategyRefs" type="set(CustomerStrategyRef)">
- <description>
- Optionally restricts the results to the specified customer strategy references.
- </description>
- </parameter>
- <parameter name="placedDateRange" type="TimeRange">
- <description>
- @Deprecated use dateRange instead.
- Optionally restricts the results to be from/to the specified placed date. This date is
- inclusive, i.e. if
- an order was placed on exactly this date (to the millisecond) then it will be included in the
- results. If
- the from is later than the to, no results will be returned.
- </description>
- </parameter>
- <parameter name="dateRange" type="TimeRange">
- <description>
- Replacement for placedDateRange to allow filtering by other date fields rather than just placedDate.
- Optionally restricts the results to be from/to the specified date, these dates are contextual
- to the orders being returned and therefore the dates used to filter on will change to placed,
- matched, voided or settled dates depending on the orderBy. This date is inclusive, i.e. if
- an order was placed on exactly this date (to the millisecond) then it will be included in the
- results. If the from is later than the to, no results will be returned.
- </description>
- </parameter>
- <parameter name="orderBy" type="OrderBy">
- <description>
- Specifies how the results will be ordered. If no value is passed in, it defaults to BY_BET.
- Also acts as a filter such that only orders with a valid value in the field being ordered by will
- be returned (i.e. BY_VOID_TIME returns only voided orders, BY_SETTLED_TIME returns only settled
- orders and BY_MATCH_TIME returns only orders with a matched date (voided, settled, matched orders)).
- </description>
- </parameter>
- <parameter name="sortDir" type="SortDir">
- <description>
- Specifies the direction the results will be sorted in. If no value is passed in, it defaults to
- EARLIEST_TO_LATEST.
- </description>
- </parameter>
- <parameter name="fromRecord" type="i32">
- <description>
- Specifies the first record that will be returned. Records start at index zero, not at index one.
- </description>
- </parameter>
- <parameter name="recordCount" type="i32">
- <description>
- Specifies how many records will be returned, from the index position 'fromRecord'. Note that
- there is a
- page size limit of 1000. A value of zero indicates that you would like all records (including
- and
- from 'fromRecord') up to the limit.
- </description>
- </parameter>
- </request>
- <simpleResponse type="CurrentOrderSummaryReport">
- <description></description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listClearedOrders" since="1.0.0">
- <description>Returns a List of bets based on the bet status, ordered by settled date
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="betStatus" type="BetStatus">
- <description>
- Restricts the results to the specified status.
- </description>
- </parameter>
- <parameter name="eventTypeIds" type="set(EventTypeId)">
- <description>
- Optionally restricts the results to the specified Event Type IDs.
- </description>
- </parameter>
- <parameter name="eventIds" type="set(EventId)">
- <description>
- Optionally restricts the results to the specified Event IDs.
- </description>
- </parameter>
- <parameter name="marketIds" type="set(MarketId)">
- <description>
- Optionally restricts the results to the specified market IDs.
- </description>
- </parameter>
- <parameter name="runnerIds" type="set(RunnerId)">
- <description>
- Optionally restricts the results to the specified Runners.
- </description>
- </parameter>
- <parameter name="betIds" type="set(BetId)">
- <description>
- Optionally restricts the results to the specified bet IDs.
- </description>
- </parameter>
- <parameter name="customerOrderRefs" type="set(CustomerOrderRef)">
- <description>
- Optionally restricts the results to the specified customer order references.
- </description>
- </parameter>
- <parameter name="customerStrategyRefs" type="set(CustomerStrategyRef)">
- <description>
- Optionally restricts the results to the specified customer strategy references.
- </description>
- </parameter>
- <parameter name="side" type="Side">
- <description>
- Optionally restricts the results to the specified side.
- </description>
- </parameter>
- <parameter name="settledDateRange" type="TimeRange">
- <description>
- Optionally restricts the results to be from/to the specified settled date. This date is
- inclusive, i.e. if
- an order was placed on exactly this date (to the millisecond) then it will be included in the
- results. If
- the from is later than the to, no results will be returned.
- </description>
- </parameter>
- <parameter name="groupBy" type="GroupBy">
- <description>
- How to aggregate the lines, if not supplied then the lowest level is returned, i.e. bet by bet
- This is only applicable to SETTLED BetStatus.
- </description>
- </parameter>
- <parameter name="includeItemDescription" type="bool">
- <description>
- If true then an ItemDescription object is included in the response.
- </description>
- </parameter>
- <parameter name="locale" type="string">
- <description>The language used for the itemDescription. If not specified, the customer account
- default is returned.
- </description>
- </parameter>
- <parameter name="fromRecord" type="i32">
- <description>
- Specifies the first record that will be returned. Records start at index zero.
- </description>
- </parameter>
- <parameter name="recordCount" type="i32">
- <description>
- Specifies how many records will be returned, from the index position 'fromRecord'. Note that
- there is a
- page size limit of 1000. A value of zero indicates that you would like all records (including
- and
- from 'fromRecord') up to the limit.
- </description>
- </parameter>
- </request>
- <simpleResponse type="ClearedOrderSummaryReport">
- <description></description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
-
- <operation name="placeOrders" since="1.0.0">
- <description>
- Place new orders into market. LIMIT orders below the minimum bet size are allowed if
- there is an unmatched bet at the same price in the market. This operation is atomic in that
- all orders will be placed or none will be placed.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketId" type="MarketId">
- <description>The market id these orders are to be placed on</description>
- </parameter>
- <parameter mandatory="true" name="instructions" type="list(PlaceInstruction)">
- <description/>
- </parameter>
- <parameter name="customerRef" type="string">
- <description>
- Optional parameter allowing the client to pass a unique string (up to 32 chars) that
- is used to de-dupe mistaken re-submissions.
- </description>
- </parameter>
- <parameter name="marketVersion" type="MarketVersion">
- <description>
- Optional parameter allowing the client to specify which version of the market the
- orders should be placed on. If the current market version is higher than that sent on an order,
- the bet will be lapsed. Useful when a customer doesn't want to bet in play and is worried
- that their bet might arrive after the market has turned in play.
- </description>
- </parameter>
- <parameter mandatory="false" name="customerStrategyRef" type="string">
- <description>
- An optional reference customers can use to specify which strategy has sent the order.
- The reference will be returned on order change messages through the stream API. The string is
- limited to 15 characters. If an empty string is provided it will be treated as null.
- </description>
- </parameter>
- <parameter mandatory="false" name="async" type="bool">
- <description>
- An optional flag (not setting equates to false) which specifies if the orders should be placed asynchronously.
- Orders can be tracked via the Exchange Stream API or or the API-NG by providing a customerOrderRef for each place order.
- An order's status will be PENDING and no bet ID will be returned.
- This functionality is available for all bet types - including MOC and LOC.
- </description>
- </parameter>
- </request>
- <simpleResponse type="PlaceExecutionReport">
- <description/>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="cancelOrders" since="1.0.0">
- <description>Cancel all bets OR cancel all bets on a market OR fully or partially cancel particular orders on a
- market. Only LIMIT orders an be cancelled or partially cancelled once placed.
- </description>
- <parameters>
- <request>
- <parameter name="marketId" type="MarketId">
- <description>If not supplied all bets are cancelled</description>
- </parameter>
- <parameter name="instructions" type="list(CancelInstruction)">
- <description>All instructions need to be on the same market.
- If not supplied all bets on the market (if market id is passed) are fully cancelled
- </description>
- </parameter>
- <parameter name="customerRef" type="string">
- <description>
- Optional parameter allowing the client to pass a unique string (upto 32 chars) that
- is used to de-dupe mistaken re-submitions.
- </description>
- </parameter>
- </request>
- <simpleResponse type="CancelExecutionReport">
- <description/>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="replaceOrders" since="1.0.0">
- <description>
- This operation is logically a bulk cancel followed by a bulk place. The cancel is completed first then
- the new orders are placed. The new orders will be placed atomically in that they will all be placed or none
- will be placed.
- In the case where the new orders cannot be placed the cancellations will not be rolled back.
- See ReplaceInstruction.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketId" type="MarketId">
- <description>The market id these orders are to be placed on</description>
- </parameter>
- <parameter mandatory="true" name="instructions" type="list(ReplaceInstruction)">
- <description/>
- </parameter>
- <parameter name="customerRef" type="string">
- <description>
- Optional parameter allowing the client to pass a unique string (up to 32 chars) that
- is used to de-dupe mistaken re-submissions.
- </description>
- </parameter>
- <parameter name="marketVersion" type="MarketVersion">
- <description>
- Optional parameter allowing the client to specify which version of the market the
- orders should be placed on. Useful when a customer doesn't want to bet in play and is worried
- that their bet might arrive after the market has turned in play.
- </description>
- </parameter>
- <parameter mandatory="false" name="async" type="bool">
- <description>
- An optional flag (not setting equates to false) which specifies if the orders should be replaced asynchronously.
- Orders can be tracked via the Exchange Stream API or the API-NG by providing a customerOrderRef for each replace order.
- Not available for MOC or LOC bets.
- </description>
- </parameter>
- </request>
- <simpleResponse type="ReplaceExecutionReport">
- <description/>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="updateOrders" since="1.0.0">
- <description>Update non-exposure changing fields</description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketId" type="MarketId">
- <description>The market id these orders are to be placed on</description>
- </parameter>
- <parameter mandatory="true" name="instructions" type="list(UpdateInstruction)">
- <description/>
- </parameter>
- <parameter name="customerRef" type="string">
- <description>
- Optional parameter allowing the client to pass a unique string (up to 32 chars) that
- is used to de-dupe mistaken re-submissions.
- </description>
- </parameter>
- </request>
- <simpleResponse type="UpdateExecutionReport">
- <description/>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listMarketProfitAndLoss" since="1.0.0">
- <description>
- Retrieve profit and loss for a given list of markets. The values are calculated using matched bets and optionally settled bets.
- Only odds markets are implemented, markets of other types are silently ignored.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketIds" type="set(MarketId)">
- <description>List of markets to calculate profit and loss</description>
- </parameter>
- <parameter mandatory="false" name="includeSettledBets" type="bool">
- <description>Option to include settled bets (partially settled markets only). Defaults to false if not specified.</description>
- </parameter>
- <parameter mandatory="false" name="includeBspBets" type="bool">
- <description>Option to include BSP bets. Defaults to false if not specified.</description>
- </parameter>
- <parameter mandatory="false" name="netOfCommission" type="bool">
- <description>
- Option to return profit and loss net of users current commission rate for this market including any special tariffs.
- Defaults to false if not specified.
- </description>
- </parameter>
- </request>
- <simpleResponse type="list(MarketProfitAndLoss)">
- <description/>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="setDefaultExposureLimitForMarketGroups" since="1.0.0">
- <description>
- Create/update default exposure limit for market groups of given type.
- New value and breach action will be immediately applied to existing instances of this type (unless overridden using setExposureLimitForMarketGroup).
- If default values are overridden for market groups (using setExposureLimitForMarketGroup), overrides will NOT be
- touched.
- In order to clear this limit "removeDefaultExposureLimitForMarketGroups" operation should be used. It's not allowed to set default limit to an
- empty limit (see type ExposureLimit).
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketGroupType" type="MarketGroupType">
- <description>
- Market group type
- </description>
- </parameter>
- <parameter mandatory="true" name="limit" type="ExposureLimit">
- <description>
- Default exposure limit and action
- </description>
- </parameter>
- </request>
- <simpleResponse type="string">
- <description>SUCCESS if successful</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="setExposureLimitForMarketGroup" since="1.0.0">
- <description>
- Create/update exposure limit for a market group.
- New limit will be applied immediately (even if a default limit exists for this type).
- The limit will be deleted upon account action (see deleteMarketGroupExposureLimit) or when no active markets
- remain under market group.
- It is possible to "invalidate" default limit for a specific group by using a "empty" limit (see type ExposureLimit).
- Upon successful execution of the request, the effective limit for this group will be the one set by this request (Properties will NOT be inherited from default limit).
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketGroup" type="MarketGroup">
- <description>Market group</description>
- </parameter>
- <parameter mandatory="true" name="limit" type="ExposureLimit">
- <description>Exposure limit</description>
- </parameter>
- </request>
- <simpleResponse type="string">
- <description>SUCCESS if successful</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="removeDefaultExposureLimitForMarketGroups" since="1.0.0">
- <description>
- Remove default exposure limit for a market group type.
- This operation will NOT remove/update any market group limits.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketGroupType" type="MarketGroupType">
- <description>Market group type</description>
- </parameter>
- </request>
- <simpleResponse type="string">
- <description>SUCCESS if successful</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="removeExposureLimitForMarketGroup" since="1.0.0">
- <description>
- Delete exposure limit for a market group.
- If a default exposure limit exist for market type, it takes effect immediately.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="marketGroup" type="MarketGroup">
- <description>Market group</description>
- </parameter>
- </request>
- <simpleResponse type="string">
- <description>SUCCESS if successful</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="listExposureLimitsForMarketGroups" since="1.0.0">
- <description>
- Response to this request returns default group limit and group limits grouped by type.
- If marketGroupTypeFilter is not populated values for all types are returned.
- The response will always contain the default limit. It is possible to control which groups to return using marketGroupsFilter parameter.
- If marketGroupsFilter is not set all group limits are returned. If an emtpy list is passed only default limit(s) is returned.
- When marketGroupTypeFilter and marketGroupsFilter used together, all groups in marketGroupsFilter are required to be of same type (type used in marketGroupTypeFilter).
- </description>
- <parameters>
- <request>
- <parameter mandatory="false" name="marketGroupTypeFilter" type="MarketGroupType">
- <description>Optionally filter results by market group type.</description>
- </parameter>
- <parameter mandatory="false" name="marketGroupFilter" type="list(MarketGroup)">
- <description>Optionally filter result by market groups.</description>
- </parameter>
- </request>
- <simpleResponse type="list(ExposureLimitsForMarketGroups)">
- <description>Exposure limits grouped by market group type</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="unblockMarketGroup" since="1.0.0">
- <description>
- Unblock a market group after it has been blocked due to the breach of a previously set exposure limit.
- </description>
-
- <parameters>
- <request>
- <parameter mandatory="true" name="marketGroup" type="MarketGroup">
- <description>Market group to unblock</description>
- </parameter>
- </request>
- <simpleResponse type="string">
- <description>SUCCESS if successful</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="getExposureReuseEnabledEvents" since="1.0.0">
- <description>
- Retrieves events from exposure reuse enabled events list. To edit this list use
- addExposureReuseEnabledEvents and removeExposureReuseEnabledEvents operations.
- </description>
- <parameters>
- <request>
- </request>
- <simpleResponse type="list(i64)">
- <description>List of events enabled for exposure reuse</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="addExposureReuseEnabledEvents" since="1.0.0">
- <description>
- Enables events for exposure reuse by appending them to the current list of events already enabled.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="eventIds" type="list(i64)">
- <description>
- List of event ids to remove.
- </description>
- </parameter>
- </request>
- <simpleResponse type="string">
- <description>SUCCESS if successful</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <operation name="removeExposureReuseEnabledEvents" since="1.0.0">
- <description>
- Removes events from exposure reuse enabled events list.
- </description>
- <parameters>
- <request>
- <parameter mandatory="true" name="eventIds" type="list(i64)">
- <description>
- List of event ids to remove.
- </description>
- </parameter>
- </request>
- <simpleResponse type="string">
- <description>SUCCESS if successful</description>
- </simpleResponse>
- <exceptions>
- <exception type="APINGException">
- <description>Generic exception that is thrown if this operation fails for any reason.</description>
- </exception>
- </exceptions>
- </parameters>
- </operation>
-
- <!-- Data types -->
- <dataType name="MarketFilter">
- <description>
- </description>
- <parameter name="textQuery" type="string">
- <description>Restrict markets by any text associated with the market such as the Name, Event, Competition,
- etc. You can include a wildcard (*) character as long as it is not the first character.
- </description>
- </parameter>
- <parameter name="exchangeIds" type="set(ExchangeId)">
- <description>Restrict markets by the Exchange where the market operates.
- Note: This is not currently in use and only entities for the current exchange
- will be returned.
- </description>
- </parameter>
- <parameter name="eventTypeIds" type="set(EventTypeId)">
- <description>Restrict markets by event type associated with the market. (i.e., Football, Hockey, etc)
- </description>
- </parameter>
- <parameter name="eventIds" type="set(EventId)">
- <description>Restrict markets by the event id associated with the market.</description>
- </parameter>
- <parameter name="competitionIds" type="set(CompetitionId)">
- <description>Restrict markets by the competitions associated with the market.</description>
- </parameter>
- <parameter name="marketIds" type="set(MarketId)">
- <description>Restrict markets by the market id associated with the market.</description>
- </parameter>
- <parameter name="venues" type="set(Venue)">
- <description>Restrict markets by the venue associated with the market. Currently only Horse Racing markets
- have venues.
- </description>
- </parameter>
- <parameter name="bspOnly" type="bool">
- <description>Restrict to bsp markets only, if True or non-bsp markets if False. If not specified then
- returns both BSP and non-BSP markets
- </description>
- </parameter>
- <parameter name="turnInPlayEnabled" type="bool">
- <description>Restrict to markets that will turn in play if True or will not turn in play if false. If not
- specified, returns both.
- </description>
- </parameter>
- <parameter name="inPlayOnly" type="bool">
- <description>Restrict to markets that will turn in play if True or will not turn in play if false. If not
- specified, returns both.
- </description>
- </parameter>
- <parameter name="marketBettingTypes" type="set(MarketBettingType)">
- <description>Restrict to markets that match the betting type of the market (i.e. Odds, Asian Handicap
- Singles, Asian Handicap Doubles or Line)
- </description>
- </parameter>
- <parameter name="marketCountries" type="set(CountryCode)">
- <description>Restrict to markets that are in the specified country or countries</description>
- </parameter>
- <parameter name="marketTypeCodes" type="set(MarketType)">
- <description>Restrict to markets that match the type of the market (i.e., MATCH_ODDS, HALF_TIME_SCORE). You
- should use this instead of relying on the market name as the market type codes are the same in all
- locales
- </description>
- </parameter>
- <parameter name="marketStartTime" type="TimeRange">
- <description>Restrict to markets with a market start time before or after the specified date</description>
- </parameter>
- <parameter name="withOrders" type="set(OrderStatus)">
- <description>Restrict to markets that I have one or more orders in these status.
- </description>
- </parameter>
- <parameter name="raceTypes" type="set(string)">
- <description>Restrict by race type</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketCatalogue">
- <description>Information about a market</description>
- <parameter mandatory="true" name="marketId" type="string">
- <description>The unique identifier for the market</description>
- </parameter>
- <parameter mandatory="true" name="marketName" type="string">
- <description>The name of the market</description>
- </parameter>
- <parameter name="marketStartTime" type="dateTime">
- <description>The time this market starts at, only returned when the MARKET_START_TIME enum is passed in the
- marketProjections
- </description>
- </parameter>
- <parameter name="description" type="MarketDescription">
- <description>Details about the market</description>
- </parameter>
- <parameter name="totalMatched" type="double">
- <description>The total amount of money matched on the market. This value is truncated at 2dp.</description>
- </parameter>
- <parameter name="runners" type="list(RunnerCatalog)">
- <description>The runners (selections) contained in the market</description>
- </parameter>
- <parameter name="eventType" type="EventType">
- <description>The Event Type the market is contained within</description>
- </parameter>
- <parameter name="competition" type="Competition">
- <description>The competition the market is contained within. Usually only applies to Football competitions
- </description>
- </parameter>
- <parameter name="event" type="Event">
- <description>The event the market is contained within</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketBook">
- <description>The dynamic data in a market</description>
- <parameter mandatory="true" name="marketId" type="string">
- <description>The unique identifier for the market</description>
- </parameter>
-
- <parameter mandatory="true" name="isMarketDataDelayed" type="bool">
- <description>True if the data returned by listMarketBook will be delayed. The data may be delayed because
- you are not logged in with a funded account or you are using an Application Key that does not allow up
- to date data.
- </description>
- </parameter>
- <parameter name="status" type="string">
- <description>The status of the market, for example ACTIVE, SUSPENDED, SETTLED, etc.</description>
- </parameter>
- <parameter name="betDelay" type="i32">
- <description>The number of seconds an order is held until it is submitted into the market. Orders are
- usually delayed when the market is in-play
- </description>
- </parameter>
- <parameter name="bspReconciled" type="bool">
- <description>True if the market starting price has been reconciled</description>
- </parameter>
- <parameter name="complete" type="bool">
- <description/>
- </parameter>
- <parameter name="inplay" type="bool">
- <description>True if the market is currently in play</description>
- </parameter>
- <parameter name="numberOfWinners" type="i32">
- <description>The number of selections that could be settled as winners</description>
- </parameter>
- <parameter name="numberOfRunners" type="i32">
- <description>The number of runners in the market</description>
- </parameter>
- <parameter name="numberOfActiveRunners" type="i32">
- <description>The number of runners that are currently active. An active runner is a selection available for
- betting
- </description>
- </parameter>
- <parameter name="lastMatchTime" type="dateTime">
- <description>The most recent time an order was executed</description>
- </parameter>
- <parameter name="totalMatched" type="double">
- <description>The total amount matched. This value is truncated at 2dp.</description>
- </parameter>
- <parameter name="totalAvailable" type="double">
- <description>The total amount of orders that remain unmatched. This value is truncated at 2dp.</description>
- </parameter>
- <parameter name="crossMatching" type="bool">
- <description>True if cross matching is enabled for this market.</description>
- </parameter>
- <parameter name="runnersVoidable" type="bool">
- <description>True if runners in the market can be voided</description>
- </parameter>
- <parameter name="version" type="i64">
- <description>The version of the market. The version increments whenever the market status changes, for
- example, turning in-play, or suspended when a goal score.
- </description>
- </parameter>
- <parameter name="runners" type="list(Runner)">
- <description>Information about the runners (selections) in the market.</description>
- </parameter>
- <parameter name="keyLineDescription" type="KeyLineDescription" mandatory="false">
- <description>
- Description of a markets key line for valid market types
- </description>
- </parameter>
- </dataType>
-
- <dataType name="RunnerCatalog">
- <description>Information about the Runners (selections) in a market</description>
- <parameter mandatory="true" name="selectionId" type="SelectionId">
- <description>The unique id for the selection.</description>
- </parameter>
- <parameter name="runnerName" type="string" mandatory="true">
- <description>The name of the runner</description>
- </parameter>
- <parameter mandatory="true" name="handicap" type="double">
- <description>The handicap</description>
- </parameter>
- <parameter mandatory="true" name="sortPriority" type="i32">
- <description>The sort priority of this runner</description>
- </parameter>
- <parameter name="metadata" type="map(string,string)">
- <description>Metadata associated with the runner</description>
- </parameter>
- </dataType>
-
-
- <dataType name="Runner">
- <description>The dynamic data about runners in a market</description>
- <parameter mandatory="true" name="selectionId" type="SelectionId">
- <description>The unique id of the runner (selection)</description>
- </parameter>
- <parameter mandatory="true" name="handicap" type="double">
- <description>The handicap</description>
- </parameter>
- <parameter mandatory="true" name="status" type="string">
- <description>The status of the selection (i.e., ACTIVE, REMOVED, WINNER, LOSER)</description>
- </parameter>
- <parameter name="adjustmentFactor" type="double">
- <description>The adjustment factor applied if the selection is removed</description>
- </parameter>
- <parameter name="lastPriceTraded" type="double">
- <description>The price of the most recent bet matched on this selection</description>
- </parameter>
- <parameter name="totalMatched" type="double">
- <description>The total amount matched on this runner. This value is truncated at 2dp.</description>
- </parameter>
- <parameter name="removalDate" type="dateTime">
- <description>If date and time the runner was removed</description>
- </parameter>
- <parameter name="sp" type="StartingPrices">
- <description>The BSP related prices for this runner</description>
- </parameter>
- <parameter name="ex" type="ExchangePrices">
- <description>The Exchange prices available for this runner</description>
- </parameter>
- <parameter name="orders" type="list(Order)">
- <description>List of orders in the market</description>
- </parameter>
- <parameter name="matches" type="list(Match)">
- <description>List of matches (i.e, orders that have been fully or partially executed)</description>
- </parameter>
- <parameter name="matchesByStrategy" type="map(string, Matches)">
- <description>List of matches keyed by strategy, ordered by matched data</description>
- </parameter>
- </dataType>
-
- <dataType name="StartingPrices">
- <description>Information about the Betfair Starting Price. Only available in BSP markets</description>
- <parameter name="nearPrice" type="double">
- <description>What the starting price would be if the market was reconciled now taking into account the SP
- bets as well as unmatched exchange bets on the same selection in the exchange.
- </description>
- </parameter>
- <parameter name="farPrice" type="double">
- <description>What the starting price would be if the market was reconciled now taking into account only the
- currently place SP bets. The Far Price is not as complicated but not as accurate and only accounts for
- money on the exchange at SP.
- </description>
- </parameter>
- <parameter name="backStakeTaken" type="list(PriceSize)">
- <description/>
- </parameter>
- <parameter name="layLiabilityTaken" type="list(PriceSize)">
- <description/>
- </parameter>
- <parameter name="actualSP" type="double">
- <description>The final BSP price for this runner. Only available for a BSP market that has been
- reconciled.
- </description>
- </parameter>
- </dataType>
-
- <dataType name="ExchangePrices">
- <description/>
- <parameter name="availableToBack" type="list(PriceSize)">
- <description/>
- </parameter>
- <parameter name="availableToLay" type="list(PriceSize)">
- <description/>
- </parameter>
- <parameter name="tradedVolume" type="list(PriceSize)">
- <description/>
- </parameter>
- </dataType>
-
- <dataType name="Event">
- <description>Event</description>
- <parameter name="id" type="EventId">
- <description>The unique id for the event</description>
- </parameter>
- <parameter name="name" type="string">
- <description>The name of the event</description>
- </parameter>
- <parameter name="countryCode" type="CountryCode">
- <description>countryCode</description>
- </parameter>
- <parameter name="timezone" type="string">
- <description>timezone</description>
- </parameter>
- <parameter name="venue" type="string">
- <description>venue</description>
- </parameter>
- <parameter name="openDate" type="dateTime">
- <description>openDate</description>
- </parameter>
- </dataType>
-
- <dataType name="EventResult">
- <description>Event Result</description>
- <parameter name="event" type="Event">
- <description>Event</description>
- </parameter>
- <parameter name="marketCount" type="i32">
- <description>Count of markets associated with this event</description>
- </parameter>
- </dataType>
-
- <dataType name="Competition">
- <description>Competition</description>
- <parameter name="id" type="CompetitionId">
- <description>id</description>
- </parameter>
- <parameter name="name" type="string">
- <description>name</description>
- </parameter>
- </dataType>
-
- <dataType name="CompetitionResult">
- <description>Competition Result</description>
- <parameter name="competition" type="Competition">
- <description>Competition</description>
- </parameter>
- <parameter name="marketCount" type="i32">
- <description>Count of markets associated with this competition</description>
- </parameter>
- <parameter name="competitionRegion" type="string">
- <description>Region in which this competition is happening</description>
- </parameter>
- </dataType>
-
- <dataType name="EventType">
- <description>EventType</description>
- <parameter name="id" type="EventTypeId">
- <description>id</description>
- </parameter>
- <parameter name="name" type="string">
- <description>name</description>
- </parameter>
- </dataType>
-
- <dataType name="EventTypeResult">
- <description>EventType Result</description>
- <parameter name="eventType" type="EventType">
- <description>EventType</description>
- </parameter>
- <parameter name="marketCount" type="i32">
- <description>Count of markets associated with this eventType</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketTypeResult">
- <description>MarketType Result</description>
- <parameter name="marketType" type="MarketType">
- <description>Market Type</description>
- </parameter>
- <parameter name="marketCount" type="i32">
- <description>Count of markets associated with this marketType</description>
- </parameter>
- </dataType>
-
- <dataType name="CountryCodeResult">
- <description>CountryCode Result</description>
- <parameter name="countryCode" type="CountryCode">
- <description>Country Code</description>
- </parameter>
- <parameter name="marketCount" type="i32">
- <description>Count of markets associated with this Country Code</description>
- </parameter>
- </dataType>
-
- <dataType name="VenueResult">
- <description>Venue Result</description>
- <parameter name="venue" type="Venue">
- <description>Venue</description>
- </parameter>
- <parameter name="marketCount" type="i32">
- <description>Count of markets associated with this Venue</description>
- </parameter>
- </dataType>
-
- <dataType name="TimeRange">
- <description>TimeRange</description>
- <parameter name="from" type="dateTime">
- <description>from, format: ISO 8601)</description>
- </parameter>
- <parameter name="to" type="dateTime">
- <description>to, format: ISO 8601</description>
- </parameter>
- </dataType>
-
- <dataType name="TimeRangeResult">
- <description>TimeRange Result</description>
- <parameter name="timeRange" type="TimeRange">
- <description>TimeRange</description>
- </parameter>
- <parameter name="marketCount" type="i32">
- <description>Count of markets associated with this TimeRange</description>
- </parameter>
- </dataType>
-
- <dataType name="Order">
- <description/>
- <parameter name="betId" type="BetId" mandatory="true">
- <description/>
- </parameter>
- <parameter name="orderType" type="string" mandatory="true">
- <description>BSP Order type.</description>
- </parameter>
- <parameter name="status" type="string" mandatory="true">
- <description>Either EXECUTABLE (an unmatched amount remains) or EXECUTION_COMPLETE (no unmatched amount
- remains).
- </description>
- </parameter>
- <parameter name="persistenceType" type="string" mandatory="true">
- <description>What to do with the order at turn-in-play</description>
- </parameter>
- <parameter name="side" type="string" mandatory="true">
- <description/>
- </parameter>
- <parameter name="price" type="Price" mandatory="true">
- <description>The price of the bet.</description>
- </parameter>
- <parameter name="size" type="Size" mandatory="true">
- <description>The size of the bet.</description>
- </parameter>
- <parameter name="bspLiability" type="Size" mandatory="true">
- <description>Not to be confused with size. This is the liability of a given BSP bet.</description>
- </parameter>
- <parameter name="placedDate" type="dateTime" mandatory="true">
- <description>The date, to the second, the bet was placed.</description>
- </parameter>
- <parameter name="avgPriceMatched" type="Price">
- <description>
- The average price matched at. Voided match fragments are removed from this average
- calculation.
- This value is not meaningful for activity on LINE markets and is not guaranteed
- to be returned or maintained for these markets.
- </description>
- </parameter>
- <parameter name="sizeMatched" type="Size">
- <description>The current amount of this bet that was matched.</description>
- </parameter>
- <parameter name="sizeRemaining" type="Size">
- <description>The current amount of this bet that is unmatched.</description>
- </parameter>
- <parameter name="sizeLapsed" type="Size">
- <description>The current amount of this bet that was lapsed.</description>
- </parameter>
- <parameter name="sizeCancelled" type="Size">
- <description>The current amount of this bet that was cancelled.</description>
- </parameter>
- <parameter name="sizeVoided" type="Size">
- <description>The current amount of this bet that was voided.</description>
- </parameter>
- <parameter name="customerOrderRef" type="CustomerOrderRef">
- <description>The customer order reference sent for this bet</description>
- </parameter>
- <parameter name="customerStrategyRef" type="CustomerStrategyRef">
- <description>The customer strategy reference sent for this bet</description>
- </parameter>
- </dataType>
-
- <dataType name="Matches">
- <description>
- Match list.
- </description>
- <parameter name="matches" type="list(Match)" mandatory="false">
- <description>List of matches</description>
- </parameter>
- </dataType>
-
- <dataType name="Match">
- <description>An individual bet Match, or rollup by price or avg price. Rollup
- depends on the requested MatchProjection
- </description>
- <parameter name="betId" type="BetId">
- <description>Only present if no rollup</description>
- </parameter>
- <parameter name="matchId" type="MatchId">
- <description>Only present if no rollup</description>
- </parameter>
- <parameter name="side" type="string" mandatory="true">
- <description/>
- </parameter>
- <parameter name="price" type="Price" mandatory="true">
- <description>
- Either actual match price or avg match price depending on rollup.
- This value is not meaningful for activity on LINE markets and is not guaranteed to be returned or maintained for these markets.
- </description>
- </parameter>
- <parameter name="Size" type="Size" mandatory="true">
- <description>Size matched at in this fragment, or at this price or avg price depending on rollup
- </description>
- </parameter>
- <parameter name="matchDate" type="dateTime">
- <description>Only present if no rollup</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketState">
- <description>Market definition</description>
- <parameter name="status" type="string" mandatory="true">
- <description>marketStatus</description>
- </parameter>
- <parameter name="betDelay" type="i32" mandatory="true">
- <description>betDelay</description>
- </parameter>
- <parameter name="bspReconciled" type="bool" mandatory="true">
- <description>bspReconciled</description>
- </parameter>
- <parameter name="complete" type="bool" mandatory="true">
- <description>complete</description>
- </parameter>
- <parameter name="inplay" type="bool" mandatory="true">
- <description>inplay</description>
- </parameter>
- <parameter name="numberOfActiveRunners" type="i32" mandatory="true">
- <description>numberActiveOfRunners</description>
- </parameter>
- <parameter name="lastMatchTime" type="dateTime" mandatory="true">
- <description>lastMatchTime</description>
- </parameter>
- <parameter name="totalMatched" type="Size" mandatory="true">
- <description/>
- </parameter>
- <parameter name="totalAvailable" type="Size" mandatory="true">
- <description>Zero for closed markets</description>
- </parameter>
- <parameter name="keyLineDescription" type="KeyLineDescription" mandatory="false">
- <description>
- Description of a markets key line for valid market types
- </description>
- </parameter>
- </dataType>
-
- <dataType name="MarketVersion">
- <description>Market version</description>
- <parameter name="version" type="i64">
- <description>A non-monotonically increasing number indicating market changes</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketDescription">
- <description>Market definition</description>
- <parameter name="persistenceEnabled" type="bool" mandatory="true">
- <description>persistenceMarket</description>
- </parameter>
- <parameter name="bspMarket" type="bool" mandatory="true">
- <description>bspMarket</description>
- </parameter>
- <parameter name="marketTime" type="dateTime" mandatory="true">
- <description>marketTime</description>
- </parameter>
- <parameter name="suspendTime" type="dateTime" mandatory="true">
- <description>marketSuspendTime</description>
- </parameter>
- <parameter name="settleTime" type="dateTime">
- <description>settled time</description>
- </parameter>
- <parameter name="bettingType" type="string" mandatory="true">
- <description>bettingType</description>
- </parameter>
- <parameter name="turnInPlayEnabled" type="bool" mandatory="true">
- <description>canTurnInPlay</description>
- </parameter>
- <parameter name="marketType" type="string" mandatory="true">
- <description>market base type</description>
- </parameter>
- <parameter name="regulator" type="string" mandatory="true">
- <description>the market regulator</description>
- </parameter>
- <parameter name="marketBaseRate" type="double" mandatory="true">
- <description/>
- </parameter>
- <parameter name="discountAllowed" type="bool" mandatory="true">
- <description/>
- </parameter>
- <parameter name="wallet" type="string">
- <description/>
- </parameter>
- <parameter name="rules" type="string">
- <description/>
- </parameter>
- <parameter name="rulesHasDate" type="bool">
- <description/>
- </parameter>
- <parameter name="clarifications" type="string">
- <description/>
- </parameter>
- <parameter name="eachWayDivisor" type="double">
- <description>Each Way Divisor for E/W markets</description>
- </parameter>
- <parameter name="lineRangeInfo" type="MarketLineRangeInfo">
- <description>Line range info for Line markets and some variants of Handicap markets</description>
- </parameter>
- <parameter name="raceType" type="string" mandatory="false">
- <description>An external identifier of a race type</description>
- </parameter>
- <parameter name="priceLadderDescription" type="PriceLadderDescription" mandatory="false">
- <description>Details about the price ladder in use for this market.</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketRates">
- <description>Market Rates</description>
- <parameter name="marketBaseRate" type="double" mandatory="true">
- <description>marketBaseRate</description>
- </parameter>
- <parameter name="discountAllowed" type="bool" mandatory="true">
- <description>discountAllowed</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketLicence">
- <description>Market Licence</description>
- <parameter name="wallet" type="string" mandatory="true">
- <description>The wallet from which funds will be taken when betting on this market</description>
- </parameter>
- <parameter name="rules" type="string">
- <description>The rules for this market</description>
- </parameter>
- <parameter name="rulesHasDate" type="bool">
- <description>The market's start date and time are relevant to the rules.</description>
- </parameter>
- <parameter name="clarifications" type="string">
- <description>Clarifications to the rules for the market</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketLineRangeInfo">
- <description>Market Line and Range Info</description>
- <parameter name="maxUnitValue" type="double" mandatory="true">
- <description>Maximum value for the outcome, in market units for this market (eg 100 runs)</description>
- </parameter>
- <parameter name="minUnitValue" type="double" mandatory="true">
- <description>Minimum value for the outcome, in market units for this market (eg 0 runs)</description>
- </parameter>
- <parameter name="interval" type="double" mandatory="true">
- <description>.
- For Handicap and Line markets, the lines available on this market will be between the range of
- minUnitValue and maxUnitValue, in increments of the interval value.
- e.g. If marketUnit is runs, minUnitValue=10, maxUnitValue=20 and interval=0.5,
- then valid lines include 10, 10.5, 11, 11.5 up to 20 runs.
- </description>
- </parameter>
- <parameter name="marketUnit" type="string" mandatory="true">
- <description>The type of unit the lines are incremented in by the interval (e.g: runs, goals or seconds)</description>
- </parameter>
- </dataType>
-
- <dataType name="PriceSize">
- <description/>
- <parameter name="price" type="Price" mandatory="true">
- <description/>
- </parameter>
- <parameter name="size" type="Size" mandatory="true">
- <description/>
- </parameter>
- </dataType>
-
- <dataType name="CurrentOrderSummaryReport">
- <description>A container representing search results.</description>
- <parameter name="currentOrders" type="list(CurrentOrderSummary)" mandatory="true">
- <description>
- The list of current orders returned by your query. This will be a valid list (i.e. empty or non-empty
- but never 'null').
- </description>
- </parameter>
- <parameter name="moreAvailable" type="bool" mandatory="true">
- <description>
- Indicates whether there are further result items beyond this page. Note that underlying data
- is highly time-dependent and the subsequent search orders query might return an empty result.
- </description>
- </parameter>
- </dataType>
-
- <dataType name="CurrentOrderSummary">
- <description>Summary of a current order.</description>
- <parameter name="betId" type="BetId" mandatory="true">
- <description>The bet ID of the original place order.</description>
- </parameter>
- <parameter name="marketId" type="MarketId" mandatory="true">
- <description>The market id the order is for.</description>
- </parameter>
- <parameter name="selectionId" type="SelectionId" mandatory="true">
- <description>The selection id the order is for.</description>
- </parameter>
- <parameter name="handicap" type="Handicap" mandatory="true">
- <description>The handicap of the bet.</description>
- </parameter>
- <parameter name="priceSize" type="PriceSize" mandatory="true">
- <description>The price and size of the bet.</description>
- </parameter>
- <parameter name="bspLiability" type="Size" mandatory="true">
- <description>Not to be confused with size. This is the liability of a given BSP bet.</description>
- </parameter>
- <parameter name="side" type="string" mandatory="true">
- <description>BACK/LAY</description>
- </parameter>
- <parameter name="status" type="string" mandatory="true">
- <description>Either EXECUTABLE (an unmatched amount remains) or EXECUTION_COMPLETE (no unmatched amount
- remains).
- </description>
- </parameter>
- <parameter name="persistenceType" type="string" mandatory="true">
- <description>What to do with the order at turn-in-play.</description>
- </parameter>
- <parameter name="orderType" type="string" mandatory="true">
- <description>BSP Order type.</description>
- </parameter>
- <parameter name="placedDate" type="dateTime" mandatory="true">
- <description>The date, to the second, the bet was placed.</description>
- </parameter>
- <parameter name="matchedDate" type="dateTime" mandatory="true">
- <description>The date, to the second, of the last matched bet fragment (where applicable).</description>
- </parameter>
- <parameter name="averagePriceMatched" type="Price">
- <description>The average price matched at. Voided match fragments are removed from this average
- calculation.
- This value is not meaningful for activity on LINE markets and is not guaranteed to be returned or maintained for these markets.
- </description>
- </parameter>
- <parameter name="sizeMatched" type="Size">
- <description>The current amount of this bet that was matched.</description>
- </parameter>
- <parameter name="sizeRemaining" type="Size">
- <description>The current amount of this bet that is unmatched.</description>
- </parameter>
- <parameter name="sizeLapsed" type="Size">
- <description>The current amount of this bet that was lapsed.</description>
- </parameter>
- <parameter name="sizeCancelled" type="Size">
- <description>The current amount of this bet that was cancelled.</description>
- </parameter>
- <parameter name="sizeVoided" type="Size">
- <description>The current amount of this bet that was voided.</description>
- </parameter>
- <parameter name="regulatorAuthCode" type="string">
- <description>The regulator authorisation code.</description>
- </parameter>
- <parameter name="regulatorCode" type="string">
- <description>The regulator Code.</description>
- </parameter>
- <parameter name="customerOrderRef" type="string">
- <description>The order reference defined by the customer for this bet</description>
- </parameter>
- <parameter name="customerStrategyRef" type="string">
- <description>The strategy reference defined by the customer for this bet</description>
- </parameter>
- </dataType>
-
- <dataType name="ClearedOrderSummary">
- <description>Summary of a cleared order.</description>
- <parameter name="eventTypeId" type="EventTypeId">
- <description>The id of the event type bet on. Available at EVENT_TYPE groupBy level or lower.</description>
- </parameter>
- <parameter name="eventId" type="EventId">
- <description>The id of the event bet on. Available at EVENT groupBy level or lower.</description>
- </parameter>
- <parameter name="marketId" type="MarketId">
- <description>The id of the market bet on. Available at MARKET groupBy level or lower.</description>
- </parameter>
- <parameter name="selectionId" type="SelectionId">
- <description>The id of the selection bet on. Available at RUNNER groupBy level or lower.</description>
- </parameter>
- <parameter name="handicap" type="Handicap">
- <description>The id of the market bet on. Available at MARKET groupBy level or lower.</description>
- </parameter>
- <parameter name="betId" type="BetId">
- <description>The id of the bet. Available at BET groupBy level.</description>
- </parameter>
- <parameter name="placedDate" type="dateTime">
- <description>The date the bet order was placed by the customer. Only available at BET groupBy level.
- </description>
- </parameter>
- <parameter name="persistenceType" type="string">
- <description>
- The turn in play persistence state of the order at bet placement time.
- This field will be empty or omitted on true SP bets. Only available at BET groupBy level.
- </description>
- </parameter>
- <parameter name="orderType" type="string">
- <description>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.
- </description>
- </parameter>
- <parameter name="side" type="string">
- <description>Whether the bet was a back or lay bet. Available at SIDE groupBy level or lower.</description>
- </parameter>
- <parameter name="itemDescription" type="ItemDescription">
- <description>A container for all the anciliary data and localised text valid for this Item</description>
- </parameter>
- <parameter name="betOutcome" type="string">
- <description>The settlement outcome of the bet. Tri-state (WIN/LOSE/PLACE) to account for Each Way bets where
- the place portion of the bet won but the win portion lost. The profit/loss amount in this case could
- be positive or negative depending on the price matched at. Only available at BET groupBy level.
- </description>
- </parameter>
- <parameter name="priceRequested" type="Price">
- <description>The average requested price across all settled bet orders under this Item. Available at SIDE
- groupBy level or lower.
- For Line markets this is the line position requested.
- </description>
- </parameter>
- <parameter name="settledDate" type="dateTime">
- <description>The date and time the bet order was settled by Betfair. Available at SIDE groupBy level or
- lower.
- </description>
- </parameter>
- <parameter name="lastMatchedDate" type="dateTime">
- <description>The date and time the last bet order was matched by Betfair. Available on Settled orders only.
- </description>
- </parameter>
- <!--specific to settled/voided bets-->
- <parameter name="betCount" type="i32">
- <description>The number of actual bets within this grouping (will be 1 for BET groupBy)</description>
- </parameter>
- <parameter name="commission" type="Size">
- <description>The cumulative amount of commission paid by the customer across all bets under this Item, in
- the account currency. Available at EXCHANGE, EVENT_TYPE, EVENT and MARKET level groupings only.
- </description>
- </parameter>
- <parameter name="priceMatched" type="Price">
- <description>The average matched price across all settled bets or bet fragments under this Item. Available
- at SIDE groupBy level or lower.
- This value is not meaningful for activity on LINE markets and is not guaranteed to be returned or maintained for these markets.
- </description>
- </parameter>
- <parameter name="priceReduced" type="bool">
- <description>If true, then the matched price was affected by a reduction factor due to of a runner removal
- from this Horse Racing market.
- </description>
- </parameter>
- <parameter name="sizeSettled" type="Size">
- <description>The cumulative bet size that was settled as matched or voided under this Item, in the account
- currency. Available at SIDE groupBy level or lower.
- </description>
- </parameter>
- <parameter name="profit" type="Size">
- <description>The profit or loss (negative profit) gained on this line, in the account currency</description>
- </parameter>
- <!--specific to cancelled bets-->
- <parameter name="sizeCancelled" type="Size">
- <description>The amount of the bet that was available to be matched, before cancellation or lapsing, in the
- account currency
- </description>
- </parameter>
- <parameter name="customerOrderRef" type="string">
- <description>The order reference defined by the customer for the bet order
- </description>
- </parameter>
- <parameter name="customerStrategyRef" type="string">
- <description>The strategy reference defined by the customer for the bet order
- </description>
- </parameter>
- </dataType>
-
- <dataType name="ClearedOrderSummaryReport">
- <description>A container representing search results.</description>
- <parameter name="clearedOrders" type="list(ClearedOrderSummary)" mandatory="true">
- <description>
- The list of cleared orders returned by your query. This will be a valid list (i.e. empty or non-empty
- but never 'null').
- </description>
- </parameter>
- <parameter name="moreAvailable" type="bool" mandatory="true">
- <description>
- Indicates whether there are further result items beyond this page. Note that underlying data
- is highly time-dependent and the subsequent search orders query might return an empty result.
- </description>
- </parameter>
- </dataType>
-
- <dataType name="ItemDescription">
- <description>This object contains some text which may be useful to render a betting history view. It offers no
- long-term warranty as to the correctness of the text.
- </description>
- <parameter name="eventTypeDesc" type="string">
- <description>The event type name, translated into the requested locale. Available at EVENT_TYPE groupBy or
- lower.
- </description>
- </parameter>
- <parameter name="eventDesc" type="string">
- <description>The eventName, or openDate + venue, translated into the requested locale. Available at EVENT
- groupBy or lower.
- </description>
- </parameter>
- <parameter name="marketDesc" type="string">
- <description>The market name or racing market type ("Win", "To Be Placed (2 places)", "To Be Placed (5
- places)" etc) translated into the requested locale. Available at MARKET groupBy or lower.
- </description>
- </parameter>
- <parameter name="marketType" type="string">
- <description>The market type
- </description>
- </parameter>
- <parameter name="marketStartTime" type="dateTime">
- <description>The start time of the market (in ISO-8601 format, not translated). Available at MARKET groupBy
- or lower.
- </description>
- </parameter>
- <parameter name="runnerDesc" type="string">
- <description>The runner name, maybe including the handicap, translated into the requested locale. Available
- at BET groupBy.
- </description>
- </parameter>
- <parameter name="numberOfWinners" type="i32">
- <description>The numberOfWinners on a market. Available at BET groupBy.</description>
- </parameter>
- <parameter name="eachWayDivisor" type="double">
- <description>The odds divisor applicable to EachWay markets
- </description>
- </parameter>
- </dataType>
-
- <dataType name="RunnerId">
- <description>This object contains the unique identifier for a runner</description>
- <parameter name="marketId" type="MarketId" mandatory="true">
- <description>The id of the market bet on</description>
- </parameter>
- <parameter name="selectionId" type="SelectionId" mandatory="true">
- <description>The id of the selection bet on</description>
- </parameter>
- <parameter name="handicap" type="Handicap">
- <description>The handicap associated with the runner in case of asian handicap markets, null otherwise.
- </description>
- </parameter>
- </dataType>
-
- <!-- betting data types -->
- <dataType name="PlaceInstruction">
- <description>Instruction to place a new order</description>
- <parameter mandatory="true" name="orderType" type="OrderType">
- <description/>
- </parameter>
- <parameter mandatory="true" name="selectionId" type="SelectionId">
- <description>The selection_id.</description>
- </parameter>
- <parameter name="handicap" type="Handicap">
- <description>The handicap applied to the selection, if on an asian-style market.</description>
- </parameter>
- <parameter mandatory="true" name="side" type="Side">
- <description>Back or Lay</description>
- </parameter>
- <parameter type="LimitOrder" name="limitOrder">
- <description/>
- </parameter>
- <parameter type="LimitOnCloseOrder" name="limitOnCloseOrder">
- <description/>
- </parameter>
- <parameter type="MarketOnCloseOrder" name="marketOnCloseOrder">
- <description/>
- </parameter>
- <parameter mandatory="false" name="customerOrderRef" type="string">
- <description>
- An optional reference the customer can set to identify instructions and it will be returned on order
- change messages via the stream API. No validation will be done on uniqueness and the string is limited
- to 32 characters. If an empty string is provided it will be treated as null.
- </description>
- </parameter>
- </dataType>
-
- <dataType name="PlaceExecutionReport">
- <description/>
- <parameter name="customerRef" type="string">
- <description>
- Echo of the customerRef if passed.
- </description>
- </parameter>
- <parameter mandatory="true" type="string" name="status">
- <description/>
- </parameter>
- <parameter type="string" name="errorCode">
- <description/>
- </parameter>
- <parameter type="MarketId" name="marketId">
- <description>Echo of marketId passed</description>
- </parameter>
- <parameter type="list(PlaceInstructionReport)" name="instructionReports">
- <description/>
- </parameter>
- </dataType>
-
- <dataType name="LimitOrder">
- <description>Place a new LIMIT order (simple exchange bet for immediate execution)</description>
- <parameter mandatory="false" name="size" type="Size">
- <description>
- The size of the bet.
- It is illegal to specify size if BetTargetType is specified.
- </description>
- </parameter>
- <parameter mandatory="true" name="price" type="Price">
- <description>
- The limit price.
- For LINE markets, the price at which the bet is settled and struck will
- always be 2.0 (Evens). On these bets, the Price field is used to indicate the line value which is
- being bought or sold.
- </description>
- </parameter>
- <parameter mandatory="false" name="persistenceType" type="PersistenceType">
- <description>
- What to do with the order at turn-in-play
- If no PersistenceType and TimeInForce value is specified, a PersistenceType of LAPSE will be used.
- </description>
- </parameter>
- <parameter mandatory="false" name="timeInForce" type="TimeInForce">
- <description>
- The type of TimeInForce value to use. This value takes precedence over any PersistenceType value chosen.
- If this attribute is populated along with the PersistenceType field, then the PersistenceType will be
- ignored.
- TimeInForce bets are valid for LINE markets however Volume Weighted Average Price (VWAP) functionality is disabled.
- </description>
- </parameter>
- <parameter mandatory="false" name="minFillSize" type="Size">
- <description>
- An optional field used if the TimeInForce attribute is populated.
- If specified without TimeInForce then this field is ignored.
- If no minFillSize is specified, the order is killed unless the entire size can be matched.
- If minFillSize is specified, the order is killed unless at least the minFillSize can be matched.
- The minFillSize cannot be greater than the order's size.
- If specified for a BetTargetType and FILL_OR_KILL order, then this value will be ignored
- </description>
- </parameter>
- <parameter mandatory="false" name="betTargetType" type="BetTargetType">
- <description>
- An optional field to allow betting to a targeted PAYOUT or BACKERS_PROFIT.
- It is illegal to specify both a Size and BetTargetType
- For line markets, BetTargetType bets are invalid.
- Matching provides best execution at the requested price or better up to the payout or profit.
- If the bet is not matched completely and immediately, the remaining portion enters the unmatched pool of bets on the exchange
- </description>
- </parameter>
- <parameter mandatory="false" name="betTargetSize" type="Size">
- <description>
- An optional field which must be specified if BetTargetType is specified for this order
- The requested outcome size of either the payout or profit.
- This is named from the backer's perspective. For Lay bets the profit represents the bet's liability
- </description>
- </parameter>
- </dataType>
-
- <dataType name="LimitOnCloseOrder">
- <description>Place a new LIMIT_ON_CLOSE bet</description>
- <parameter mandatory="true" name="liability" type="Size">
- <description>The size of the bet.</description>
- </parameter>
- <parameter mandatory="true" name="price" type="Price">
- <description>The limit price of the bet if LOC</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketOnCloseOrder">
- <description>Place a new MARKET_ON_CLOSE bet</description>
- <parameter mandatory="true" name="liability" type="Size">
- <description>The size of the bet.</description>
- </parameter>
- </dataType>
-
- <dataType name="PlaceInstructionReport">
- <description>Response to a PlaceInstruction</description>
- <parameter mandatory="true" name="status" type="string">
- <description>whether the command succeeded or failed</description>
- </parameter>
- <parameter name="errorCode" type="string">
- <description>cause of failure, or null if command succeeds</description>
- </parameter>
- <parameter mandatory="false" name="orderStatus" type="OrderStatus">
- <description>
- The status of the order, if the instruction succeeded.
- If the instruction was unsuccessful, no value is provided.
- </description>
- </parameter>
- <parameter mandatory="true" type="PlaceInstruction" name="instruction">
- <description>The instruction that was requested</description>
- </parameter>
- <parameter name="betId" type="string">
- <description>
- The bet ID of the new bet. Will be null on failure or if order was placed asynchronously.
- </description>
- </parameter>
- <parameter name="placedDate" type="dateTime">
- <description>Will be null if order was placed asynchronously</description>
- </parameter>
- <parameter name="averagePriceMatched" type="Price">
- <description>
- Will be null if order was placed asynchronously.
- This value is not meaningful for activity on LINE markets and is not guaranteed to be returned or maintained for these markets.
- </description>
- </parameter>
- <parameter name="sizeMatched" type="Size">
- <description>Will be null if order was placed asynchronously</description>
- </parameter>
- </dataType>
-
- <dataType name="CancelInstruction">
- <description>Instruction to fully or partially cancel an order (only applies to LIMIT orders)</description>
- <parameter mandatory="true" name="betId" type="string">
- <description/>
- </parameter>
- <parameter name="sizeReduction" type="Size">
- <description>If supplied then this is a partial cancel</description>
- </parameter>
- </dataType>
-
- <dataType name="CancelExecutionReport">
- <description/>
- <parameter name="customerRef" type="string">
- <description>
- Echo of the customerRef if passed.
- </description>
- </parameter>
- <parameter mandatory="true" type="string" name="status">
- <description/>
- </parameter>
- <parameter type="string" name="errorCode">
- <description/>
- </parameter>
- <parameter type="MarketId" name="marketId">
- <description>Echo of marketId passed</description>
- </parameter>
- <parameter type="list(CancelInstructionReport)" name="instructionReports">
- <description/>
- </parameter>
- </dataType>
-
- <dataType name="ReplaceInstruction">
- <description>Instruction to replace a LIMIT or LIMIT_ON_CLOSE order at a new price. Original order will be
- cancelled
- and a new order placed at the new price for the remaining stake.
- </description>
- <parameter mandatory="true" name="betId" type="string">
- <description/>
- </parameter>
- <parameter mandatory="true" name="newPrice" type="Price">
- <description>The price to replace the bet at</description>
- </parameter>
- </dataType>
-
- <dataType name="ReplaceExecutionReport">
- <description/>
- <parameter name="customerRef" type="string">
- <description>
- Echo of the customerRef if passed.
- </description>
- </parameter>
- <parameter mandatory="true" type="string" name="status">
- <description/>
- </parameter>
- <parameter type="string" name="errorCode">
- <description/>
- </parameter>
- <parameter type="MarketId" name="marketId">
- <description>Echo of marketId passed</description>
- </parameter>
- <parameter type="list(ReplaceInstructionReport)" name="instructionReports">
- <description/>
- </parameter>
- </dataType>
-
- <dataType name="ReplaceInstructionReport">
- <description/>
- <parameter mandatory="true" name="status" type="string">
- <description>whether the command succeeded or failed</description>
- </parameter>
- <parameter name="errorCode" type="string">
- <description>cause of failure, or null if command succeeds</description>
- </parameter>
- <parameter name="cancelInstructionReport" type="CancelInstructionReport">
- <description>Cancelation report for the original order</description>
- </parameter>
- <parameter name="placeInstructionReport" type="PlaceInstructionReport">
- <description>Placement report for the new order</description>
- </parameter>
- </dataType>
-
- <dataType name="CancelInstructionReport">
- <description/>
- <parameter mandatory="true" name="status" type="string">
- <description>whether the command succeeded or failed</description>
- </parameter>
- <parameter name="errorCode" type="string">
- <description>cause of failure, or null if command succeeds</description>
- </parameter>
- <parameter type="CancelInstruction" name="instruction">
- <description>The instruction that was requested</description>
- </parameter>
- <parameter mandatory="true" name="sizeCancelled" type="Size">
- <description/>
- </parameter>
- <parameter mandatory="true" name="cancelledDate" type="dateTime">
- <description/>
- </parameter>
- </dataType>
-
- <dataType name="UpdateInstruction">
- <description>Instruction to update LIMIT bet's persistence of an order that do not affect exposure</description>
- <parameter mandatory="true" name="betId" type="string">
- <description/>
- </parameter>
- <parameter mandatory="true" name="newPersistenceType" type="PersistenceType">
- <description>The new persistence type to update this bet to</description>
- </parameter>
- </dataType>
-
- <dataType name="UpdateExecutionReport">
- <description/>
- <parameter name="customerRef" type="string">
- <description>
- Echo of the customerRef if passed.
- </description>
- </parameter>
- <parameter mandatory="true" type="string" name="status">
- <description/>
- </parameter>
- <parameter type="string" name="errorCode">
- <description/>
- </parameter>
- <parameter type="MarketId" name="marketId">
- <description>Echo of marketId passed</description>
- </parameter>
- <parameter type="list(UpdateInstructionReport)" name="instructionReports">
- <description/>
- </parameter>
- </dataType>
-
- <dataType name="UpdateInstructionReport">
- <description/>
- <parameter mandatory="true" name="status" type="string">
- <description>whether the command succeeded or failed</description>
- </parameter>
- <parameter name="errorCode" type="string">
- <description>cause of failure, or null if command succeeds</description>
- </parameter>
- <parameter mandatory="true" name="instruction" type="UpdateInstruction">
- <description>The instruction that was requested</description>
- </parameter>
- </dataType>
-
- <dataType name="PriceProjection">
- <description>
- Selection criteria of the returning price data
- </description>
- <parameter name="priceData" type="set(PriceData)">
- <description>
- The basic price data you want to receive in the response.
- </description>
- </parameter>
- <parameter name="exBestOffersOverrides" type="ExBestOffersOverrides">
- <description>
- Options to alter the default representation of best offer prices
- Applicable to EX_BEST_OFFERS priceData selection
- </description>
- </parameter>
- <parameter name="virtualise" type="bool">
- <description>
- Indicates if the returned prices should include virtual prices.
- Applicable to EX_BEST_OFFERS and EX_ALL_OFFERS priceData selections, default value is false.
- </description>
- </parameter>
- <parameter name="rolloverStakes" type="bool">
- <description>
- Indicates if the volume returned at each price point should be the absolute value or a
- cumulative sum of volumes available at the price and all better prices.
- If unspecified defaults to false.
- Applicable to EX_BEST_OFFERS and EX_ALL_OFFERS price projections.
- Not supported as yet.
- </description>
- </parameter>
- </dataType>
-
- <dataType name="ExBestOffersOverrides">
- <description>
- Options to alter the default representation of best offer prices
- </description>
- <parameter name="bestPricesDepth" type="i32">
- <description>
- The maximum number of prices to return on each side for each runner.
- If unspecified defaults to 3.
- </description>
- </parameter>
- <parameter name="rollupModel" type="RollupModel">
- <description>
- The model to use when rolling up available sizes.
- If unspecified defaults to STAKE rollup model with rollupLimit of
- minimum stake in the specified currency.
- </description>
- </parameter>
- <parameter name="rollupLimit" type="i32">
- <description>
- The volume limit to use when rolling up returned sizes. The exact
- definition of the limit depends on the rollupModel. If no limit is provided it
- will use minimum stake as default the value. Ignored if no rollup model is specified.
- </description>
- </parameter>
- <parameter name="rollupLiabilityThreshold" type="double">
- <description>
- Only applicable when rollupModel is MANAGED_LIABILITY.
- The rollup model switches from being stake based to liability based
- at the smallest lay price which is >= rollupLiabilityThreshold.service level default (TBD).
- Not supported as yet.
- </description>
- </parameter>
- <parameter name="rollupLiabilityFactor" type="i32">
- <description>
- Only applicable when rollupModel is MANAGED_LIABILITY.
- (rollupLiabilityFactor * rollupLimit) is the minimum liabilty the
- user is deemed to be comfortable with. After the rollupLiabilityThreshold
- price subsequent volumes will be rolled up to minimum value
- such that the liability >= the minimum liability.service level default (5).
- Not supported as yet.
- </description>
- </parameter>
- </dataType>
-
- <dataType name="MarketProfitAndLoss">
- <description>Profit and loss in a market</description>
- <parameter name="marketId" type="string">
- <description>The unique identifier for the market</description>
- </parameter>
- <parameter name="commissionApplied" type="double">
- <description>
- The commission rate applied to P&amp;L values. Only returned if netOfCommision option is requested
- </description>
- </parameter>
- <parameter name="profitAndLosses" type="list(RunnerProfitAndLoss)">
- <description>
- Calculated profit and loss data.
- </description>
- </parameter>
- </dataType>
-
- <dataType name="RunnerProfitAndLoss">
- <description>Profit and loss if selection is wins or loses</description>
- <parameter name="selectionId" type="SelectionId">
- <description>The unique identifier for the selection</description>
- </parameter>
- <parameter name="ifWin" type="double">
- <description>
- Profit and loss for the market if this selection is the winner
- </description>
- </parameter>
- <parameter name="ifLose" type="double">
- <description>
- Profit and loss for the market if this selection is the loser. Only returned for multi-winner odds markets.
- </description>
- </parameter>
- <parameter name="ifPlace" type="double">
- <description>
- Profit and loss for the market if this selection is placed. Only returned for EACH_WAY markets.
- </description>
- </parameter>
- </dataType>
-
- <dataType name="PriceLadderDescription">
- <description>
- Description of the price ladder type and any related data.
- </description>
- <parameter name="type" type="PriceLadderType" mandatory="true">
- <description>The type of price ladder.</description>
- </parameter>
- </dataType>
-
- <dataType name="KeyLineSelection">
- <description>
- Description of a markets key line selection, comprising the selectionId and handicap of the team it is applied to.
- </description>
- <parameter name="selectionId" type="SelectionId" mandatory="true">
- <description>Selection ID of the runner in the key line handicap.</description>
- </parameter>
- <parameter name="handicap" type="Handicap" mandatory="true">
- <description>Handicap value of the key line.</description>
- </parameter>
- </dataType>
-
- <dataType name="KeyLineDescription">
- <description>
- A list of KeyLineSelection objects describing the key line for the market
- </description>
- <parameter name="keyLine" type="list(KeyLineSelection)" mandatory="true">
- <description>A list of KeyLineSelection objects</description>
- </parameter>
- </dataType>
-
- <dataType name="ExposureLimitsForMarketGroups">
- <description>
- Wrapper type that contains accounts exposure limits for a market group type.
- If default limit exists for group type, defaultLimit value will be populated.
- Group limits to return can be controller by marketGroupFilter parameter (see listExposureLimitsForMarketGroups operation).
- </description>
- <parameter mandatory="true" name="marketGroupType" type="MarketGroupType">
- <description>Market Group Type</description>
- </parameter>
- <parameter mandatory="false" name="defaultLimit" type="ExposureLimit">
- <description>Default limit (if exists)</description>
- </parameter>
- <parameter mandatory="false" name="groupLimits" type="list(MarketGroupExposureLimit)">
- <description>Group limits for type</description>
- </parameter>
- <parameter mandatory="false" name="blockedMarketGroups" type="list(MarketGroupId)">
- <description>Blocked groups due to limit breach</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketGroup">
- <description>Represents a market group</description>
- <parameter mandatory="true" name="type" type="MarketGroupType">
- <description>Type of the group</description>
- </parameter>
- <parameter mandatory="true" name="id" type="MarketGroupId">
- <description>ID of the group</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketGroupId">
- <description>Container type for market group ID</description>
- <parameter mandatory="false" name="eventId" type="i64">
- <description>EventId (if type is EVENT)</description>
- </parameter>
- </dataType>
-
- <dataType name="LimitBreachAction">
- <description>Action that should be execute when limit is breached</description>
- <parameter mandatory="true" name="actionType" type="LimitBreachActionType">
- <description>Type of the action</description>
- </parameter>
- </dataType>
-
- <dataType name="MarketGroupExposureLimit">
- <description>Container type for a group exposure limit</description>
- <parameter mandatory="true" name="groupId" type="MarketGroupId">
- <description>Market group ID</description>
- </parameter>
- <parameter mandatory="true" name="limit" type="ExposureLimit">
- <description>Exposure limit</description>
- </parameter>
- </dataType>
-
- <dataType name="ExposureLimit">
- <description>
- Exposure limit and limit breach action.
- Not populating one of total or matched parameters indicates that no limit should be set for that exposure value.
-
- A special use of this type is when none of its parameters are populated, this can be used to override
- default limit to "no limit" for a specific instance of market group (see setExposureLimitForMarketGroup operation)
- </description>
- <parameter mandatory="false" name="matched" type="double">
- <description>Set a limit on matched bet exposure on market group</description>
- </parameter>
- <parameter mandatory="false" name="total" type="double">
- <description>Set a limit on total (matched + unmatched) bet exposure on market group</description>
- </parameter>
- <parameter mandatory="false" name="limitBreachAction" type="LimitBreachAction">
- <description></description>
- </parameter>
- </dataType>
-
- <exceptionType name="APINGException" prefix="ANGX">
- <description>This exception is thrown when an operation fails</description>
- <parameter name="errorCode" type="string">
- <description>the unique code for this error</description>
- <validValues>
- <value id="1" name="TOO_MUCH_DATA">
- <description>The operation requested too much data</description>
- </value>
- <value id="2" name="INVALID_INPUT_DATA">
- <description>Invalid input data</description>
- </value>
- <value id="3" name="INVALID_SESSION_INFORMATION">
- <description>The session token passed is invalid</description>
- </value>
- <value id="4" name="NO_APP_KEY">
- <description>An application key is required for this operation</description>
- </value>
- <value id="5" name="NO_SESSION">
- <description>A session token is required for this operation</description>
- </value>
- <value id="6" name="UNEXPECTED_ERROR">
- <description>An unexpected internal error occurred that prevented successful request processing.
- </description>
- </value>
- <value id="7" name="INVALID_APP_KEY">
- <description>The application key passed is invalid</description>
- </value>
- <value id="8" name="TOO_MANY_REQUESTS">
- <description>There are too many pending requests</description>
- </value>
- <value id="9" name="SERVICE_BUSY">
- <description>The service is currently too busy to service this request</description>
- </value>
- <value id="10" name="TIMEOUT_ERROR">
- <description>Internal call to downstream service timed out</description>
- </value>
- <value id="11" name="APP_KEY_CREATION_FAILED">
- <description>The application key creation has failed</description>
- </value>
- <value id="12" name="DUPLICATE_APP_NAME">
- <description>The application name specified already exists</description>
- </value>
- <value id="13" name="APP_CREATION_FAILED">
- <description>The application name specified is too long</description>
- </value>
- <value id="14" name="REQUEST_SIZE_EXCEEDS_LIMIT">
- <description>The request has exceeded the maximum allowed size</description>
- </value>
- <value id="15" name="ACCESS_DENIED">
- <description>The access to this functionality is not allowed</description>
- </value>
- <value id="16" name="INVALID_MARKET_GROUP">
- <description>
- Provided market group id does not identify a known market group
- </description>
- </value>
- <value id="17" name="EXPOSURE_LIMIT_NOT_EXIST">
- <description>
- Unable to delete/update limit as it doesn't exist
- </description>
- </value>
- <value id="18" name="MARKET_GROUP_NOT_BLOCKED">
- <description>
- Unable to unblock market group after exposure limit breach, market group is not blocked
- </description>
- </value>
- </validValues>
- </parameter>
- <parameter name="errorDetails" type="string">
- <description>the stack trace of the error</description>
- </parameter>
- <parameter name="requestUUID" type="string">
- <description/>
- </parameter>
- </exceptionType>
-
- <simpleType name="MarketProjection" type="string">
- <validValues>
- <value name="COMPETITION">
- <description>If not selected then the competition will not be returned with marketCatalogue
- </description>
- </value>
- <value name="EVENT">
- <description>If not selected then the event will not be returned with marketCatalogue</description>
- </value>
- <value name="EVENT_TYPE">
- <description>If not selected then the eventType will not be returned with marketCatalogue</description>
- </value>
- <value name="MARKET_START_TIME">
- <description>If not selected then the start time will not be returned with marketCatalogue
- </description>
- </value>
- <value name="MARKET_DESCRIPTION">
- <description>If not selected then the description will not be returned with marketCatalogue
- </description>
- </value>
- <value name="RUNNER_DESCRIPTION">
- <description>If not selected then the runners will not be returned with marketCatalogue</description>
- </value>
- <value name="RUNNER_METADATA">
- <description>If not selected then the runner metadata will not be returned with marketCatalogue. If
- selected then RUNNER_DESCRIPTION will also be returned regardless of whether it is included as a
- market projection.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="PriceData" type="string">
- <validValues>
- <value name="SP_AVAILABLE">
- <description/>
- </value>
- <value name="SP_TRADED">
- <description/>
- </value>
- <value name="EX_BEST_OFFERS">
- <description/>
- </value>
- <value name="EX_ALL_OFFERS">
- <description>EX_ALL_OFFERS trumps EX_BEST_OFFERS if both settings are present</description>
- </value>
- <value name="EX_TRADED">
- <description/>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="MatchProjection" type="string">
- <validValues>
- <value name="NO_ROLLUP">
- <description/>
- </value>
- <value name="ROLLED_UP_BY_PRICE">
- <description/>
- </value>
- <value name="ROLLED_UP_BY_AVG_PRICE">
- <description/>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="OrderProjection" type="string">
- <validValues>
- <value name="ALL">
- <description/>
- </value>
- <value name="EXECUTABLE">
- <description/>
- </value>
- <value name="EXECUTION_COMPLETE">
- <description/>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="MarketStatus" type="string">
- <validValues>
- <value name="INACTIVE">
- <description>Inactive Market</description>
- </value>
- <value name="OPEN">
- <description>Open Market</description>
- </value>
- <value name="SUSPENDED">
- <description>Suspended Market</description>
- </value>
- <value name="CLOSED">
- <description>Closed Market</description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="RunnerStatus" type="string">
- <validValues>
- <value name="ACTIVE">
- <description>ACTIVE</description>
- </value>
- <value name="WINNER">
- <description>WINNER</description>
- </value>
- <value name="LOSER">
- <description>LOSER</description>
- </value>
- <value name="REMOVED_VACANT">
- <description/>
- </value>
- <value name="REMOVED">
- <description>REMOVED</description>
- </value>
- <value name="PLACED">
- <description>PLACED</description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="TimeGranularity" type="string">
- <validValues>
- <value name="DAYS">
- <description/>
- </value>
- <value name="HOURS">
- <description/>
- </value>
- <value name="MINUTES">
- <description/>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="MarketType" type="string"/>
- <simpleType name="Venue" type="string"/>
- <simpleType name="MarketId" type="string"/>
- <simpleType name="SelectionId" type="i64"/>
- <simpleType name="Handicap" type="double"/>
- <simpleType name="EventId" type="string"/>
- <simpleType name="EventTypeId" type="string"/>
- <simpleType name="CountryCode" type="string"/>
- <simpleType name="ExchangeId" type="string"/>
- <simpleType name="CompetitionId" type="string"/>
- <simpleType name="Price" type="double"/>
- <simpleType name="Size" type="double"/>
- <simpleType name="BetId" type="string"/>
- <simpleType name="MatchId" type="string"/>
- <simpleType name="CustomerOrderRef" type="string"/>
- <simpleType name="CustomerStrategyRef" type="string"/>
-
- <simpleType name="Side" type="string">
- <validValues>
- <value name="BACK">
- <description>
- To back a team, horse or outcome is to bet on the selection to win.
- For Line markets a Back bet refers to a SELL line. A SELL line will win if the outcome is LESS THAN the taken line (price).
- </description>
- </value>
- <value name="LAY">
- <description>
- To lay a team, horse, or outcome is to bet on the selection to lose.
- For line markets a Lay bet refers to a BUY line. A BUY line will win if the outcome is MORE THAN the taken line (price).
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="OrderStatus" type="string">
- <validValues>
- <value name="PENDING">
- <description>
- An asynchronous order is yet to be processed. Once the bet has been processed by the exchange
- (including waiting for any in-play delay), the result will be reported and available on the
- Exchange Stream API and API NG.
- Not a valid search criteria on MarketFilter
- </description>
- </value>
- <value name="EXECUTION_COMPLETE">
- <description>An order that does not have any remaining unmatched portion.</description>
- </value>
- <value name="EXECUTABLE">
- <description>An order that has a remaining unmatched portion.</description>
- </value>
- <value name="EXPIRED">
- <description>
- The order is no longer available for execution due to its time in force constraint.
- In the case of FILL_OR_KILL orders, this means the order has been killed because it could not be filled to your specifications.
- Not a valid search criteria on MarketFilter
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="OrderBy" type="string">
- <validValues>
- <value name="BY_BET">
- <description>@Deprecated Use BY_PLACE_TIME instead. Order by placed time, then bet id.</description>
- </value>
- <value name="BY_MARKET">
- <description>Order by market id, then placed time, then bet id.</description>
- </value>
- <value name="BY_PLACE_TIME">
- <description>Order by placed time, then bet id. This is an alias of to be deprecated BY_BET.
- </description>
- </value>
- <value name="BY_MATCH_TIME">
- <description>Order by time of last matched fragment (if any), then placed time, then bet id.
- Filters out orders which have no matched date
- </description>
- </value>
- <value name="BY_VOID_TIME">
- <description>Order by time of last voided fragment (if any), then by last match time,
- then placed time, then bet id. Filters out orders which have not been voided.
- </description>
- </value>
- <value name="BY_SETTLED_TIME">
- <description>Order by time of last settled fragment (if any), then by last match time,
- then placed time, then bet id. Filters out orders which have not been settled.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="SortDir" type="string">
- <validValues>
- <value name="EARLIEST_TO_LATEST">
- <description>Order from earliest value to latest e.g. lowest betId is first in the results.
- </description>
- </value>
- <value name="LATEST_TO_EARLIEST">
- <description>Order from the latest value to the earliest e.g. highest betId is first in the results.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="OrderType" type="string">
- <validValues>
- <value name="LIMIT">
- <description>A normal exchange limit order for immediate execution</description>
- </value>
- <value name="LIMIT_ON_CLOSE">
- <description>Limit order for the auction (SP)</description>
- </value>
- <value name="MARKET_ON_CLOSE">
- <description>Market order for the auction (SP)</description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="MarketSort" type="string">
- <validValues>
- <value name="MINIMUM_TRADED">
- <description>Minimum traded volume</description>
- </value>
- <value name="MAXIMUM_TRADED">
- <description>Maximum traded volume</description>
- </value>
- <value name="MINIMUM_AVAILABLE">
- <description>Minimum available to match</description>
- </value>
- <value name="MAXIMUM_AVAILABLE">
- <description>Maximum available to match</description>
- </value>
- <value name="FIRST_TO_START">
- <description>The closest markets based on their expected start time</description>
- </value>
- <value name="LAST_TO_START">
- <description>The most distant markets based on their expected start time</description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="MarketBettingType" type="string">
- <validValues>
- <value name="ODDS">
- <description>Odds Market</description>
- </value>
- <value name="LINE">
- <description>Line markets operate at even-money odds of 2.0. However, price for these markets
- refers to the line positions available as defined by the markets min-max range and interval
- steps. Customers either Buy a line (LAY bet, winning if outcome is greater than the taken line (price))
- or Sell a line (BACK bet, winning if outcome is less than the taken line (price)). If settled outcome
- equals the taken line, stake is returned.</description>
- </value>
- <value name="RANGE">
- <description>Range Market</description>
- </value>
- <value name="ASIAN_HANDICAP_DOUBLE_LINE">
- <description>Asian Handicap Market</description>
- </value>
- <value name="ASIAN_HANDICAP_SINGLE_LINE">
- <description>Asian Single Line Market</description>
- </value>
- <value name="FIXED_ODDS">
- <description>
- Sportsbook Odds Market. This type is deprecated and will be removed
- in future releases, when Sportsbook markets will be represented as ODDS market
- but with a different product type.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <!-- betting simple types -->
- <simpleType name="ExecutionReportStatus" type="string">
- <validValues>
- <value name="SUCCESS">
- <description/>
- </value>
- <value name="FAILURE">
- <description/>
- </value>
- <value name="PROCESSED_WITH_ERRORS">
- <description/>
- </value>
- <value name="TIMEOUT">
- <description/>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="ExecutionReportErrorCode" type="string">
- <validValues>
- <value name="ERROR_IN_MATCHER">
- <description>The matcher's not healthy</description>
- </value>
- <value name="PROCESSED_WITH_ERRORS">
- <description>The order itself has been accepted, but at least one (possibly all) actions have generated
- errors
- </description>
- </value>
- <value name="BET_ACTION_ERROR">
- <description>There is an error with an action that has caused the entire order to be rejected
- </description>
- </value>
- <value name="INVALID_ACCOUNT_STATE">
- <description>Order rejected due to the account's status (suspended, inactive, dup cards)</description>
- </value>
- <value name="INVALID_WALLET_STATUS">
- <description>Order rejected due to the account's wallet's status</description>
- </value>
- <value name="INSUFFICIENT_FUNDS">
- <description>Account has exceeded its exposure limit or available to bet limit</description>
- </value>
- <value name="LOSS_LIMIT_EXCEEDED">
- <description>The account has exceed the self imposed loss limit</description>
- </value>
- <value name="MARKET_SUSPENDED">
- <description>Market is suspended</description>
- </value>
- <value name="MARKET_NOT_OPEN_FOR_BETTING">
- <description>Market is not open for betting, either inactive, suspended or closed</description>
- </value>
- <value name="DUPLICATE_TRANSACTION">
- <description>duplicate customer referece data submitted</description>
- </value>
- <value name="INVALID_ORDER">
- <description>
- 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
- </description>
- </value>
- <value name="INVALID_MARKET_ID">
- <description>Market doesn't exist</description>
- </value>
- <value name="PERMISSION_DENIED">
- <description>Business rules do not allow order to be placed</description>
- </value>
- <value name="DUPLICATE_BETIDS">
- <description>duplicate bet ids found</description>
- </value>
- <value name="NO_ACTION_REQUIRED">
- <description>Order hasn't been passed to matcher as system detected there will be no state change
- </description>
- </value>
- <value name="SERVICE_UNAVAILABLE">
- <description>The requested service is unavailable</description>
- </value>
- <value name="REJECTED_BY_REGULATOR">
- <description>The regulator rejected the order</description>
- </value>
- <value name="NO_CHASING">
- <description>
- A specific error code that relates to Spanish Exchange markets only which indicates that the bet
- placed contravenes the Spanish regulatory rules relating to loss chasing.
- </description>
- </value>
- <value name="REGULATOR_IS_NOT_AVAILABLE">
- <description>The underlying regulator service is not available.</description>
- </value>
- <value name="TOO_MANY_INSTRUCTIONS">
- <description>The amount of orders exceeded the maximum amount allowed to be executed</description>
- </value>
- <value name="INVALID_MARKET_VERSION">
- <description>The supplied market version is invalid. Max length allowed for market version is 12.</description>
- </value>
- <value name="EVENT_EXPOSURE_LIMIT_EXCEEDED">
- <description>
- Had the instructions been carried out, the account's self imposed event exposure limit would have been exceeded.
- </description>
- </value>
- <value name="EVENT_MATCHED_EXPOSURE_LIMIT_EXCEEDED">
- <description>
- Had the instructions been carried out, the account's self imposed matched event exposure limit would have been exceeded.
- </description>
- </value>
- <value name="EVENT_BLOCKED">
- <description>
- Betting on this event is blocked due to exposure limit breach. unblockMarketGroup operation should be invoked to enable betting.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="PersistenceType" type="string">
- <validValues>
- <value name="LAPSE">
- <description>Lapse the order at turn-in-play</description>
- </value>
- <value name="PERSIST">
- <description>Persist the order to in-play</description>
- </value>
- <value name="MARKET_ON_CLOSE">
- <description>Put the order into the auction (SP) at turn-in-play</description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="InstructionReportStatus" type="string">
- <validValues>
- <value name="SUCCESS">
- <description/>
- </value>
- <value name="FAILURE">
- <description/>
- </value>
- <value name="TIMEOUT">
- <description/>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="InstructionReportErrorCode" type="string">
- <validValues>
- <value name="INVALID_BET_SIZE">
- <description>Bet size is invalid for your currency or your regulator</description>
- </value>
- <value name="INVALID_RUNNER">
- <description>Runner does not exist, includes vacant traps in greyhound racing</description>
- </value>
- <value name="BET_TAKEN_OR_LAPSED">
- <description>
- 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
- </description>
- </value>
- <value name="BET_IN_PROGRESS">
- <description>No result was received from the matcher in a timeout configured for the system
- </description>
- </value>
- <value name="RUNNER_REMOVED">
- <description>Runner has been removed from the event</description>
- </value>
- <value name="MARKET_NOT_OPEN_FOR_BETTING">
- <description>Attempt to edit a bet on a market that has closed.</description>
- </value>
- <value name="LOSS_LIMIT_EXCEEDED">
- <description>The action has caused the account to exceed the self imposed loss limit</description>
- </value>
- <value name="MARKET_NOT_OPEN_FOR_BSP_BETTING">
- <description>Market now closed to bsp betting. Turned in-play or has been reconciled</description>
- </value>
- <value name="INVALID_PRICE_EDIT">
- <description>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
- </description>
- </value>
- <value name="INVALID_ODDS">
- <description>Odds not on price ladder - either edit or placement</description>
- </value>
- <value name="INSUFFICIENT_FUNDS">
- <description>Insufficient funds available to cover the bet action. Either the exposure limit or
- available to bet limit would be exceeded
- </description>
- </value>
- <value name="INVALID_PERSISTENCE_TYPE">
- <description>Invalid persistence type for this market, e.g. KEEP for a non bsp market</description>
- </value>
- <value name="ERROR_IN_MATCHER">
- <description>A problem with the matcher prevented this action completing successfully</description>
- </value>
- <value name="INVALID_BACK_LAY_COMBINATION">
- <description>
- 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
- </description>
- </value>
- <value name="ERROR_IN_ORDER">
- <description>The action failed because the parent order failed</description>
- </value>
- <value name="INVALID_BID_TYPE">
- <description>
- Bid type is mandatory
- </description>
- </value>
- <value name="INVALID_BET_ID">
- <description>Bet for id supplied has not been found</description>
- </value>
- <value name="CANCELLED_NOT_PLACED">
- <description>Bet cancelled but replacement bet was not placed</description>
- </value>
- <value name="RELATED_ACTION_FAILED">
- <description>Action failed due to the failure of a action on which this action is dependent
- </description>
- </value>
- <value name="NO_ACTION_REQUIRED">
- <description>the action does not result in any state change. eg changing a persistence to it's current
- value
- </description>
- </value>
- <value name="INVALID_MIN_FILL_SIZE">
- <description>
- The minFillSize must be greater than zero and less than or equal to the order's size.
- The minFillSize cannot be less than the minimum bet size for your currency
- </description>
- </value>
- <value name="INVALID_CUSTOMER_ORDER_REF">
- <description>
- The supplied customer order reference is too long.
- </description>
- </value>
- <value name="TIME_IN_FORCE_CONFLICT">
- <description>
- You may only specify a time in force on either the place request OR on individual limit order
- instructions (not both), since the implied behaviors are incompatible.
- </description>
- </value>
- <value name="UNEXPECTED_PERSISTENCE_TYPE">
- <description>
- You have specified a persistence type for a FILL_OR_KILL order, which is nonsensical because no umatched portion
- can remain after the order has been placed.
- </description>
- </value>
- <value name="INVALID_ORDER_TYPE">
- <description>You have specified a time in force of FILL_OR_KILL, but have included a non-LIMIT order type.</description>
- </value>
- <value name="UNEXPECTED_MIN_FILL_SIZE">
- <description>
- You have specified a minFillSize on a limit order, where the limit order's time in force is not FILL_OR_KILL.
- Using minFillSize is not supported where the time in force of the request (as opposed to an order) is FILL_OR_KILL.
- </description>
- </value>
- <value name="INVALID_CUSTOMER_STRATEGY_REF">
- <description>
- The supplied customer strategy reference is too long.
- </description>
- </value>
- <value name="BET_LAPSED_PRICE_IMPROVEMENT_TOO_LARGE">
- <description>
- Your bet is lapsed. There is better odds than requested available in the market, but your
- preferences don't allow the system to match your bet against better odds. Change your betting
- preferences to accept better odds if you don't want to receive this error.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="RollupModel" type="string">
- <validValues>
- <value name="STAKE">
- <description>
- The volumes will be rolled up to the minimum value which is >= rollupLimit.
- </description>
- </value>
- <value name="PAYOUT">
- <description>
- The volumes will be rolled up to the minimum value where the payout( price * volume ) is >= rollupLimit.
- On a LINE market, volumes will be rolled up where payout( 2.0 * volume ) is >= rollupLimit.
- </description>
- </value>
- <value name="MANAGED_LIABILITY">
- <description>
- The volumes will be rolled up to the minimum value which is >= rollupLimit, until a lay price
- threshold.
- There after, the volumes will be rolled up to the minimum value such that the liability >= a minimum
- liability.
- Not supported as yet.
- </description>
- </value>
- <value name="NONE">
- <description>
- No rollup will be applied. However the volumes will be filtered by currency specific minimum stake
- unless overridden specifically for the channel.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="GroupBy" type="string">
- <validValues>
- <value name="EVENT_TYPE">
- <description>A roll up of settled P&amp;L, commission paid and number of bet orders, on a specified
- event type
- </description>
- </value>
- <value name="EVENT">
- <description>A roll up of settled P&amp;L, commission paid and number of bet orders, on a specified
- event
- </description>
- </value>
- <value name="MARKET">
- <description>A roll up of settled P&amp;L, commission paid and number of bet orders, on a specified
- market
- </description>
- </value>
- <value name="RUNNER">
- <description>A roll up of settled P&amp;L and the number of bet orders, on a specified runner within a
- specified market
- </description>
- </value>
- <value name="SIDE">
- <description>An averaged roll up of settled P&amp;L, and number of bets, on the specified side of a
- specified selection within a specified market, that are either settled or voided
- </description>
- </value>
- <value name="BET">
- <description>The P&amp;L, commission paid, side and regulatory information etc, about each individual
- bet order
- </description>
- </value>
- <value name="STRATEGY">
- <description>A roll up of settled P&amp;L and the number of bet orders, on a specified strategy across
- the Betfair Exchange
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="BetStatus" type="string">
- <validValues>
- <value name="SETTLED">
- <description>A matched bet that was settled normally</description>
- </value>
- <value name="VOIDED">
- <description>A matched bet that was subsequently voided by Betfair, before, during or after settlement
- </description>
- </value>
- <value name="LAPSED">
- <description>Unmatched bet that was cancelled by Betfair (for example at turn in play).</description>
- </value>
- <value name="CANCELLED">
- <description>Unmatched bet that was cancelled by an explicit customer action.</description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="TimeInForce" type="string">
- <validValues>
- <value name="FILL_OR_KILL">
- <description>
- Execute the transaction immediately and completely (filled to size or between minFillSize and size) or not at all (cancelled).
- For LINE markets Volume Weighted Average Price (VWAP) functionality is disabled.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="BetTargetType" type="string">
- <validValues>
- <value name="PAYOUT">
- <description>
- The total payout requested on a LimitOrder.
- BetTargetType bets are invalid for LINE markets.
- </description>
- </value>
- <value name="BACKERS_PROFIT">
- <description>
- The payout requested minus the calculated size at which this LimitOrder is to be placed.
- BetTargetType bets are invalid for LINE markets.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="PriceLadderType" type="string">
- <validValues>
- <value name="CLASSIC">
- <description>Price ladder increments traditionally used for Odds Markets.
- </description>
- </value>
- <value name="FINEST">
- <description> Price ladder with the finest available increment, traditionally used for
- Asian Handicap markets.
- </description>
- </value>
- <value name="LINE_RANGE">
- <description> Price ladder used for LINE markets. Refer to MarketLineRangeInfo for more details.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="MarketGroupType" type="string">
- <validValues>
- <value name="EVENT">
- <description>
- An exchange event that has markets under it.
- EventId should be used as groupId parameter of MarketGroup type.
- </description>
- </value>
- </validValues>
- </simpleType>
-
- <simpleType name="LimitBreachActionType" type="string">
- <validValues>
- <value name="REJECT_BETS">
- <description>
- Bet placements for market group will be rejected if they breach limit.
- For every bet placement exposure values will be compared against limit values.
- </description>
- </value>
- <value name="STOP_BETTING">
- <description>
- Bet placements for market group will be rejected.
- Once the limit is breached account should use unblockMarketGroup to unlock market group.
-
- Note that this type is only applicable to matched exposure limit
- </description>
- </value>
- <value name="TEAR_DOWN_MARKET_GROUP">
- <description>
- Bet placements for market group will be rejected. Service will initiate a request to cancel unmatched bets under market group.
- Once the limit is breached account should use unblockMarketGroup to unlock market group.
-
- Note that this type is only applicable to matched exposure limit
- </description>
- </value>
- </validValues>
- </simpleType>
-</interface>
diff --git a/genapi/SportsAPING.xml.SHA256SUM b/genapi/SportsAPING.xml.SHA256SUM
new file mode 100644
index 0000000..4ee0c39
--- /dev/null
+++ b/genapi/SportsAPING.xml.SHA256SUM
@@ -0,0 +1 @@
+2ca10c0376ac5d64bb80620c993bcbf26c646f8c1f7b873a0e1f6f91a4f1ce07 SportsAPING.xml
diff --git a/genapi/SportsAPING.xml.patch b/genapi/SportsAPING.xml.patch
new file mode 100644
index 0000000..29a3ecf
--- /dev/null
+++ b/genapi/SportsAPING.xml.patch
@@ -0,0 +1,11 @@
+--- SportsAPING.xml 2019-10-26 23:59:42.396665946 +0200
++++ SportsAPING.xml.new 2019-10-27 00:24:13.473332462 +0200
+@@ -1204,7 +1204,7 @@
+ <parameter mandatory="true" name="status" type="string">
+ <description>The status of the selection (i.e., ACTIVE, REMOVED, WINNER, LOSER)</description>
+ </parameter>
+- <parameter mandatory="true" name="adjustmentFactor" type="double">
++ <parameter name="adjustmentFactor" type="double">
+ <description>The adjustment factor applied if the selection is removed</description>
+ </parameter>
+ <parameter name="lastPriceTraded" type="double">
diff --git a/genapi/main.py b/genapi/main.py
index f8df9e2..5061e52 100755
--- a/genapi/main.py
+++ b/genapi/main.py
@@ -1,4 +1,19 @@
#!/usr/bin/env python3
+# SPDX-Copyright: Copyright (c) 2019 Daniel Edgecumbe (esotericnonsense)
+# SPDX-License-Identifier: AGPL-3.0-only
+#
+# This file is part of botfair. botfair is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero General
+# Public License as published by the Free Software Foundation, either version
+# 3 of the License, or (at your option) any later version.
+#
+# botfair is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
+# for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with botfair. If not, see <http://www.gnu.org/licenses/>.
from typing import Optional, List, Tuple
from xml.etree.ElementTree import Element, parse
@@ -655,12 +670,12 @@ Result<{resp_type}>"""
def main() -> None:
- tree = parse("SportsAPING.xml")
+ tree = parse("SportsAPING.patched.xml")
aping: APING = parse_aping(tree.getroot())
# print(aping.to_json())
- print("// This file is generated.")
- print("// Any manual edits will be overwritten.")
+ print("// This file has been automatically generated.")
+ print("// Any manual edits may be overwritten.")
print()
print("#![allow(non_camel_case_types)]") # TODO figure this out
print("#![allow(non_snake_case)]") # TODO figure this out
diff --git a/genapi/main.sh b/genapi/main.sh
index a5d88bf..41a4d3a 100755
--- a/genapi/main.sh
+++ b/genapi/main.sh
@@ -1,12 +1,79 @@
#!/usr/bin/env bash
-set -euxo pipefail
+# SPDX-Copyright: Copyright (c) 2019 Daniel Edgecumbe (esotericnonsense)
+# SPDX-License-Identifier: AGPL-3.0-only
+#
+# This file is part of botfair. botfair is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero General
+# Public License as published by the Free Software Foundation, either version
+# 3 of the License, or (at your option) any later version.
+#
+# botfair is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
+# for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with botfair. If not, see <http://www.gnu.org/licenses/>.
-# First:
-# $ python3 -m virtualenv env
-# $ source env/bin/activate
-# $ pip install -r requirements.txt
+set -euo pipefail
+
+echo "Generating bindings from the Betfair XML." >&2
+echo "---" >&2
+
+_env=$(mktemp -d)
+trap 'rm -rf "${_env}"' exit
+
+if [[ -d "${_env}/bin" ]]; then
+ echo "Virtualenv should not exist, but it does. Exiting." >&2
+ exit 1
+fi
+
+echo "Creating virtualenv" >&2
+python3 -m virtualenv "${_env}"
+
+# We assume that if a venv is present, it's the correct one
+set +u # cannot activate a venv with -u
+if [[ -n $VIRTUAL_ENV ]]; then
+ echo "Should not be in a virtualenv, but we are. Exiting." >&2
+ exit 1
+fi
+
+# shellcheck source=/dev/null
+. "${_env}/bin/activate"
+
+if [[ -z $VIRTUAL_ENV ]]; then
+ echo "Sourced virtualenv, but not in virtualenv. Exiting." >&2
+ exit 1
+fi
+set -u
+
+echo "Installing requirements into virtualenv..." >&2
+pip install -q -r requirements.txt
+
+if [[ ! -f "SportsAPING.xml" ]]; then
+ echo "Downloading API docs..." >&2
+ curl -OL https://docs.developer.betfair.com/download/attachments/4392337/SportsAPING.xml
+ echo "done"
+else
+ echo "API docs already present, not downloading." >&2
+fi
+
+echo "Checking API documentation checksum" >&2
+sha256sum -c SportsAPING.xml.SHA256SUM
+
+if [[ ! -f "SportsAPING.patched.xml" ]]; then
+ echo "Patching API docs..." >&2
+ patch -o "SportsAPING.patched.xml" "SportsAPING.xml" \
+ < "SportsAPING.xml.patch"
+ echo "done"
+else
+ echo "API docs already patched" >&2
+fi
_output="$(realpath ../src/generated_api.rs)"
-echo "Writing generated API to ${_output}"
+echo "Writing generated API to ${_output}" >&2
./main.py | rustfmt --config max_width=79 > "${_output}"
+
+echo "---" >&2
+echo "Done!" >&2
diff --git a/src/json_rpc.rs b/src/json_rpc.rs
index 22ab04e..6725666 100644
--- a/src/json_rpc.rs
+++ b/src/json_rpc.rs
@@ -1,3 +1,19 @@
+// SPDX-Copyright: Copyright (c) 2019 Daniel Edgecumbe (esotericnonsense)
+// SPDX-License-Identifier: AGPL-3.0-only
+//
+// This file is part of botfair. botfair is free software: you can
+// redistribute it and/or modify it under the terms of the GNU Affero General
+// Public License as published by the Free Software Foundation, either version
+// 3 of the License, or (at your option) any later version.
+//
+// botfair is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
+// for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with botfair. If not, see <http://www.gnu.org/licenses/>.
+
use serde::{Deserialize, Serialize};
#[derive(Serialize)]
diff --git a/src/lib.rs b/src/lib.rs
index 416da15..d19467e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,19 @@
+// SPDX-Copyright: Copyright (c) 2019 Daniel Edgecumbe (esotericnonsense)
+// SPDX-License-Identifier: AGPL-3.0-only
+//
+// This file is part of botfair. botfair is free software: you can
+// redistribute it and/or modify it under the terms of the GNU Affero General
+// Public License as published by the Free Software Foundation, either version
+// 3 of the License, or (at your option) any later version.
+//
+// botfair is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
+// for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with botfair. If not, see <http://www.gnu.org/licenses/>.
+
#[macro_use]
extern crate log;