Click or drag to resize

AutoaddressClient Class

Client for accessing the Autoaddress 2.0 service.
Inheritance Hierarchy
SystemObject
  Autoaddress.Autoaddress2_0AutoaddressClient

Namespace:  Autoaddress.Autoaddress2_0
Assembly:  Autoaddress2.0SDK (in Autoaddress2.0SDK.dll) Version: 1.0.18
Syntax
public class AutoaddressClient : IAutoaddress

The AutoaddressClient type exposes the following members.

Constructors
  NameDescription
Public methodAutoaddressClient(String)
Constructs AutoaddressClient with a licence key and the other configuration settings using defaults.
Public methodAutoaddressClient(String, AutoaddressConfig)
Constructs AutoaddressClient with a licence key and an AutoaddressConfig object.
Top
Methods
  NameDescription
Public methodCode exampleAutoComplete
Lookup a Postcode or Address auto complete options. Returns all available data if found.
Public methodCode exampleAutoCompleteAsync
Lookup a Postcode or Address auto complete options as an asynchronous operation. Returns all available data if found.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodCode exampleFindAddress(Link)
Lookup a Postcode or Address. Returns all available data if found.
Public methodCode exampleFindAddress(Request)
Lookup a Postcode or Address. Returns all available data if found.
Public methodCode exampleFindAddressAsync(Link)
Lookup a Postcode or Address as an asynchronous operation. Returns all available data if found.
Public methodCode exampleFindAddressAsync(Request)
Lookup a Postcode or Address as an asynchronous operation. Returns all available data if found.
Public methodGetEcadData(Link)
Return all the available data from the ECAD for the supplied ECAD Id.
Public methodCode exampleGetEcadData(Request)
Return all the available data from the ECAD for the supplied ECAD Id.
Public methodGetEcadDataAsync(Link)
Return all the available data from the ECAD for the supplied ECAD Id as an asynchronous operation.
Public methodCode exampleGetEcadDataAsync(Request)
Return all the available data from the ECAD for the supplied ECAD Id as an asynchronous operation.
Public methodGetGbBuildingData(Link)
Return data for the supplied UK address ID.
Public methodGetGbBuildingData(Request)
Return data for the supplied UK address ID.
Public methodGetGbBuildingDataAsync(Link)
Return data for the supplied UK address ID as an asynchronous operation.
Public methodGetGbBuildingDataAsync(Request)
Return data for the supplied UK address ID as an asynchronous operation.
Public methodGetGbPostcodeData(Link)
Return data for the supplied UK postcode.
Public methodCode exampleGetGbPostcodeData(Request)
Return data for the supplied UK postcode.
Public methodGetGbPostcodeDataAsync(Link)
Return data for the supplied UK postcode as an asynchronous operation.
Public methodCode exampleGetGbPostcodeDataAsync(Request)
Return data for the supplied UK postcode as an asynchronous operation.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodMapId(Link)
Map ID.
Public methodCode exampleMapId(Request)
Map ID.
Public methodMapIdAsync(Link)
Map ID as an asynchronous operation.
Public methodCode exampleMapIdAsync(Request)
Map ID as an asynchronous operation.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodCode examplePostcodeLookup(Link)
Lookup a Postcode. Returns all available data if found.
Public methodCode examplePostcodeLookup(Request)
Lookup a Postcode. Returns all available data if found.
Public methodCode examplePostcodeLookupAsync(Link)
Lookup a Postcode as an asynchronous operation. Returns all available data if found.
Public methodCode examplePostcodeLookupAsync(Request)
Lookup a Postcode as an asynchronous operation. Returns all available data if found.
Public methodReverseGeocode(Link)
Reverse geocode a location. Returns the nearest building to the location within the specified maxDistance.
Public methodCode exampleReverseGeocode(Request)
Reverse geocode a location. Returns the nearest building to the location within the specified maxDistance.
Public methodReverseGeocodeAsync(Link)
Reverse geocode a location as an asynchronous operation. Returns the nearest building to the location within the specified maxDistance.
Public methodCode exampleReverseGeocodeAsync(Request)
Reverse geocode a location as an asynchronous operation. Returns the nearest building to the location within the specified maxDistance.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodVerifyAddress(Link)
Verify that the address supplied matches the Eircode supplied.
Public methodCode exampleVerifyAddress(Request)
Verify that the address supplied matches the Eircode supplied.
Public methodVerifyAddressAsync(Link)
Verify that the address supplied matches the Eircode supplied as an asynchronous operation.
Public methodCode exampleVerifyAddressAsync(Request)
Verify that the address supplied matches the Eircode supplied as an asynchronous operation.
Top
Events
  NameDescription
Public eventPostRequest
Occurs after response was received from Autoaddress endpoint.
Public eventPreRequest
Occurs just before request is sent to Autoaddress endpoint.
Top
Remarks
The AutoaddressClient provides methods for calling the various Autoaddress 2.0 service methods.
Examples
The following code example creates an AutoaddressClient and makes a FindAddress call. The licence key is retrieved from the application's default configuration.
C#
using System;
using Autoaddress.Autoaddress2_0.Model;
using Autoaddress.Autoaddress2_0.Model.FindAddress;

namespace Autoaddress.Autoaddress2_0.Test.Example
{
    public class AutoaddressClientExample1
    {
        public static void Run()
        {
            const string address = "8 Silver Birches, Dunboyne";
            var autoaddressClient = new AutoaddressClient(Settings.Licence.Key);

            var request = new Request(address: address, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);
            var response = autoaddressClient.FindAddress(request);

            Console.WriteLine("response.Result = {0}", response.Result);
            Console.WriteLine("response.Postcode = {0}", response.Postcode);
            Console.WriteLine("response.PostalAddress = {0}", string.Join(",", response.PostalAddress));
        }
    }
}

// This code example produces the following output:
// response.Result = PostcodeAppended
// response.Postcode = A86VC04
// response.PostalAddress = 8 SILVER BIRCHES,MILLFARM,DUNBOYNE,CO. MEATH
The following code example creates an AutoaddressClient using a licence key and makes a FindAddress call.
C#
using System;
using Autoaddress.Autoaddress2_0.Model;
using Autoaddress.Autoaddress2_0.Model.FindAddress;

namespace Autoaddress.Autoaddress2_0.Test.Example
{
    public class AutoaddressClientExample2
    {
        public static void Run()
        {
            const string licenceKey = "TheLicenceKey";
            const string address = "8 Silver Birches, Dunboyne";
            var autoaddressClient = new AutoaddressClient(licenceKey);

            var request = new Request(address: address, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);
            var response = autoaddressClient.FindAddress(request);

            Console.WriteLine("response.Result = {0}", response.Result);
            Console.WriteLine("response.Postcode = {0}", response.Postcode);
            Console.WriteLine("response.PostalAddress = {0}", string.Join(",", response.PostalAddress));
        }
    }
}

// This code example produces the following output:
// response.Result = PostcodeAppended
// response.Postcode = A86VC04
// response.PostalAddress = 8 SILVER BIRCHES,MILLFARM,DUNBOYNE,CO. MEATH
The following code example creates an AutoaddressClient using a licence key and Autoaddress config then makes a FindAddress call.
C#
using System;
using Autoaddress.Autoaddress2_0.Model;
using Autoaddress.Autoaddress2_0.Model.FindAddress;

namespace Autoaddress.Autoaddress2_0.Test.Example
{
    public class AutoaddressClientExample3
    {
        public static void Run()
        {
            const string apiBaseAddress = "https://api.autoaddress.ie";
            const int requestTimeoutMilliseconds = 5000;
            const string licenceKey = "TheLicenceKey";
            const string address = "8 Silver Birches, Dunboyne";
            var autoaddressConfig = new AutoaddressConfig(apiBaseAddress, requestTimeoutMilliseconds);
            var autoaddressClient = new AutoaddressClient(licenceKey, autoaddressConfig);

            var request = new Request(address: address, language: Language.EN, country: Country.IE, limit: 20, geographicAddress: false, vanityMode: false, addressElements: false, addressProfileName: null);
            var response = autoaddressClient.FindAddress(request);

            Console.WriteLine("response.Result = {0}", response.Result);
            Console.WriteLine("response.Postcode = {0}", response.Postcode);
            Console.WriteLine("response.PostalAddress = {0}", string.Join(",", response.PostalAddress));
        }
    }
}

// This code example produces the following output:
// response.Result = PostcodeAppended
// response.Postcode = A86VC04
// response.PostalAddress = 8 SILVER BIRCHES,MILLFARM,DUNBOYNE,CO. MEATH
See Also