Click or drag to resize

DataApi Class

Provides easy, type-safe access to the API's data-related operations.
Inheritance Hierarchy
SystemObject
  DegreeDays.Api.DataDataApi

Namespace: DegreeDays.Api.Data
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public sealed class DataApi

The DataApi type exposes the following members.

Constructors
 NameDescription
Public methodDataApi Constructs a DataApi object that uses the specified IRequestProcessor internally.
Top
Methods
 NameDescription
Public methodGetLocationData Sends your request for data (for a specified location) to the API servers, returning a response containing data you requested, or throwing an appropriate subclass of DegreeDaysApiException if something goes wrong.
Public methodGetLocationInfo A lightweight alternative to GetLocationData(LocationDataRequest) that returns info about the station(s) that would be used to satisfy an equivalent LocationDataRequest, but not the data itself.
Top
Remarks

To get a DataApi object and use it, you would typically create a DegreeDaysApi object, get the DataApi object from that, then call the method you want. For example, to send a LocationDataRequest to the API and get a LocationDataResponse back:

DegreeDaysApi api = new DegreeDaysApi(
    new AccountKey(yourStringAccountKey),
    new SecurityKey(yourStringSecurityKey));
LocationDataResponse response =
    api.DataApi.GetLocationData(yourLocationDataRequest);

See GetLocationData(LocationDataRequest) and GetLocationInfo(LocationInfoRequest) for much more info and sample code.

Thread Safety
This class is designed to be safe for use from multiple concurrent threads. However, if you create a customized instance of this class (using an IRequestProcessor that you have written or customized), then the thread-safety of its operation will depend on the thread-safety of that IRequestProcessor.
See Also