text: /********************************************************* {COPYRIGHT-TOP} ***
   * Licensed Materials - Property of IBM
   * 5725-Z22, 5725-Z63, 5725-U33, 5725-Z63
   *
   * (C) Copyright IBM Corporation 2016, 2017
   *
   * All Rights Reserved.
   * US Government Users Restricted Rights - Use, duplication or disclosure
   * restricted by GSA ADP Schedule Contract with IBM Corp.
   ********************************************************** {COPYRIGHT-END} **/
  // Node module: apiconnect-cli-policies
  
  
  var g = require('strong-globalize')();
  var logger = require('apiconnect-cli-logger');
  
  function formatter() {}
  
  formatter.prototype.getFormatter = function(result, options) {
    logger.writeln(g.f('name: %s', result.name));
    logger.writeln(g.f('display name: %s', result.appName));
    logger.writeln(g.f('description: %s', result.appDescription));
    logger.writeln(g.f('client id: %s', result.clientId));
    logger.writeln(g.f('consumer org name: %s', result.consumerOrg.name));
  };
  
  formatter.prototype.listFormatter = function(results) {
    for (var i = 0; i < results.length; i++) {
      logger.writeln(g.f('%s in %s', results[i].appName, results[i].consumerOrg.name));
    }
  };
  
  formatter.prototype.error = function(error) {
    throw error;
  };
  
  module.exports = formatter;
  
  