/// <summary> /// Initializes a new instance of the <see cref="AuthenticationParameters" /> class. /// </summary> protected AuthenticationParameters(MgmtAccount account, MgmtEnvironment environment, IEnumerable <string> scopes) { account.AssertNotNull(nameof(account)); environment.AssertNotNull(nameof(environment)); scopes.AssertNotNull(nameof(scopes)); Account = account; Environment = environment; Scopes = scopes; }
/// <summary> /// Gets the Azure cloud instance based an instance of the <see cref="MgmtEnvironment" /> class. /// </summary> /// <param name="environment">The environment information used to be generate the Azure Cloud instance.</param> /// <returns>The Azure cloud instance based an instance of the <see cref="MgmtEnvironment" /> class.</returns> private static AzureCloudInstance GetAzureCloudInstance(MgmtEnvironment environment) { environment.AssertNotNull(nameof(environment)); if (environment.EnvironmentName == EnvironmentName.AzureChinaCloud) { return(AzureCloudInstance.AzureChina); } else if (environment.EnvironmentName == EnvironmentName.AzureGermanCloud) { return(AzureCloudInstance.AzureGermany); } else if (environment.EnvironmentName == EnvironmentName.AzureCloud) { return(AzureCloudInstance.AzurePublic); } else if (environment.EnvironmentName == EnvironmentName.AzureUSGovernment) { return(AzureCloudInstance.AzureUsGovernment); } return(AzureCloudInstance.None); }