"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StreamGrants=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var perms=()=>{var tmp=require("./perms");return perms=()=>tmp,tmp},iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp};class StreamGrants{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_dynamodb.StreamGrants",version:"2.256.1"};tableStreamArn;encryptionKey;constructor(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_dynamodb_StreamGrantsProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,StreamGrants),error}this.tableStreamArn=props.tableStreamArn,this.encryptionKey=props?.encryptionKey}actions(grantee,...actions){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.actions),error}return iam().Grant.addToPrincipal({grantee,actions,resourceArns:[this.tableStreamArn]})}list(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.list),error}return iam().Grant.addToPrincipal({grantee,actions:["dynamodb:ListStreams"],resourceArns:["*"]})}read(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.read),error}return this.list(grantee),this.encryptionKey?.grant(grantee,...perms().KEY_READ_ACTIONS),iam().Grant.addToPrincipal({grantee,actions:perms().READ_STREAM_DATA_ACTIONS,resourceArns:[this.tableStreamArn]})}}exports.StreamGrants=StreamGrants;
