/**
 * Copyright         2020
 * Description       Example template RESTlet
 * Functional Spec   n/a
 **/
/**
 * @NApiVersion 2.1
 * @NScriptType Restlet
 */

import { EntryPoints } from 'N/types'
import * as LogManager from '../NFT-SS2-6.0.0/EC_Logger'

const log = LogManager.DefaultLogger

namespace X {
  /**
   * main script entrypoint for HTTP GET
   */
  export function get (ctx: EntryPoints.RESTlet.get) {
    log.debug(`hello world`, ctx.length)
  }

  /**
   * main script entrypoint for HTTP POST
   */
  export function post (/*ctx: EntryPoints.RESTlet.post*/) {
  }

  /**
   * main script entrypoint for HTTP PUT
   */
  export function put (/*ctx: EntryPoints.RESTlet.put*/) {
  }

  /**
   * main script entrypoint for HTTP DELETE
   */
  export function delete_ (/*ctx: EntryPoints.RESTlet.delete_*/) {
  }

}

LogManager.autoLogMethodEntryExit({ target: X, method: /\w+/ }, {
  withGovernance: true,
  withProfiling: true
})

export = {
  get: X.get,
  post: X.post,
  put: X.put,
  delete: X.delete_
}
