import { Action , BaseResource , handlerEvent } from '@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib' ; import { commonAws } from 'aws-resource-providers-common' ; import { mainModule } from 'process' ; import { ResourceModel } from './models' ; class Resource extends BaseResource < ResourceModel > { @ handlerEvent ( Action . Create ) @ commonAws ( { serviceName : 'Account' , debug : true } ) public async create ( action , args , service , model ) { const _ = await service . putAlternateContact ( { AlternateContactType : model . alternateContactType , AccountId : model . accountId , Name : model . name , PhoneNumber : model . phoneNumber , Title : model . title , EmailAddress : model . emailAddress , } ) . promise ( ) ; return Promise . resolve ( model ) ; } @ handlerEvent ( Action . Update ) @ commonAws ( { serviceName : 'Account' , debug : true } ) public async update ( action , args , service , model ) { const _ = await service . putAlternateContact ( { AlternateContactType : model . alternateContactType , AccountId : model . accountId , Name : model . name , PhoneNumber : model . phoneNumber , Title : model . title , EmailAddress : model . emailAddress , } ) . promise ( ) ; return Promise . resolve ( model ) ; } @ handlerEvent ( Action . Delete ) @ commonAws ( { serviceName : 'Account' , debug : true } ) public async delete ( action , args , service , model ) { const _ = await service . deleteAlternateContact ( { AlternateContactType : model . alternateContactType , AccountId : model . accountId , } ) . promise ( ) ; return Promise . resolve ( model ) ; } } export const resource = new Resource ( ResourceModel . TYPE_NAME , ResourceModel ) ; export const entrypoint = resource . entrypoint ; export const testEntrypoint = resource . testEntrypoint ;