<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.Reflection.Emit;

namespace SurveyMonkeyApi
{
    internal class JsonSerializeGetSurveyList
    {
        public long survey_id { get; set; }
        public DateTime date_created { get; set; }
        public DateTime date_modified { get; set; }
        public string title { get; set; }
        public SMApi.LanguageIds language_id { get; set; }
        public int question_count { get; set; }
        public int num_responses { get; set; }
        public string analysis_url { get; set; }
        public string preview_url { get; set; }

        public Survey ToSurvey()
        {
            var survey = new Survey()
            {
                survey_id = survey_id,
                date_created = date_created,
                date_modified = date_modified,
                nickname = title,
                language_id = language_id,
                question_count = question_count,
                num_responses = num_responses,
                analysis_url = analysis_url,
                preview_url = preview_url
            };
            return survey;
        }
    }

    internal class JsonSerializeGetSurveyDetails
    {
        public long survey_id { get; set; }
        public DateTime date_created { get; set; }
        public DateTime date_modified { get; set; }
        public SMApi.LanguageIds language_id { get; set; }
        public int num_responses { get; set; }
        public int question_count { get; set; }
        public string nickname { get; set; }
        public Title title { get; set; }
        public List<Page> pages { get; set; }

        public Survey ToSurvey()
        {
            var survey = new Survey()
            {
                survey_id = survey_id,
                date_created = date_created,
                date_modified = date_modified,
                title_text = title.text,
                title_enabled = title.enabled,
                language_id = language_id,
                question_count = question_count,
                num_responses = num_responses,
                nickname = nickname,
                pages = pages
            };
            return survey;
        }
    }

    public class Survey
    {
        public long survey_id { get; set; }
        public DateTime date_created { get; set; }
        public DateTime date_modified { get; set; }
        public string title_text { get; set; }
        public bool title_enabled { get; set; }
        public SMApi.LanguageIds language_id { get; set; }
        public int question_count { get; set; }
        public int num_responses { get; set; }
        public string analysis_url { get; set; }
        public string preview_url { get; set; }
        public string nickname { get; set; }
        public List<Page> pages { get; set; }
        public List<Collector> collectors { get; set; }
        public List<Response> responses
        {
            get
            {
                return collectors == null ? null : collectors.SelectMany(collector => collector.responses).ToList();
            }
        }
        public List<Question> questions
        {
            get
            {
                return pages == null ? null : pages.SelectMany(page => page.questions).ToList();
            }
        }
    }

    internal class Title
    {
        public bool enabled { get; set; }
        public string text { get; set; }
    }

    public class Page
    {
        public long page_id { get; set; }
        public string heading { get; set; }
        public string sub_heading { get; set; }
        public List<Question> questions { get; set; }
    }

    public class Question
    {
        public long question_id { get; set; }
        public string heading { get; set; }
        public int position { get; set; }
        public Type type { get; set; }
        public List<QuestionAnswer> answers { get; set; }
    }

    public class Type
    {
        public SMApi.QuestionFamilies family { get; set; }
        public SMApi.QuestionSubtypes subtype { get; set; }
    }

    public class QuestionAnswer
    {
        public long answer_id { get; set; }
        public int position { get; set; }
        public string text { get; set; }
        public SMApi.AnswerTypes type { get; set; }
        public bool visible { get; set; }
        public int weight { get; set; }
        public bool apply_all_rows { get; set; }
        public bool is_answer { get; set; }
        public List<Item> items { get; set; }
    }

    public class Item
    {
        public long answer_id { get; set; }
        public int position { get; set; }
        public string type { get; set; }
        public string text { get; set; }
    }

    public class Collector
    {<commit_msg>Renaming Type -> QuestionType<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.Reflection.Emit;

namespace SurveyMonkeyApi
{
    internal class JsonSerializeGetSurveyList
    {
        public long survey_id { get; set; }
        public DateTime date_created { get; set; }
        public DateTime date_modified { get; set; }
        public string title { get; set; }
        public SMApi.LanguageIds language_id { get; set; }
        public int question_count { get; set; }
        public int num_responses { get; set; }
        public string analysis_url { get; set; }
        public string preview_url { get; set; }

        public Survey ToSurvey()
        {
            var survey = new Survey()
            {
                survey_id = survey_id,
                date_created = date_created,
                date_modified = date_modified,
                nickname = title,
                language_id = language_id,
                question_count = question_count,
                num_responses = num_responses,
                analysis_url = analysis_url,
                preview_url = preview_url
            };
            return survey;
        }
    }

    internal class JsonSerializeGetSurveyDetails
    {
        public long survey_id { get; set; }
        public DateTime date_created { get; set; }
        public DateTime date_modified { get; set; }
        public SMApi.LanguageIds language_id { get; set; }
        public int num_responses { get; set; }
        public int question_count { get; set; }
        public string nickname { get; set; }
        public Title title { get; set; }
        public List<Page> pages { get; set; }

        public Survey ToSurvey()
        {
            var survey = new Survey()
            {
                survey_id = survey_id,
                date_created = date_created,
                date_modified = date_modified,
                title_text = title.text,
                title_enabled = title.enabled,
                language_id = language_id,
                question_count = question_count,
                num_responses = num_responses,
                nickname = nickname,
                pages = pages
            };
            return survey;
        }
    }

    public class Survey
    {
        public long survey_id { get; set; }
        public DateTime date_created { get; set; }
        public DateTime date_modified { get; set; }
        public string title_text { get; set; }
        public bool title_enabled { get; set; }
        public SMApi.LanguageIds language_id { get; set; }
        public int question_count { get; set; }
        public int num_responses { get; set; }
        public string analysis_url { get; set; }
        public string preview_url { get; set; }
        public string nickname { get; set; }
        public List<Page> pages { get; set; }
        public List<Collector> collectors { get; set; }
        public List<Response> responses
        {
            get
            {
                return collectors == null ? null : collectors.SelectMany(collector => collector.responses).ToList();
            }
        }
        public List<Question> questions
        {
            get
            {
                return pages == null ? null : pages.SelectMany(page => page.questions).ToList();
            }
        }
    }

    internal class Title
    {
        public bool enabled { get; set; }
        public string text { get; set; }
    }

    public class Page
    {
        public long page_id { get; set; }
        public string heading { get; set; }
        public string sub_heading { get; set; }
        public List<Question> questions { get; set; }
    }

    public class Question
    {
        public long question_id { get; set; }
        public string heading { get; set; }
        public int position { get; set; }
        public QuestionType type { get; set; }
        public List<QuestionAnswer> answers { get; set; }
    }

    public class QuestionType
    {
        public SMApi.QuestionFamilies family { get; set; }
        public SMApi.QuestionSubtypes subtype { get; set; }
    }

    public class QuestionAnswer
    {
        public long answer_id { get; set; }
        public int position { get; set; }
        public string text { get; set; }
        public SMApi.AnswerTypes type { get; set; }
        public bool visible { get; set; }
        public int weight { get; set; }
        public bool apply_all_rows { get; set; }
        public bool is_answer { get; set; }
        public List<Item> items { get; set; }
    }

    public class Item
    {
        public long answer_id { get; set; }
        public int position { get; set; }
        public string type { get; set; }
        public string text { get; set; }
    }

    public class Collector
    {
{'fraction_non_alphanumeric': 0.07906026557711951, 'fraction_numerical': 0.0, 'mean_word_length': 1.7280579548620785, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2735089', 'n_tokens_mistral': 2639, 'n_tokens_neox': 2561, 'n_words': 816}