import { AccessLevelList } from '../shared/access-level' ; import { PolicyStatement , Operator } from '../shared' ; param sid export class RedshiftData extends PolicyStatement { public servicePrefix = 'redshift-data' ; param sid constructor ( sid ? ) { super ( sid ) ; } /**
     * Grants permission to execute multiple queries under a single connection.
     *
     * Access Level: Write
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_BatchExecuteStatement.html
     */ public toBatchExecuteStatement ( ) { return this . to ( 'BatchExecuteStatement' ) ; } /**
     * Grants permission to cancel a running query
     *
     * Access Level: Write
     *
     * Possible conditions:
     * - .ifStatementOwnerIamUserid()
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_CancelStatement.html
     */ public toCancelStatement ( ) { return this . to ( 'CancelStatement' ) ; } /**
     * Grants permission to retrieve detailed information about a statement execution
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifStatementOwnerIamUserid()
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_DescribeStatement.html
     */ public toDescribeStatement ( ) { return this . to ( 'DescribeStatement' ) ; } /**
     * Grants permission to retrieve metadata about a particular table
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_DescribeTable.html
     */ public toDescribeTable ( ) { return this . to ( 'DescribeTable' ) ; } /**
     * Grants permission to execute a query
     *
     * Access Level: Write
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_ExecuteStatement.html
     */ public toExecuteStatement ( ) { return this . to ( 'ExecuteStatement' ) ; } /**
     * Grants permission to fetch the result of a query
     *
     * Access Level: Read
     *
     * Possible conditions:
     * - .ifStatementOwnerIamUserid()
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_GetStatementResult.html
     */ public toGetStatementResult ( ) { return this . to ( 'GetStatementResult' ) ; } /**
     * Grants permission to list databases for a given cluster
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_ListDatabases.html
     */ public toListDatabases ( ) { return this . to ( 'ListDatabases' ) ; } /**
     * Grants permission to list schemas for a given cluster
     *
     * Access Level: Read
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_ListSchemas.html
     */ public toListSchemas ( ) { return this . to ( 'ListSchemas' ) ; } /**
     * Grants permission to list queries for a given principal
     *
     * Access Level: List
     *
     * Possible conditions:
     * - .ifStatementOwnerIamUserid()
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_ListStatements.html
     */ public toListStatements ( ) { return this . to ( 'ListStatements' ) ; } /**
     * Grants permission to list tables for a given cluster
     *
     * Access Level: List
     *
     * https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_ListTables.html
     */ public toListTables ( ) { return this . to ( 'ListTables' ) ; } protected accessLevelList : AccessLevelList = { Write : [ 'BatchExecuteStatement' , 'CancelStatement' , 'ExecuteStatement' ] , Read : [ 'DescribeStatement' , 'DescribeTable' , 'GetStatementResult' , 'ListDatabases' , 'ListSchemas' ] , List : [ 'ListStatements' , 'ListTables' ] } ; param clusterName param account param region param partition public onCluster ( clusterName , account ? , region ? , partition ? ) { return this . on ( `arn:${ partition || 'aws' }:redshift:${ region || '*' }:${ account || '*' }:cluster:${ clusterName }` ) ; } param value param operator public ifStatementOwnerIamUserid ( value , operator ? ) { return this . if ( `statement-owner-iam-userid` , value , operator || 'StringLike' ) ; } }