Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StatementEvent2" /> class.
 /// </summary>
 /// <param name="contractSelections"> These particular contracts are not related to markets in the same way that most contracts are related to markets.&lt;br&gt; The contract_selections field is only set for accumulator markets and it refers to the contract IDs that the acca is made up of, an example:&lt;br&gt; &lt;br&gt; M1 (Winner market in Man Utd - Liverpool) &lt;ul&gt; &lt;li&gt;M1-C1 (Man Utd) &lt;li&gt;M1-C2 (Draw) &lt;li&gt;M1-C3 (Liverpool) &lt;/ul&gt; &lt;/ul&gt; M2 (Winner market in Arsenal - Chelsea) &lt;ul&gt; &lt;li&gt;M2-C1 (Arsenal) &lt;li&gt;M2-C2 (Draw) &lt;li&gt;M2-C3 (Chelsea) &lt;/ul&gt; &lt;br&gt; Now an accumulator market is created:&lt;br&gt; M3 (Man Utd and Arsenal both to win on 23rd of February) &lt;ul&gt; &lt;li&gt;M3-C1 (Yes) &lt;li&gt;M3-C2 (No) &lt;/ul&gt; &lt;br&gt; In this case, M3 will have two contracts (M3-C1 and M3-C2) but contract_selections will be M1-C1 (Man Utd) and M2-C1 (Arsenal).&lt;br&gt; (required).</param>
 /// <param name="marketType">marketType (required).</param>
 /// <param name="name"> Name of the market. This field is for display purposes and should not be used to identify the market.&lt;br&gt; The market_type field should be used instead. (required).</param>
 public StatementEvent2(List <int?> contractSelections = default(List <int?>), AccountActivityResponseMarketType marketType = default(AccountActivityResponseMarketType), string name = default(string))
 {
     // to ensure "contractSelections" is required (not null)
     if (contractSelections == null)
     {
         throw new InvalidDataException("contractSelections is a required property for StatementEvent2 and cannot be null");
     }
     else
     {
         this.ContractSelections = contractSelections;
     }
     // to ensure "marketType" is required (not null)
     if (marketType == null)
     {
         throw new InvalidDataException("marketType is a required property for StatementEvent2 and cannot be null");
     }
     else
     {
         this.MarketType = marketType;
     }
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for StatementEvent2 and cannot be null");
     }
     else
     {
         this.Name = name;
     }
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Market" /> class.
 /// </summary>
 /// <param name="betDelay">How much is the bet delay for this market,\&quot; the interval between order placement and acceptance (required).</param>
 /// <param name="cashoutEnabled"> Cashout enabled determines whether instant cashout is enabled for this market. If true, trading out of this market will cause the settlement result to be immediatelly reflected in the customer&#x27;s balance (before the final settlement of the market). (required).</param>
 /// <param name="category">Category of this market.</param>
 /// <param name="complete">Complete markets cannot have additional contracts added after market creation (required).</param>
 /// <param name="contractSelections"> These particular contracts are not related to markets in the same way that most contracts are related to markets.&lt;br&gt; The contract_selections field is only set for accumulator markets and it refers to the contract IDs that the acca is made up of, an example:&lt;br&gt; &lt;br&gt; M1 (Winner market in Man Utd - Liverpool) &lt;ul&gt; &lt;li&gt;M1-C1 (Man Utd) &lt;li&gt;M1-C2 (Draw) &lt;li&gt;M1-C3 (Liverpool) &lt;/ul&gt; &lt;/ul&gt; M2 (Winner market in Arsenal - Chelsea) &lt;ul&gt; &lt;li&gt;M2-C1 (Arsenal) &lt;li&gt;M2-C2 (Draw) &lt;li&gt;M2-C3 (Chelsea) &lt;/ul&gt; &lt;br&gt; Now an accumulator market is created:&lt;br&gt; M3 (Man Utd and Arsenal both to win on 23rd of February) &lt;ul&gt; &lt;li&gt;M3-C1 (Yes) &lt;li&gt;M3-C2 (No) &lt;/ul&gt; &lt;br&gt; In this case, M3 will have two contracts (M3-C1 and M3-C2) but contract_selections will be M1-C1 (Man Utd) and M2-C1 (Arsenal).&lt;br&gt;.</param>
 /// <param name="created">When was the market created in the Smarkets exchange (required).</param>
 /// <param name="description">A summary about this market.</param>
 /// <param name="displayOrder">Markets are sorted in the website according to these numbers in descending order.</param>
 /// <param name="displayType"> The display type can be used by frontend to define how the odds of the contracts of&lt;br&gt; the market will appear on the website. (required) (default to DisplayTypeEnum.Default).</param>
 /// <param name="eventId">This ID uniquely identifies an event (required).</param>
 /// <param name="hidden">Hidden markets aren&#x27;t displayed in our website (required).</param>
 /// <param name="id">This ID uniquely identifies the market (required).</param>
 /// <param name="inplayEnabled">True if trading will be open when the markets go live in-play.</param>
 /// <param name="marketType">marketType (required).</param>
 /// <param name="modified">The datetime of the last modification made by Smarkets to the market properties (required).</param>
 /// <param name="name"> Name of the market. This field is for display purposes and should not be used to identify the market.&lt;br&gt; The market_type field should be used instead. (required).</param>
 /// <param name="slug"> Slug concisely represents the market.&lt;br&gt; It should not be used to identify the market.&lt;br&gt; The market_type field should be used instead. (required).</param>
 /// <param name="state"> Market state can have the following values:&lt;br&gt; -new: just created, still not open for trading&lt;br&gt; -open: open for trading not live in-play&lt;br&gt; -live: open for trading, live in-play&lt;br&gt; -halted: trading is halted temporarily, usually due to material events&lt;br&gt; -settled: traded has ceased and the market has settled&lt;br&gt; -voided: the market was voided and no winner was chosen&lt;br&gt; -unavailable: the maret is not available for betting (required).</param>
 /// <param name="winnerCount"> How many winners will the market have.&lt;br&gt; Usually this number is 1, except for \&quot;To Place\&quot;, \&quot;Top x Finish\&quot; type markets      (required).</param>
 public Market(int?betDelay = default(int?), bool?cashoutEnabled = default(bool?), CategoryEnum?category = default(CategoryEnum?), bool?complete = default(bool?), List <int?> contractSelections = default(List <int?>), DateTime?created = default(DateTime?), string description = default(string), int?displayOrder = default(int?), DisplayTypeEnum displayType = DisplayTypeEnum.Default, string eventId = default(string), bool?hidden = default(bool?), string id = default(string), bool?inplayEnabled = default(bool?), AccountActivityResponseMarketType marketType = default(AccountActivityResponseMarketType), DateTime?modified = default(DateTime?), string name = default(string), string slug = default(string), StateEnum state = default(StateEnum), int?winnerCount = default(int?))
 {
     // to ensure "betDelay" is required (not null)
     if (betDelay == null)
     {
         throw new InvalidDataException("betDelay is a required property for Market and cannot be null");
     }
     else
     {
         this.BetDelay = betDelay;
     }
     // to ensure "cashoutEnabled" is required (not null)
     if (cashoutEnabled == null)
     {
         throw new InvalidDataException("cashoutEnabled is a required property for Market and cannot be null");
     }
     else
     {
         this.CashoutEnabled = cashoutEnabled;
     }
     // to ensure "complete" is required (not null)
     if (complete == null)
     {
         throw new InvalidDataException("complete is a required property for Market and cannot be null");
     }
     else
     {
         this.Complete = complete;
     }
     // to ensure "created" is required (not null)
     if (created == null)
     {
         throw new InvalidDataException("created is a required property for Market and cannot be null");
     }
     else
     {
         this.Created = created;
     }
     // to ensure "displayType" is required (not null)
     if (displayType == null)
     {
         throw new InvalidDataException("displayType is a required property for Market and cannot be null");
     }
     else
     {
         this.DisplayType = displayType;
     }
     // to ensure "eventId" is required (not null)
     if (eventId == null)
     {
         throw new InvalidDataException("eventId is a required property for Market and cannot be null");
     }
     else
     {
         this.EventId = eventId;
     }
     // to ensure "hidden" is required (not null)
     if (hidden == null)
     {
         throw new InvalidDataException("hidden is a required property for Market and cannot be null");
     }
     else
     {
         this.Hidden = hidden;
     }
     // to ensure "id" is required (not null)
     if (id == null)
     {
         throw new InvalidDataException("id is a required property for Market and cannot be null");
     }
     else
     {
         this.Id = id;
     }
     // to ensure "marketType" is required (not null)
     if (marketType == null)
     {
         throw new InvalidDataException("marketType is a required property for Market and cannot be null");
     }
     else
     {
         this.MarketType = marketType;
     }
     // to ensure "modified" is required (not null)
     if (modified == null)
     {
         throw new InvalidDataException("modified is a required property for Market and cannot be null");
     }
     else
     {
         this.Modified = modified;
     }
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for Market and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     // to ensure "slug" is required (not null)
     if (slug == null)
     {
         throw new InvalidDataException("slug is a required property for Market and cannot be null");
     }
     else
     {
         this.Slug = slug;
     }
     // to ensure "state" is required (not null)
     if (state == null)
     {
         throw new InvalidDataException("state is a required property for Market and cannot be null");
     }
     else
     {
         this.State = state;
     }
     // to ensure "winnerCount" is required (not null)
     if (winnerCount == null)
     {
         throw new InvalidDataException("winnerCount is a required property for Market and cannot be null");
     }
     else
     {
         this.WinnerCount = winnerCount;
     }
     this.Category           = category;
     this.ContractSelections = contractSelections;
     this.Description        = description;
     this.DisplayOrder       = displayOrder;
     this.InplayEnabled      = inplayEnabled;
 }