import { AccessLevelList } from '../shared/access-level' ; import { PolicyStatement } from '../shared' ; param sid export class CodeguruReviewer extends PolicyStatement { public servicePrefix = 'codeguru-reviewer' ; param sid constructor ( sid ? ) { super ( sid ) ; } /**
     * Grants permission to associates a repository with Amazon CodeGuru Reviewer
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifAwsRequestTag()
     * - .ifAwsTagKeys()
     *
     * Dependent actions:
     * - codecommit:ListRepositories
     * - codecommit:TagResource
     * - events:PutRule
     * - events:PutTargets
     * - iam:CreateServiceLinkedRole
     * - s3:CreateBucket
     * - s3:ListBucket
     * - s3:PutBucketPolicy
     * - s3:PutLifecycleConfiguration
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_AssociateRepository.html
     */ public toAssociateRepository ( ) { return this . to ( 'AssociateRepository' ) ; } /**
     * Grants permission to create a code review
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * Dependent actions:
     * - s3:GetObject
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CreateCodeReview.html
     */ public toCreateCodeReview ( ) { return this . to ( 'CreateCodeReview' ) ; } /**
     * Grants permission to perform webbased oauth handshake for 3rd party providers
     *
     * Access Level: Read
     */ public toCreateConnectionToken ( ) { return this . to ( 'CreateConnectionToken' ) ; } /**
     * Grants permission to describe a code review
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeCodeReview.html
     */ public toDescribeCodeReview ( ) { return this . to ( 'DescribeCodeReview' ) ; } /**
     * Grants permission to describe a recommendation feedback on a code review
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRecommendationFeedback.html
     */ public toDescribeRecommendationFeedback ( ) { return this . to ( 'DescribeRecommendationFeedback' ) ; } /**
     * Grants permission to describe a repository association
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRepositoryAssociation.html
     */ public toDescribeRepositoryAssociation ( ) { return this . to ( 'DescribeRepositoryAssociation' ) ; } /**
     * Grants permission to disassociate a repository with Amazon CodeGuru Reviewer
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * Dependent actions:
     * - codecommit:UntagResource
     * - events:DeleteRule
     * - events:RemoveTargets
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DisassociateRepository.html
     */ public toDisassociateRepository ( ) { return this . to ( 'DisassociateRepository' ) ; } /**
     * Grants permission to view pull request metrics in console
     *
     * Access Level: Read
     */ public toGetMetricsData ( ) { return this . to ( 'GetMetricsData' ) ; } /**
     * Grants permission to list summary of code reviews
     *
     * Access Level: List
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListCodeReviews.html
     */ public toListCodeReviews ( ) { return this . to ( 'ListCodeReviews' ) ; } /**
     * Grants permission to list summary of recommendation feedback on a code review
     *
     * Access Level: List
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRecommendationFeedback.html
     */ public toListRecommendationFeedback ( ) { return this . to ( 'ListRecommendationFeedback' ) ; } /**
     * Grants permission to list summary of recommendations on a code review
     *
     * Access Level: List
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRecommendations.html
     */ public toListRecommendations ( ) { return this . to ( 'ListRecommendations' ) ; } /**
     * Grants permission to list summary of repository associations
     *
     * Access Level: List
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html
     */ public toListRepositoryAssociations ( ) { return this . to ( 'ListRepositoryAssociations' ) ; } /**
     * Grants permission to list the resource attached to a associated repository ARN
     *
     * Access Level: List
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListTagsForResource.html
     */ public toListTagsForResource ( ) { return this . to ( 'ListTagsForResource' ) ; } /**
     * Grants permission to list 3rd party providers repositories in console
     *
     * Access Level: Read
     */ public toListThirdPartyRepositories ( ) { return this . to ( 'ListThirdPartyRepositories' ) ; } /**
     * Grants permission to put feedback for a recommendation on a code review
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_PutRecommendationFeedback.html
     */ public toPutRecommendationFeedback ( ) { return this . to ( 'PutRecommendationFeedback' ) ; } /**
     * Grants permission to attach resource tags to an associated repository ARN
     *
     * Access Level: Tagging
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_TagResource.html
     */ public toTagResource ( ) { return this . to ( 'TagResource' ) ; } /**
     * Grants permission to disassociate resource tags from an associated repository ARN
     *
     * Access Level: Tagging
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_UnTagResource.html
     */ public toUnTagResource ( ) { return this . to ( 'UnTagResource' ) ; } protected accessLevelList : AccessLevelList = { Write : [ 'AssociateRepository' , 'CreateCodeReview' , 'DisassociateRepository' , 'PutRecommendationFeedback' ] , Read : [ 'CreateConnectionToken' , 'DescribeCodeReview' , 'DescribeRecommendationFeedback' , 'DescribeRepositoryAssociation' , 'GetMetricsData' , 'ListThirdPartyRepositories' ] , List : [ 'ListCodeReviews' , 'ListRecommendationFeedback' , 'ListRecommendations' , 'ListRepositoryAssociations' , 'ListTagsForResource' ] , Tagging : [ 'TagResource' , 'UnTagResource' ] } ; param resourceId param account param region param partition public onAssociation ( resourceId , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:codeguru-reviewer:${ region || '*' }:${ account || '*' }:association:${ resourceId }` ) ; } param codeReviewUuid param account param region param partition public onCodereview ( codeReviewUuid , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:codeguru-reviewer:${ region || '*' }:${ account || '*' }:code-review:${ codeReviewUuid }` ) ; } param repositoryName param account param region param partition public onRepository ( repositoryName , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:codecommit:${ region || '*' }:${ account || '*' }:${ repositoryName }` ) ; } param connectionId param account param region param partition public onConnection ( connectionId , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:codestar-connections:${ region || '*' }:${ account || '*' }:connection/${ connectionId }` ) ; } }