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