| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | |
|
| | 6 | | namespace Azure.Data.AppConfiguration |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Configuration Setting model factory that enables mocking for the App Configuration client library. |
| | 10 | | /// </summary> |
| | 11 | | public static class ConfigurationModelFactory |
| | 12 | | { |
| | 13 | | /// <summary> |
| | 14 | | /// Initializes a new instance of the <see cref="ConfigurationSetting"/> for mocking purposes. |
| | 15 | | /// </summary> |
| | 16 | | /// <param name="key">The primary identifier of a configuration setting.</param> |
| | 17 | | /// <param name="value">The configuration setting's value.</param> |
| | 18 | | /// <param name="label">A label used to group configuration settings.</param> |
| | 19 | | /// <param name="contentType">The content type of the configuration setting's value.</param> |
| | 20 | | /// <param name="eTag">An ETag indicating the version of a configuration setting within a configuration store.</ |
| | 21 | | /// <param name="lastModified">The last time a modifying operation was performed on the given configuration sett |
| | 22 | | /// <param name="isReadOnly">A value indicating whether the configuration setting is read only.</param> |
| | 23 | | public static ConfigurationSetting ConfigurationSetting( |
| | 24 | | string key, |
| | 25 | | string value, |
| | 26 | | string label = null, |
| | 27 | | string contentType = null, |
| | 28 | | ETag eTag = default, |
| | 29 | | DateTimeOffset? lastModified = null, |
| | 30 | | bool? isReadOnly = null) |
| | 31 | | { |
| 0 | 32 | | return new ConfigurationSetting(key, value, label) |
| 0 | 33 | | { |
| 0 | 34 | | ContentType = contentType, |
| 0 | 35 | | ETag = eTag, |
| 0 | 36 | | LastModified = lastModified, |
| 0 | 37 | | IsReadOnly = isReadOnly |
| 0 | 38 | | }; |
| | 39 | | } |
| | 40 | | } |
| | 41 | | } |