protected async Task <DateTime[]> GetDates()
        {
            RestRequest request = new RestRequest($"{PlatformInfo.GetAvailableDatesApiMethod}/{OperationInfo.Number}");

            ConfigureRequest(request);

            IRestResponse dates = await ApiClient.ExecuteAsync(request);

            if (dates.StatusCode != HttpStatusCode.OK)
            {
                OnRequestError?.Invoke(this, new DateCheckerErrorEventArgs((int)dates.StatusCode));
                throw new Exception();
            }

            if (dates.Content.Contains(PlatformInfo.GeneralErrorMessage))
            {
                OnRequestError?.Invoke(this, new DateCheckerErrorEventArgs((int)dates.StatusCode));
                throw new Exception();
            }

            DateTime[] availableDates = null;

            try
            {
                DateCheckDto dateCheckDto = JsonConvert.DeserializeObject <DateCheckDto>(dates.Content);
                availableDates = dateCheckDto.AvailableDates;
            }
            catch
            {
                availableDates = JsonConvert.DeserializeObject <DateTime[]>(dates.Content);
            }

            string datesString = JsonConvert.SerializeObject(availableDates);

            OnRequestOK?.Invoke(this, new DateCheckerOkEventArgs(datesString));

            return(availableDates);
        }
        protected async Task <DateTime[]> GetTimesForDate(DateTime date)
        {
            RestRequest request = new RestRequest($"{PlatformInfo.GetAvailableSlotsForDateApiMethod}/{OperationInfo.Number}/{date.GetFormattedDate()}");

            ConfigureRequest(request);

            IRestResponse slots = await ApiClient.ExecuteAsync(request);

            if (slots.StatusCode != HttpStatusCode.OK)
            {
                throw new Exception();
            }

            if (slots.Content.Contains(PlatformInfo.GeneralErrorMessage))
            {
                throw new Exception();
            }

            DateTime[] availableTimes = null;

            try
            {
                TimeCheckDtos  = JsonConvert.DeserializeObject <TimeCheckDto[]>(slots.Content);
                availableTimes = TimeCheckDtos.Select(timeCheckDto => timeCheckDto.DateTime).ToArray();
            }
            catch
            {
                availableTimes = JsonConvert.DeserializeObject <DateTime[]>(slots.Content);
            }

            string timesString = JsonConvert.SerializeObject(availableTimes);

            OnRequestOK?.Invoke(this, new DateCheckerOkEventArgs(timesString));

            return(availableTimes);
        }