<commit_before>﻿using Skybrud.Social.Json;

namespace Skybrud.Social.BitBucket.Objects {

    /// <summary>
    /// Class describing a BitBucket user.
    /// </summary>
    public class BitBucketUser {

        #region Properties

        /// <summary>
        /// Gets the username of the user.
        /// </summary>
        public string Username { get; private set; }

        /// <summary>
        /// Gets the first name of the user.
        /// </summary>
        public string FirstName { get; private set; }

        /// <summary>
        /// Gets the last name of the user.
        /// </summary>
        public string LastName { get; private set; }

        /// <summary>
        /// Gets the display name of the user.
        /// </summary>
        public string DisplayName { get; private set; }

        /// <summary>
        /// Gets whether the user is team account.
        /// </summary>
        public bool IsTeam { get; private set; }

        /// <summary>
        /// Gets the secure Gravatar URL for the user's avatar.
        /// </summary>
        public string Avatar { get; private set; }

        /// <summary>
        /// Gets the relative API resource URL for the user.
        /// </summary>
        public string ResourceUri { get; private set; }

        #endregion

        #region Constructor

        internal BitBucketUser() {
            // Hide default constructor
        }

        #endregion

        #region Methods

        public static BitBucketUser Parse(JsonObject obj) {
            return new BitBucketUser {
                Username = obj.GetString("username"),
                FirstName = obj.GetString("first_name"),
                LastName = obj.GetString("last_name"),
                DisplayName = obj.GetString("display_name"),
                IsTeam = obj.GetBoolean("is_team"),
                Avatar = obj.GetString("avatar"),
                ResourceUri = obj.GetString("resource_uri")
            };
        }

        #endregion

    }

}<commit_msg>BitBucket: Input validation in BitBucketUser.Parse<commit_after>﻿using Skybrud.Social.Json;

namespace Skybrud.Social.BitBucket.Objects {

    /// <summary>
    /// Class describing a BitBucket user.
    /// </summary>
    public class BitBucketUser {

        #region Properties

        /// <summary>
        /// Gets the username of the user.
        /// </summary>
        public string Username { get; private set; }

        /// <summary>
        /// Gets the first name of the user.
        /// </summary>
        public string FirstName { get; private set; }

        /// <summary>
        /// Gets the last name of the user.
        /// </summary>
        public string LastName { get; private set; }

        /// <summary>
        /// Gets the display name of the user.
        /// </summary>
        public string DisplayName { get; private set; }

        /// <summary>
        /// Gets whether the user is team account.
        /// </summary>
        public bool IsTeam { get; private set; }

        /// <summary>
        /// Gets the secure Gravatar URL for the user's avatar.
        /// </summary>
        public string Avatar { get; private set; }

        /// <summary>
        /// Gets the relative API resource URL for the user.
        /// </summary>
        public string ResourceUri { get; private set; }

        #endregion

        #region Constructor

        internal BitBucketUser() {
            // Hide default constructor
        }

        #endregion

        #region Methods

        public static BitBucketUser Parse(JsonObject obj) {
            if (obj == null) return null;
            return new BitBucketUser {
                Username = obj.GetString("username"),
                FirstName = obj.GetString("first_name"),
                LastName = obj.GetString("last_name"),
                DisplayName = obj.GetString("display_name"),
                IsTeam = obj.GetBoolean("is_team"),
                Avatar = obj.GetString("avatar"),
                ResourceUri = obj.GetString("resource_uri")
            };
        }

        #endregion

    }

}
{'fraction_non_alphanumeric': 0.11365295692382575, 'fraction_numerical': 0.0, 'mean_word_length': 1.5122249388753055, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '4043685', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1010, 'n_words': 325}