Esempio 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);
     }
 }
        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"));
        }