public class DsClient extends Object
| Constructor and Description |
|---|
DsClient(String apiKey) |
DsClient(String apiKey,
JsonConverter jsonConverter) |
DsClient(String apiKey,
JsonConverter jsonConverter,
okhttp3.OkHttpClient httpClient) |
DsClient(String apiKey,
okhttp3.OkHttpClient httpClient) |
| Modifier and Type | Method and Description |
|---|---|
Integer |
apiCalls()
The number of API calls made for today.
|
String |
responseTime()
The server-side response time of the last request.
|
DsResponse |
sendForecastRequest(DsForecastRequest request)
Sends a Forecast Request to darksky.net.
|
DsResponse |
sendTimeMachineRequest(DsTimeMachineRequest request)
Sends a Time Machine Request to darksky.net
A Time Machine Request returns the observed (in the past) or forecasted (in the
future) hour-by-hour and daily weather conditions for a particular date.
|
public DsClient(String apiKey)
public DsClient(String apiKey, okhttp3.OkHttpClient httpClient)
public DsClient(String apiKey, JsonConverter jsonConverter)
public DsClient(String apiKey, JsonConverter jsonConverter, okhttp3.OkHttpClient httpClient)
@Nullable public DsResponse sendForecastRequest(DsForecastRequest request) throws IOException
Request - objectIOException@Nullable public DsResponse sendTimeMachineRequest(DsTimeMachineRequest request) throws IOException
DsResponse.currently() data point will refer to the time provided,
rather than the current time.DsResponse.minutely() data block will be omitted, unless you are
requesting a time within an hour of the present.DsResponse.hourly() data block will contain data points starting at
midnight (local time) of the day requested, and continuing until midnight (local
time) of the following day.DsResponse.daily() data block will contain a single data point
referring to the requested date.DsResponse.alerts() data block will be omitted.Request - objectIOExceptionpublic Integer apiCalls()
public String responseTime()
Copyright © 2016–2020. All rights reserved.