//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.SqlTools.ResourceProvider.Core;
using Microsoft.SqlTools.ResourceProvider.Core.Authentication;
namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl
{
///
/// Implementation for
/// Contains information about an Azure subscription identifier
///
public class AzureSubscriptionIdentifier : IAzureSubscriptionIdentifier
{
///
/// Default constructor to initialize the subscription identifier
///
public AzureSubscriptionIdentifier(IAzureUserAccount userAccount, string tenantId, string subscriptionId, Uri serviceManagementEndpoint)
{
UserAccount = userAccount;
TenantId = tenantId;
SubscriptionId = subscriptionId;
ServiceManagementEndpoint = serviceManagementEndpoint;
}
///
/// Returns true if given subscription identifier equals this class
///
public bool Equals(IAzureSubscriptionIdentifier other)
{
return other != null &&
CommonUtil.SameString(SubscriptionId, other.SubscriptionId) &&
CommonUtil.SameUri(ServiceManagementEndpoint, other.ServiceManagementEndpoint);
}
public IAzureUserAccount UserAccount
{
get;
private set;
}
///
/// Returns the endpoint url used by the identifier
///
public Uri ServiceManagementEndpoint
{
get;
private set;
}
///
/// Subscription id
///
public string SubscriptionId
{
get;
private set;
}
///
/// The ID of the tenant this subscription comes from
///
public string TenantId
{
get;
private set;
}
}
}