// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
#nullable disable
using System;
using System.ComponentModel;
using Azure.ResourceManager.MongoCluster;
namespace Azure.ResourceManager.MongoCluster.Models
{
/// The network bypass mode for the Mongo cluster.
public readonly partial struct MongoClusterNetworkBypassMode : IEquatable
{
private readonly string _value;
/// No network bypass is enabled.
private const string NoneValue = "None";
/// Allows Azure Cosmos DB service to bypass network restrictions.
private const string AzureCosmosDBValue = "AzureCosmosDB";
/// Initializes a new instance of .
/// The value.
/// is null.
public MongoClusterNetworkBypassMode(string value)
{
Argument.AssertNotNull(value, nameof(value));
_value = value;
}
/// No network bypass is enabled.
public static MongoClusterNetworkBypassMode None { get; } = new MongoClusterNetworkBypassMode(NoneValue);
/// Allows Azure Cosmos DB service to bypass network restrictions.
public static MongoClusterNetworkBypassMode AzureCosmosDB { get; } = new MongoClusterNetworkBypassMode(AzureCosmosDBValue);
/// Determines if two values are the same.
/// The left value to compare.
/// The right value to compare.
public static bool operator ==(MongoClusterNetworkBypassMode left, MongoClusterNetworkBypassMode right) => left.Equals(right);
/// Determines if two values are not the same.
/// The left value to compare.
/// The right value to compare.
public static bool operator !=(MongoClusterNetworkBypassMode left, MongoClusterNetworkBypassMode right) => !left.Equals(right);
/// Converts a string to a .
/// The value.
public static implicit operator MongoClusterNetworkBypassMode(string value) => new MongoClusterNetworkBypassMode(value);
/// Converts a string to a .
/// The value.
public static implicit operator MongoClusterNetworkBypassMode?(string value) => value == null ? null : new MongoClusterNetworkBypassMode(value);
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is MongoClusterNetworkBypassMode other && Equals(other);
///
public bool Equals(MongoClusterNetworkBypassMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
///
public override string ToString() => _value;
}
}