| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using System.Collections.Generic; |
| | | 6 | | using System.Text; |
| | | 7 | | |
| | | 8 | | namespace Azure.Storage.Files.DataLake.Models |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Optional parameters for <see cref="DataLakeFileClient.QueryAsync(string, DataLakeQueryOptions, System.Threading. |
| | | 12 | | /// </summary> |
| | | 13 | | public class DataLakeQueryOptions |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Optional input text configuration. |
| | | 17 | | /// </summary> |
| | 0 | 18 | | public IDataLakeQueryTextOptions InputTextConfiguration { get; set; } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Optional output text configuration. |
| | | 22 | | /// </summary> |
| | 0 | 23 | | public IDataLakeQueryTextOptions OutputTextConfiguration { get; set; } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Lock for ErrorHandler add and remove. |
| | | 27 | | /// </summary> |
| | 52 | 28 | | private readonly object _objectLock = new object(); |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Optional error handler. |
| | | 32 | | /// </summary> |
| | | 33 | | public event Action<DataLakeQueryError> ErrorHandler |
| | | 34 | | { |
| | | 35 | | add |
| | | 36 | | { |
| | 4 | 37 | | lock (_objectLock) |
| | | 38 | | { |
| | 4 | 39 | | _errorHandler += value; |
| | 4 | 40 | | } |
| | 4 | 41 | | } |
| | | 42 | | remove |
| | | 43 | | { |
| | 0 | 44 | | lock (_objectLock) |
| | | 45 | | { |
| | 0 | 46 | | _errorHandler -= value; |
| | 0 | 47 | | } |
| | 0 | 48 | | } |
| | | 49 | | } |
| | | 50 | | |
| | | 51 | | internal Action<DataLakeQueryError> _errorHandler; |
| | | 52 | | |
| | | 53 | | /// <summary> |
| | | 54 | | /// Optional <see cref="DataLakeRequestConditions"/> to add conditions on the query. |
| | | 55 | | /// </summary> |
| | 96 | 56 | | public DataLakeRequestConditions Conditions { get; set; } |
| | | 57 | | |
| | | 58 | | /// <summary> |
| | | 59 | | /// Optional progress handler. |
| | | 60 | | /// </summary> |
| | 56 | 61 | | public IProgress<long> ProgressHandler { get; set; } |
| | | 62 | | } |
| | | 63 | | } |