Exemple #1
0
 protected override EitherStrict <TLeft, TRight> ProcessSub(IRestResponse response, TSerializer serializer)
 {
     if (ProcessorStructure.CanProcess(response))
     {
         return(ProcessorStructure.Process(response, serializer));
     }
     else
     {
         return(leftProcessorStructure.Process(response, serializer));
     }
 }
Exemple #2
0
        /// <summary>
        /// Given a RestSharp response it returns the final value.
        /// </summary>
        public TResult GetResultFromResponse(IRestResponse response)
        {
            //It always adds the exception processor to the end of the processor list
            processor.Add(exProcesorCreator());

            //The default processor is always added to the end of the list
            ProcessorUtilities.AddNeutralProcessorAtEndsForStructure <TResult, TSerializer>(processor);

            //It sets the error serializer to all processors
            ProcessorUtilities.SetErrorSerializerForStructure <TResult, TSerializer>(processor, errorSerializer);

            //Applies the post-processing to the response
            return(processor.Process(response, serializer));
        }