/// <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 DeleteProject() { foreach (string id in helper.GetIds()) { var request = new PivotalRequest("projects/" + id); RequestManager.Delete(PivotalClient.GetInstance(), request); } }
public SlackRequestProcessor() { _triggerWordMap = new Dictionary <CommandType, Func <SlackResponse> > { { CommandType.Help, Help }, { CommandType.Info, Info }, { CommandType.SetProjectId, SetProjectId }, { CommandType.AddTasks, AddTasks }, { CommandType.AddStory, AddStory }, { CommandType.AddDefaultTask, AddDefaultTask }, { CommandType.ClearDefaultTasks, ClearDefaultTasks }, { CommandType.SetDefaultTasksFromJson, SetDefaultTasksFromJson }, { CommandType.RandomFractal, RandomFractal }, { CommandType.AddCats, AddCats }, { CommandType.YouTube, YouTube }, { CommandType.Imgur, Imgur }, { CommandType.GoogleBooks, GoogleBooks }, { CommandType.GoogleVision, GoogleVision }, { CommandType.SendText, SendText }, { CommandType.SearchRepos, SearchRepos } }; _databaseClient = !string.IsNullOrEmpty(ConfigurationManager.AppSettings["SqlConnectionString"]) ? (IDatabaseClient) new SqlDatabaseClient() : new RavenDatabaseClient(); _pivotalClient = new PivotalClient(); _fractalClient = new FractalClient(); _bitlyClient = new BitlyClient(); _catApiClient = new CatApiClient(); _imgurClient = new ImgurClient(); _youTubeClient = new YouTubeClient(); _googleVisionClient = new GoogleVisionClient(); _googleBooksClient = new GoogleBooksClient(); _textBeltClient = new TextBeltClient(); _gitHubClient = new GitHubClient(); _validator = new RequestValidator(); }