/// <summary> /// Initializes a new instance of the <see cref="ListDataTypesCommand"/> class. /// </summary> /// <param name="datasetName">Name of the dataset.</param> /// <param name="token">The token.</param> /// <param name="options">The options.</param> /// <remarks></remarks> public ListDataTypesCommand(string datasetName, string token, NCDCOptions options) : base( HTTPVerb.GET, string.Format("datasets/{0}/datatypes.json", datasetName), token, options) { this.DeserializationHandler = NCDCDataTypeCollection.Deserialize; }
// all other types must go here /// <summary> /// Initializes a new instance of the <see cref="ListDataCommand"/> class. /// </summary> /// <param name="token">The token.</param> /// <param name="options">The options.</param> /// <remarks></remarks> public ListDataCommand(string token, NCDCOptions options) : base( HTTPVerb.GET, "", token, options) { this.DeserializationHandler = NCDCDataCollection.Deserialize; }
/// <summary> /// Initializes a new instance of the <see cref="ShowDataTypesCommand"/> class. /// </summary> /// <param name="token">The token.</param> /// <param name="options">The options.</param> /// <remarks></remarks> public ShowDataTypesCommand(string token, NCDCOptions options) : base( HTTPVerb.GET, "", token, options) { this.DeserializationHandler = NCDCDataType.Deserialize; }
/// <summary> /// Initializes a new instance of the <see cref="NCDCCommand<T>"/> class. /// </summary> /// <param name="method">The method.</param> /// <param name="endPoint">The end point.</param> /// <param name="token">The token.</param> /// <param name="optionalProperties">The optional properties.</param> /// <remarks></remarks> protected NCDCCommand(HTTPVerb method, string endPoint, string token, NCDCOptions optionalProperties) { this.RequestParameters = new Dictionary <string, object>(); this.Verb = method; this.Token = token; this.NCDCOptions = optionalProperties ?? new NCDCOptions(); NCDCUtilities.CurrentToken = this.Token; this.SetCommandUri(endPoint); }
/// <summary> /// Inits this instance. /// </summary> /// <remarks></remarks> public override void Init() { NCDCOptions options = this.NCDCOptions as NCDCOptions; if (options == null) { this.RequestParameters.Add("page", "1"); return; } this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1"); }
/// <summary> /// Initializes a new instance of the <see cref="ListDataCommand"/> class. /// </summary> /// <param name="datasetName">Name of the dataset.</param> /// <param name="locationTypeName">Name of the location type.</param> /// <param name="locationId">The location id.</param> /// <param name="stationId">The station id.</param> /// <param name="dataTypeId">The data type id.</param> /// <param name="token">The token.</param> /// <param name="options">The options.</param> /// <remarks></remarks> public ListDataCommand(string datasetName, string locationTypeName, string locationId, string stationId, string dataTypeId, string token, NCDCOptions options) : base( HTTPVerb.GET, string.Format("datasets/{0}/locationtypes/{1}/locations/{2}/stations/{3}/datatypes/{4}/data.json", datasetName, locationTypeName, locationId, stationId, dataTypeId), token, options) { this.DataSetName = datasetName; this.LocationId = locationId; this.LocationTypeId = locationTypeName; this.StationId = stationId; this.DataTypeId = dataTypeId; this.DeserializationHandler = NCDCDataCollection.Deserialize; }
public static NCDCResponse <NCDCDataCollection> GetDataForLocationTypeLocationAndDataType(string datasetName, string locationTypeId, string locationId, string dataTypeId, string token = null, NCDCOptions options = null) { token = token ?? NCDCUtilities.GetUnlockedToken(); var command = new ListDataCommand(token, options); command.BuildDatasetLocationTypeLocationDataTypeUri(datasetName, locationTypeId, locationId, dataTypeId); return(NCDCCommand <NCDCDataCollection> .PerformAction(command)); }
public static NCDCResponse <NCDCDataCollection> GetDataForDataset(string datasetName, string token = null, NCDCOptions options = null) { token = token ?? NCDCUtilities.GetUnlockedToken(); var command = new ListDataCommand(datasetName, token, options); return(NCDCCommand <NCDCDataCollection> .PerformAction(command)); }
public static NCDCResponse <NCDCLocation> GetLocationInformation(string datasetName, string locationId, string token = null, NCDCOptions options = null) { token = token ?? NCDCUtilities.GetUnlockedToken(); var command = new ShowLocationCommand(datasetName, locationId, token, options); return(NCDCCommand <NCDCLocation> .PerformAction(command)); }
public static NCDCResponse <NCDCDataType> GetDataTypeInformationForLocation(string datasetName, string locationId, string dataTypeId, string token = null, NCDCOptions options = null) { token = token ?? NCDCUtilities.GetUnlockedToken(); var command = new ShowDataTypesCommand(token, options); command.BuildDatasetsLocationsUri(datasetName, locationId, dataTypeId); return(NCDCCommand <NCDCDataType> .PerformAction(command)); }
public static NCDCResponse <NCDCDataTypeCollection> GetDataTypesForStation(string datasetName, string stationId, string token = null, NCDCOptions options = null) { token = token ?? NCDCUtilities.GetUnlockedToken(); var command = new ListDataTypesCommand(token, options); command.BuildDatasetsStationsUri(datasetName, stationId); return(NCDCCommand <NCDCDataTypeCollection> .PerformAction(command)); }
/// <summary> /// Initializes a new instance of the <see cref="ListStationsCommand"/> class. /// </summary> /// <param name="datasetName">Name of the dataset.</param> /// <param name="locationId">The location id.</param> /// <param name="token">The token.</param> /// <param name="options">The options.</param> /// <remarks></remarks> public ListStationsCommand(string datasetName, string locationId, string token, NCDCOptions options) : base( HTTPVerb.GET, string.Format("datasets/{0}/locations/{1}/stations.json", datasetName, locationId), token, options) { this.DeserializationHandler = NCDCStationCollection.Deserialize; }
/// <summary> /// Initializes a new instance of the <see cref="ShowDataTypesCommand"/> class. /// </summary> /// <param name="datasetName">Name of the dataset.</param> /// <param name="dataTypeId">The data type id.</param> /// <param name="token">The token.</param> /// <param name="options">The options.</param> /// <remarks></remarks> public ShowDataTypesCommand(string datasetName, string dataTypeId, string token, NCDCOptions options) : base( HTTPVerb.GET, string.Format("datasets/{0}/datatypes/{1}.json", datasetName, dataTypeId), token, options) { this.DeserializationHandler = NCDCDataType.Deserialize; }