title: How to create intent in DialogFlow Fulfillment by code?
body: <p>I've started learning DialogFlow, I want to know that how can I create an Intent in Fulfillment by code, instead of creating it by GUI.</p>
  
  <p>here is my existing Fulfillment code:</p>
  
  <pre><code>'use strict';
  
  const functions = require('firebase-functions');
  const { WebhookClient } = require('dialogflow-fulfillment');
  const { Card, Suggestion } = require('dialogflow-fulfillment');
  
  process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
  
  exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) =&gt; {
      const agent = new WebhookClient({ request, response });
      console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
      console.log('Dialogflow Request body: ' + JSON.stringify(request.body));
  
      function welcome(agent) {
          agent.add(`Welcome to my firstagent!`);
      }
  
      function fallback(agent) {
          agent.add(`I didn't understand!`);
          agent.add(`I'm sorry, can you try again??`);
          agent.add(`Can you please tell me again??`);
          agent.add(`Sorry, I don't understand`);
      }
  
  let intentMap = new Map();
      //these are the intents that I've already created in dialog flow, But I want to create a new intent in code!
      intentMap.set('Default Welcome Intent', welcome);
      intentMap.set('Default Fallback Intent', fallback);
      agent.handleRequest(intentMap);
  });
  </code></pre>