public static async void Run()
        {
            const string postcode          = "D02C966";
            var          autoaddressClient = new AutoaddressClient(Settings.Licence.Key);
            var          request           = new Request(postcode: postcode, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);

            var response1 = await autoaddressClient.PostcodeLookupAsync(request);

            Console.WriteLine("response1.Result = {0}", response1.Result);
            Console.WriteLine("response1.MatchLevel = {0}", response1.MatchLevel);
            Console.WriteLine("response1.AddressType = {0}", response1.AddressType);
            Console.WriteLine("response1.AddressId = {0}", response1.AddressId);
            Console.WriteLine("response1.Postcode = {0}", response1.Postcode);
            Console.WriteLine("response1.PostalAddress = {0}", string.Join(",", response1.PostalAddress));
            Console.WriteLine("response1.Options[0].DisplayName = {0}", response1.Options[0].DisplayName);
            Console.WriteLine("response1.Options[1].DisplayName = {0}", response1.Options[1].DisplayName);
            Console.WriteLine("response1.Options[2].DisplayName = {0}", response1.Options[2].DisplayName);

            var response2 = await autoaddressClient.PostcodeLookupAsync(response1.Options[2].Links.OfType <Model.PostcodeLookup.Link>().First());

            Console.WriteLine("response2.Result = {0}", response2.Result);
            Console.WriteLine("response2.MatchLevel = {0}", response2.MatchLevel);
            Console.WriteLine("response2.AddressType = {0}", response2.AddressType);
            Console.WriteLine("response2.AddressId = {0}", response2.AddressId);
            Console.WriteLine("response2.Postcode = {0}", response2.Postcode);
            Console.WriteLine("response2.PostalAddress = {0}", string.Join(",", response2.PostalAddress));
        }
        public static async void Main()
        {
            const string postcode = "D08XY00";
            var autoaddressClient = new AutoaddressClient();
            var request = new Request(postcode: postcode, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);

            var response1 = await autoaddressClient.PostcodeLookupAsync(request);

            Console.WriteLine("response1.Result = {0}", response1.Result);
            Console.WriteLine("response1.MatchLevel = {0}", response1.MatchLevel);
            Console.WriteLine("response1.AddressType = {0}", response1.AddressType);
            Console.WriteLine("response1.AddressId = {0}", response1.AddressId);
            Console.WriteLine("response1.Postcode = {0}", response1.Postcode);
            Console.WriteLine("response1.PostalAddress = {0}", string.Join(",", response1.PostalAddress));
            Console.WriteLine("response1.Options[0].DisplayName = {0}", response1.Options[0].DisplayName);
            Console.WriteLine("response1.Options[1].DisplayName = {0}", response1.Options[1].DisplayName);
            Console.WriteLine("response1.Options[2].DisplayName = {0}", response1.Options[2].DisplayName);

            var response2 = await autoaddressClient.PostcodeLookupAsync(response1.Options[2].Links.OfType<Model.PostcodeLookup.Link>().First());
            
            Console.WriteLine("response2.Result = {0}", response2.Result);
            Console.WriteLine("response2.MatchLevel = {0}", response2.MatchLevel);
            Console.WriteLine("response2.AddressType = {0}", response2.AddressType);
            Console.WriteLine("response2.AddressId = {0}", response2.AddressId);
            Console.WriteLine("response2.Postcode = {0}", response2.Postcode);
            Console.WriteLine("response2.PostalAddress = {0}", string.Join(",", response2.PostalAddress));
        }
        public static async void Run()
        {
            const string postcode          = "A86VC04";
            var          autoaddressClient = new AutoaddressClient(Settings.Licence.Key);
            var          request           = new Request(postcode: postcode, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);

            var response = await autoaddressClient.PostcodeLookupAsync(request);

            Console.WriteLine("response.Result = {0}", response.Result);
            Console.WriteLine("response.MatchLevel = {0}", response.MatchLevel);
            Console.WriteLine("response.AddressType = {0}", response.AddressType);
            Console.WriteLine("response.AddressId = {0}", response.AddressId);
            Console.WriteLine("response.Postcode = {0}", response.Postcode);
            Console.WriteLine("response.PostalAddress = {0}", string.Join(",", response.PostalAddress));
        }
        public static async void Main()
        {
            const string postcode = "A86VC04";
            var autoaddressClient = new AutoaddressClient();
            var request = new Request(postcode: postcode, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);

            var response = await autoaddressClient.PostcodeLookupAsync(request);

            Console.WriteLine("response.Result = {0}", response.Result);
            Console.WriteLine("response.MatchLevel = {0}", response.MatchLevel);
            Console.WriteLine("response.AddressType = {0}", response.AddressType);
            Console.WriteLine("response.AddressId = {0}", response.AddressId);
            Console.WriteLine("response.Postcode = {0}", response.Postcode);
            Console.WriteLine("response.PostalAddress = {0}", string.Join(",", response.PostalAddress));
        }
        public async Task PostcodeLookupAsync_IE_D08XY00ThenSelectGammaFromOptions_ReturnsValidResponses()
        {
            const string postcode = "D08XY00";
            var autoaddressClient = new AutoaddressClient();
            var request = new Autoaddress2_0.Model.PostcodeLookup.Request(postcode: postcode, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);

            var firstResponse = await autoaddressClient.PostcodeLookupAsync(request);

            Assert.NotNull(firstResponse);
            Assert.AreEqual(Autoaddress2_0.Model.PostcodeLookup.ReturnCode.ValidPostcode, firstResponse.Result);
            Assert.AreEqual(postcode, firstResponse.Postcode);
            Assert.NotNull(firstResponse.PostalAddress);
            Assert.AreEqual(3, firstResponse.PostalAddress.Length);
            Assert.AreEqual("4 INNS COURT", firstResponse.PostalAddress[0]);
            Assert.AreEqual("WINETAVERN STREET", firstResponse.PostalAddress[1]);
            Assert.AreEqual("DUBLIN 8", firstResponse.PostalAddress[2]);
            Assert.IsNotNull(firstResponse.Options);
            Assert.AreEqual(3, firstResponse.Options.Length);
            Assert.AreEqual("4 INNS COURT, WINETAVERN STREET, DUBLIN 8", firstResponse.Options[0].DisplayName);
            Assert.AreEqual("AUTOADDRESS, 4 INNS COURT, WINETAVERN STREET, DUBLIN 8", firstResponse.Options[1].DisplayName);
            Assert.AreEqual("GAMMA, 4 INNS COURT, WINETAVERN STREET, DUBLIN 8", firstResponse.Options[2].DisplayName);
            Assert.NotNull(firstResponse.Options[2].Links);
            Assert.Greater(firstResponse.Options[2].Links.Length, 0);
            Assert.NotNull(firstResponse.Options[2].Links[0]);

            var secondResponse = await autoaddressClient.PostcodeLookupAsync(firstResponse.Options[2].Links.OfType<Model.PostcodeLookup.Link>().First());
            Assert.AreEqual(Autoaddress2_0.Model.PostcodeLookup.ReturnCode.ValidPostcode, firstResponse.Result);
            Assert.AreEqual(postcode, firstResponse.Postcode);
            Assert.AreEqual(AddressType.Organisation, secondResponse.AddressType);
        }
        public async Task PostcodeLookupAsync_IE_D08XY00_ReturnsValidResponse()
        {
            const string postcode = "D08XY00";
            var autoaddressClient = new AutoaddressClient();
            var request = new Autoaddress2_0.Model.PostcodeLookup.Request(postcode: postcode, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);

            var response = await autoaddressClient.PostcodeLookupAsync(request);

            Assert.NotNull(response);
            Assert.AreEqual(Autoaddress2_0.Model.PostcodeLookup.ReturnCode.ValidPostcode, response.Result);
            Assert.AreEqual(postcode, response.Postcode);
            Assert.NotNull(response.PostalAddress);
            Assert.AreEqual(3, response.PostalAddress.Length);
            Assert.AreEqual("4 INNS COURT", response.PostalAddress[0]);
            Assert.AreEqual("WINETAVERN STREET", response.PostalAddress[1]);
            Assert.AreEqual("DUBLIN 8", response.PostalAddress[2]);
            Assert.IsNotNull(response.Options);
            Assert.AreEqual(3, response.Options.Length);
            Assert.AreEqual("4 INNS COURT, WINETAVERN STREET, DUBLIN 8", response.Options[0].DisplayName);
            Assert.AreEqual("AUTOADDRESS, 4 INNS COURT, WINETAVERN STREET, DUBLIN 8", response.Options[1].DisplayName);
            Assert.AreEqual("GAMMA, 4 INNS COURT, WINETAVERN STREET, DUBLIN 8", response.Options[2].DisplayName);
        }
        public async Task PostcodeLookupAsync_IE_A86VC04_ReturnsValidResponse()
        {
            const string postcode = "A86VC04";
            var autoaddressClient = new AutoaddressClient();
            var request = new Autoaddress2_0.Model.PostcodeLookup.Request(postcode: postcode, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);

            var response = await autoaddressClient.PostcodeLookupAsync(request);

            Assert.NotNull(response);
            Assert.AreEqual(Autoaddress2_0.Model.PostcodeLookup.ReturnCode.ValidPostcode, response.Result);
            Assert.AreEqual(postcode, response.Postcode);
            Assert.NotNull(response.PostalAddress);
            Assert.AreEqual(4, response.PostalAddress.Length);
            Assert.AreEqual("8 SILVER BIRCHES", response.PostalAddress[0]);
            Assert.AreEqual("MILLFARM", response.PostalAddress[1]);
            Assert.AreEqual("DUNBOYNE", response.PostalAddress[2]);
            Assert.AreEqual("CO. MEATH", response.PostalAddress[3]);
        }