using System;
namespace Unity.Services.Core.Environments
{
///
/// Initialization option extensions related to environments.
///
public static class EnvironmentsOptionsExtensions
{
internal const string EnvironmentNameKey = "com.unity.services.core.environment-name";
///
/// An extension to set the environment to use.
///
/// The InitializationOptions object to modify
/// The name of the environment to use
/// Throws a if environmentName is null or empty.
///
/// Return .
/// Fluent interface pattern to make it easier to chain set options operations.
///
public static InitializationOptions SetEnvironmentName(this InitializationOptions self, string environmentName)
{
if (string.IsNullOrEmpty(environmentName))
throw new ArgumentException("Environment name cannot be null or empty.", nameof(environmentName));
self.SetOption(EnvironmentNameKey, environmentName);
return self;
}
}
}