| | | 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 | | /// Represents information about the entity (such as Azure SQL table or |
| | | 19 | | /// DocumentDb collection) that will be indexed. |
| | | 20 | | /// </summary> |
| | | 21 | | public partial class DataContainer |
| | | 22 | | { |
| | | 23 | | /// <summary> |
| | | 24 | | /// Initializes a new instance of the DataContainer class. |
| | | 25 | | /// </summary> |
| | 324 | 26 | | public DataContainer() |
| | | 27 | | { |
| | | 28 | | CustomInit(); |
| | 324 | 29 | | } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Initializes a new instance of the DataContainer class. |
| | | 33 | | /// </summary> |
| | | 34 | | /// <param name="name">The name of the table or view (for Azure SQL |
| | | 35 | | /// data source) or collection (for DocumentDB data source) that will |
| | | 36 | | /// be indexed.</param> |
| | | 37 | | /// <param name="query">A query that is applied to this data container. |
| | | 38 | | /// The syntax and meaning of this parameter is datasource-specific. |
| | | 39 | | /// Not supported by Azure SQL datasources.</param> |
| | 2 | 40 | | public DataContainer(string name, string query = default(string)) |
| | | 41 | | { |
| | 2 | 42 | | Name = name; |
| | 2 | 43 | | Query = query; |
| | | 44 | | CustomInit(); |
| | 2 | 45 | | } |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// An initialization method that performs custom operations like setting defaults |
| | | 49 | | /// </summary> |
| | | 50 | | partial void CustomInit(); |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Gets or sets the name of the table or view (for Azure SQL data |
| | | 54 | | /// source) or collection (for DocumentDB data source) that will be |
| | | 55 | | /// indexed. |
| | | 56 | | /// </summary> |
| | | 57 | | [JsonProperty(PropertyName = "name")] |
| | 762 | 58 | | public string Name { get; set; } |
| | | 59 | | |
| | | 60 | | /// <summary> |
| | | 61 | | /// Gets or sets a query that is applied to this data container. The |
| | | 62 | | /// syntax and meaning of this parameter is datasource-specific. Not |
| | | 63 | | /// supported by Azure SQL datasources. |
| | | 64 | | /// </summary> |
| | | 65 | | [JsonProperty(PropertyName = "query")] |
| | 374 | 66 | | public string Query { get; set; } |
| | | 67 | | |
| | | 68 | | /// <summary> |
| | | 69 | | /// Validate the object. |
| | | 70 | | /// </summary> |
| | | 71 | | /// <exception cref="ValidationException"> |
| | | 72 | | /// Thrown if validation fails |
| | | 73 | | /// </exception> |
| | | 74 | | public virtual void Validate() |
| | | 75 | | { |
| | 152 | 76 | | if (Name == null) |
| | | 77 | | { |
| | 0 | 78 | | throw new ValidationException(ValidationRules.CannotBeNull, "Name"); |
| | | 79 | | } |
| | 152 | 80 | | } |
| | | 81 | | } |
| | | 82 | | } |