Ejemplo n.º 1
0
        /// <summary>
        /// Builds client according to parameter.
        /// </summary>
        /// <param name="service">API service enum.</param>
        /// <returns>Client instance.</returns>
        public static IClient GetClient(ApisEnum service)
        {
            IClient client;

            switch (service)
            {
            case ApisEnum.Pivotal:
                client = PivotalClient.GetInstance();
                break;

            case ApisEnum.Trello:
                client = TrelloClient.GetInstance();
                break;

            case ApisEnum.Todoist:
                client = TodoistClient.GetInstance();
                break;

            case ApisEnum.Salesforce:
                client = SalesforceClient.GetInstance();
                break;

            default:
                client = PivotalClient.GetInstance();
                break;
            }

            return(client);
        }
 public void DeleteBoard()
 {
     foreach (string id in helper.GetIds())
     {
         var request = new TrelloRequest(resource: "boards/" + id);
         RequestManager.Delete(TrelloClient.GetInstance(), request);
     }
 }
Ejemplo n.º 3
0
        public async Task Test()
        {
            var trelloClient = new TrelloClient();

            var me = await trelloClient.CurrentUserProfileAsync();

            Console.WriteLine(me);
        }
 public ShopifyServiceBusTriggerManager(IOrderReader orderReader, IOrderFilter orderCreatedFilter, IOrderToTrelloCardMapper orderMapper, TrelloClient trelloClient, ILogger <ShopifyServiceBusTriggerManager> logger, SheetsClient sheetsClient)
 {
     _orderReader        = orderReader;
     _orderCreatedFilter = orderCreatedFilter;
     _orderMapper        = orderMapper;
     _trelloClient       = trelloClient;
     _logger             = logger;
     _sheetsClient       = sheetsClient;
 }
Ejemplo n.º 5
0
        public async Task Org()
        {
            var trelloClient = new TrelloClient();

            var org = await trelloClient.Organizations();

            foreach (var organizations in org)
            {
                Console.WriteLine(organizations);
            }
        }
Ejemplo n.º 6
0
        public async Task Checklists()
        {
            var trelloClient = new TrelloClient();

            foreach (var board in (await trelloClient.CurrentUserProfileAsync()).Boards)
            {
                var boards = await trelloClient.ChecklistsByBoardId(board.Id);

                ;
            }
        }
Ejemplo n.º 7
0
        public TrelloToGoogleService()
        {
            _configuration = new TrelloStatsConfiguration();
            var htmlFactory = new HtmlFactory(_configuration);
            var spreadsheetEntryFactory = new SpreadsheetEntryFactory(_configuration, htmlFactory);
            var trelloClient = new TrelloClient(_configuration);

            _googleClient = new GoogleClient(_configuration);
            _googleService = new GoogleService(_configuration, spreadsheetEntryFactory, _googleClient);
            _trelloService = new TrelloService(_configuration, trelloClient);
            _highChartsJsonService = new HighChartsJsonService(_configuration, htmlFactory);
            _timesheetService = new TimesheetService(_configuration, _googleClient);
            _boardStatsService = new BoardStatsService(_configuration);
        }
        public void CreateBoard()
        {
            var request     = new TrelloRequest(resource: "boards");
            var requestBody = $"{{\"name\": \"Board created\"}}";

            request.GetRequest().AddJsonBody(requestBody);

            // Send Request
            var response = RequestManager.Post(TrelloClient.GetInstance(), request);

            // Parse response to json object
            helper.StoreId(response.GetValue("id"));
            helper.StoreData("BOARD_ID", response.GetValue("id"));
        }
Ejemplo n.º 9
0
        public static void RegisterAuth()
        {
            // Create and register our custom Trello client as an OAuth client provider
            var trelloClient = new TrelloClient(
                consumerKey: "aaaaa",
                consumerSecret: "bbbbb",
                appName: "Custom OAuth Provider");

            OAuthWebSecurity.RegisterClient(trelloClient, "Trello", null);

            // Create and register our custom GitHub client as an OAuth client provider
            var gitHubClient = new GitHubClient(
                clientId: "ccccc",
                clientSecret: "ddddd");

            OAuthWebSecurity.RegisterClient(gitHubClient, "GitHub", null);
        }
Ejemplo n.º 10
0
        public void Init()
        {
            _trelloFake = A.Fake <ITrello>();
            var unityContainer = new UnityContainer();

            Ioc.Configure(unityContainer);
            unityContainer.RegisterInstance(_trelloFake);
            var trelloLists = new [] { new List {
                                           Name = ListName, Id = "1"
                                       } };

            A.CallTo(() => _trelloFake.Lists.ForBoard(TrelloClient.BoardId, ListFilter.All)).Returns(trelloLists);
            var config = A.Fake <ITrelloConfig>();

            A.CallTo(() => config.BoardId).Returns("id");
            _trelloClient = new TrelloClient(config);
        }
        public EmailNotificationService()
        {
            log        = LogManager.GetLogger(typeof(EmailNotificationService));
            smtpClient = new SmtpClient();

            var deployStatusConfiguration = DeployStatusSettingsSection.Settings.AsDeployConfiguration();

            performEmailNotificationCheckOnStartup = deployStatusConfiguration.PerformEmailNotificationsCheckOnStartup;
            var trelloApiConfiguration = deployStatusConfiguration.Trello;

            reportAfterDaysInColumn = trelloApiConfiguration.EmailNotificationConfiguration.ReportAfterDaysInColumn;
            trelloClient            = new TrelloClient(trelloApiConfiguration);
            deployEmailAddress      = trelloApiConfiguration.EmailResolver.GetEmail("deployalready");

            pollAtTime = new TimeSpan(9, 00, 00);

            timer = new Timer(SendEmailsIfNecessary);
        }
Ejemplo n.º 12
0
        static async Task Main(string[] args)
        {
            var credentialsService = new CredentialsService.CredentialsService();
            var credentials        = await credentialsService.GetCredentials();

            var client = new TrelloClient(
                credentials.UserName,
                credentials.ApiKey,
                credentials.ApiToken);

            var boards = await client.GetBoardsAsync();

            foreach (var board in boards)
            {
                var lists = await client.GetListsByBoardIdAsync(board.Id);

                Console.WriteLine(board.Id);
                Console.WriteLine(board.Name);
                Console.WriteLine(board.Desc);
                Console.WriteLine(board.Url);

                foreach (var list in lists)
                {
                    Console.WriteLine("\t" + list.Name);
                    Console.WriteLine("\t" + list.BoardId);

                    var cards = await client.GetCardsByListIdAsync(list.Id);

                    foreach (var card in cards)
                    {
                        Console.WriteLine("\t\t" + card.Name);
                        if (!string.IsNullOrEmpty(card.Desc))
                        {
                            Console.WriteLine("\t\tDesc: " + card.Desc);
                        }
                        Console.WriteLine("\t\t" + card.ListId);
                    }
                }
            }
        }
Ejemplo n.º 13
0
 /// <summary>
 /// </summary>
 /// <param name="restClient"></param>
 /// <param name="member"></param>
 public Organizations(TrelloClient restClient, Member member)
     : base(restClient, restClient.Request <List <Organization> >(new ByMemberOrganizationsRequest(member)))
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// </summary>
 /// <param name="restClient"></param>
 /// <param name="organization"></param>
 public Members(TrelloClient restClient, Organization organization)
     : base(restClient, restClient.Request <List <Member> >(new ByOrganizationMembers(organization)))
 {
 }
Ejemplo n.º 15
0
 /// <summary>
 /// </summary>
 /// <param name="restClient"></param>
 /// <param name="card"></param>
 public Members(TrelloClient restClient, Card card)
     : base(restClient, restClient.Request <List <Member> >(new ByCardMembersRequest(card)))
 {
 }
Ejemplo n.º 16
0
 public TrelloController(TrelloService trelloService, TrelloClient trelloClient)
 {
     this.trelloService = trelloService;
     this.trelloClient  = trelloClient;
 }
Ejemplo n.º 17
0
 public TrelloService(TrelloClient trelloClient, IEmailService emailService)
 {
     this.trelloClient = trelloClient;
     this.emailService = emailService;
 }
Ejemplo n.º 18
0
 public void CleanUp()
 {
     _trelloFake   = null;
     _trelloClient = null;
 }
Ejemplo n.º 19
0
 public TrelloService(ITrelloStatsConfiguration configuration, TrelloClient trelloClient)
 {
     _configuration = configuration;
     _trelloClient = trelloClient;
 }
Ejemplo n.º 20
0
 /// <summary>
 /// </summary>
 /// <param name="restClient"></param>
 /// <param name="board"></param>
 public Members(TrelloClient restClient, Board board)
     : base(restClient, restClient.Request <List <Member> >(new ByBoardMembersRequest(board)))
 {
 }