| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.Search.Models |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Linq; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Provides parameter values to a distance scoring function. |
| | 19 | | /// </summary> |
| | 20 | | public partial class DistanceScoringParameters |
| | 21 | | { |
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the DistanceScoringParameters class. |
| | 24 | | /// </summary> |
| 486 | 25 | | public DistanceScoringParameters() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 486 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the DistanceScoringParameters class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="referencePointParameter">The name of the parameter |
| | 34 | | /// passed in search queries to specify the reference location.</param> |
| | 35 | | /// <param name="boostingDistance">The distance in kilometers from the |
| | 36 | | /// reference location where the boosting range ends.</param> |
| 478 | 37 | | public DistanceScoringParameters(string referencePointParameter, double boostingDistance) |
| | 38 | | { |
| 478 | 39 | | ReferencePointParameter = referencePointParameter; |
| 478 | 40 | | BoostingDistance = boostingDistance; |
| | 41 | | CustomInit(); |
| 478 | 42 | | } |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// An initialization method that performs custom operations like setting defaults |
| | 46 | | /// </summary> |
| | 47 | | partial void CustomInit(); |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// Gets or sets the name of the parameter passed in search queries to |
| | 51 | | /// specify the reference location. |
| | 52 | | /// </summary> |
| | 53 | | [JsonProperty(PropertyName = "referencePointParameter")] |
| 1944 | 54 | | public string ReferencePointParameter { get; set; } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Gets or sets the distance in kilometers from the reference location |
| | 58 | | /// where the boosting range ends. |
| | 59 | | /// </summary> |
| | 60 | | [JsonProperty(PropertyName = "boostingDistance")] |
| 1464 | 61 | | public double BoostingDistance { get; set; } |
| | 62 | |
|
| | 63 | | /// <summary> |
| | 64 | | /// Validate the object. |
| | 65 | | /// </summary> |
| | 66 | | /// <exception cref="ValidationException"> |
| | 67 | | /// Thrown if validation fails |
| | 68 | | /// </exception> |
| | 69 | | public virtual void Validate() |
| | 70 | | { |
| 480 | 71 | | if (ReferencePointParameter == null) |
| | 72 | | { |
| 0 | 73 | | throw new ValidationException(ValidationRules.CannotBeNull, "ReferencePointParameter"); |
| | 74 | | } |
| 480 | 75 | | } |
| | 76 | | } |
| | 77 | | } |