From 04049afed4d70a363e35566149f150343174ba45 Mon Sep 17 00:00:00 2001 From: Scott Arbeit Date: Sat, 4 Nov 2023 01:52:29 -0700 Subject: [PATCH] Switched validations from lists to arrays, because fuck linked lists --- src/Grace.Server/Branch.Server.fs | 840 +++++++++--------- src/Grace.Server/Diff.Server.fs | 26 +- src/Grace.Server/Directory.Server.fs | 52 +- src/Grace.Server/Organization.Server.fs | 126 +-- src/Grace.Server/Owner.Server.fs | 102 +-- src/Grace.Server/Repository.Server.fs | 240 ++--- src/Grace.Server/Validations.Server.fs | 10 +- .../Validation/Utilities.Validation.fs | 6 +- 8 files changed, 704 insertions(+), 698 deletions(-) diff --git a/src/Grace.Server/Branch.Server.fs b/src/Grace.Server/Branch.Server.fs index 2d07cb4..e4afcec 100644 --- a/src/Grace.Server/Branch.Server.fs +++ b/src/Grace.Server/Branch.Server.fs @@ -29,7 +29,7 @@ open System.Threading.Tasks module Branch = - type Validations<'T when 'T :> BranchParameters> = 'T -> HttpContext -> Task> list + type Validations<'T when 'T :> BranchParameters> = 'T -> HttpContext -> Task> array let activitySource = new ActivitySource("Branch") @@ -39,6 +39,20 @@ module Branch = let actorId = ActorId($"{branchId}") actorProxyFactory.CreateActorProxy(actorId, ActorName.Branch) + let commonValidations (parameters: BranchParameters) = + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired |] + let processCommand<'T when 'T :> BranchParameters> (context: HttpContext) (validations: Validations<'T>) (command: 'T -> Task) = task { try @@ -103,26 +117,26 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateBranchParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherBranchIdOrBranchNameRequired - String.isNotEmpty parameters.BranchId BranchIdIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isNotEmpty parameters.BranchName BranchNameIsRequired - String.isValidGraceName parameters.BranchName InvalidBranchName - Guid.isValidAndNotEmpty parameters.ParentBranchId InvalidBranchId - String.isValidGraceName parameters.ParentBranchName InvalidBranchName - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.ParentBranchId parameters.ParentBranchName ParentBranchDoesNotExist - Branch.branchNameDoesNotExist parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchName BranchNameAlreadyExists ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherBranchIdOrBranchNameRequired + String.isNotEmpty parameters.BranchId BranchIdIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isNotEmpty parameters.BranchName BranchNameIsRequired + String.isValidGraceName parameters.BranchName InvalidBranchName + Guid.isValidAndNotEmpty parameters.ParentBranchId InvalidBranchId + String.isValidGraceName parameters.ParentBranchName InvalidBranchName + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.ParentBranchId parameters.ParentBranchName ParentBranchDoesNotExist + Branch.branchNameDoesNotExist parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchName BranchNameAlreadyExists |] let command (parameters: CreateBranchParameters) = task { @@ -156,23 +170,23 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: RebaseParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherBranchIdOrBranchNameRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Branch.referenceIdExists parameters.BasedOn ReferenceIdDoesNotExist - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ParentBranchDoesNotExist - Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Commit CommitIsDisabled ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherBranchIdOrBranchNameRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Branch.referenceIdExists parameters.BasedOn ReferenceIdDoesNotExist + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ParentBranchDoesNotExist + Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Commit CommitIsDisabled |] let command (parameters: RebaseParameters) = Rebase(parameters.BasedOn) |> returnTask @@ -184,24 +198,24 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateReferenceParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherBranchIdOrBranchNameRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - String.isNotEmpty parameters.Message MessageIsRequired - String.maxLength parameters.Message 2048 StringIsTooLong - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ParentBranchDoesNotExist - Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Promotion PromotionIsDisabled ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherBranchIdOrBranchNameRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + String.isNotEmpty parameters.Message MessageIsRequired + String.maxLength parameters.Message 2048 StringIsTooLong + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ParentBranchDoesNotExist + Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Promotion PromotionIsDisabled |] let command (parameters: CreateReferenceParameters) = BranchCommand.Promote(parameters.DirectoryId, parameters.Sha256Hash, ReferenceText parameters.Message) |> returnTask @@ -213,24 +227,24 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateReferenceParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherBranchIdOrBranchNameRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - String.isNotEmpty parameters.Message MessageIsRequired - String.maxLength parameters.Message 2048 StringIsTooLong - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist - Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Commit CommitIsDisabled ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherBranchIdOrBranchNameRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + String.isNotEmpty parameters.Message MessageIsRequired + String.maxLength parameters.Message 2048 StringIsTooLong + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist + Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Commit CommitIsDisabled |] let command (parameters: CreateReferenceParameters) = BranchCommand.Commit(parameters.DirectoryId, parameters.Sha256Hash, ReferenceText parameters.Message) |> returnTask @@ -242,24 +256,24 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateReferenceParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - String.maxLength parameters.Message 2048 StringIsTooLong - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist - Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Checkpoint CheckpointIsDisabled ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + String.maxLength parameters.Message 2048 StringIsTooLong + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist + Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Checkpoint CheckpointIsDisabled |] let command (parameters: CreateReferenceParameters) = BranchCommand.Checkpoint(parameters.DirectoryId, parameters.Sha256Hash, ReferenceText parameters.Message) |> returnTask @@ -271,24 +285,24 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateReferenceParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - String.maxLength parameters.Message 4096 StringIsTooLong - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist - Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Save SaveIsDisabled ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + String.maxLength parameters.Message 4096 StringIsTooLong + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist + Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Save SaveIsDisabled |] let command (parameters: CreateReferenceParameters) = BranchCommand.Save(parameters.DirectoryId, parameters.Sha256Hash, ReferenceText parameters.Message) |> returnTask @@ -300,24 +314,24 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateReferenceParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - String.maxLength parameters.Message 2048 StringIsTooLong - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist - Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Tag TagIsDisabled ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + String.maxLength parameters.Message 2048 StringIsTooLong + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist + Branch.branchAllowsReferenceType parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ReferenceType.Tag TagIsDisabled |] let command (parameters: CreateReferenceParameters) = BranchCommand.Tag(parameters.DirectoryId, parameters.Sha256Hash, ReferenceText parameters.Message) |> returnTask @@ -329,22 +343,22 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: EnableFeatureParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let command (parameters: EnableFeatureParameters) = EnablePromotion(parameters.Enabled) |> returnTask @@ -356,23 +370,23 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: EnableFeatureParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] - + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] + let command (parameters: EnableFeatureParameters) = EnableCommit(parameters.Enabled) |> returnTask return! processCommand context validations command @@ -383,22 +397,22 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: EnableFeatureParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let command (parameters: EnableFeatureParameters) = EnableCheckpoint(parameters.Enabled) |> returnTask @@ -410,22 +424,22 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: EnableFeatureParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ParentBranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ParentBranchDoesNotExist |] let command (parameters: EnableFeatureParameters) = EnableSave(parameters.Enabled) |> returnTask @@ -437,22 +451,22 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: EnableFeatureParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let command (parameters: EnableFeatureParameters) = EnableTag(parameters.Enabled) |> returnTask @@ -464,22 +478,22 @@ module Branch = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: DeleteBranchParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let command (parameters: DeleteBranchParameters) = DeleteLogical (parameters.Force, parameters.DeleteReason) |> returnTask @@ -492,22 +506,22 @@ module Branch = task { try let validations (parameters: GetBranchParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = task { @@ -527,22 +541,22 @@ module Branch = task { try let validations (parameters: BranchParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ParentBranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName ParentBranchDoesNotExist |] let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = task { @@ -562,22 +576,22 @@ module Branch = task { try let validations (parameters: GetReferenceParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = task { @@ -600,23 +614,23 @@ module Branch = task { try let validations (parameters: GetReferencesParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IBranchActor) = task { @@ -637,25 +651,25 @@ module Branch = task { try let validations (parameters: GetDiffsForReferenceTypeParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive - String.isNotEmpty parameters.ReferenceType ReferenceTypeMustBeProvided - DiscriminatedUnion.isMemberOf parameters.ReferenceType InvalidReferenceType - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive + String.isNotEmpty parameters.ReferenceType ReferenceTypeMustBeProvided + DiscriminatedUnion.isMemberOf parameters.ReferenceType InvalidReferenceType + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IBranchActor) = task { @@ -692,23 +706,23 @@ module Branch = task { try let validations (parameters: GetReferencesParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = task { @@ -729,23 +743,23 @@ module Branch = task { try let validations (parameters: GetReferencesParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = task { @@ -766,24 +780,24 @@ module Branch = task { try let validations (parameters: GetReferencesParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] - + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] + let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = task { let! branchDto = actorProxy.Get() @@ -803,23 +817,23 @@ module Branch = task { try let validations (parameters: GetReferencesParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = @@ -841,23 +855,23 @@ module Branch = task { try let validations (parameters: GetReferencesParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + Number.isPositiveOrZero parameters.MaxCount ValueMustBePositive + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = task { @@ -877,24 +891,24 @@ module Branch = task { try let validations (parameters: GetBranchVersionParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired - Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId - String.isValidGraceName parameters.BranchName InvalidBranchName - Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired - String.isEmptyOrValidSha256Hash parameters.Sha256Hash Sha256HashDoesNotExist - Guid.isValidAndNotEmpty parameters.ReferenceId ReferenceIdDoesNotExist - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameIsRequired + Guid.isValidAndNotEmpty parameters.BranchId InvalidBranchId + String.isValidGraceName parameters.BranchName InvalidBranchName + Input.eitherIdOrNameMustBeProvided parameters.BranchId parameters.BranchName EitherBranchIdOrBranchNameRequired + String.isEmptyOrValidSha256Hash parameters.Sha256Hash Sha256HashDoesNotExist + Guid.isValidAndNotEmpty parameters.ReferenceId ReferenceIdDoesNotExist + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Branch.branchExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName parameters.BranchId parameters.BranchName BranchDoesNotExist |] let query (context: HttpContext) maxCount (actorProxy: IBranchActor) = task { diff --git a/src/Grace.Server/Diff.Server.fs b/src/Grace.Server/Diff.Server.fs index f5ee1b1..62408ee 100644 --- a/src/Grace.Server/Diff.Server.fs +++ b/src/Grace.Server/Diff.Server.fs @@ -28,7 +28,7 @@ open System.Threading.Tasks open System.Text.Json module Diff = - type Validations<'T when 'T :> DiffParameters> = 'T -> HttpContext -> Task> list + type Validations<'T when 'T :> DiffParameters> = 'T -> HttpContext -> Task> array let activitySource = new ActivitySource("Repository") @@ -120,10 +120,10 @@ module Diff = task { try let validations (parameters: PopulateParameters) (context: HttpContext) = - [ Guid.isNotEmpty parameters.DirectoryId1 DiffError.InvalidDirectoryId - Guid.isNotEmpty parameters.DirectoryId2 DiffError.InvalidDirectoryId - Directory.directoryIdExists parameters.DirectoryId1 DiffError.DirectoryDoesNotExist - Directory.directoryIdExists parameters.DirectoryId2 DiffError.DirectoryDoesNotExist ] + [| Guid.isNotEmpty parameters.DirectoryId1 DiffError.InvalidDirectoryId + Guid.isNotEmpty parameters.DirectoryId2 DiffError.InvalidDirectoryId + Directory.directoryIdExists parameters.DirectoryId1 DiffError.DirectoryDoesNotExist + Directory.directoryIdExists parameters.DirectoryId2 DiffError.DirectoryDoesNotExist |] let query (context: HttpContext) _ (actorProxy: IDiffActor) = task { @@ -143,10 +143,10 @@ module Diff = task { try let validations (parameters: GetDiffParameters) (context: HttpContext) = - [ Guid.isNotEmpty parameters.DirectoryId1 DiffError.InvalidDirectoryId - Guid.isNotEmpty parameters.DirectoryId2 DiffError.InvalidDirectoryId - Directory.directoryIdExists parameters.DirectoryId1 DiffError.DirectoryDoesNotExist - Directory.directoryIdExists parameters.DirectoryId2 DiffError.DirectoryDoesNotExist ] + [| Guid.isNotEmpty parameters.DirectoryId1 DiffError.InvalidDirectoryId + Guid.isNotEmpty parameters.DirectoryId2 DiffError.InvalidDirectoryId + Directory.directoryIdExists parameters.DirectoryId1 DiffError.DirectoryDoesNotExist + Directory.directoryIdExists parameters.DirectoryId2 DiffError.DirectoryDoesNotExist |] let query (context: HttpContext) _ (actorProxy: IDiffActor) = task { @@ -167,10 +167,10 @@ module Diff = task { try let validations (parameters: GetDiffBySha256HashParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.Sha256Hash1 DiffError.Sha256HashIsRequired - String.isNotEmpty parameters.Sha256Hash2 DiffError.Sha256HashIsRequired - String.isValidSha256Hash parameters.Sha256Hash1 DiffError.InvalidSha256Hash - String.isValidSha256Hash parameters.Sha256Hash2 DiffError.InvalidSha256Hash ] + [| String.isNotEmpty parameters.Sha256Hash1 DiffError.Sha256HashIsRequired + String.isNotEmpty parameters.Sha256Hash2 DiffError.Sha256HashIsRequired + String.isValidSha256Hash parameters.Sha256Hash1 DiffError.InvalidSha256Hash + String.isValidSha256Hash parameters.Sha256Hash2 DiffError.InvalidSha256Hash |] let query (context: HttpContext) _ (actorProxy: IDiffActor) = task { diff --git a/src/Grace.Server/Directory.Server.fs b/src/Grace.Server/Directory.Server.fs index 64f8214..df6fe52 100644 --- a/src/Grace.Server/Directory.Server.fs +++ b/src/Grace.Server/Directory.Server.fs @@ -28,7 +28,7 @@ open System.Threading.Tasks module DirectoryVersion = - type Validations<'T when 'T :> DirectoryParameters> = 'T -> HttpContext -> Task> list + type Validations<'T when 'T :> DirectoryParameters> = 'T -> HttpContext -> Task> array //type QueryResult<'T, 'U when 'T :> DirectoryParameters> = 'T -> int -> IDirectoryVersionActor ->Task<'U> let activitySource = new ActivitySource("Branch") @@ -88,9 +88,9 @@ module DirectoryVersion = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty $"{parameters.DirectoryVersion.DirectoryId}" DirectoryError.InvalidDirectoryId - Guid.isValidAndNotEmpty $"{parameters.DirectoryVersion.RepositoryId}" DirectoryError.InvalidRepositoryId - Repository.repositoryIdExists $"{parameters.DirectoryVersion.RepositoryId}" DirectoryError.RepositoryDoesNotExist ] + [| Guid.isValidAndNotEmpty $"{parameters.DirectoryVersion.DirectoryId}" DirectoryError.InvalidDirectoryId + Guid.isValidAndNotEmpty $"{parameters.DirectoryVersion.RepositoryId}" DirectoryError.InvalidRepositoryId + Repository.repositoryIdExists $"{parameters.DirectoryVersion.RepositoryId}" DirectoryError.RepositoryDoesNotExist |] let command (parameters: CreateParameters) (context: HttpContext) = task { @@ -108,10 +108,10 @@ module DirectoryVersion = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: GetParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty $"{parameters.RepositoryId}" DirectoryError.InvalidRepositoryId - Guid.isValidAndNotEmpty $"{parameters.DirectoryId}" DirectoryError.InvalidRepositoryId - Repository.repositoryIdExists $"{parameters.RepositoryId}" DirectoryError.RepositoryDoesNotExist - Directory.directoryIdExists (Guid.Parse(parameters.DirectoryId)) DirectoryError.DirectoryDoesNotExist ] + [| Guid.isValidAndNotEmpty $"{parameters.RepositoryId}" DirectoryError.InvalidRepositoryId + Guid.isValidAndNotEmpty $"{parameters.DirectoryId}" DirectoryError.InvalidRepositoryId + Repository.repositoryIdExists $"{parameters.RepositoryId}" DirectoryError.RepositoryDoesNotExist + Directory.directoryIdExists (Guid.Parse(parameters.DirectoryId)) DirectoryError.DirectoryDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IDirectoryVersionActor) = task { @@ -128,10 +128,10 @@ module DirectoryVersion = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: GetParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty $"{parameters.RepositoryId}" DirectoryError.InvalidRepositoryId - Guid.isValidAndNotEmpty $"{parameters.DirectoryId}" DirectoryError.InvalidRepositoryId - Repository.repositoryIdExists $"{parameters.RepositoryId}" DirectoryError.RepositoryDoesNotExist - Directory.directoryIdExists (Guid.Parse(parameters.DirectoryId)) DirectoryError.DirectoryDoesNotExist ] + [| Guid.isValidAndNotEmpty $"{parameters.RepositoryId}" DirectoryError.InvalidRepositoryId + Guid.isValidAndNotEmpty $"{parameters.DirectoryId}" DirectoryError.InvalidRepositoryId + Repository.repositoryIdExists $"{parameters.RepositoryId}" DirectoryError.RepositoryDoesNotExist + Directory.directoryIdExists (Guid.Parse(parameters.DirectoryId)) DirectoryError.DirectoryDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IDirectoryVersionActor) = task { @@ -148,9 +148,9 @@ module DirectoryVersion = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: GetByDirectoryIdsParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty $"{parameters.RepositoryId}" DirectoryError.InvalidRepositoryId - Repository.repositoryIdExists $"{parameters.RepositoryId}" DirectoryError.RepositoryDoesNotExist - Directory.directoryIdsExist parameters.DirectoryIds DirectoryError.DirectoryDoesNotExist ] + [| Guid.isValidAndNotEmpty $"{parameters.RepositoryId}" DirectoryError.InvalidRepositoryId + Repository.repositoryIdExists $"{parameters.RepositoryId}" DirectoryError.RepositoryDoesNotExist + Directory.directoryIdsExist parameters.DirectoryIds DirectoryError.DirectoryDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IDirectoryVersionActor) = task { @@ -172,10 +172,10 @@ module DirectoryVersion = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: GetBySha256HashParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty $"{parameters.DirectoryId}" DirectoryError.InvalidDirectoryId - Guid.isValidAndNotEmpty $"{parameters.RepositoryId}" DirectoryError.InvalidRepositoryId - String.isNotEmpty parameters.Sha256Hash DirectoryError.Sha256HashIsRequired - Repository.repositoryIdExists $"{parameters.RepositoryId}" DirectoryError.RepositoryDoesNotExist ] + [| Guid.isValidAndNotEmpty $"{parameters.DirectoryId}" DirectoryError.InvalidDirectoryId + Guid.isValidAndNotEmpty $"{parameters.RepositoryId}" DirectoryError.InvalidRepositoryId + String.isNotEmpty parameters.Sha256Hash DirectoryError.Sha256HashIsRequired + Repository.repositoryIdExists $"{parameters.RepositoryId}" DirectoryError.RepositoryDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IDirectoryVersionActor) = task { @@ -194,15 +194,15 @@ module DirectoryVersion = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SaveDirectoryVersionsParameters) (context: HttpContext) = - let mutable allValidations: Task> list = List.Empty + let mutable allValidations: Task> array = Array.Empty() for directoryVersion in parameters.DirectoryVersions do let validations = - [ Guid.isValidAndNotEmpty $"{directoryVersion.DirectoryId}" DirectoryError.InvalidDirectoryId - Guid.isValidAndNotEmpty $"{directoryVersion.RepositoryId}" DirectoryError.InvalidRepositoryId - String.isNotEmpty $"{directoryVersion.Sha256Hash}" DirectoryError.Sha256HashIsRequired - String.isNotEmpty $"{directoryVersion.RelativePath}" DirectoryError.RelativePathMustNotBeEmpty - Repository.repositoryIdExists $"{directoryVersion.RepositoryId}" DirectoryError.RepositoryDoesNotExist ] - allValidations <- List.append allValidations validations + [| Guid.isValidAndNotEmpty $"{directoryVersion.DirectoryId}" DirectoryError.InvalidDirectoryId + Guid.isValidAndNotEmpty $"{directoryVersion.RepositoryId}" DirectoryError.InvalidRepositoryId + String.isNotEmpty $"{directoryVersion.Sha256Hash}" DirectoryError.Sha256HashIsRequired + String.isNotEmpty $"{directoryVersion.RelativePath}" DirectoryError.RelativePathMustNotBeEmpty + Repository.repositoryIdExists $"{directoryVersion.RepositoryId}" DirectoryError.RepositoryDoesNotExist |] + allValidations <- Array.append allValidations validations allValidations let command (parameters: SaveDirectoryVersionsParameters) (context: HttpContext) = diff --git a/src/Grace.Server/Organization.Server.fs b/src/Grace.Server/Organization.Server.fs index d33cd6e..b39b1ef 100644 --- a/src/Grace.Server/Organization.Server.fs +++ b/src/Grace.Server/Organization.Server.fs @@ -23,7 +23,7 @@ open System.Diagnostics module Organization = - type Validations<'T when 'T :> OrganizationParameters> = 'T -> HttpContext -> Task> list + type Validations<'T when 'T :> OrganizationParameters> = 'T -> HttpContext -> Task> array let activitySource = new ActivitySource("Organization") @@ -92,16 +92,16 @@ module Organization = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateOrganizationParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isNotEmpty parameters.OrganizationName OrganizationNameIsRequired - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationNameIsUnique parameters.OwnerId parameters.OwnerName parameters.OrganizationName OrganizationNameAlreadyExists ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isNotEmpty parameters.OrganizationName OrganizationNameIsRequired + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationNameIsUnique parameters.OwnerId parameters.OwnerName parameters.OrganizationName OrganizationNameAlreadyExists |] let command (parameters: CreateOrganizationParameters) = task { @@ -119,13 +119,13 @@ module Organization = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetOrganizationNameParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - String.isNotEmpty parameters.NewName OrganizationNameIsRequired - String.isValidGraceName parameters.NewName InvalidOrganizationName - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted ] + [| String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + String.isNotEmpty parameters.NewName OrganizationNameIsRequired + String.isValidGraceName parameters.NewName InvalidOrganizationName + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted |] let command (parameters: SetOrganizationNameParameters) = OrganizationCommand.SetName (OrganizationName parameters.NewName) |> returnTask @@ -138,13 +138,13 @@ module Organization = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetOrganizationTypeParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - String.isNotEmpty parameters.OrganizationType OrganizationTypeIsRequired - DiscriminatedUnion.isMemberOf parameters.OrganizationType InvalidOrganizationType - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted ] + [| String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + String.isNotEmpty parameters.OrganizationType OrganizationTypeIsRequired + DiscriminatedUnion.isMemberOf parameters.OrganizationType InvalidOrganizationType + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted |] let command (parameters: SetOrganizationTypeParameters) = OrganizationCommand.SetType (Utilities.discriminatedUnionFromString(parameters.OrganizationType).Value) |> returnTask @@ -156,13 +156,13 @@ module Organization = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetOrganizationSearchVisibilityParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - String.isNotEmpty parameters.SearchVisibility SearchVisibilityIsRequired - DiscriminatedUnion.isMemberOf parameters.SearchVisibility InvalidSearchVisibility - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted ] + [| String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + String.isNotEmpty parameters.SearchVisibility SearchVisibilityIsRequired + DiscriminatedUnion.isMemberOf parameters.SearchVisibility InvalidSearchVisibility + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted |] let command (parameters: SetOrganizationSearchVisibilityParameters) = OrganizationCommand.SetSearchVisibility (Utilities.discriminatedUnionFromString(parameters.SearchVisibility).Value) |> returnTask @@ -175,11 +175,11 @@ module Organization = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetOrganizationDescriptionParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isNotEmpty parameters.Description OrganizationDescriptionIsRequired - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted ] + [| String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isNotEmpty parameters.Description OrganizationDescriptionIsRequired + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted |] let command (parameters: SetOrganizationDescriptionParameters) = OrganizationCommand.SetDescription(parameters.Description) |> returnTask @@ -192,11 +192,11 @@ module Organization = task { try let validations (parameters: ListRepositoriesParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted ] + [| String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted |] let query (context: HttpContext) (maxCount: int) (actorProxy: IOrganizationActor) = task { @@ -215,12 +215,12 @@ module Organization = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: DeleteOrganizationParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - String.isNotEmpty parameters.DeleteReason DeleteReasonIsRequired - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted ] + [| String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + String.isNotEmpty parameters.DeleteReason DeleteReasonIsRequired + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted |] let command (parameters: DeleteOrganizationParameters) = OrganizationCommand.DeleteLogical (parameters.Force, parameters.DeleteReason) |> returnTask @@ -232,12 +232,12 @@ module Organization = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: OrganizationParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationIsDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsNotDeleted ] + [| String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationIsDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsNotDeleted |] let command (parameters: OrganizationParameters) = OrganizationCommand.Undelete |> returnTask @@ -250,15 +250,15 @@ module Organization = task { try let validations (parameters: GetOrganizationParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist - Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + String.isNotEmpty parameters.OrganizationId OrganizationIdIsRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIsDeleted |] let query (context: HttpContext) (maxCount: int) (actorProxy: IOrganizationActor) = task { diff --git a/src/Grace.Server/Owner.Server.fs b/src/Grace.Server/Owner.Server.fs index 4d5b1a0..cf60008 100644 --- a/src/Grace.Server/Owner.Server.fs +++ b/src/Grace.Server/Owner.Server.fs @@ -28,7 +28,7 @@ open Grace.Shared.Utilities module Owner = - type Validations<'T when 'T :> OwnerParameters> = 'T -> HttpContext -> Task> list + type Validations<'T when 'T :> OwnerParameters> = 'T -> HttpContext -> Task> array let activitySource = new ActivitySource("Owner") @@ -96,12 +96,12 @@ module Owner = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: CreateOwnerParameters) (context: HttpContext) = - [ String.isNotEmpty parameters.OwnerId OwnerIdIsRequired - Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isNotEmpty parameters.OwnerName OwnerNameIsRequired - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Owner.ownerIdDoesNotExist parameters.OwnerId OwnerIdAlreadyExists - Owner.ownerNameDoesNotExist parameters.OwnerName OwnerNameAlreadyExists ] + [| String.isNotEmpty parameters.OwnerId OwnerIdIsRequired + Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isNotEmpty parameters.OwnerName OwnerNameIsRequired + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Owner.ownerIdDoesNotExist parameters.OwnerId OwnerIdAlreadyExists + Owner.ownerNameDoesNotExist parameters.OwnerName OwnerNameAlreadyExists |] let command (parameters: CreateOwnerParameters) = let ownerIdGuid = Guid.Parse(parameters.OwnerId) @@ -115,14 +115,14 @@ module Owner = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetOwnerNameParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - String.isNotEmpty parameters.NewName OwnerNameIsRequired - String.isValidGraceName parameters.NewName InvalidOwnerName - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted - Owner.ownerNameDoesNotExist parameters.NewName OwnerNameAlreadyExists ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + String.isNotEmpty parameters.NewName OwnerNameIsRequired + String.isValidGraceName parameters.NewName InvalidOwnerName + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted + Owner.ownerNameDoesNotExist parameters.NewName OwnerNameAlreadyExists |] let command (parameters: SetOwnerNameParameters) = OwnerCommand.SetName (OwnerName parameters.NewName) |> returnTask @@ -135,13 +135,13 @@ module Owner = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetOwnerTypeParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - String.isNotEmpty parameters.OwnerType OwnerTypeIsRequired - DiscriminatedUnion.isMemberOf parameters.OwnerType InvalidOwnerType - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + String.isNotEmpty parameters.OwnerType OwnerTypeIsRequired + DiscriminatedUnion.isMemberOf parameters.OwnerType InvalidOwnerType + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted |] let command (parameters: SetOwnerTypeParameters) = OwnerCommand.SetType (Utilities.discriminatedUnionFromString(parameters.OwnerType).Value) |> returnTask @@ -153,12 +153,12 @@ module Owner = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetOwnerSearchVisibilityParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - DiscriminatedUnion.isMemberOf parameters.SearchVisibility InvalidSearchVisibility - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + DiscriminatedUnion.isMemberOf parameters.SearchVisibility InvalidSearchVisibility + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted |] let command (parameters: SetOwnerSearchVisibilityParameters) = OwnerCommand.SetSearchVisibility (Utilities.discriminatedUnionFromString(parameters.SearchVisibility).Value) |> returnTask @@ -170,12 +170,12 @@ module Owner = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetOwnerDescriptionParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - String.isNotEmpty parameters.Description DescriptionIsRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + String.isNotEmpty parameters.Description DescriptionIsRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted |] let command (parameters: SetOwnerDescriptionParameters) = OwnerCommand.SetDescription (parameters.Description) |> returnTask @@ -188,7 +188,7 @@ module Owner = task { try let validations (parameters: ListOrganizationsParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId |] let query (context: HttpContext) (maxCount: int) (actorProxy: IOwnerActor) = task { @@ -207,12 +207,12 @@ module Owner = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: DeleteOwnerParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - String.isNotEmpty parameters.DeleteReason DeleteReasonIsRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + String.isNotEmpty parameters.DeleteReason DeleteReasonIsRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted |] let command (parameters: DeleteOwnerParameters) = OwnerCommand.DeleteLogical (parameters.Force, parameters.DeleteReason) |> returnTask @@ -224,11 +224,11 @@ module Owner = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: OwnerParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Owner.ownerIsDeleted parameters.OwnerId parameters.OwnerName OwnerIsNotDeleted ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Owner.ownerIsDeleted parameters.OwnerId parameters.OwnerName OwnerIsNotDeleted |] let command (parameters: OwnerParameters) = OwnerCommand.Undelete |> returnTask @@ -241,11 +241,11 @@ module Owner = task { try let validations (parameters: GetOwnerParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Owner.ownerIsNotDeleted parameters.OwnerId parameters.OwnerName OwnerIsDeleted |] let query (context: HttpContext) (maxCount: int) (actorProxy: IOwnerActor) = task { diff --git a/src/Grace.Server/Repository.Server.fs b/src/Grace.Server/Repository.Server.fs index cc1375a..e59bea1 100644 --- a/src/Grace.Server/Repository.Server.fs +++ b/src/Grace.Server/Repository.Server.fs @@ -38,7 +38,7 @@ open Giraffe.ViewEngine.HtmlElements module Repository = - type Validations<'T when 'T :> RepositoryParameters> = 'T -> HttpContext -> Task> list + type Validations<'T when 'T :> RepositoryParameters> = 'T -> HttpContext -> Task> array let activitySource = new ActivitySource("Repository") @@ -49,21 +49,21 @@ module Repository = actorProxyFactory.CreateActorProxy(actorId, ActorName.Repository) let commonValidations<'T when 'T :> RepositoryParameters> (parameters: 'T) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName |] let processCommand<'T when 'T :> RepositoryParameters> (context: HttpContext) (validations: Validations<'T>) (command: 'T -> Task) = task { try use activity = activitySource.StartActivity("processCommand", ActivityKind.Server) let! parameters = context |> parse<'T> - let validationResults = List.append (commonValidations parameters context) (validations parameters context) + let validationResults = Array.append (commonValidations parameters context) (validations parameters context) let! validationsPassed = validationResults |> allPass if validationsPassed then let! repositoryId = resolveRepositoryId parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName @@ -94,7 +94,7 @@ module Repository = try use activity = activitySource.StartActivity("processQuery", ActivityKind.Server) //let! parameters = context |> parse<'T> - let validationResults = List.append (commonValidations parameters context) (validations parameters context) + let validationResults = Array.append (commonValidations parameters context) (validations parameters context) //let validationResults = validations parameters context let! validationsPassed = validationResults |> allPass if validationsPassed then @@ -122,18 +122,18 @@ module Repository = //let! parameters = context |> parse //logToConsole $"parameters.ObjectStorageProvider: {parameters.ObjectStorageProvider}" let validations (parameters: CreateRepositoryParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - String.isNotEmpty parameters.RepositoryId RepositoryIdIsRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isNotEmpty parameters.RepositoryName RepositoryNameIsRequired - String.isValidGraceName parameters.RepositoryName InvalidRepositoryName - Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + String.isNotEmpty parameters.RepositoryId RepositoryIdIsRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isNotEmpty parameters.RepositoryName RepositoryNameIsRequired + String.isValidGraceName parameters.RepositoryName InvalidRepositoryName + Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist + Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist |] let command (parameters: CreateRepositoryParameters) = task { @@ -151,10 +151,10 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetRepositoryVisibilityParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Repository.visibilityIsValid parameters.Visibility InvalidVisibilityValue - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Repository.visibilityIsValid parameters.Visibility InvalidVisibilityValue + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: SetRepositoryVisibilityParameters) = SetVisibility(discriminatedUnionFromString(parameters.Visibility).Value) |> returnTask @@ -167,10 +167,10 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetSaveDaysParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Repository.daysIsValid parameters.SaveDays InvalidSaveDaysValue - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Repository.daysIsValid parameters.SaveDays InvalidSaveDaysValue + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: SetSaveDaysParameters) = SetSaveDays(parameters.SaveDays) |> returnTask @@ -182,10 +182,10 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetCheckpointDaysParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Repository.daysIsValid parameters.CheckpointDays InvalidCheckpointDaysValue - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Repository.daysIsValid parameters.CheckpointDays InvalidCheckpointDaysValue + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: SetCheckpointDaysParameters) = SetCheckpointDays(parameters.CheckpointDays) |> returnTask @@ -197,9 +197,9 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: EnablePromotionTypeParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: EnablePromotionTypeParameters) = EnableSingleStepPromotion (parameters.Enabled) |> returnTask @@ -211,9 +211,9 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: EnablePromotionTypeParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: EnablePromotionTypeParameters) = EnableComplexPromotion (parameters.Enabled) |> returnTask @@ -225,10 +225,10 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetRepositoryStatusParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - DiscriminatedUnion.isMemberOf parameters.Status InvalidRepositoryStatus - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + DiscriminatedUnion.isMemberOf parameters.Status InvalidRepositoryStatus + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: SetRepositoryStatusParameters) = SetRepositoryStatus(discriminatedUnionFromString(parameters.Status).Value) |> returnTask @@ -241,10 +241,10 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetDefaultServerApiVersionParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - String.isNotEmpty parameters.DefaultServerApiVersion InvalidServerApiVersion - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + String.isNotEmpty parameters.DefaultServerApiVersion InvalidServerApiVersion + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: SetDefaultServerApiVersionParameters) = SetDefaultServerApiVersion(parameters.DefaultServerApiVersion) |> returnTask @@ -256,9 +256,9 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: RecordSavesParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: RecordSavesParameters) = SetRecordSaves (parameters.RecordSaves) |> returnTask @@ -270,10 +270,10 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: SetRepositoryDescriptionParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - String.isNotEmpty parameters.Description DescriptionIsRequired - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + String.isNotEmpty parameters.Description DescriptionIsRequired + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: SetRepositoryDescriptionParameters) = SetDescription (parameters.Description) |> returnTask @@ -285,10 +285,10 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: DeleteRepositoryParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - String.isNotEmpty parameters.DeleteReason DeleteReasonIsRequired - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + String.isNotEmpty parameters.DeleteReason DeleteReasonIsRequired + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsNotDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsDeleted |] let command (parameters: DeleteRepositoryParameters) = DeleteLogical (parameters.Force, parameters.DeleteReason) |> returnTask @@ -300,9 +300,9 @@ module Repository = fun (next: HttpFunc) (context: HttpContext) -> task { let validations (parameters: RepositoryParameters) (context: HttpContext) = - [ Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist - Repository.repositoryIsDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsNotDeleted ] + [| Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Repository.repositoryExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryDoesNotExist + Repository.repositoryIsDeleted parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName parameters.RepositoryId parameters.RepositoryName RepositoryIsNotDeleted |] let command (parameters: RepositoryParameters) = Undelete |> returnTask @@ -315,14 +315,14 @@ module Repository = task { try let validations (parameters: RepositoryParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IRepositoryActor) = task { @@ -341,14 +341,14 @@ module Repository = task { try let validations (parameters: RepositoryParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IRepositoryActor) = task { @@ -367,15 +367,15 @@ module Repository = task { try let validations (parameters: RepositoryParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - String.isNotEmpty parameters.RepositoryName RepositoryNameIsRequired - Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + String.isNotEmpty parameters.RepositoryName RepositoryNameIsRequired + Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IRepositoryActor) = task { @@ -394,16 +394,16 @@ module Repository = task { try let validations (parameters: GetBranchesParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Number.isWithinRange parameters.MaxCount 1 1000 InvalidMaxCountValue - Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Number.isWithinRange parameters.MaxCount 1 1000 InvalidMaxCountValue + Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IRepositoryActor) = task { @@ -425,17 +425,17 @@ module Repository = task { try let validations (parameters: GetReferencesByReferenceIdParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Input.listIsNonEmpty parameters.ReferenceIds ReferenceIdsAreRequired - Number.isWithinRange parameters.MaxCount 1 1000 InvalidMaxCountValue - Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Input.listIsNonEmpty parameters.ReferenceIds ReferenceIdsAreRequired + Number.isWithinRange parameters.MaxCount 1 1000 InvalidMaxCountValue + Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IRepositoryActor) = task { @@ -456,17 +456,17 @@ module Repository = task { try let validations (parameters: GetBranchesByBranchIdParameters) (context: HttpContext) = - [ Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId - String.isValidGraceName parameters.OwnerName InvalidOwnerName - Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired - Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId - String.isValidGraceName parameters.OrganizationName InvalidOrganizationName - Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired - Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId - Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired - Input.listIsNonEmpty parameters.BranchIds BranchIdsAreRequired - Number.isWithinRange parameters.MaxCount 1 1000 InvalidMaxCountValue - Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist ] + [| Guid.isValidAndNotEmpty parameters.OwnerId InvalidOwnerId + String.isValidGraceName parameters.OwnerName InvalidOwnerName + Input.eitherIdOrNameMustBeProvided parameters.OwnerId parameters.OwnerName EitherOwnerIdOrOwnerNameRequired + Guid.isValidAndNotEmpty parameters.OrganizationId InvalidOrganizationId + String.isValidGraceName parameters.OrganizationName InvalidOrganizationName + Input.eitherIdOrNameMustBeProvided parameters.OrganizationId parameters.OrganizationName EitherOrganizationIdOrOrganizationNameRequired + Guid.isValidAndNotEmpty parameters.RepositoryId InvalidRepositoryId + Input.eitherIdOrNameMustBeProvided parameters.RepositoryId parameters.RepositoryName EitherRepositoryIdOrRepositoryNameRequired + Input.listIsNonEmpty parameters.BranchIds BranchIdsAreRequired + Number.isWithinRange parameters.MaxCount 1 1000 InvalidMaxCountValue + Repository.repositoryIdExists parameters.RepositoryId RepositoryIdDoesNotExist |] let query (context: HttpContext) (maxCount: int) (actorProxy: IRepositoryActor) = task { diff --git a/src/Grace.Server/Validations.Server.fs b/src/Grace.Server/Validations.Server.fs index 1e3267c..d3b29f8 100644 --- a/src/Grace.Server/Validations.Server.fs +++ b/src/Grace.Server/Validations.Server.fs @@ -16,6 +16,7 @@ open System open System.Collections.Concurrent open System.Collections.Generic open System.Threading.Tasks +open ApplicationContext module Validations = @@ -39,7 +40,6 @@ module Validations = let! exists = ownerActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(ownerGuid, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error @@ -80,7 +80,6 @@ module Validations = let! exists = ownerActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(ownerGuid, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error @@ -163,7 +162,6 @@ module Validations = let! exists = organizationActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(organizationGuid, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error @@ -216,7 +214,6 @@ module Validations = let! exists = organizationActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(organizationGuid, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error @@ -282,7 +279,6 @@ module Validations = let! exists = repositoryActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(repositoryGuid, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error @@ -318,7 +314,6 @@ module Validations = let! exists = repositoryActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(repositoryGuid, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error @@ -382,7 +377,6 @@ module Validations = let! exists = branchActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(branchGuid, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error @@ -426,7 +420,6 @@ module Validations = let! exists = branchActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(branchGuid, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error @@ -502,7 +495,6 @@ module Validations = let! exists = directoryVersionActorProxy.Exists() if exists then use newCacheEntry = memoryCache.CreateEntry(directoryId, Value = null, SlidingExpiration = DefaultSlidingExpiration) - newCacheEntry.Dispose() return Ok () else return Error error diff --git a/src/Grace.Shared/Validation/Utilities.Validation.fs b/src/Grace.Shared/Validation/Utilities.Validation.fs index 7a096e1..8a648a4 100644 --- a/src/Grace.Shared/Validation/Utilities.Validation.fs +++ b/src/Grace.Shared/Validation/Utilities.Validation.fs @@ -9,10 +9,10 @@ module Utilities = /// Retrieves the first error from a list of validations. /// /// A list of Result values. - let getFirstError (validations: Task> list) = + let getFirstError (validations: Task> array) = task { let! firstError = validations - |> TaskSeq.ofTaskList + |> TaskSeq.ofTaskArray |> TaskSeq.tryFind(fun validation -> Result.isError validation) return match firstError with | Some result -> match result with | Ok _ -> None | Error error -> Some error // This line can't return None, because we'll always have an error if we get here. @@ -26,7 +26,7 @@ module Utilities = let anyFail validations = task { return! validations - |> TaskSeq.ofTaskList + |> TaskSeq.ofTaskArray |> TaskSeq.exists(fun validation -> Result.isError validation) }