import { AccessLevelList } from '../shared/access-level' ; import { PolicyStatement , Operator } from '../shared' ; param sid export class RefactorSpaces extends PolicyStatement { public servicePrefix = 'refactor-spaces' ; param sid constructor ( sid ? ) { super ( sid ) ; } /**
     * Grants permission to create an application within an environment
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifAwsRequestTag()
     * - .ifAwsTagKeys()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateApplication.html
     */ public toCreateApplication ( ) { return this . to ( 'CreateApplication' ) ; } /**
     * Grants permission to create an environment
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifAwsRequestTag()
     * - .ifAwsTagKeys()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateEnvironment.html
     */ public toCreateEnvironment ( ) { return this . to ( 'CreateEnvironment' ) ; } /**
     * Grants permission to create a route within an application
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifServiceCreatedByAccount()
     * - .ifRouteCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifSourcePath()
     * - .ifAwsRequestTag()
     * - .ifAwsTagKeys()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateRoute.html
     */ public toCreateRoute ( ) { return this . to ( 'CreateRoute' ) ; } /**
     * Grants permission to create a service within an application
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifServiceCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifAwsRequestTag()
     * - .ifAwsTagKeys()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateService.html
     */ public toCreateService ( ) { return this . to ( 'CreateService' ) ; } /**
     * Grants permission to delete an application from an environment
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_DeleteApplication.html
     */ public toDeleteApplication ( ) { return this . to ( 'DeleteApplication' ) ; } /**
     * Grants permission to delete an environment
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_DeleteEnvironment.html
     */ public toDeleteEnvironment ( ) { return this . to ( 'DeleteEnvironment' ) ; } /**
     * Grants permission to delete a resource policy
     *
     * Access Level: Write
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_DeleteResourcePolicy.html
     */ public toDeleteResourcePolicy ( ) { return this . to ( 'DeleteResourcePolicy' ) ; } /**
     * Grants permission to delete a route from an application
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifServiceCreatedByAccount()
     * - .ifRouteCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifSourcePath()
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_DeleteRoute.html
     */ public toDeleteRoute ( ) { return this . to ( 'DeleteRoute' ) ; } /**
     * Grants permission to delete a service from an application
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifServiceCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_DeleteService.html
     */ public toDeleteService ( ) { return this . to ( 'DeleteService' ) ; } /**
     * Grants permission to get more information about an application
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_GetApplication.html
     */ public toGetApplication ( ) { return this . to ( 'GetApplication' ) ; } /**
     * Grants permission to get more information for an environment
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_GetEnvironment.html
     */ public toGetEnvironment ( ) { return this . to ( 'GetEnvironment' ) ; } /**
     * Grants permission to get the details about a resource policy
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_GetResourcePolicy.html
     */ public toGetResourcePolicy ( ) { return this . to ( 'GetResourcePolicy' ) ; } /**
     * Grants permission to get more information about a route
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifServiceCreatedByAccount()
     * - .ifRouteCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifSourcePath()
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_GetRoute.html
     */ public toGetRoute ( ) { return this . to ( 'GetRoute' ) ; } /**
     * Grants permission to get more information about a service
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifServiceCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_GetService.html
     */ public toGetService ( ) { return this . to ( 'GetService' ) ; } /**
     * Grants permission to list all the applications in an environment
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_ListApplications.html
     */ public toListApplications ( ) { return this . to ( 'ListApplications' ) ; } /**
     * Grants permission to list all the VPCs for the environment
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_ListEnvironmentVpcs.html
     */ public toListEnvironmentVpcs ( ) { return this . to ( 'ListEnvironmentVpcs' ) ; } /**
     * Grants permission to list all environments
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_ListEnvironment.html
     */ public toListEnvironments ( ) { return this . to ( 'ListEnvironments' ) ; } /**
     * Grants permission to list all the routes in an application
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_ListRoutes.html
     */ public toListRoutes ( ) { return this . to ( 'ListRoutes' ) ; } /**
     * Grants permission to list all the services in an environment
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_ListServices.html
     */ public toListServices ( ) { return this . to ( 'ListServices' ) ; } /**
     * Grants permission to list all the tags for a given resource
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_ListTagsForResource.html
     */ public toListTagsForResource ( ) { return this . to ( 'ListTagsForResource' ) ; } /**
     * Grants permission to add a resource policy
     *
     * Access Level: Write
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_PutResourcePolicy.html
     */ public toPutResourcePolicy ( ) { return this . to ( 'PutResourcePolicy' ) ; } /**
     * Grants permission to tag a resource
     *
     * Access Level: Tagging
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifServiceCreatedByAccount()
     * - .ifRouteCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifSourcePath()
     * - .ifAwsTagKeys()
     * - .ifAwsRequestTag()
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_TagResource.html
     */ public toTagResource ( ) { return this . to ( 'TagResource' ) ; } /**
     * Grants permission to remove a tag from a resource
     *
     * Access Level: Tagging
     *
     * Possible conditions:
     * - .ifApplicationCreatedByAccount()
     * - .ifServiceCreatedByAccount()
     * - .ifRouteCreatedByAccount()
     * - .ifCreatedByAccountIds()
     * - .ifSourcePath()
     * - .ifAwsTagKeys()
     * - .ifAwsRequestTag()
     * - .ifAwsResourceTag()
     *
     * https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_UntagResource.html
     */ public toUntagResource ( ) { return this . to ( 'UntagResource' ) ; } protected accessLevelList : AccessLevelList = { Write : [ 'CreateApplication' , 'CreateEnvironment' , 'CreateRoute' , 'CreateService' , 'DeleteApplication' , 'DeleteEnvironment' , 'DeleteResourcePolicy' , 'DeleteRoute' , 'DeleteService' , 'PutResourcePolicy' ] , Read : [ 'GetApplication' , 'GetEnvironment' , 'GetResourcePolicy' , 'GetRoute' , 'GetService' , 'ListApplications' , 'ListEnvironmentVpcs' , 'ListEnvironments' , 'ListRoutes' , 'ListServices' , 'ListTagsForResource' ] , Tagging : [ 'TagResource' , 'UntagResource' ] } ; param environmentId param account param region param partition public onEnvironment ( environmentId , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:refactor-spaces:${ region || '*' }:${ account || '*' }:environment/${ environmentId }` ) ; } param environmentId param applicationId param account param region param partition public onApplication ( environmentId , applicationId , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:refactor-spaces:${ region || '*' }:${ account || '*' }:environment/${ environmentId }/application/${ applicationId }` ) ; } param environmentId param applicationId param serviceId param account param region param partition public onService ( environmentId , applicationId , serviceId , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:refactor-spaces:${ region || '*' }:${ account || '*' }:environment/${ environmentId }/application/${ applicationId }/service/${ serviceId }` ) ; } param environmentId param applicationId param routeId param account param region param partition public onRoute ( environmentId , applicationId , routeId , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:refactor-spaces:${ region || '*' }:${ account || '*' }:environment/${ environmentId }/application/${ applicationId }/route/${ routeId }` ) ; } param value param operator public ifApplicationCreatedByAccount ( value , operator ? ) { return this . if ( `ApplicationCreatedByAccount` , value , operator || 'StringLike' ) ; } param value param operator public ifCreatedByAccountIds ( value , operator ? ) { return this . if ( `CreatedByAccountIds` , value , operator || 'StringLike' ) ; } param value param operator public ifRouteCreatedByAccount ( value , operator ? ) { return this . if ( `RouteCreatedByAccount` , value , operator || 'StringLike' ) ; } param value param operator public ifServiceCreatedByAccount ( value , operator ? ) { return this . if ( `ServiceCreatedByAccount` , value , operator || 'StringLike' ) ; } param value param operator public ifSourcePath ( value , operator ? ) { return this . if ( `SourcePath` , value , operator || 'StringLike' ) ; } }