Amazon.Runtime.Internal.Transform.JsonUnmarshallerContext.Read C# (CSharp) Method

Read() public method

Reads to the next token in the json document, and updates the context accordingly.
public Read ( ) : bool
return bool
        public override bool Read()
        {
            if (wasPeeked)
            {
                wasPeeked = false;
                return currentToken == null;
            }
            
            bool result = jsonReader.Read();
            if (result)
            {
                currentToken = jsonReader.Token;
                UpdateContext();
            }
            else
            {
                currentToken = null;
            }
            wasPeeked = false;
            return result;
        }

Usage Example

       private static void UnmarshallResult(JsonUnmarshallerContext context,GetHostnameSuggestionResponse response)
       {
         
           int originalDepth = context.CurrentDepth;
           int targetDepth = originalDepth + 1;
           while (context.Read())
           {
             
             if (context.TestExpression("LayerId", targetDepth))
             {
               context.Read();
               response.LayerId = StringUnmarshaller.GetInstance().Unmarshall(context);
               continue;
             }
 
             if (context.TestExpression("Hostname", targetDepth))
             {
               context.Read();
               response.Hostname = StringUnmarshaller.GetInstance().Unmarshall(context);
               continue;
             }
 
               if (context.CurrentDepth <= originalDepth)
               {                   
                   return;
               }
           }
                       
           return;
       }                        
All Usage Examples Of Amazon.Runtime.Internal.Transform.JsonUnmarshallerContext::Read