{
  "metadata": {
    "schemaVersion": "1.0",
    "importType": "LEX",
    "importFormat": "JSON"
  },
  "resource": {
    "name": "ExpenseBot",
    "version": "6",
    "intents": [{
      "rejectionStatement": {
        "messages": [{
          "contentType": "PlainText",
          "content": "OK, I haven't recorded the expense."
        }]
      },
      "name": "RecordExpense",
      "version": "15",
      "fulfillmentActivity": {
        "type": "CodeHook",
        "codeHook": {
          "uri": "arn:aws:lambda:us-east-1:YOUR-ACCOUNT-NUMBER-HERE:function:ExpenseBotValidationHandler",
          "messageVersion": "1.0"
        }
      },
      "sampleUtterances": [
        "{ExpenseAmount} non-billable",
        "{ExpenseAmount}",
        "{ExpenseAmount} for {ExpenseCategory}",
        "{ExpenseAmount} for {ExpenseCategory} {ExpenseIsBillable}",
        "{ExpenseAmount} for {ExpenseCategory} {ExpenseIsBillable} to {ExpenseProject}",
        "{ExpenseAmount} {ExpenseCategory}"
      ],
      "slots": [{
          "name": "ExpenseAmount",
          "slotConstraint": "Required",
          "slotType": "AMAZON.NUMBER",
          "valueElicitationPrompt": {
            "messages": [{
              "contentType": "PlainText",
              "content": "How much was this expense?"
            }],
            "maxAttempts": 2
          },
          "priority": 1,
          "sampleUtterances": []
        },
        {
          "name": "ExpenseCategory",
          "slotConstraint": "Required",
          "slotType": "ExpenseCategory",
          "slotTypeVersion": "1",
          "valueElicitationPrompt": {
            "messages": [{
              "contentType": "PlainText",
              "content": "${ExpenseAmount} for which category? Meals, travel, or other?"
            }],
            "maxAttempts": 2,
            "responseCard": "{\"version\":1,\"contentType\":\"application/vnd.amazonaws.card.generic\",\"genericAttachments\":[]}"
          },
          "priority": 3,
          "sampleUtterances": []
        },
        {
          "name": "ExpenseImage",
          "slotConstraint": "Optional",
          "slotType": "ExpenseImageURL",
          "slotTypeVersion": "1",
          "valueElicitationPrompt": {
            "messages": [{
              "contentType": "PlainText",
              "content": "Do you have a receipt? If yes, send an image. If not, say &quot;no&quot;."
            }],
            "maxAttempts": 2,
            "responseCard": "{\"version\":1,\"contentType\":\"application/vnd.amazonaws.card.generic\",\"genericAttachments\":[]}"
          },
          "priority": 6,
          "sampleUtterances": []
        },
        {
          "name": "ExpenseIsBillable",
          "slotConstraint": "Optional",
          "slotType": "ExpenseIsBillable",
          "slotTypeVersion": "1",
          "valueElicitationPrompt": {
            "messages": [{
              "contentType": "PlainText",
              "content": "e.g. What city?"
            }],
            "maxAttempts": 2
          },
          "priority": 4,
          "sampleUtterances": []
        },
        {
          "name": "ExpenseProject",
          "slotConstraint": "Optional",
          "slotType": "ExpenseProject",
          "slotTypeVersion": "1",
          "valueElicitationPrompt": {
            "messages": [{
              "contentType": "PlainText",
              "content": "What project is this billable to?"
            }],
            "maxAttempts": 2
          },
          "priority": 5,
          "sampleUtterances": []
        }
      ],
      "confirmationPrompt": {
        "messages": [{
            "contentType": "PlainText",
            "content": "Should I record ${ExpenseAmount} under {ExpenseCategory}?"
          },
          {
            "contentType": "PlainText",
            "content": "Record {ExpenseAmount} for {ExpenseCategory} billable to {ExpenseProject}?"
          },
          {
            "contentType": "PlainText",
            "content": "Ready to submit this?"
          }
        ],
        "maxAttempts": 3
      },
      "dialogCodeHook": {
        "uri": "arn:aws:lambda:us-east-1:773548596459:function:ExpenseBotValidationHandler",
        "messageVersion": "1.0"
      },
      "conclusionStatement": {
        "messages": [{
          "contentType": "PlainText",
          "content": "ok thanks"
        }]
      }
    }],
    "slotTypes": [{
        "description": "a project for which the expense is billable",
        "name": "ExpenseProject",
        "version": "1",
        "enumerationValues": [{
            "value": "mom and pop",
            "synonyms": []
          },
          {
            "value": "global corp",
            "synonyms": []
          },
          {
            "value": "united industries",
            "synonyms": []
          },
          {
            "value": "company 2",
            "synonyms": []
          },
          {
            "value": "big co",
            "synonyms": []
          },
        ],
        "valueSelectionStrategy": "ORIGINAL_VALUE"
      },
      {
        "description": "flags to say that the expense is billable.",
        "name": "ExpenseIsBillable",
        "version": "1",
        "enumerationValues": [{
          "value": "true",
          "synonyms": [
            "billable",
            "billed",
            "bill"
          ]
        }],
        "valueSelectionStrategy": "TOP_RESOLUTION"
      },
      {
        "description": "the category for the expense.",
        "name": "ExpenseCategory",
        "version": "1",
        "enumerationValues": [{
            "value": "Travel",
            "synonyms": [
              "hotel",
              "baggage",
              "bag fee",
              "uber"
            ]
          },
          {
            "value": "Miscellaneous",
            "synonyms": [
              "other",
              "misc"
            ]
          },
          {
            "value": "Meals",
            "synonyms": [
              "meals",
              "dinner",
              "breakfast",
              "lunch",
              "snack",
              "coffee"
            ]
          }
        ],
        "valueSelectionStrategy": "TOP_RESOLUTION"
      },
      {
        "description": "twilio's s3 location for the receipt image",
        "name": "ExpenseImageURL",
        "version": "1",
        "enumerationValues": [{
          "value": "string",
          "synonyms": []
        }],
        "valueSelectionStrategy": "ORIGINAL_VALUE"
      }
    ],
    "voiceId": "0",
    "childDirected": false,
    "locale": "en-US",
    "idleSessionTTLInSeconds": 180,
    "clarificationPrompt": {
      "messages": [{
        "contentType": "PlainText",
        "content": "Sorry, can you please repeat that?"
      }],
      "maxAttempts": 5
    },
    "abortStatement": {
      "messages": [{
        "contentType": "PlainText",
        "content": "Sorry, I could not understand. Goodbye."
      }]
    }
  }
}