Beispiel #1
0
        internal static DataFeedIngestionStatus DeserializeDataFeedIngestionStatus(JsonElement element)
        {
            DateTimeOffset      timestamp = default;
            IngestionStatusType status    = default;
            string message = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("timestamp"))
                {
                    timestamp = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    status = new IngestionStatusType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("message"))
                {
                    message = property.Value.GetString();
                    continue;
                }
            }
            return(new DataFeedIngestionStatus(timestamp, status, message));
        }
        internal static DataFeedIngestionStatus DeserializeDataFeedIngestionStatus(JsonElement element)
        {
            Optional <DateTimeOffset>      timestamp = default;
            Optional <IngestionStatusType> status    = default;
            Optional <string> message = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("timestamp"))
                {
                    timestamp = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    status = new IngestionStatusType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("message"))
                {
                    message = property.Value.GetString();
                    continue;
                }
            }
            return(new DataFeedIngestionStatus(Optional.ToNullable(timestamp), Optional.ToNullable(status), message.Value));
        }
        internal DataFeedIngestionStatus(DateTimeOffset timestamp, IngestionStatusType status, string message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            Timestamp = timestamp;
            Status    = status;
            Message   = message;
        }
Beispiel #4
0
 public static DataFeedIngestionStatus DataFeedIngestionStatus(DateTimeOffset timestamp = default, IngestionStatusType status = default, string message = null)
 {
     return(new DataFeedIngestionStatus(timestamp, status, message));
 }