| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using Azure.Core; |
| | 5 | | using System; |
| | 6 | |
|
| | 7 | | namespace Azure.Analytics.Synapse.Spark.Models |
| | 8 | | { |
| | 9 | | /// <summary> The ErrorSource. </summary> |
| | 10 | | [CodeGenModel("SparkErrorSource")] |
| | 11 | | public readonly partial struct SparkErrorSource : IEquatable<SparkErrorSource> |
| | 12 | | { |
| | 13 | | /// <summary> Determines if two <see cref="SparkErrorSource"/> values are the same. </summary> |
| | 14 | | public SparkErrorSource(string value) |
| | 15 | | { |
| 0 | 16 | | _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 0 | 17 | | } |
| | 18 | |
|
| | 19 | | private const string SystemValue = "System"; |
| | 20 | | private const string UserValue = "User"; |
| | 21 | | private const string UnknownValue = "Unknown"; |
| | 22 | | private const string DependencyValue = "Dependency"; |
| | 23 | |
|
| | 24 | | /// <summary> System. </summary> |
| | 25 | | [CodeGenMember("System")] |
| 0 | 26 | | public static SparkErrorSource SystemError { get; } = new SparkErrorSource(SystemValue); |
| | 27 | | /// <summary> User. </summary> |
| | 28 | | [CodeGenMember("User")] |
| 0 | 29 | | public static SparkErrorSource UserError { get; } = new SparkErrorSource(UserValue); |
| | 30 | | /// <summary> Unknown. </summary> |
| | 31 | | [CodeGenMember("Unknown")] |
| 0 | 32 | | public static SparkErrorSource UnknownError { get; } = new SparkErrorSource(UnknownValue); |
| | 33 | | /// <summary> Dependency. </summary> |
| | 34 | | [CodeGenMember("Dependency")] |
| 0 | 35 | | public static SparkErrorSource DependencyError { get; } = new SparkErrorSource(DependencyValue); |
| | 36 | |
|
| | 37 | | /// <inheritdoc /> |
| | 38 | | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] |
| 0 | 39 | | public override bool Equals(object obj) => obj is SparkErrorSource other && Equals(other); |
| | 40 | | /// <inheritdoc /> |
| 0 | 41 | | public bool Equals(SparkErrorSource other) => string.Equals(_value, other._value, System.StringComparison.Ordina |
| | 42 | |
|
| | 43 | | /// <inheritdoc /> |
| | 44 | | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] |
| 0 | 45 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 46 | | /// <inheritdoc /> |
| 0 | 47 | | public override string ToString() => _value; |
| | 48 | | } |
| | 49 | | } |