33 lines
956 B
C#
33 lines
956 B
C#
|
|
public class SignalIntegration
|
|
{
|
|
public static SignalIntegration Instance;
|
|
|
|
public SignalIntegration(string uri, int port, string phoneNumber)
|
|
{
|
|
var http = new HttpClient() {
|
|
BaseAddress = new Uri("http://" + uri + ":" + port)
|
|
};
|
|
apiClient = new song_of_the_day.swaggerClient(http);
|
|
apiClient.BaseUrl = "";
|
|
this.phoneNumber = phoneNumber;
|
|
}
|
|
|
|
private song_of_the_day.swaggerClient apiClient;
|
|
|
|
private string phoneNumber;
|
|
|
|
public async Task ListGroups()
|
|
{
|
|
Console.WriteLine("listing groups");
|
|
try {
|
|
ICollection<song_of_the_day.GroupEntry> groupEntries = await apiClient.GroupsAllAsync(this.phoneNumber);
|
|
Console.WriteLine($"{groupEntries.Count} groups");
|
|
}
|
|
catch (Exception ex) {
|
|
Console.WriteLine("Exception: " + ex.Message);
|
|
}
|
|
|
|
Console.WriteLine("listing groups done");
|
|
}
|
|
} |