|
| 1 | +// Licensed to Elasticsearch B.V under one or more agreements. |
| 2 | +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. |
| 3 | +// See the LICENSE file in the project root for more information |
| 4 | + |
| 5 | +using System; |
| 6 | +using System.Linq.Expressions; |
| 7 | +using System.Runtime.Serialization; |
| 8 | +using Elasticsearch.Net.Utf8Json; |
| 9 | + |
| 10 | +namespace Nest |
| 11 | +{ |
| 12 | + [InterfaceDataContract] |
| 13 | + public interface IRegisteredDomainProcessor : IProcessor |
| 14 | + { |
| 15 | + [DataMember(Name = "field")] |
| 16 | + Field Field { get; set; } |
| 17 | + |
| 18 | + [DataMember(Name = "ignore_missing")] |
| 19 | + bool? IgnoreMissing { get; set; } |
| 20 | + |
| 21 | + [DataMember(Name = "target_field")] |
| 22 | + Field TargetField { get; set; } |
| 23 | + } |
| 24 | + |
| 25 | + public class RegisteredDomainProcessor : ProcessorBase, IRegisteredDomainProcessor |
| 26 | + { |
| 27 | + protected override string Name => "registered_domain"; |
| 28 | + |
| 29 | + /// <inheritdoc /> |
| 30 | + public Field Field { get; set; } |
| 31 | + /// <inheritdoc /> |
| 32 | + public bool? IgnoreMissing { get; set; } |
| 33 | + /// <inheritdoc /> |
| 34 | + public Field TargetField { get; set; } |
| 35 | + } |
| 36 | + |
| 37 | + /// <inheritdoc cref="IFingerprintProcessor" /> |
| 38 | + public class RegisteredDomainProcessorDescriptor<T> |
| 39 | + : ProcessorDescriptorBase<RegisteredDomainProcessorDescriptor<T>, IRegisteredDomainProcessor>, IRegisteredDomainProcessor |
| 40 | + where T : class |
| 41 | + { |
| 42 | + protected override string Name => "registered_domain"; |
| 43 | + |
| 44 | + Field IRegisteredDomainProcessor.Field { get; set; } |
| 45 | + bool? IRegisteredDomainProcessor.IgnoreMissing { get; set; } |
| 46 | + Field IRegisteredDomainProcessor.TargetField { get; set; } |
| 47 | + |
| 48 | + /// <inheritdoc cref="IRegisteredDomainProcessor.Field" /> |
| 49 | + public RegisteredDomainProcessorDescriptor<T> Field(Field field) => Assign(field, (a, v) => a.Field = v); |
| 50 | + |
| 51 | + /// <inheritdoc cref="IRegisteredDomainProcessor.Field" /> |
| 52 | + public RegisteredDomainProcessorDescriptor<T> Field<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 53 | + Assign(objectPath, (a, v) => a.Field = v); |
| 54 | + |
| 55 | + /// <inheritdoc cref="IRegisteredDomainProcessor.IgnoreMissing" /> |
| 56 | + public RegisteredDomainProcessorDescriptor<T> IgnoreMissing(bool? ignoreMissing = true) => Assign(ignoreMissing, (a, v) => a.IgnoreMissing = v); |
| 57 | + |
| 58 | + /// <inheritdoc cref="IRegisteredDomainProcessor.TargetField" /> |
| 59 | + public RegisteredDomainProcessorDescriptor<T> TargetField(Field field) => Assign(field, (a, v) => a.TargetField = v); |
| 60 | + |
| 61 | + /// <inheritdoc cref="IRegisteredDomainProcessor.TargetField" /> |
| 62 | + public RegisteredDomainProcessorDescriptor<T> TargetField<TValue>(Expression<Func<T, TValue>> objectPath) => |
| 63 | + Assign(objectPath, (a, v) => a.TargetField = v); |
| 64 | + } |
| 65 | +} |
0 commit comments