// This file was generated by Mendix Modeler 7.23.
//
// WARNING: Code you write here will be lost the next time you deploy the project.

package testslackconnector.proxies.microflows;

import java.util.HashMap;
import java.util.Map;
import com.mendix.core.Core;
import com.mendix.core.CoreException;
import com.mendix.systemwideinterfaces.MendixRuntimeException;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.systemwideinterfaces.core.IMendixObject;

public class Microflows
{
	// These are the microflows for the TestSlackConnector module
	public static testslackconnector.proxies.SlackMessages createNewSlackMessage(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "TestSlackConnector.CreateNewSlackMessage", params);
			return result == null ? null : testslackconnector.proxies.SlackMessages.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static testslackconnector.proxies.SlackConfig getSlackConfig(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "TestSlackConnector.GetSlackConfig", params);
			return result == null ? null : testslackconnector.proxies.SlackConfig.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void onSlackMessage(IContext context, java.lang.String _senderId, java.lang.String _content, java.lang.String _channelId, java.lang.String _eventJson, java.util.Date _timestamp)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("SenderId", _senderId);
			params.put("Content", _content);
			params.put("ChannelId", _channelId);
			params.put("EventJson", _eventJson);
			params.put("Timestamp", _timestamp);
			Core.execute(context, "TestSlackConnector.OnSlackMessage", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void postSlackMessage(IContext context, testslackconnector.proxies.SlackMessages _slackMessage)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("SlackMessage", _slackMessage == null ? null : _slackMessage.getMendixObject());
			Core.execute(context, "TestSlackConnector.PostSlackMessage", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void registerSlackListener(IContext context, testslackconnector.proxies.SlackMessages _slackMessages)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("SlackMessages", _slackMessages == null ? null : _slackMessages.getMendixObject());
			Core.execute(context, "TestSlackConnector.RegisterSlackListener", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void sendDirectSlackMessage(IContext context, testslackconnector.proxies.SlackMessages _slackMessage)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("SlackMessage", _slackMessage == null ? null : _slackMessage.getMendixObject());
			Core.execute(context, "TestSlackConnector.SendDirectSlackMessage", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static boolean startup(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			return (java.lang.Boolean)Core.execute(context, "TestSlackConnector.Startup", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
}