export enum AccountSASPermission { Read = "r" , Write = "w" , Delete = "d" , List = "l" , Add = "a" , Create = "c" , Update = "u" , Process = "p" } /**
 * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value
 * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the
 * values are set, this should be serialized with toString and set as the permissions field on an
 *  AccountSASSignatureValues object. It is possible to construct the permissions string without this class, but
 * the order of the permissions is particular and this class guarantees correctness.
 *
 *  export class export default class AccountSASPermissions { static param { string } permissions returns { AccountSASPermissions } memberof public static parse ( permissions ) { const accountSASPermissions = new AccountSASPermissions ( ) ; for ( const c of permissions ) { switch ( c ) { case AccountSASPermission . Read : if ( accountSASPermissions . read ) { throw new RangeError ( `Duplicated permission character: ${ c }` ) ; } accountSASPermissions . read = true ; break ; case AccountSASPermission . Write : if ( accountSASPermissions . write ) { throw new RangeError ( `Duplicated permission character: ${ c }` ) ; } accountSASPermissions . write = true ; break ; case AccountSASPermission . Delete : if ( accountSASPermissions . delete ) { throw new RangeError ( `Duplicated permission character: ${ c }` ) ; } accountSASPermissions . delete = true ; break ; case AccountSASPermission . List : if ( accountSASPermissions . list ) { throw new RangeError ( `Duplicated permission character: ${ c }` ) ; } accountSASPermissions . list = true ; break ; case AccountSASPermission . Add : if ( accountSASPermissions . add ) { throw new RangeError ( `Duplicated permission character: ${ c }` ) ; } accountSASPermissions . add = true ; break ; case AccountSASPermission . Create : if ( accountSASPermissions . create ) { throw new RangeError ( `Duplicated permission character: ${ c }` ) ; } accountSASPermissions . create = true ; break ; case AccountSASPermission . Update : if ( accountSASPermissions . update ) { throw new RangeError ( `Duplicated permission character: ${ c }` ) ; } accountSASPermissions . update = true ; break ; case AccountSASPermission . Process : if ( accountSASPermissions . process ) { throw new RangeError ( `Duplicated permission character: ${ c }` ) ; } accountSASPermissions . process = true ; break ; default : throw new RangeError ( `Invalid permission character: ${ c }` ) ; } } return accountSASPermissions ; } type { boolean } memberof public read : boolean = false ; type { boolean } memberof public write : boolean = false ; type { boolean } memberof public delete : boolean = false ; type { boolean } memberof public list : boolean = false ; type { boolean } memberof public add : boolean = false ; type { boolean } memberof public create : boolean = false ; type { boolean } memberof public update : boolean = false ; type { boolean } memberof public process : boolean = false ; see https returns { string } memberof public toString ( ) { const permissions = [ ] ; if ( this . read ) { permissions . push ( AccountSASPermission . Read ) ; } if ( this . write ) { permissions . push ( AccountSASPermission . Write ) ; } if ( this . delete ) { permissions . push ( AccountSASPermission . Delete ) ; } if ( this . list ) { permissions . push ( AccountSASPermission . List ) ; } if ( this . add ) { permissions . push ( AccountSASPermission . Add ) ; } if ( this . create ) { permissions . push ( AccountSASPermission . Create ) ; } if ( this . update ) { permissions . push ( AccountSASPermission . Update ) ; } if ( this . process ) { permissions . push ( AccountSASPermission . Process ) ; } return permissions . join ( "" ) ; } }