| | | 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.ComponentModel; |
| | | 7 | | |
| | | 8 | | namespace Azure.Data.AppConfiguration |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// <para><see cref="SettingSelector"/> is a set of options that allows selecting |
| | | 12 | | /// a filtered set of <see cref="ConfigurationSetting"/> entities from the |
| | | 13 | | /// configuration store, and optionally allows indicating which fields of |
| | | 14 | | /// each setting to retrieve.</para> |
| | | 15 | | /// <para>Literals or filters may be specified for keys and labels.</para> |
| | | 16 | | /// <para>For more information, <see href="https://github.com/Azure/AppConfiguration/blob/master/docs/REST/kv.md#fil |
| | | 17 | | /// </summary> |
| | | 18 | | public class SettingSelector |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// A wildcard that matches any key or any label when passed as a filter |
| | | 22 | | /// to Keys or Labels. |
| | | 23 | | /// </summary> |
| | 0 | 24 | | public static readonly string Any = "*"; |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Key filter that will be used to select a set of <see cref="ConfigurationSetting"/> entities. |
| | | 28 | | /// </summary> |
| | | 29 | | /// <remarks>See the documentation for this client library for details on the format of filter expressions.</rem |
| | 258 | 30 | | public string KeyFilter { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Label filter that will be used to select a set of <see cref="ConfigurationSetting"/> entities. |
| | | 34 | | /// </summary> |
| | | 35 | | /// <remarks>See the documentation for this client library for details on the format of filter expressions.</rem |
| | 174 | 36 | | public string LabelFilter { get; set; } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// The fields of the <see cref="ConfigurationSetting"/> to retrieve for each setting in the retrieved group. |
| | | 40 | | /// </summary> |
| | 230 | 41 | | public SettingFields Fields { get; set; } = SettingFields.All; |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// Indicates the point in time in the revision history of the selected <see cref="ConfigurationSetting"/> entit |
| | | 45 | | /// If set, all properties of the <see cref="ConfigurationSetting"/> entities in the returned group will be exac |
| | | 46 | | /// were at this time. |
| | | 47 | | /// </summary> |
| | 116 | 48 | | public DateTimeOffset? AcceptDateTime { get; set; } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// Creates a default <see cref="SettingSelector"/> that will retrieve all <see cref="ConfigurationSetting"/> en |
| | | 52 | | /// </summary> |
| | 164 | 53 | | public SettingSelector() { } |
| | | 54 | | |
| | | 55 | | #region nobody wants to see these |
| | | 56 | | /// <summary> |
| | | 57 | | /// Check if two SettingSelector instances are equal. |
| | | 58 | | /// </summary> |
| | | 59 | | /// <param name="obj">The instance to compare to.</param> |
| | | 60 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 0 | 61 | | public override bool Equals(object obj) => base.Equals(obj); |
| | | 62 | | |
| | | 63 | | /// <summary> |
| | | 64 | | /// Get a hash code for the SettingSelector. |
| | | 65 | | /// </summary> |
| | | 66 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 0 | 67 | | public override int GetHashCode() => base.GetHashCode(); |
| | | 68 | | |
| | | 69 | | /// <summary> |
| | | 70 | | /// Creates a string in reference to the SettingSelector. |
| | | 71 | | /// </summary> |
| | | 72 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 0 | 73 | | public override string ToString() => base.ToString(); |
| | | 74 | | #endregion |
| | | 75 | | } |
| | | 76 | | } |