public static CollectionData FromProtobuf(this GetCollectionResponse getCollectionResponse) { return(new CollectionData { Cards = getCollectionResponse.Cards.Select(card => card.FromProtobuf()).ToList() }); }
public static GetCollectionResponse Unmarshall(UnmarshallerContext context) { GetCollectionResponse getCollectionResponse = new GetCollectionResponse(); getCollectionResponse.HttpResponse = context.HttpResponse; return(getCollectionResponse); }
public async Task GetCollectionAsync_ShouldReturnError_WhenNotFound() { GetCollectionResponse getCollectionResponse = await _collectionApi.GetCollectionAsync("MyWrongCollection"); Assert.False(getCollectionResponse.IsSuccess); Assert.True(getCollectionResponse.ResponseDetails.Error); Assert.Equal(HttpStatusCode.NotFound, getCollectionResponse.ResponseDetails.Code); }
public HttpResponseMessage GetIdentities() { if (Context.Principal == null) { return(Request.CreateResponse(HttpStatusCode.Unauthorized)); } GetCollectionResponse <Identity> response = _router.Query <GetIdentitiesByPrincipalRequest, GetCollectionResponse <Identity> >(new GetIdentitiesByPrincipalRequest() { PrincipalId = Context.Principal.Id }); if (response.Results == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, response.Results.Select(x => new { x.Id, x.Name, x.Kind }))); }