Esempio 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");
        }
Esempio n. 2
0
        internal AccountBalance(JObject obj)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");

            Credits = obj.DecValueStrict("credits");
            Currency = obj.Value<string>("currency");
        }
Esempio 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");
        }
Esempio 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");
        }
Esempio 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");
        }
Esempio 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();
        }