import { BaseModel , Dict , integer , Integer , Optional , transformValue } from 'cfn-rpdk' ; import { Exclude , Expose , Type , Transform } from 'class-transformer' ; export class ResourceModel extends BaseModel { [ 'constructor' ] : typeof ResourceModel ; @ Exclude ( ) public static readonly TYPE_NAME : string = 'Community::SSO::AssignmentGroup' ; @ Exclude ( ) protected readonly IDENTIFIER_KEY_RESOURCEID : string = '/properties/ResourceId' ; @ Expose ( { name : 'InstanceArn' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'instanceArn' , value , obj , [ ] ) , { toClassOnly : true , } ) instanceArn ? : Optional < string > ; @ Expose ( { name : 'ResourceId' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'resourceId' , value , obj , [ ] ) , { toClassOnly : true , } ) resourceId ? : Optional < string > ; @ Expose ( { name : 'PermissionSets' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'permissionSets' , value , obj , [ Array ] ) , { toClassOnly : true , } ) permissionSets ? : Optional < Array < string > > ; @ Expose ( { name : 'PrincipalId' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'principalId' , value , obj , [ ] ) , { toClassOnly : true , } ) principalId ? : Optional < string > ; @ Expose ( { name : 'PrincipalType' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'principalType' , value , obj , [ ] ) , { toClassOnly : true , } ) principalType ? : Optional < string > ; @ Expose ( { name : 'Targets' } ) @ Type ( ( ) => Target ) targets ? : Optional < Array < Target > > ; @ Exclude ( ) public getPrimaryIdentifier ( ) { const identifier = { } ; if ( this . resourceId != null ) { identifier [ this . IDENTIFIER_KEY_RESOURCEID ] = this . resourceId ; } return Object . keys ( identifier ) . length === 1 ? identifier : null ; } @ Exclude ( ) public getAdditionalIdentifiers ( ) { const identifiers = new Array < Dict > ( ) ; return identifiers . length === 0 ? null : identifiers ; } } export class Target extends BaseModel { [ 'constructor' ] : typeof Target ; @ Expose ( { name : 'TargetType' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'targetType' , value , obj , [ ] ) , { toClassOnly : true , } ) targetType ? : Optional < string > ; @ Expose ( { name : 'TargetIds' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'targetIds' , value , obj , [ Array ] ) , { toClassOnly : true , } ) targetIds ? : Optional < Array < string > > ; }