Exemplo n.º 1
0
        internal Feedback(JObject obj)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");

            CommentForTranslator = obj.Value<string>("for_translator");
            Rating = (Stars)(int)obj.DecValueStrict("rating");
        }
Exemplo n.º 2
0
        internal AccountBalance(JObject obj)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");

            Credits = obj.DecValueStrict("credits");
            Currency = obj.Value<string>("currency");
        }
Exemplo n.º 3
0
        internal AccountStats(JObject obj)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");

            CreditsSpent = obj.DecValueStrict("credits_spent");
            Currency = obj.Value<string>("currency");
            UserSince = obj.DateValueStrict("user_since");
        }
Exemplo n.º 4
0
        internal LanguagePair(JObject obj)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");

            FromLanguage = obj.Value<string>("lc_src");
            ToLanguage = obj.Value<string>("lc_tgt");
            Tier = obj.Value<string>("tier").ToTranslationTier();
            Currency = obj.Value<string>("currency");
            UnitPrice = obj.DecValueStrict("unit_price");
        }
Exemplo n.º 5
0
        internal Order(JObject obj)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");

            OrderId = obj.IntValueStrict("order_id");
            Currency = obj.Value<string>("currency");

            TotalCredits = obj.DecValueStrict("total_credits");
            TotalUnits = obj.IntValueStrict("total_units");

            UseSameTranslator = obj.BoolValueStrict("as_group");

            QueuedJobs = obj.IntValueStrict("jobs_queued");
            TotalJobs = obj.IntValueStrict("total_jobs");

            AvailableJobs = obj.ReadIntArrayAsRoList("jobs_available");
            PendingJobs = obj.ReadIntArrayAsRoList("jobs_pending");
            ReviewableJobs = obj.ReadIntArrayAsRoList("jobs_reviewable");
            ApprovedJobs = obj.ReadIntArrayAsRoList("jobs_approved");
            RevisingJobs = obj.ReadIntArrayAsRoList("jobs_revising");
        }
Exemplo n.º 6
0
        internal Quote(JObject obj)
        {
            if (obj == null) throw new ArgumentNullException("obj");

            UnitCount = obj.IntValueStrict("unit_count");
            Credits = obj.DecValueStrict("credits");

            Currency = obj.Value<string>("currency");
            SourceLanguage = obj.Value<string>("lc_src");
            CustomData = obj.Value<string>("custom_data");

            Eta = obj.TsValueStrict("eta");
            JobType = obj.Value<string>("type").ToJobType();
        }