コード例 #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);
        }
コード例 #2
0
 public void DeleteBoard()
 {
     foreach (string id in helper.GetIds())
     {
         var request = new TrelloRequest(resource: "boards/" + id);
         RequestManager.Delete(TrelloClient.GetInstance(), request);
     }
 }
コード例 #3
0
        public async Task Test()
        {
            var trelloClient = new TrelloClient();

            var me = await trelloClient.CurrentUserProfileAsync();

            Console.WriteLine(me);
        }
コード例 #4
0
 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;
 }
コード例 #5
0
        public async Task Org()
        {
            var trelloClient = new TrelloClient();

            var org = await trelloClient.Organizations();

            foreach (var organizations in org)
            {
                Console.WriteLine(organizations);
            }
        }
コード例 #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);

                ;
            }
        }
コード例 #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);
        }
コード例 #8
0
        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"));
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #11
0
        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);
        }
コード例 #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);
                    }
                }
            }
        }
コード例 #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)))
 {
 }
コード例 #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)))
 {
 }
コード例 #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)))
 {
 }
コード例 #16
0
 public TrelloController(TrelloService trelloService, TrelloClient trelloClient)
 {
     this.trelloService = trelloService;
     this.trelloClient  = trelloClient;
 }
コード例 #17
0
 public TrelloService(TrelloClient trelloClient, IEmailService emailService)
 {
     this.trelloClient = trelloClient;
     this.emailService = emailService;
 }
コード例 #18
0
 public void CleanUp()
 {
     _trelloFake   = null;
     _trelloClient = null;
 }
コード例 #19
0
 public TrelloService(ITrelloStatsConfiguration configuration, TrelloClient trelloClient)
 {
     _configuration = configuration;
     _trelloClient = trelloClient;
 }
コード例 #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)))
 {
 }