--[[
Ejemplo:
	lua test.lua 192.168.4.11

	donde 192.168.4.11 es la ip de cassandra
]]--
require "json"
require "socket"

local cassandra = require "lua_cassandra"
local cassandraHost = arg[1] or "127.0.0.1"
local cassandraPort = arg[2] or 9160
print("Connecting CASSANDRA " .. tostring(cassandraHost) .. ":" .. tostring(cassandraPort))
cassandra.seed(cassandraHost, cassandraPort)

--local apiLuis = require("luis"):new()

local apiLuis20 = require("luis"):new("2.0")
local apiLuis30 = require("luis"):new("3.0-PREVIEW")

apiLuis30.EnableLogger(true)
local models = require("luis.models")

local function LoadAzureAccounts (tenantInfo)
	print("")
	print("-- TEST 1 LoadAzureAccounts ---(START)------------")
	local success, response = apiLuis30.LoadAzureAccounts(tenantInfo)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(response))
	print("-- TEST 1 LoadAzureAccounts ---(END)------------")
	print("")
end

local function GetAssignedAzureAccountsResourceInAppApiV3_0 (appId, tenantInfo)
	print("")
	print("-- TEST 2 GetAssignedAzureAccountsResourceInAppApiV3_0 ---(START)------------")
	local success, response = apiLuis30:GetAssignedAzureAccountsResourceInApp(appId, tenantInfo)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(response))
	print("-- TEST 2 GetAssignedAzureAccountsResourceInAppApiV3_0 ---(END)------------")
	print("")
end

local function GetAssignedAzureAccountsResourceInAppApiV2_0 (appId, tenantInfo)
	print("")
	print("-- TEST 2 GetAssignedAzureAccountsResourceInAppApiV2_0 ---(START)------------")
	local success, response = apiLuis20:GetAssignedAzureAccountsResourceInApp(appId, tenantInfo)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(response))
	print("-- TEST 2 GetAssignedAzureAccountsResourceInAppApiV2_0 ---(END)------------")
	print("")
end


local function LoadTenantAndAzureAccountAndToken (vcc, tenantInfo)
	print("")
	print("-- TEST 3 LoadTenantAndAzureAccountAndToken ---(START)------------")
	local success, vccAzureAccount, tokenInfo, vccTenants = apiLuis30.LoadTenantAndAzureAccountAndToken(vcc)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-vccAzureAccount: " .. json.encode(vccAzureAccount))
	print("-tokenInfo: " .. json.encode(tokenInfo))
	print("-vccTenants: " .. json.encode(vccTenants))
	print("-- TEST 3 LoadTenantAndAzureAccountAndToken ---(END)------------")
	print("")
end

local function RenameEntity (info)
	print("")
	print("-- TEST 4 RenameEntity ---(START)------------")
	local success, response = apiLuis30.RenameAppEntitySimple(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 4 RenameEntity ---(END)------------")
	print("")
end

local function RenameHierarchicalEntityApiV3_0 (info)
	print("")
	print("-- TEST 5 RenameHierarchicalEntityApiV3_0 ---(START)------------")
	local success, response = apiLuis30:RenameAppEntityHierarchical(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 5 RenameHierarchicalEntityApiV3_0 ---(END)------------")
	print("")
end

local function RenameHierarchicalEntityApiV2_0 (info)
	print("")
	print("-- TEST 5.1 RenameHierarchicalEntityApiV2_0 ---(START)------------")
	local success, response = apiLuis20:RenameAppEntityHierarchical(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 5.1 RenameHierarchicalEntityApiV2_0 ---(END)------------")
	print("")
end

local function CreateSimpleEntityApiV2_0 (info)
	print("")
	print("-- TEST 6.1 CreateSimpleEntityApiV2_0 ---(START)------------")
	local success, response = apiLuis20:CreateAppEntitySimple(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 6.1 CreateSimpleEntityApiV2_0 ---(END)------------")
	print("")
end

local function CreateMachineLearnedEntityApiV3_0 (info)
	print("")
	print("-- TEST 6.2 CreateMachineLearnedEntityApiV3_0 ---(START)------------")
	local success, response = apiLuis30:CreateAppEntityMachineLearned(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 6.2 CreateMachineLearnedEntityApiV3_0 ---(END)------------")
	print("")
end

local function RenameAppEntityMachineLearnedV3_0 (info)
	print("")
	print("-- TEST 6.3 RenameAppEntityMachineLearnedV3_0 ---(START)------------")
	local success, response = apiLuis30:RenameAppEntityMachineLearned(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 6.3 RenameAppEntityMachineLearnedV3_0 ---(END)------------")
	print("")
end

local function CreateMachineLearnedEntityChildApiV3_0 (info)
	print("")
	print("-- TEST 6.4 CreateMachineLearnedEntityChildApiV3_0 ---(START)------------")
	local success, response = apiLuis30:CreateAppEntityChildMachineLearned(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 6.2 CreateMachineLearnedEntityChildApiV3_0 ---(END)------------")
	print("")
end

local function DeleteAppEntityMachineLearnedApiV3_0 (info)
	print("")
	print("-- TEST 6.4 DeleteAppEntityMachineLearnedApiV3_0 ---(START)------------")
	local success, response = apiLuis30:DeleteAppEntityMachineLearned(info.appId, info.entityId, info.versionId)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 6.2 DeleteAppEntityMachineLearnedApiV3_0 ---(END)------------")
	print("")
end

local function CreateHierarchicalEntityApiV2_0 (info)
	print("")
	print("-- TEST 7.1 CreateHierarchicalEntityApiV2_0 ---(START)------------")
	local success, response = apiLuis20:CreateAppEntityHierarchical(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 7.1 CreateHierarchicalEntityApiV2_0 ---(END)------------")
	print("")
end

local function CreateHierarchicalEntityApiV3_0 (info)
	print("")
	print("-- TEST 7.2 CreateHierarchicalEntityApiV3_0 ---(START)------------")
	local success, response = apiLuis30:CreateAppEntityHierarchical(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 7.2 CreateHierarchicalEntityApiV3_0 ---(END)------------")
	print("")
end

local function CreateCompositeEntityApiV2_0 (info)
	print("")
	print("-- TEST 8.1 CreateCompositeEntityApiV2_0 ---(START)------------")
	local success, response = apiLuis20:CreateAppEntityComposite(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 8.1 CreateCompositeEntityApiV2_0 ---(END)------------")
	print("")
end

local function CreateCompositeEntityApiV3_0 (info)
	print("")
	print("-- TEST 8.2 CreateCompositeEntityApiV3_0 ---(START)------------")
	local success, response = apiLuis30:CreateAppEntityComposite(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 8.2 CreateCompositeEntityApiV3_0 ---(END)------------")
	print("")
end

local function RenameCompositeEntityApiV3_0 (info)
	print("")
	print("-- TEST 9.1 RenameCompositeEntityApiV3_0 ---(START)------------")
	local success, response = apiLuis30:RenameAppEntityComposite(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 9.1 RenameCompositeEntityApiV3_0 ---(END)------------")
	print("")
end

local function RenameCompositeEntityApiV2_0 (info)
	print("")
	print("-- TEST 9.2 RenameCompositeEntityApiV2_0 ---(START)------------")
	local success, response = apiLuis20:RenameAppEntityComposite(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(json.encode(response)))
	print("-- TEST 9.2 RenameCompositeEntityApiV2_0 ---(END)------------")
	print("")
end

local function LoadAppVersionsV2_0 (info)
	print("")
	print("-- TEST 10.1 LoadAppVersionsV2_0 ---(START)------------")
	local success, response = apiLuis20:LoadAppVersions(info.appId, info.paginated or "")
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(response))
	print("-- TEST 10.1 LoadAppVersionsV2_0 ---(END)------------")
	print("")
end

local function LoadAppVersionsV3_0 (info)
	print("")
	print("-- TEST 10.2 LoadAppVersionsV3_0 ---(START)------------")
	local success, response = apiLuis30:LoadAppVersions(info.appId, info.paginated or "")
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(response))
	print("-- TEST 10.2 LoadAppVersionsV3_0 ---(END)------------")
	print("")
end

local function LoadAllAppEntitiesMachineLearnedV3_0 (info)
	print("")
	print("-- TEST 10.2 LoadAllAppEntitiesMachineLearnedV3_0 ---(START)------------")
	local success, response = apiLuis30:LoadAllAppEntitiesMachineLearned(info.appId, info.versionId, info.paginated or "")
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(response))
	print("-- TEST 10.2 LoadAllAppEntitiesMachineLearnedV3_0 ---(END)------------")
	print("")
end

local function GetAppEntityMachineLearnedV3_0 (info)
	print("")
	print("-- TEST 10.3 GetAppEntityMachineLearnedV3_0 ---(START)------------")
	local success, response = apiLuis30:GetAppEntityMachineLearned(info.appId, info.entityId, info.versionId)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(response))
	print("-- TEST 10.2 GetAppEntityMachineLearnedV3_0 ---(END)------------")
	print("")
end


local function AddUtteranceAppIntentV3_0 (info)
	print("")
	print("-- TEST 11.1 AddUtteranceAppIntentV3_0 ---(START)------------")
	local success, response = apiLuis30:AddUtteranceAppIntent(info)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-response: " .. tostring(response))
	print("-- TEST 11.1 AddUtteranceAppIntentV3_0 ---(END)------------")
	print("")
end

local function ExportApp (appId)
	print("")
	print("-- TEST 12.1 ExportApp ---(START)------------")
	local success, encodedExportedApp, exportedApp = apiLuis20:ExportApp(appId)
	--local success, encodedExportedApp, exportedApp = apiLuis30:ExportApp(appId)
	print("-----------------")
	print("-success: " .. tostring(success))
	print("-encodedExportedApp: " .. tostring(encodedExportedApp))
	print("-exportedApp: " .. tostring(exportedApp))
	print("-- TEST 12.1 ExportApp ---(END)------------")
	print("")
end

-- ---- TEST 1------------------------------------
-- --[[
	-- Lista todas las Azure Accounts para un "tenant_id" determinado
-- ]]--
-- local tenantInfo = {
	-- tenant_id = "359e9065-2b08-4aae-9504-38e2a3b4b356",
	-- client_id = "d336fabc-9804-4186-8f8f-b40c52f39c6e",
	-- client_secret = "J]Z/1@x/4PJXG9K1+SIj96GaIQ:iLS1s",
	-- resource = "https://management.azure.com/"
-- }
-- LoadAzureAccounts(tenantInfo)
-- ---------------------------------------------------

---- TEST 2------------------------------------
--[[
	Lista las Azure Accounts que se le han asignado a una App determinada para un "tenant_id" determinado
]]--
-- local appId = "59fe1144-7c41-48b4-a599-d722b85a2dbf"
-- local tenantInfo = {
--  	tenant_id = "359e9065-2b08-4aae-9504-38e2a3b4b356",
--  	client_id = "d336fabc-9804-4186-8f8f-b40c52f39c6e",
--  	client_secret = "J]Z/1@x/4PJXG9K1+SIj96GaIQ:iLS1s",
--  	resource = "https://management.azure.com/"
--  }
--  GetAssignedAzureAccountsResourceInAppApiV3_0(appId, tenantInfo)

--  GetAssignedAzureAccountsResourceInAppApiV2_0(appId, tenantInfo)
-- ---------------------------------------------------

---- TEST 3------------------------------------
--[[
	Lista las Azure Accounts que se le han asignado a una App determinada para un "tenant_id" determinado
]]--
--local vcc = "emma"
--LoadTenantAndAzureAccountAndToken(vcc)
---------------------------------------------------

---- TEST 4------------------------------------
--[[
	
]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	entityId = "8eafd0e3-53ef-42da-9cd3-a05faa4b02ed",
-- 	versionId = "0.1",
-- 	name = "NewNameEntityEmma3"
-- }
-- RenameEntity(info)
-- ---------------------------------------------------

-- -- ---- TEST 5 (version 3.0 PREVIEW) ------------------------------------
-- -- --[[
	
-- -- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	entityId = "61e0ab64-53ef-4d80-8377-a7a482ee16fb",
-- 	versionId = "0.1",
-- 	entity = {
-- 		name = "1 H 3.0",
-- 		children = {"hijoasdfasdfasdfasdfasdfsda1"}
-- 	}
-- }
-- RenameHierarchicalEntityApiV3_0(info)
-- -- -- ---------------------------------------------------

-- ---- TEST 5.1 (version 2.0) ------------------------------------
-- --[[
	
-- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	entityId = "61e0ab64-53ef-4d80-8377-a7a482ee16fb",
-- 	versionId = "0.1",
-- 	entity = {
-- 		name = "1 H 2.0",
-- 		children = {"hijo3"}
-- 	}
-- }
-- RenameHierarchicalEntityApiV2_0(info)
-- ---------------------------------------------------

-- ---- TEST 6.1 (version 2.0) ------------------------------------
--[[
	
]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	name = "SIMPLE_api2.0_Name2"
-- }
-- CreateSimpleEntityApiV2_0(info)
-- ---------------------------------------------------


-- ---- TEST 6.2 (version 3.0) ------------------------------------
--[[
	
]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	name = "MachineLearned_api3.0_Name2"
-- }
-- CreateMachineLearnedEntityApiV3_0(info)
-- ---------------------------------------------------

-- ---- TEST 6.3 (version 3.0) ------------------------------------
--[[
	
]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	name = "MachineLearned_api3.0_Name3_with_childrens",
-- 	children = {
-- 		{
-- 			name = "nombre"
-- 		},
-- 		{
-- 			name =  "apellido"
-- 		}
-- 	}
-- }
-- CreateMachineLearnedEntityApiV3_0(info)
-- ---------------------------------------------------

-- ---- TEST 6.4 (version 3.0) ------------------------------------
--[[
	
]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	name = "MachineLearned_api3.0_Name3_with_childrens1",
-- 	children = {
-- 		{
-- 			name = "nombre"
-- 		},
-- 		{
-- 			name =  "apellido"
-- 		}
-- 	}
-- }
-- CreateMachineLearnedEntityApiV3_0(info)
-- ---------------------------------------------------

-- ---- TEST 6.5 (version 3.0) ------------------------------------
--[[
	
]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	name = "MachineLearned_api3.0_Name3_with_childrens2",
-- 	children = {
-- 		{
-- 			name = "nombre"
-- 		},
-- 		{
-- 			name =  "apellido",
-- 			children = {
-- 				{
-- 					name = "apodo"
-- 				}
-- 			}
-- 		}
-- 	}
-- }
-- CreateMachineLearnedEntityApiV3_0(info)
-- ---------------------------------------------------

-- -- ---- TEST 6.6 (version 3.0) ------------------------------------
-- --[[
	
-- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	name = "ML_test_api03_b",
-- 	children = {
-- 		{
-- 			name = "uno"
-- 		},
-- 		{
-- 			name = "dos"
-- 		}
-- 	}
-- }
-- CreateMachineLearnedEntityApiV3_0(info)
-- -- ---------------------------------------------------


-- -- -- ---- TEST 6.7 (version 3.0) ------------------------------------
-- -- --[[
	
-- -- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	entityId = "58432406-11cd-4a49-b109-f510c6d20744",
-- 	versionId = "0.1",
-- 	name = "ML_test_api03_d"
-- }
-- RenameAppEntityMachineLearnedV3_0(info)
-- -- -- ---------------------------------------------------

-- -- ---- TEST 6.7 (version 3.0) ------------------------------------
-- --[[
	
-- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
--  	entityId = "e358e908-706e-4ed0-abde-5d431a3250ff",
-- 	versionId = "0.1",
-- 	name = "Hijo1",
-- 	children = {
-- 		{
-- 			name = "Hijo1.1"
-- 		},
-- 		{
-- 			name = "Hijo1.2"
-- 		}
-- 	}
-- }
-- CreateMachineLearnedEntityChildApiV3_0(info)


-- -- ---- TEST 6.7.1 (version 30) ------------------------------------
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
--  	entityId = "f44584eb-bdf8-4a1d-8e51-b341c1d3ba20",
-- 	versionId = "0.1"
-- }
-- DeleteAppEntityMachineLearnedApiV3_0(info)

-- ---- TEST 6.8 (version 30) ------------------------------------

-- LoadAllAppEntitiesMachineLearnedV3_0({
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	paginated = ""
-- })

-- -- ---- TEST 6.9 (version 30) ------------------------------------
-- GetAppEntityMachineLearnedV3_0({
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	entityId = "c5d3139a-fdc2-4a07-8923-147e128acf94",
-- 	versionId = "0.1"
-- })





-- ---------------------------------------------------


-- -- ---- TEST 7.1 (version 2.0) ------------------------------------
-- --[[
	
-- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	entity = {
-- 		name = "1 H",
-- 		children = { "hijo 1", "hijo 2"}
-- 	}

-- }
-- CreateHierarchicalEntityApiV2_0(info)

-- -- -- ---- TEST 7.2 (version 3.0) ------------------------------------
-- -- --[[
	
-- -- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	entity = {
-- 		name = "1 H",
-- 		children = { "hijo 1", "hijo 2"}
-- 	}

-- }
-- CreateHierarchicalEntityApiV3_0(info)

-- -- ---- TEST 8.1 (version 2.0) ------------------------------------
-- --[[
	
-- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	entity = {
-- 		name = "c2Api20",
-- 		children = {"s1a"}
-- 	}

-- }
-- CreateCompositeEntityApiV2_0(info)

-- -- ---- TEST 8.2 (version 2.0) ------------------------------------
-- --[[
	
-- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	versionId = "0.1",
-- 	entity = {
-- 		name = "c1Api30_preview",
-- 		children = {"s1a"}
-- 	}

-- }
-- CreateCompositeEntityApiV3_0(info)


-- -- ---- TEST 9.1 (version 3.0 PREVIEW) ------------------------------------
-- -- --[[
	
-- -- -- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	entityId = "87e29900-f09a-4615-a5a9-4889faff263a",
-- 	versionId = "0.1",
-- 	entity = {
-- 		name = "1 C 3.0_a",
-- 		children = {"entidadSimple1"}
-- 	}
-- }
-- RenameCompositeEntityApiV3_0(info)
-- -- -- ---------------------------------------------------

-- ---- TEST 9.2 (version 2.0) ------------------------------------
-- --[[
	
-- ]]--
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	entityId = "87e29900-f09a-4615-a5a9-4889faff263a",
-- 	versionId = "0.1",
-- 	entity = {
-- 		name = "1 C 2.0a",
-- 		--children = {"s1a"}
-- 		children = {"entidadSimple1"}
-- 	}
-- }
-- RenameCompositeEntityApiV2_0(info)
-- ---------------------------------------------------

-- LoadAppVersionsV2_0({
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	paginated = ""
-- })

-- LoadAppVersionsV3_0({
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	paginated = ""
-- })

-- ---------------------------------------------------
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	utterance = "hay alguna sucursal ?",
-- 	intentName = "intentv30",
-- 	entityLabels = {
-- 		{
-- 			entityName = "machine2",
-- 			startCharIndex = 4,
-- 			endCharIndex = 9,
-- 			children = {}
-- 		}
-- 	}
-- }
-- AddUtteranceAppIntentV3_0(info)

-- ---------------------------------------------------
-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	utterance = "hay alguna sucursal ?",
-- 	intentName = "intentv30",
-- 	entityLabels = {
-- 		{
-- 			entityName = "machine2",
-- 			startCharIndex = 4,
-- 			endCharIndex = 9,
-- 			children = {
-- 				{
-- 					entityName = "2",
-- 					startCharIndex = 4,
-- 					endCharIndex = 9,
-- 					children = {}
-- 				}
-- 			}
-- 		}
-- 	}
-- }
-- AddUtteranceAppIntentV3_0(info)

-- -- ---------------------------------------------------

-- local info = {
-- 	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
-- 	utterance = "hay alguna sucursal ?",
-- 	intentName = "intentv30",
-- 	entityLabels = {
-- 		{
-- 			entityName = "machine2",
-- 			startCharIndex = 4,
-- 			endCharIndex = 9,
-- 			children = {
-- 				{
-- 					entityName = "2",
-- 					startCharIndex = 4,
-- 					endCharIndex = 9,
-- 					children = {
-- 						{
-- 							entityName = "2.2",
-- 							startCharIndex = 4,
-- 							endCharIndex = 9,
-- 							children = {}
-- 						}
-- 					}
-- 				}
-- 			}
-- 		}
-- 	}
-- }
-- AddUtteranceAppIntentV3_0(info)

-- -- ---------------------------------------------------


local info = {
	appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d",
	utterance = "hay alguna sucursal ?",
	intentName = "intentv30",
	entityLabels = {
		{
			entityName = "machine2",
			startCharIndex = 4,
			endCharIndex = 9,
			children = {
				{
					entityName = "2",
					startCharIndex = 4,
					endCharIndex = 9,
					children = {
						{
							entityName = "2.2",
							startCharIndex = 4,
							endCharIndex = 9,
							children = {
								{
									entityName = "2.2.1",
									startCharIndex = 4,
									endCharIndex = 9,
									children = {}
								}
							}
						}
					}
				}
			}
		}
	}
}
--AddUtteranceAppIntentV3_0(info)

-- ---------------------------------------------------

--local appId = "aaf03b5e-c22e-4098-8148-11c6591bb56d"
local appId = "a083c176-b180-4266-91d5-9d074e46a485"
--ExportApp(appId)