// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;

namespace Azure.AI.Translation.Document
{
    /// <summary> Enums containing high level error codes. </summary>
    public readonly partial struct DocumentTranslationErrorCode : IEquatable<DocumentTranslationErrorCode>
    {
        private readonly string _value;

        /// <summary> Initializes a new instance of <see cref="DocumentTranslationErrorCode"/>. </summary>
        /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
        public DocumentTranslationErrorCode(string value)
        {
            _value = value ?? throw new ArgumentNullException(nameof(value));
        }

        private const string InvalidRequestValue = "InvalidRequest";
        private const string InvalidArgumentValue = "InvalidArgument";
        private const string InternalServerErrorValue = "InternalServerError";
        private const string ServiceUnavailableValue = "ServiceUnavailable";
        private const string ResourceNotFoundValue = "ResourceNotFound";
        private const string UnauthorizedValue = "Unauthorized";
        private const string RequestRateTooHighValue = "RequestRateTooHigh";

        /// <summary> InvalidRequest. </summary>
        public static DocumentTranslationErrorCode InvalidRequest { get; } = new DocumentTranslationErrorCode(InvalidRequestValue);
        /// <summary> InvalidArgument. </summary>
        public static DocumentTranslationErrorCode InvalidArgument { get; } = new DocumentTranslationErrorCode(InvalidArgumentValue);
        /// <summary> InternalServerError. </summary>
        public static DocumentTranslationErrorCode InternalServerError { get; } = new DocumentTranslationErrorCode(InternalServerErrorValue);
        /// <summary> ServiceUnavailable. </summary>
        public static DocumentTranslationErrorCode ServiceUnavailable { get; } = new DocumentTranslationErrorCode(ServiceUnavailableValue);
        /// <summary> ResourceNotFound. </summary>
        public static DocumentTranslationErrorCode ResourceNotFound { get; } = new DocumentTranslationErrorCode(ResourceNotFoundValue);
        /// <summary> Unauthorized. </summary>
        public static DocumentTranslationErrorCode Unauthorized { get; } = new DocumentTranslationErrorCode(UnauthorizedValue);
        /// <summary> RequestRateTooHigh. </summary>
        public static DocumentTranslationErrorCode RequestRateTooHigh { get; } = new DocumentTranslationErrorCode(RequestRateTooHighValue);
        /// <summary> Determines if two <see cref="DocumentTranslationErrorCode"/> values are the same. </summary>
        public static bool operator ==(DocumentTranslationErrorCode left, DocumentTranslationErrorCode right) => left.Equals(right);
        /// <summary> Determines if two <see cref="DocumentTranslationErrorCode"/> values are not the same. </summary>
        public static bool operator !=(DocumentTranslationErrorCode left, DocumentTranslationErrorCode right) => !left.Equals(right);
        /// <summary> Converts a string to a <see cref="DocumentTranslationErrorCode"/>. </summary>
        public static implicit operator DocumentTranslationErrorCode(string value) => new DocumentTranslationErrorCode(value);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is DocumentTranslationErrorCode other && Equals(other);
        /// <inheritdoc />
        public bool Equals(DocumentTranslationErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
        /// <inheritdoc />
        public override string ToString() => _value;
    }
}
