public virtual async Task MaterializeAsync <TIncludedDoc>(SearchIndexResponse <TIncludedDoc> response, HttpResponseMessage httpResponse) { using (var content = await httpResponse.Content.ReadAsStreamAsync().ForAwait()) { Serializer.Populate(response, content); } }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { SearchIndexResponse response = new SearchIndexResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("thingGroups", targetDepth)) { var unmarshaller = new ListUnmarshaller <ThingGroupDocument, ThingGroupDocumentUnmarshaller>(ThingGroupDocumentUnmarshaller.Instance); response.ThingGroups = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("things", targetDepth)) { var unmarshaller = new ListUnmarshaller <ThingDocument, ThingDocumentUnmarshaller>(ThingDocumentUnmarshaller.Instance); response.Things = unmarshaller.Unmarshall(context); continue; } } return(response); }
protected async virtual void OnSuccessfulResponse <TIncludedDoc>(SearchIndexResponse <TIncludedDoc> response, HttpResponseMessage httpResponse) { using (var content = await httpResponse.Content.ReadAsStreamAsync().ForAwait()) { EntitySerializer.Populate(response, content); } }
protected virtual void MaterializeFailedResponse <TIncludedDoc>(SearchIndexResponse <TIncludedDoc> response, HttpResponseMessage httpResponse) { FailedResponseMaterializer.Materialize(response, httpResponse); }
public SearcIndexResponseAssertions(SearchIndexResponse response) : base(response) { }
public static SearcIndexResponseAssertions <TIncludedDoc> Should <TIncludedDoc>(this SearchIndexResponse <TIncludedDoc> response) { return(new SearcIndexResponseAssertions <TIncludedDoc>(response)); }
public static SearcIndexResponseAssertions Should(this SearchIndexResponse response) { return(new SearcIndexResponseAssertions(response)); }