add some initial stuff
This commit is contained in:
33
song_of_the_day/MessengerIntegration/SignalIntegration.cs
Normal file
33
song_of_the_day/MessengerIntegration/SignalIntegration.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user