/// <summary>/// Create a new task querying EVSE data from the OICP server./// The request might either have none, 'SearchCenter + DistanceKM' or 'LastCall' parameters./// Because of limitations at Hubject the SearchCenter and LastCall parameters can not be used at the same time!/// </summary>/// <param name="ProviderId">The unique identification of the EVSP.</param>/// <param name="SearchCenter">An optional geo coordinate of the search center.</param>/// <param name="DistanceKM">An optional search distance relative to the search center.</param>/// <param name="LastCall">An optional timestamp of the last call.</param>/// <param name="QueryTimeout">An optional timeout for this query.</param>publicasyncTask<HTTPResponse<IEnumerable<eRoamingEVSEData>>>PullEVSEData(EVSP_IdProviderId,GeoCoordinateSearchCenter=null,UInt64DistanceKM=0,DateTime?LastCall=null,TimeSpan?QueryTimeout=null){ [...]}
varreq=newEMPClient("api.playground.hubject.com").PullEVSEData(EVSP_Id.Parse("DE*GDF"),SearchCenter:newGeoCoordinate(Latitude.Parse(49.731102),Longitude.Parse(10.142533)),DistanceKM:100,QueryTimeout:TimeSpan.FromSeconds(120)).ContinueWith(task=>{vareRoamingEVSEData=task.Result.Content;if(eRoamingEVSEData.StatusCode.HasResult)Console.WriteLine(eRoamingEVSEData.OperatorEVSEData.Select(evsedata=>"'"+evsedata.OperatorName+"' has "+evsedata.EVSEDataRecords.Count()+" EVSEs").AggregateWith(Environment.NewLine)+Environment.NewLine));else{Console.WriteLine(eRoamingEVSEData.StatusCode.Code);Console.WriteLine(eRoamingEVSEData.StatusCode.Description);Console.WriteLine(eRoamingEVSEData.StatusCode.AdditionalInfo);}});req.Wait();
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.