/// <summary>
        /// Fetches a list of measurements for the <paramref name="partPath"/>. The search operation can be parameterized using the specified
        /// <paramref name="filter"/>. If the filter is empty, all measurements for the specified part will be fetched.
        /// </summary>
        /// <param name="partPath">The part path to fetch the measurements for.</param>
        /// <param name="filter">A filter that can be used to further restrict the search operation.</param>
        /// <param name="streamed">
        /// This controls whether to choose a streamed transfer mode or not. Using streamed mode has the side effect, that the result is transfered
        /// using http/s when the caller enumerates the result. The caller should be aware of because then enumerating might take longer than expected.
        /// Non streamed transfer mode first reads the whole result inside the task and then returns an enumerator over the buffered result. This is
        /// the preferred way when calling the task from UI code or when enumerating the whole result. The streamed mode would be preferred when the
        /// result is processed in blocks on non UI code or when not the complete result set is used.
        /// </param>
        /// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
        public async Task <IEnumerable <SimpleMeasurement> > GetMeasurements(PathInformation partPath = null, MeasurementFilterAttributes filter = null, bool streamed = false, CancellationToken cancellationToken = default(CancellationToken))
        {
            var parameter = new List <ParameterDefinition>();

            if (filter != null)
            {
                parameter.AddRange(filter.ToParameterDefinition());
            }

            if (partPath != null)
            {
                parameter.Add(ParameterDefinition.Create("partPath", PathHelper.PathInformation2String(partPath)));
            }

            if (streamed)
            {
                return(await GetEnumerated <SimpleMeasurement>("measurements", cancellationToken, parameter.ToArray()).ConfigureAwait(false));
            }

            return(await Get <SimpleMeasurement[]>("measurements", cancellationToken, parameter.ToArray()).ConfigureAwait(false));
        }
		/// <summary>
		/// Fetches a list of measurements for the <paramref name="partPath"/>. The search operation can be parameterized using the specified 
		/// <paramref name="filter"/>. If the filter is empty, all measurements for the specified part will be fetched.
		/// </summary>
		/// <param name="partPath">The part path to fetch the measurements for.</param>
		/// <param name="filter">A filter that can be used to further restrict the search operation.</param>
		/// <param name="streamed">
		/// This controls whether to choose a streamed transfer mode or not. Using streamed mode has the side effect, that the result is transfered 
		/// using http/s when the caller enumerates the result. The caller should be aware of because then enumerating might take longer than expected.
		/// Non streamed transfer mode first reads the whole result inside the task and then returns an enumerator over the buffered result. This is
		/// the preferred way when calling the task from UI code or when enumerating the whole result. The streamed mode would be preferred when the 
		/// result is processed in blocks on non UI code or when not the complete result set is used.
		/// </param>
		/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
		public async Task<IEnumerable<SimpleMeasurement>> GetMeasurements( PathInformation partPath = null, MeasurementFilterAttributes filter = null, bool streamed = false, CancellationToken cancellationToken = default(CancellationToken) )
		{
			var parameter = new List<ParameterDefinition>();
			if( filter != null )
				parameter.AddRange( filter.ToParameterDefinition() );

			if( partPath != null )
				parameter.Add( ParameterDefinition.Create( "partPath", PathHelper.PathInformation2String( partPath ) ) );

			if( streamed )
				return await GetEnumerated<SimpleMeasurement>( "measurements", cancellationToken, parameter.ToArray() ).ConfigureAwait( false );

			return await Get<SimpleMeasurement[]>( "measurements", cancellationToken, parameter.ToArray() ).ConfigureAwait( false );
		}