| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Collections; |
| | 10 | | using System.Collections.Generic; |
| | 11 | | using Azure.Core; |
| | 12 | |
|
| | 13 | | namespace Azure.Search.Documents.Models |
| | 14 | | { |
| | 15 | | /// <summary> A result containing a document found by a suggestion query, plus associated metadata. </summary> |
| | 16 | | internal partial class SuggestResult : IReadOnlyDictionary<string, object> |
| | 17 | | { |
| | 18 | | /// <summary> Initializes a new instance of SuggestResult. </summary> |
| | 19 | | /// <param name="text"> The text of the suggestion result. </param> |
| | 20 | | /// <exception cref="ArgumentNullException"> <paramref name="text"/> is null. </exception> |
| 0 | 21 | | internal SuggestResult(string text) |
| | 22 | | { |
| 0 | 23 | | if (text == null) |
| | 24 | | { |
| 0 | 25 | | throw new ArgumentNullException(nameof(text)); |
| | 26 | | } |
| | 27 | |
|
| 0 | 28 | | Text = text; |
| 0 | 29 | | AdditionalProperties = new ChangeTrackingDictionary<string, object>(); |
| 0 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <summary> Initializes a new instance of SuggestResult. </summary> |
| | 33 | | /// <param name="text"> The text of the suggestion result. </param> |
| | 34 | | /// <param name="additionalProperties"> . </param> |
| 0 | 35 | | internal SuggestResult(string text, IReadOnlyDictionary<string, object> additionalProperties) |
| | 36 | | { |
| 0 | 37 | | Text = text; |
| 0 | 38 | | AdditionalProperties = additionalProperties; |
| 0 | 39 | | } |
| | 40 | |
|
| | 41 | | /// <summary> The text of the suggestion result. </summary> |
| 0 | 42 | | public string Text { get; } |
| 0 | 43 | | internal IReadOnlyDictionary<string, object> AdditionalProperties { get; } |
| | 44 | | /// <inheritdoc /> |
| 0 | 45 | | public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator(); |
| | 46 | | /// <inheritdoc /> |
| 0 | 47 | | IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator(); |
| | 48 | | /// <inheritdoc /> |
| 0 | 49 | | public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value); |
| | 50 | | /// <inheritdoc /> |
| 0 | 51 | | public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key); |
| | 52 | | /// <inheritdoc /> |
| 0 | 53 | | public IEnumerable<string> Keys => AdditionalProperties.Keys; |
| | 54 | | /// <inheritdoc /> |
| 0 | 55 | | public IEnumerable<object> Values => AdditionalProperties.Values; |
| | 56 | | /// <inheritdoc /> |
| 0 | 57 | | int IReadOnlyCollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count; |
| | 58 | | /// <inheritdoc /> |
| | 59 | | public object this[string key] |
| | 60 | | { |
| 0 | 61 | | get => AdditionalProperties[key]; |
| | 62 | | } |
| | 63 | | } |
| | 64 | | } |