// ------------------------------------------------------------------------------
// <auto-generated>
//    Generated by avrogen.vshost.exe, version 0.9.0.0
//    Changes to this file may cause incorrect behavior and will be lost if code
//    is regenerated
// </auto-generated>
// ------------------------------------------------------------------------------
namespace org.apache.avro.test
{
	using System;
	using System.Collections.Generic;
	using System.Text;
	using Avro;
	using Avro.Specific;
	
	/// <summary>
	/// Protocol used for testing.
	/// </summary>
	public abstract class Simple : Avro.Specific.ISpecificProtocol
	{
		private static readonly Avro.Protocol protocol = Avro.Protocol.Parse("{\r\n  \"protocol\": \"Simple\",\r\n  \"namespace\": \"org.apache.avro.test\",\r\n  \"doc\": \"Pro" +
				"tocol used for testing.\",\r\n  \"types\": [\r\n    {\r\n      \"type\": \"enum\",\r\n      \"na" +
				"me\": \"Kind\",\r\n      \"namespace\": \"org.apache.avro.test\",\r\n      \"symbols\": [\r\n  " +
				"      \"FOO\",\r\n        \"BAR\",\r\n        \"BAZ\"\r\n      ],\r\n      \"javaAnnotation\": \"" +
				"org.apache.avro.TestAnnotation\"\r\n    },\r\n    {\r\n      \"type\": \"fixed\",\r\n      \"n" +
				"ame\": \"MD5\",\r\n      \"namespace\": \"org.apache.avro.test\",\r\n      \"size\": 16,\r\n   " +
				"   \"javaAnnotation\": \"org.apache.avro.TestAnnotation\"\r\n    },\r\n    {\r\n      \"typ" +
				"e\": \"record\",\r\n      \"name\": \"TestRecord\",\r\n      \"namespace\": \"org.apache.avro." +
				"test\",\r\n      \"fields\": [\r\n        {\r\n          \"name\": \"name\",\r\n          \"type" +
				"\": \"string\",\r\n          \"javaAnnotation\": \"org.apache.avro.TestAnnotation\"\r\n    " +
				"    },\r\n        {\r\n          \"name\": \"kind\",\r\n          \"type\": \"Kind\"\r\n        " +
				"},\r\n        {\r\n          \"name\": \"hash\",\r\n          \"type\": \"MD5\"\r\n        }\r\n  " +
				"    ],\r\n      \"javaAnnotation\": \"org.apache.avro.TestAnnotation\"\r\n    },\r\n    {\r" +
				"\n      \"type\": \"error\",\r\n      \"name\": \"TestError\",\r\n      \"namespace\": \"org.apa" +
				"che.avro.test\",\r\n      \"fields\": [\r\n        {\r\n          \"name\": \"message\",\r\n   " +
				"       \"type\": \"string\"\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      \"type\": \"recor" +
				"d\",\r\n      \"name\": \"TestRecordWithUnion\",\r\n      \"namespace\": \"org.apache.avro.t" +
				"est\",\r\n      \"fields\": [\r\n        {\r\n          \"name\": \"kind\",\r\n          \"type\"" +
				": [\r\n            \"null\",\r\n            \"Kind\"\r\n          ]\r\n        },\r\n        {" +
				"\r\n          \"name\": \"value\",\r\n          \"type\": [\r\n            \"null\",\r\n        " +
				"    \"string\"\r\n          ]\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"messages\": {\r\n   " +
				" \"hello\": {\r\n      \"doc\": \"Send a greeting\",\r\n      \"request\": [\r\n        {\r\n   " +
				"       \"name\": \"greeting\",\r\n          \"type\": \"string\"\r\n        }\r\n      ],\r\n   " +
				"   \"response\": \"string\"\r\n    },\r\n    \"echo\": {\r\n      \"doc\": \"Pretend you\'re in " +
				"a cave!\",\r\n      \"request\": [\r\n        {\r\n          \"name\": \"record\",\r\n         " +
				" \"type\": \"TestRecord\"\r\n        }\r\n      ],\r\n      \"response\": \"TestRecord\"\r\n    " +
				"},\r\n    \"add\": {\r\n      \"request\": [\r\n        {\r\n          \"name\": \"arg1\",\r\n    " +
				"      \"type\": \"int\"\r\n        },\r\n        {\r\n          \"name\": \"arg2\",\r\n         " +
				" \"type\": \"int\"\r\n        }\r\n      ],\r\n      \"response\": \"int\"\r\n    },\r\n    \"echoB" +
				"ytes\": {\r\n      \"request\": [\r\n        {\r\n          \"name\": \"data\",\r\n          \"t" +
				"ype\": \"bytes\"\r\n        }\r\n      ],\r\n      \"response\": \"bytes\"\r\n    },\r\n    \"erro" +
				"r\": {\r\n      \"doc\": \"Always throws an error.\",\r\n      \"request\": [],\r\n      \"res" +
				"ponse\": \"null\",\r\n      \"errors\": [\r\n        \"TestError\"\r\n      ]\r\n    },\r\n    \"a" +
				"ck\": {\r\n      \"doc\": \"Send a one way message\",\r\n      \"request\": [],\r\n      \"res" +
				"ponse\": \"null\",\r\n      \"one-way\": true\r\n    }\r\n  }\r\n}");
		public Avro.Protocol Protocol
		{
			get
			{
				return protocol;
			}
		}
		public void Request(Avro.Specific.ICallbackRequestor requestor, string messageName, object[] args, object callback)
		{
			switch(messageName)
			{
				case "hello":
				requestor.Request<System.String>(messageName, args, callback);
				break;

				case "echo":
				requestor.Request<org.apache.avro.test.TestRecord>(messageName, args, callback);
				break;

				case "add":
				requestor.Request<System.Int32>(messageName, args, callback);
				break;

				case "echoBytes":
				requestor.Request<System.Byte[]>(messageName, args, callback);
				break;

				case "error":
				requestor.Request<System.Object>(messageName, args, callback);
				break;

				case "ack":
				requestor.Request<System.Object>(messageName, args, callback);
				break;
			};
		}
		// Send a greeting
		public abstract string hello(string greeting);
		// Pretend you're in a cave!
		public abstract org.apache.avro.test.TestRecord echo(org.apache.avro.test.TestRecord record);
		public abstract int add(int arg1, int arg2);
		public abstract byte[] echoBytes(byte[] data);
		// Always throws an error.
		public abstract object error();
		// Send a one way message
		public abstract void ack();
	}
}
