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

// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;

namespace Azure.IoT.DeviceUpdate.Models
{
    /// <summary> Supported deployment types. </summary>
    public readonly partial struct DeploymentType : IEquatable<DeploymentType>
    {
        private readonly string _value;

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

        private const string CompleteValue = "Complete";
        private const string DownloadValue = "Download";
        private const string InstallValue = "Install";

        /// <summary> A complete deployment including download, install, and apply actions. </summary>
        public static DeploymentType Complete { get; } = new DeploymentType(CompleteValue);
        /// <summary> A download-only deployment that does not include any install or apply actions. Not currently supported. </summary>
        public static DeploymentType Download { get; } = new DeploymentType(DownloadValue);
        /// <summary> An install-only rollout that does not include any download actions, only install and complete. Not currently supported. </summary>
        public static DeploymentType Install { get; } = new DeploymentType(InstallValue);
        /// <summary> Determines if two <see cref="DeploymentType"/> values are the same. </summary>
        public static bool operator ==(DeploymentType left, DeploymentType right) => left.Equals(right);
        /// <summary> Determines if two <see cref="DeploymentType"/> values are not the same. </summary>
        public static bool operator !=(DeploymentType left, DeploymentType right) => !left.Equals(right);
        /// <summary> Converts a string to a <see cref="DeploymentType"/>. </summary>
        public static implicit operator DeploymentType(string value) => new DeploymentType(value);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is DeploymentType other && Equals(other);
        /// <inheritdoc />
        public bool Equals(DeploymentType 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;
    }
}
