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::CodeCommit::RepositoryAssociation' ; @ Exclude ( ) protected readonly IDENTIFIER_KEY_ARN : string = '/properties/Arn' ; @ Expose ( { name : 'Arn' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'arn' , value , obj , [ ] ) , { toClassOnly : true , } ) arn ? : Optional < string > ; @ Expose ( { name : 'ApprovalRuleTemplateArn' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'approvalRuleTemplateArn' , value , obj , [ ] ) , { toClassOnly : true , } ) approvalRuleTemplateArn ? : Optional < string > ; @ Expose ( { name : 'ApprovalRuleTemplateName' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'approvalRuleTemplateName' , value , obj , [ ] ) , { toClassOnly : true , } ) approvalRuleTemplateName ? : Optional < string > ; @ Expose ( { name : 'RepositoryNames' } ) @ Transform ( ( value , obj ) => transformValue ( String , 'repositoryNames' , value , obj , [ Array ] ) , { toClassOnly : true , } ) repositoryNames ? : Optional < Array < string > > ; @ Exclude ( ) public getPrimaryIdentifier ( ) { const identifier = { } ; if ( this . arn != null ) { identifier [ this . IDENTIFIER_KEY_ARN ] = this . arn ; } return Object . keys ( identifier ) . length === 1 ? identifier : null ; } @ Exclude ( ) public getAdditionalIdentifiers ( ) { const identifiers = new Array < Dict > ( ) ; return identifiers . length === 0 ? null : identifiers ; } }