<commit_before>﻿using Jira.SDK.Domain;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Jira.SDK
{
    public class JiraEnvironment
    {
        private IJiraClient _client;
		internal IJiraClient Client { get { return _client; } }

		public List<Field> Fields { get; private set; }

		public void Connect(IJiraClient client)
		{
			_client = client;
			Fields = _client.GetFields();
		}

        public void Connect(String url, String username, String password)
        {
            Connect(new JiraClient(url, username, password));
        }

        public List<Project> GetProjects()
        {
			List<Project> projects = _client.GetProjects();
            projects.ForEach(p => p.JiraEnvironment = this);
            return projects;
        }

        public Project GetProject(String key)
        {
            Project project = _client.GetProject(key);
            if (project != null)
            {
                project.JiraEnvironment = this;
            }
            return project;
        }

		public List<AgileBoard> GetAgileBoards()
		{
			List<AgileBoard> boards = _client.GetAgileBoards();
			boards.ForEach(board => board.Environment = this);
			return boards;
		}

        public List<IssueFilter> GetFilters()
        {
            List<IssueFilter> filters = _client.GetFavoriteFilters();
            filters.ForEach(filter => filter.JiraEnvironment = this);
            return filters;
        }
    }
}
<commit_msg>Added a method to get an agile board by ID and to get a filter by Name to the JiraEnvironment class.<commit_after>﻿using Jira.SDK.Domain;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Jira.SDK
{
    public class JiraEnvironment
    {
        private IJiraClient _client;
		internal IJiraClient Client { get { return _client; } }

		public List<Field> Fields { get; private set; }

		public void Connect(IJiraClient client)
		{
			_client = client;
			Fields = _client.GetFields();
		}

        public void Connect(String url, String username, String password)
        {
            Connect(new JiraClient(url, username, password));
        }

        public List<Project> GetProjects()
        {
			List<Project> projects = _client.GetProjects();
            projects.ForEach(p => p.JiraEnvironment = this);
            return projects;
        }

        public Project GetProject(String key)
        {
            Project project = _client.GetProject(key);
            if (project != null)
            {
                project.JiraEnvironment = this;
            }
            return project;
        }

		public List<AgileBoard> GetAgileBoards()
		{
			List<AgileBoard> boards = _client.GetAgileBoards();
			boards.ForEach(board => board.Environment = this);
			return boards;
		}

		public AgileBoard GetAgileBoard(Int32 agileBoardID)
		{
			AgileBoard board = GetAgileBoards().Where(b => b.ID == agileBoardID).FirstOrDefault();
			if (board == null)
			{
				throw new Exception(String.Format("The board with ID {0} does not exist", agileBoardID));
			}

			return board;
		}

        public List<IssueFilter> GetFilters()
        {
            List<IssueFilter> filters = _client.GetFavoriteFilters();
            filters.ForEach(filter => filter.JiraEnvironment = this);
            return filters;
        }

		public IssueFilter GetFilter(String filtername)
		{
			IssueFilter filter = GetFilters().Where(f => f.Name.Equals(filtername)).FirstOrDefault();
			if (filter == null)
			{
				throw new Exception(String.Format("The filter with name {0} does not exist", filtername));
			}

			return filter;
		}
    }
}

{'fraction_non_alphanumeric': 0.0975475337558556, 'fraction_numerical': 0.0011022320198401765, 'mean_word_length': 2.4148635936030103, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, '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': '6116440', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1015, 'n_words': 259}