| | 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.Collections; |
| | 16 | | using System.Collections.Generic; |
| | 17 | | using System.Linq; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Contains a batch of document write actions to send to the index. |
| | 21 | | /// </summary> |
| | 22 | | public partial class IndexBatch<T> |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Initializes a new instance of the IndexBatch class. |
| | 26 | | /// </summary> |
| 0 | 27 | | public IndexBatch() |
| | 28 | | { |
| | 29 | | CustomInit(); |
| 0 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Initializes a new instance of the IndexBatch class. |
| | 34 | | /// </summary> |
| | 35 | | /// <param name="actions">The actions in the batch.</param> |
| 494 | 36 | | public IndexBatch(IEnumerable<IndexAction<T>> actions) |
| | 37 | | { |
| 494 | 38 | | Actions = actions; |
| | 39 | | CustomInit(); |
| 494 | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// An initialization method that performs custom operations like setting defaults |
| | 44 | | /// </summary> |
| | 45 | | partial void CustomInit(); |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// Gets or sets the actions in the batch. |
| | 49 | | /// </summary> |
| | 50 | | [JsonProperty(PropertyName = "value")] |
| 1434 | 51 | | public IEnumerable<IndexAction<T>> Actions { get; set; } |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// Validate the object. |
| | 55 | | /// </summary> |
| | 56 | | /// <exception cref="ValidationException"> |
| | 57 | | /// Thrown if validation fails |
| | 58 | | /// </exception> |
| | 59 | | public virtual void Validate() |
| | 60 | | { |
| 446 | 61 | | if (Actions == null) |
| | 62 | | { |
| 0 | 63 | | throw new ValidationException(ValidationRules.CannotBeNull, "Actions"); |
| | 64 | | } |
| 446 | 65 | | } |
| | 66 | | } |
| | 67 | | } |