Ejemplo n.º 1
0
 public static async Task <HttpResponseMessage> FindAllAsync(
     EastFive.Api.Security security, HttpRequestMessage request, UrlHelper url,
     MultipartAcceptArrayResponseAsync onMultipart,
     UnauthorizedResponse onUnauthorized)
 {
     return(await await ProcessStageTypes.FindAllAsync(security,
                                                       types => onMultipart(types.Select(type => GetResource(type, url))),
                                                       () => onUnauthorized().ToTask()));
 }
Ejemplo n.º 2
0
 public static async Task <HttpResponseMessage> FindByResourceAsync(
     [QueryParameter] Guid resourceId,
     EastFive.Api.Security security, UrlHelper url,
     MultipartAcceptArrayResponseAsync onMultipart,
     ReferencedDocumentNotFoundResponse onResourceNotFound,
     UnauthorizedResponse onUnauthorized)
 {
     return(await await EastFive.Azure.ProcessStages.FindByResourceAsync(resourceId, security,
                                                                         (processStages) => onMultipart(processStages.Select(ps => GetResource(ps, url))),
                                                                         () => onResourceNotFound().ToTask(),
                                                                         () => onUnauthorized().ToTask()));
 }
Ejemplo n.º 3
0
 public static async Task <HttpResponseMessage> FindByFirstStepByActorAndTypeAsync(
     [QueryParameter(Name = Resources.ProcessStage.OwnerPropertyName)] Guid ownerId,
     [QueryParameter(Name = Resources.ProcessStage.TypePropertyName)] Type resourceType,
     [QueryParameter(Name = "processstage." + Resources.ProcessStage.ConfirmablePropertyName + "." + Resources.ProcessStage.ConfirmableResource.ProcessStageNextPropertyName)]
     EastFive.Api.Controllers.WebIdNone nextStage,
     AzureApplication application, EastFive.Api.Security security, UrlHelper url,
     MultipartAcceptArrayResponseAsync onMultipart,
     ReferencedDocumentNotFoundResponse onResourceNotFound,
     UnauthorizedResponse onUnauthorized)
 {
     return(await await EastFive.Azure.ProcessStages.FindStartByActorAndResourceTypeAsync(ownerId, resourceType,
                                                                                          security,
                                                                                          (processStages) => onMultipart(processStages.Select(ps => GetResource(ps, url))),
                                                                                          () => onResourceNotFound().ToTask(),
                                                                                          () => onUnauthorized().ToTask()));
 }
Ejemplo n.º 4
0
 public static async Task <HttpResponseMessage> FindByAdapterAsync([QueryParameter] Guid adapter,
                                                                   Security security, Context context, HttpRequestMessage request, UrlHelper url,
                                                                   MultipartAcceptArrayResponseAsync onMultipart,
                                                                   ReferencedDocumentNotFoundResponse onReferenceNotFound,
                                                                   UnauthorizedResponse onUnauthorized)
 {
     return(await await EastFive.Azure.Synchronization.Connectors.FindConnectionByAdapterAsync(adapter,
                                                                                               security.performingAsActorId, security.claims,
                                                                                               connectors =>
     {
         var r = onMultipart(connectors.Select(connector => GetResource(connector, url)));
         return r;
     },
                                                                                               () => onReferenceNotFound().ToTask(),
                                                                                               () => onUnauthorized().ToTask()));
 }
 public static async Task <HttpResponseMessage> FindByRelatedAsync(
     [QueryParameter] Guid relatedTo, [QueryParameter] Guid integration,   // int top, int skip
     Security security, Context context, HttpRequestMessage request, UrlHelper url,
     MultipartAcceptArrayResponseAsync onMultipart,
     ReferencedDocumentNotFoundResponse onReferenceNotFound,
     UnauthorizedResponse onUnauthorized)
 {
     return(await await EastFive.Azure.Synchronization.Connections.FindAdaptersByRelatedAsync(relatedTo, integration,
                                                                                              security.claims,
                                                                                              synchronizations =>
     {
         var r = onMultipart(synchronizations.Select(synchronization => GetResource(synchronization, url)));
         return r;
     },
                                                                                              () => onReferenceNotFound().ToTask(),
                                                                                              () => onUnauthorized().ToTask()));
 }
 public static async Task <HttpResponseMessage> FindByResourceTypeAsync(
     [EastFive.Api.QueryParameter(Name = ActorPropertyName)] Guid actorId,
     [EastFive.Api.QueryParameter(Name = Resources.ProcessStageType.ResourceTypePropertyName)] Type resourceType,
     EastFive.Api.Security security, AzureApplication application, UrlHelper url,
     [Display(Name = "Found")] MultipartAcceptArrayResponseAsync onMultipart,
     ReferencedDocumentNotFoundResponse onResourceNotFound,
     UnauthorizedResponse onUnauthorized)
 {
     return(await await EastFive.Azure.ProcessResourceViews.FindByResourceAsync(actorId, resourceType,
                                                                                security,
                                                                                (views) =>
     {
         var viewResources = views.Select(ps => GetResource(ps, application, url)).ToArray();
         return onMultipart(viewResources);
     },
                                                                                () => onResourceNotFound().ToTask(),
                                                                                () => onUnauthorized().ToTask()));
 }
 public static async Task <HttpResponseMessage> FindByIntegrationAsync(
     [QueryParameter] Guid integration,
     [QueryParameter] string resourceType,
     Security security, Context context, HttpRequestMessage request, UrlHelper url,
     MultipartAcceptArrayResponseAsync onMultipart,
     ReferencedDocumentNotFoundResponse onReferenceNotFound,
     UnauthorizedResponse onUnauthorized)
 {
     return(await await EastFive.Azure.Synchronization.Synchronizations.FindAdaptersByIntgrationAndResourceTypeAsync(integration, resourceType,
                                                                                                                     security.performingAsActorId, security.claims,
                                                                                                                     synchronizations =>
     {
         var r = onMultipart(synchronizations.Select(synchronization => GetResource(synchronization, url)));
         return r;
     },
                                                                                                                     // TODO: Clean these up
                                                                                                                     () => onReferenceNotFound().ToTask(),
                                                                                                                     () => onReferenceNotFound().AddReason($"Resource type [{resourceType}] is not currently supported.").ToTask(),
                                                                                                                     () => onReferenceNotFound().AddReason($"The integration needs to be authenticated before it can be queried (this should be a 409).").ToTask(),
                                                                                                                     () => onUnauthorized().ToTask(),
                                                                                                                     (why) => onReferenceNotFound().AddReason(why + " (this should be a 409)").ToTask()));
 }
Ejemplo n.º 8
0
 public static Task <HttpResponseMessage> FindAllAsync(
     EastFive.Api.Security security, HttpRequestMessage request, UrlHelper url,
     MultipartAcceptArrayResponseAsync onMultipart)
 {
     return(onMultipart(stages));
 }