private async Task<GetHireGroupResult> GetHireGroupAsync(GetHireGroupRequest request)
{
string requestContents = Newtonsoft.Json.JsonConvert.SerializeObject(request);
HttpResponseMessage responseMessage = await PostHttpRequestAsync(requestContents, new Uri(GetHireGroupListUri)).ConfigureAwait(false);
if (responseMessage.IsSuccessStatusCode)
{
string stringContents = await responseMessage.Content.ReadAsStringAsync();
return new GetHireGroupResult
{
AvailableHireGroups = CreateResultForHireGroupsListRequest(stringContents)
};
}
else
{
string errorString = await responseMessage.Content.ReadAsStringAsync();
return new GetHireGroupResult
{
Error = errorString
};
}
}