/// <summary>
 /// Fetches raw data for the value identified  by the compound key of <paramref name="measurementUuid"/> and <paramref name="characteristicUuid"/> and raw data index <paramref name="rawDataKey"/>.
 /// </summary>
 /// <param name="client">The client class to use.</param>
 /// <param name="measurementUuid">The uuid of the measurement to fetch the raw data object for.</param>
 /// <param name="characteristicUuid">The uuid of the characteristic to fetch the raw data object for.</param>
 /// <param name="rawDataKey">The unique key that identifies the raw data object for the specified measurement value.</param>
 /// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
 /// <exception cref="ArgumentNullException"><paramref name="client"/> is <see langword="null" />.</exception>
 public static Task <byte[]> GetRawDataForValue([NotNull] this IRawDataServiceRestClient client, Guid measurementUuid, Guid characteristicUuid, int rawDataKey, CancellationToken cancellationToken = default)
 {
     if (client == null)
     {
         throw new ArgumentNullException(nameof(client));
     }
     return(client.GetRawData(RawDataTargetEntityDto.CreateForValue(measurementUuid, characteristicUuid), rawDataKey, cancellationToken: cancellationToken));
 }
        /// <summary>
        /// Fetches raw data as a byte array for the raw data item identified by <paramref name="info"/>.
        /// </summary>
        /// <param name="client">The client class to use.</param>
        /// <param name="info">The <see cref="RawDataInformationDto"/> that specifies the raw data object that should be fetched.</param>
        /// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
        /// <exception cref="ArgumentNullException"><paramref name="client"/> or <paramref name="info"/> is <see langword="null" />.</exception>
        public static Task <byte[]> GetRawData([NotNull] this IRawDataServiceRestClient client, [NotNull] RawDataInformationDto info, CancellationToken cancellationToken = default)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }
            if (info == null)
            {
                throw new ArgumentNullException(nameof(info));
            }

            return(client.GetRawData(info.Target, info.Key.GetValueOrDefault(), info.MD5, cancellationToken));
        }
예제 #3
0
 /// <summary>
 /// Fetches raw data for the part with <paramref name="partUuid"/> and raw data index <paramref name="rawDataKey"/>.
 /// </summary>
 /// <param name="client">The client class to use.</param>
 /// <param name="partUuid">The uuid of the part to fetch the raw data object for.</param>
 /// <param name="rawDataKey">The unique key that identifies the raw data object for the specified part.</param>
 /// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
 public static Task <byte[]> GetRawDataForPart(this IRawDataServiceRestClient client, Guid partUuid, int rawDataKey, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(client.GetRawData(RawDataTargetEntity.CreateForPart(partUuid), rawDataKey, cancellationToken: cancellationToken));
 }
예제 #4
0
 /// <summary>
 /// Fetches raw data for the value identified  by the compound key of <paramref name="measurementUuid"/> and <paramref name="characteristicUuid"/> and raw data index <paramref name="rawDataKey"/>.
 /// </summary>
 /// <param name="client">The client class to use.</param>
 /// <param name="measurementUuid">The uuid of the measurement to fetch the raw data object for.</param>
 /// <param name="characteristicUuid">The uuid of the characteristic to fetch the raw data object for.</param>
 /// <param name="rawDataKey">The unique key that identifies the raw data object for the specified measurement value.</param>
 /// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
 public static Task <byte[]> GetRawDataForValue(this IRawDataServiceRestClient client, Guid measurementUuid, Guid characteristicUuid, int rawDataKey, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(client.GetRawData(RawDataTargetEntity.CreateForValue(measurementUuid, characteristicUuid), rawDataKey, cancellationToken: cancellationToken));
 }
예제 #5
0
 /// <summary>
 /// Fetches raw data as a byte array for the raw data item identified by <paramref name="info"/>.
 /// </summary>
 /// <param name="client">The client class to use.</param>
 /// <param name="info">The <see cref="RawDataInformation"/> that specifies the raw data object that should be fetched.</param>
 /// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
 public static Task <byte[]> GetRawData(this IRawDataServiceRestClient client, RawDataInformation info, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(client.GetRawData(info.Target, info.Key, info.MD5, cancellationToken));
 }