| | 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.ComponentModel; |
| | 10 | |
|
| | 11 | | namespace Azure.Search.Documents.Indexes.Models |
| | 12 | | { |
| | 13 | | /// <summary> A string indicating what entity categories to return. </summary> |
| | 14 | | public readonly partial struct EntityCategory : IEquatable<EntityCategory> |
| | 15 | | { |
| | 16 | | private readonly string _value; |
| | 17 | |
|
| | 18 | | /// <summary> Determines if two <see cref="EntityCategory"/> values are the same. </summary> |
| | 19 | | /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> |
| | 20 | | public EntityCategory(string value) |
| | 21 | | { |
| 0 | 22 | | _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 0 | 23 | | } |
| | 24 | |
|
| | 25 | | private const string LocationValue = "location"; |
| | 26 | | private const string OrganizationValue = "organization"; |
| | 27 | | private const string PersonValue = "person"; |
| | 28 | | private const string QuantityValue = "quantity"; |
| | 29 | | private const string DatetimeValue = "datetime"; |
| | 30 | | private const string UrlValue = "url"; |
| | 31 | | private const string EmailValue = "email"; |
| | 32 | |
|
| | 33 | | /// <summary> Entities describing a physical location. </summary> |
| 0 | 34 | | public static EntityCategory Location { get; } = new EntityCategory(LocationValue); |
| | 35 | | /// <summary> Entities describing an organization. </summary> |
| 0 | 36 | | public static EntityCategory Organization { get; } = new EntityCategory(OrganizationValue); |
| | 37 | | /// <summary> Entities describing a person. </summary> |
| 0 | 38 | | public static EntityCategory Person { get; } = new EntityCategory(PersonValue); |
| | 39 | | /// <summary> Entities describing a quantity. </summary> |
| 0 | 40 | | public static EntityCategory Quantity { get; } = new EntityCategory(QuantityValue); |
| | 41 | | /// <summary> Entities describing a date and time. </summary> |
| 0 | 42 | | public static EntityCategory Datetime { get; } = new EntityCategory(DatetimeValue); |
| | 43 | | /// <summary> Entities describing a URL. </summary> |
| 0 | 44 | | public static EntityCategory Url { get; } = new EntityCategory(UrlValue); |
| | 45 | | /// <summary> Entities describing an email address. </summary> |
| 0 | 46 | | public static EntityCategory Email { get; } = new EntityCategory(EmailValue); |
| | 47 | | /// <summary> Determines if two <see cref="EntityCategory"/> values are the same. </summary> |
| 0 | 48 | | public static bool operator ==(EntityCategory left, EntityCategory right) => left.Equals(right); |
| | 49 | | /// <summary> Determines if two <see cref="EntityCategory"/> values are not the same. </summary> |
| 0 | 50 | | public static bool operator !=(EntityCategory left, EntityCategory right) => !left.Equals(right); |
| | 51 | | /// <summary> Converts a string to a <see cref="EntityCategory"/>. </summary> |
| 0 | 52 | | public static implicit operator EntityCategory(string value) => new EntityCategory(value); |
| | 53 | |
|
| | 54 | | /// <inheritdoc /> |
| | 55 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 56 | | public override bool Equals(object obj) => obj is EntityCategory other && Equals(other); |
| | 57 | | /// <inheritdoc /> |
| 0 | 58 | | public bool Equals(EntityCategory other) => string.Equals(_value, other._value, StringComparison.InvariantCultur |
| | 59 | |
|
| | 60 | | /// <inheritdoc /> |
| | 61 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 62 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 63 | | /// <inheritdoc /> |
| 0 | 64 | | public override string ToString() => _value; |
| | 65 | | } |
| | 66 | | } |