Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BetCancel{T}" /> class
 /// </summary>
 /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
 /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
 /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
 /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
 /// <param name="startTime">a number of milliseconds from UTC epoch representing the start of cancellation period</param>
 /// <param name="endTime">a number of milliseconds from UTC epoch representing the end of cancellation period</param>
 /// <param name="supersededBy">If the market was canceled because of a migration from a different sport event, a <see cref="T:Sportradar.OddsFeed.SDK.Messages.URN" /> specifying the sport event from which the market has migrated</param>
 /// <param name="markets">An <see cref="IEnumerable{T}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
 /// <param name="rawMessage">The raw message</param>
 public BetCancel(IMessageTimestamp timestamp, IProducer producer, T @event, long?requestId, long?startTime, long?endTime, URN supersededBy, IEnumerable <IMarketCancel> markets, byte[] rawMessage)
     : base(timestamp, producer, @event, requestId, markets, rawMessage)
 {
     StartTime    = startTime;
     EndTime      = endTime;
     SupersededBy = supersededBy;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MarketMessage{T,T1}" /> class
        /// </summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
        /// <param name="markets">An <see cref="IEnumerable{IMarket}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
        /// <param name="rawMessage">The raw message</param>
        protected MarketMessage(IMessageTimestamp timestamp, IProducer producer, T1 @event, long?requestId, IEnumerable <T> markets, byte[] rawMessage)
            : base(timestamp, producer, @event, requestId, rawMessage)
        {
            Guard.Argument(@event, nameof(@event)).Require(@event != null);

            _markets = markets == null ? null : new ReadOnlyCollection <T>(markets.ToList());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FixtureChange{T}" /> class
 /// </summary>
 /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
 /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
 /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
 /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
 /// <param name="changeType">A <see cref="FixtureChangeType"/> indicating how the fixture was changed (added, re-scheduled, ...)</param>
 /// <param name="nextLiveTime">The next live time</param>
 /// <param name="startTime">A value specifying the start time of the fixture in milliseconds since EPOCH UTC </param>
 /// <param name="rawMessage">The raw message</param>
 public FixtureChange(IMessageTimestamp timestamp, IProducer producer, T @event, long?requestId, FixtureChangeType changeType, long?nextLiveTime, long startTime, byte[] rawMessage)
     : base(timestamp, producer, @event, requestId, rawMessage)
 {
     ChangeType   = changeType;
     NextLiveTime = nextLiveTime;
     StartTime    = startTime;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Message" /> class
        /// </summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        protected Message(IMessageTimestamp timestamp, IProducer producer)
        {
            Guard.Argument(timestamp, nameof(timestamp)).NotNull();

            Timestamps = timestamp;
            Producer   = producer;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Message" /> class
        /// </summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        protected Message(IMessageTimestamp timestamp, IProducer producer)
        {
            Contract.Requires(timestamp != null);

            Timestamp  = timestamp.Created;
            Timestamps = timestamp;
            Producer   = producer;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventMessage{T}" /> class
        /// </summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
        /// <param name="rawMessage">The raw message </param>
        protected EventMessage(IMessageTimestamp timestamp, IProducer producer, T @event, long?requestId, byte[] rawMessage)
            : base(timestamp, producer)
        {
            Contract.Requires(@event != null);

            Event      = @event;
            RequestId  = requestId;
            RawMessage = rawMessage;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventMessage{T}" /> class
        /// </summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
        /// <param name="rawMessage">The raw message </param>
        protected EventMessage(IMessageTimestamp timestamp, IProducer producer, T @event, long?requestId, byte[] rawMessage)
            : base(timestamp, producer)
        {
            Guard.Argument(@event, nameof(@event)).Require(@event != null);

            Event      = @event;
            RequestId  = requestId;
            RawMessage = rawMessage;
        }
Ejemplo n.º 8
0
        /// <summary>Initializes a new instance of the <see cref="OddsChange{T}" /> class</summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="betStopReason">The <see cref="BetStopReason" /> enum member specifying the reason for betting being stopped, or a null reference if the reason is not known</param>
        /// <param name="bettingStatus">A <see cref="BettingStatus"/> enum indicating whether the betting should be allowed</param>
        /// <param name="markets">An <see cref="IMarketMessage{T,T1}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
        /// <param name="namedValuesProvider">The <see cref="INamedValuesProvider"/> used to provide names for betting status and bet stop reason</param>
        /// <param name="rawMessage">The raw message</param>
        public CashOutProbabilities(IMessageTimestamp timestamp, IProducer producer, T @event, int?betStopReason, int?bettingStatus, IEnumerable <IMarketWithProbabilities> markets, INamedValuesProvider namedValuesProvider, byte[] rawMessage)
            : base(timestamp, producer, @event, null, markets, rawMessage)
        {
            Guard.Argument(namedValuesProvider, nameof(namedValuesProvider)).NotNull();

            _betStopReason      = betStopReason;
            _bettingStatus      = bettingStatus;
            _namedValueProvider = namedValuesProvider;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventMessage{T}" /> class
        /// </summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="competition">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
        /// <param name="rawMessage">The raw message </param>
        protected EventMessage(IMessageTimestamp timestamp, IProducer producer, T competition, long?requestId, byte[] rawMessage)
            : base(timestamp, producer)
        {
            Guard.Argument(competition, nameof(competition)).Require(competition != null);

            Event      = competition;
            RequestId  = requestId;
            RawMessage = rawMessage;
        }
        /// <summary>Initializes a new instance of the <see cref="OddsChange{T}" /> class</summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="betStopReason">The <see cref="BetStopReason" /> enum member specifying the reason for betting being stopped, or a null reference if the reason is not known</param>
        /// <param name="bettingStatus">A <see cref="BettingStatus"/> enum indicating whether the betting should be allowed</param>
        /// <param name="markets">An <see cref="IMarketMessage{T,T1}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
        /// <param name="namedValuesProvider">The <see cref="INamedValuesProvider"/> used to provide names for betting status and bet stop reason</param>
        /// <param name="rawMessage">The raw message</param>
        public CashOutProbabilities(IMessageTimestamp timestamp, IProducer producer, T @event, int?betStopReason, int?bettingStatus, IEnumerable <IMarketWithProbabilities> markets, INamedValuesProvider namedValuesProvider, byte[] rawMessage)
            : base(timestamp, producer, @event, null, markets, rawMessage)
        {
            Contract.Requires(namedValuesProvider != null);

            _betStopReason      = betStopReason;
            _bettingStatus      = bettingStatus;
            _namedValueProvider = namedValuesProvider;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MarketMessage{T,T1}" /> class
        /// </summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
        /// <param name="markets">An <see cref="IEnumerable{IMarket}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
        /// <param name="rawMessage">The raw message</param>
        protected MarketMessage(IMessageTimestamp timestamp, IProducer producer, T1 @event, long?requestId, IEnumerable <T> markets, byte[] rawMessage)
            : base(timestamp, producer, @event, requestId, rawMessage)
        {
            Contract.Requires(@event != null);

            if (markets != null && markets.Any())
            {
                _markets = markets as IReadOnlyCollection <T> ?? new ReadOnlyCollection <T>(markets.ToList());
            }
        }
Ejemplo n.º 12
0
        /// <summary>Initializes a new instance of the <see cref="OddsChange{T}" /> class</summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
        /// <param name="changeReason">a <see cref="EventMessage{T}" /> member specifying the reason for the odds change</param>
        /// <param name="betStopReason">the <see cref="BetStopReason" /> enum member specifying the reason for betting being stopped, or a null reference if the reason is not known</param>
        /// <param name="bettingStatus">a <see cref="BettingStatus"/> enum indicating whether the betting should be allowed</param>
        /// <param name="markets">An <see cref="IMarketMessage{T,T1}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
        /// <param name="oddsGenerationProperties">Provided by the prematch odds producer only, and contains a few key-parameters that can be used in a client’s own special odds model, or even offer spread betting bets based on it</param>
        /// <param name="namedValuesProvider">The <see cref="INamedValuesProvider"/> used to provide names for betting status and bet stop reason</param>
        /// <param name="rawMessage">The raw message</param>
        public OddsChange(IMessageTimestamp timestamp, IProducer producer, T @event, long?requestId, OddsChangeReason?changeReason, int?betStopReason, int?bettingStatus, IEnumerable <IMarketWithOdds> markets, oddsGenerationProperties oddsGenerationProperties, INamedValuesProvider namedValuesProvider, byte[] rawMessage)
            : base(timestamp, producer, @event, requestId, markets, rawMessage)
        {
            Guard.Argument(namedValuesProvider, nameof(namedValuesProvider)).NotNull();

            _namedValueProvider      = namedValuesProvider;
            ChangeReason             = changeReason;
            _betStopReason           = betStopReason;
            _bettingStatus           = bettingStatus;
            OddsGenerationProperties = oddsGenerationProperties == null
                                           ? null
                                           : new OddsGeneration(oddsGenerationProperties);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BetSettlement{T}" /> class
 /// </summary>
 /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
 /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
 /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
 /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
 /// <param name="markets">An <see cref="IEnumerable{T}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
 /// <param name="certainty">A <see cref="IBetSettlement{T}"/> certainty</param>
 /// <param name="rawMessage">The raw message</param>
 public BetSettlement(IMessageTimestamp timestamp,
                      IProducer producer,
                      T @event,
                      long?requestId,
                      IEnumerable <IMarketWithSettlement> markets,
                      int certainty,
                      byte[] rawMessage)
     : base(timestamp, producer, @event, requestId, markets, rawMessage)
 {
     if (certainty == 1)
     {
         Certainty = BetSettlementCertainty.LiveScouted;
     }
     else if (certainty == 2)
     {
         Certainty = BetSettlementCertainty.Confirmed;
     }
     else
     {
         Certainty = BetSettlementCertainty.Unknown;
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RollbackBetSettlement{T}" /> message
 /// </summary>
 /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
 /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
 /// <param name="competition">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
 /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
 /// <param name="markets">An <see cref="IMarketMessage{T,T1}" /> describing markets associated with the current <see cref="EventMessage{T}" /></param>
 /// <param name="rawMessage">The raw message</param>
 public RollbackBetSettlement(IMessageTimestamp timestamp, IProducer producer, T competition, long?requestId, IEnumerable <IMarketCancel> markets, byte[] rawMessage)
     : base(timestamp, producer, competition, requestId, markets, rawMessage)
 {
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BetStop{T}" /> class
 /// </summary>
 /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
 /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
 /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
 /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
 /// <param name="marketStatus">a <see cref="MarketStatus" /> specifying the new status of the associated markets</param>
 /// <param name="groups">a list of <see cref="string"/> specifying which market groups needs to be stopped</param>
 /// <param name="rawMessage">The raw message</param>
 public BetStop(IMessageTimestamp timestamp, IProducer producer, T @event, long?requestId, MarketStatus marketStatus, IEnumerable <string> groups, byte[] rawMessage)
     : base(timestamp, producer, @event, requestId, rawMessage)
 {
     MarketStatus = marketStatus;
     Groups       = groups;
 }
Ejemplo n.º 16
0
 private void WriteSportEntity(string msgType, ISportEvent message, IMessageTimestamp timestamp)
 {
     _log.Debug($"{msgType.Replace("`1", string.Empty)} message for eventId {message.Id}. Timestamp={timestamp?.Created}.");
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Alive" /> class
 /// </summary>
 /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
 /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
 /// <param name="subscribed">A value indicating whether the SDK is subscribed to the producer specified by the <see cref="IProducer" /> property</param>
 internal Alive(IMessageTimestamp timestamp, IProducer producer, bool subscribed)
     : base(timestamp, producer)
 {
     Subscribed = subscribed;
 }
 /// <summary>
 /// </summary>
 /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
 /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
 /// <param name="requestId">the id of the request which triggered the current <see cref="SnapshotCompleted" /> message</param>
 public SnapshotCompleted(IMessageTimestamp timestamp, IProducer producer, long requestId)
     : base(timestamp, producer)
 {
     RequestId = requestId;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RollbackBetCancel{T}" /> class
 /// </summary>
 /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
 /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
 /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
 /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
 /// <param name="startTime">The number of milliseconds from UTC epoch representing the start of rollback cancellation period</param>
 /// <param name="endTime">The number of milliseconds from UTC epoch representing the end of rollback cancellation period</param>
 /// <param name="markets">An <see cref="IEnumerable{T}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
 /// <param name="rawMessage">The raw message</param>
 public RollbackBetCancel(IMessageTimestamp timestamp, IProducer producer, T @event, long?requestId, long?startTime, long?endTime, IEnumerable <IMarketCancel> markets, byte[] rawMessage)
     : base(timestamp, producer, @event, requestId, markets, rawMessage)
 {
     StartTime = startTime;
     EndTime   = endTime;
 }