public static async void ClientTest() { string clientName = String.Format("Very Big Company {0} {1}", DateTime.Now.ToString("h:mm:ss tt"), DateTime.Now.ToString("dd/MM/yyyy")); string newClientName = String.Format("A really Very Big Company {0} {1}", DateTime.Now.ToString("h:mm:ss tt"), DateTime.Now.ToString("dd/MM/yyyy")); string notes = "Notes on a really very big company."; TogglSharpAPI.V8.Client client = await TogglSharpAPI.V8.Client.Create(clientName, MeV8.DefaultWId); TogglSharpAPI.V8.Client clientTwo = await TogglSharpAPI.V8.Client.Retrieve(client.Id); if (client.Id != clientTwo.Id) { throw new Exception("Client ID's don't match."); } client = await client.Update(newClientName, notes); List <TogglSharpAPI.V8.Project> projects = await client.RetrieveProjects(); if (projects == null) { Debug.WriteLine("Projects is NULL but it could be that there are no projects."); } List <TogglSharpAPI.V8.Client> myClients = await TogglSharpAPI.V8.Client.Retrieve(); if (myClients == null) { throw new Exception("No clients found, expected to find at the least the client created above."); } Debugger.Break(); await client.Delete(); Debugger.Break(); }
public static async void ListClientProjects() { if (MeV8.Clients.Count > 0) { TogglSharpAPI.V8.Client client = MeV8.Clients.First(); var projects = await client.RetrieveProjects(TogglSharpAPI.V8.Client.Active.Both); Debugger.Break(); } else { throw new Exception("No clients to retrieve"); } }