CODEGURU-REVIEWER

AssociateRepository

enum_EncryptionOption := [ "AWS_OWNED_CMK", "CUSTOMER_MANAGED_CMK" ]

valid {
    input.Body.Repository.CodeCommit.Name == STRING
    input.Body.Repository.Bitbucket.Name == STRING
    input.Body.Repository.Bitbucket.ConnectionArn == STRING
    input.Body.Repository.Bitbucket.Owner == STRING
    input.Body.Repository.GitHubEnterpriseServer.Name == STRING
    input.Body.Repository.GitHubEnterpriseServer.ConnectionArn == STRING
    input.Body.Repository.GitHubEnterpriseServer.Owner == STRING
    input.Body.Repository.S3Bucket.Name == STRING
    input.Body.Repository.S3Bucket.BucketName == STRING
    input.Body.ClientRequestToken == STRING
    input.Body.Tags.STRING == STRING
    input.Body.KMSKeyDetails.KMSKeyId == STRING
    input.Body.KMSKeyDetails.EncryptionOption == enum_EncryptionOption[_]
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

CreateCodeReview

enum_AnalysisType := [ "Security", "CodeQuality" ]
enum_VendorName := [ "GitHub", "GitLab", "NativeS3" ]

valid {
    input.Body.Name == STRING
    input.Body.RepositoryAssociationArn == STRING
    input.Body.Type.RepositoryAnalysis.RepositoryHead.BranchName == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.CommitDiff.SourceCommit == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.CommitDiff.DestinationCommit == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.CommitDiff.MergeBaseCommit == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.RepositoryHead.BranchName == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.BranchDiff.SourceBranchName == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.BranchDiff.DestinationBranchName == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.S3BucketRepository.Name == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.S3BucketRepository.Details.BucketName == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.S3BucketRepository.Details.CodeArtifacts.SourceCodeArtifactsObjectKey == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.S3BucketRepository.Details.CodeArtifacts.BuildArtifactsObjectKey == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.RequestMetadata.RequestId == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.RequestMetadata.Requester == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.RequestMetadata.EventInfo.Name == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.RequestMetadata.EventInfo.State == STRING
    input.Body.Type.RepositoryAnalysis.SourceCodeType.RequestMetadata.VendorName == enum_VendorName[_]
    input.Body.Type.AnalysisTypes[_] == enum_AnalysisType[_]
    input.Body.ClientRequestToken == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DescribeCodeReview

valid {
    input.ReqMap.CodeReviewArn == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DescribeRecommendationFeedback

valid {
    input.ReqMap.CodeReviewArn == STRING
    input.Qs.RecommendationId == STRING
    input.Qs.UserId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DescribeRepositoryAssociation

valid {
    input.ReqMap.AssociationArn == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DisassociateRepository

valid {
    input.ReqMap.AssociationArn == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ListCodeReviews

enum_JobState := [ "Completed", "Pending", "Failed", "Deleting" ]
enum_ProviderType := [ "CodeCommit", "GitHub", "Bitbucket", "GitHubEnterpriseServer", "S3Bucket" ]
enum_Type := [ "PullRequest", "RepositoryAnalysis" ]

valid {
    input.Qs.ProviderTypes[_] == enum_ProviderType[_]
    input.Qs.States[_] == enum_JobState[_]
    input.Qs.RepositoryNames[_] == STRING
    input.Qs.Type == enum_Type[_]
    input.Qs.MaxResults == INTEGER
    input.Qs.NextToken == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ListRecommendationFeedback

valid {
    input.ReqMap.CodeReviewArn == STRING
    input.Qs.NextToken == STRING
    input.Qs.MaxResults == INTEGER
    input.Qs.UserIds[_] == STRING
    input.Qs.RecommendationIds[_] == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ListRecommendations

valid {
    input.ReqMap.CodeReviewArn == STRING
    input.Qs.NextToken == STRING
    input.Qs.MaxResults == INTEGER
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ListRepositoryAssociations

enum_ProviderType := [ "CodeCommit", "GitHub", "Bitbucket", "GitHubEnterpriseServer", "S3Bucket" ]
enum_RepositoryAssociationState := [ "Associated", "Associating", "Failed", "Disassociating", "Disassociated" ]

valid {
    input.Qs.ProviderType[_] == enum_ProviderType[_]
    input.Qs.State[_] == enum_RepositoryAssociationState[_]
    input.Qs.Name[_] == STRING
    input.Qs.Owner[_] == STRING
    input.Qs.MaxResults == INTEGER
    input.Qs.NextToken == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ListTagsForResource

valid {
    input.ReqMap.resourceArn == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

PutRecommendationFeedback

enum_Reaction := [ "ThumbsUp", "ThumbsDown" ]

valid {
    input.Body.CodeReviewArn == STRING
    input.Body.RecommendationId == STRING
    input.Body.Reactions[_] == enum_Reaction[_]
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

TagResource

valid {
    input.Body.Tags.STRING == STRING
    input.ReqMap.resourceArn == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

UntagResource

valid {
    input.ReqMap.resourceArn == STRING
    input.Qs.tagKeys[_] == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}