4 instantiations of BicepValueProxy
Aspire.Hosting.Azure.Provisioning (4)
BicepValueProxy.cs (4)
53return new(value, typeof(T), forcedSecure: false); 60return new(value, typeof(T), isSecure); 75return new(value, valueType, forcedSecure: false); 163return new(new BicepValue<object>(expression), typeof(object), isSecure);
179 references to BicepValueProxy
Aspire.Hosting.Azure.Provisioning (104)
BicepStringBuilderProxy.cs (3)
41internal BicepStringBuilderProxy AppendValue(BicepValueProxy value) 55internal BicepValueProxy Build() 57return BicepValueProxy.Create(_builder.Build(), _isSecure);
BicepValueFactory.cs (87)
47internal BicepValueProxy String(string value) 51return BicepValueProxy.Create(new BicepValue<string>(value)); 60internal BicepValueProxy Integer(int value) 62return BicepValueProxy.Create(new BicepValue<int>(value)); 71internal BicepValueProxy Boolean(bool value) 73return BicepValueProxy.Create(new BicepValue<bool>(value)); 82internal BicepValueProxy Double(double value) 84return BicepValueProxy.Create(new BicepValue<double>(value)); 93internal BicepValueProxy Guid(Guid value) 95return BicepValueProxy.Create(new BicepValue<Guid>(value)); 104internal BicepValueProxy Uri(Uri value) 108return BicepValueProxy.Create(new BicepValue<Uri>(value)); 117internal BicepValueProxy Location(string name) 121return BicepValueProxy.Create(new BicepValue<AzureLocation>(new AzureLocation(name))); 130internal BicepValueProxy TimeSpan(TimeSpan value) 132return BicepValueProxy.Create(new BicepValue<TimeSpan>(value)); 142internal BicepValueProxy Parameter( 148return BicepValueProxy.Create<string>(parameter.AsProvisioningParameter(_infrastructure, bicepIdentifier)); 159internal BicepValueProxy ReferenceExpression( 166return BicepValueProxy.Create<string>(expression.AsProvisioningParameter(_infrastructure, bicepIdentifier, isSecure)); 175internal BicepValueProxy Identifier(string bicepIdentifier) 179return BicepValueProxy.CreateExpression(new IdentifierExpression(bicepIdentifier), isSecure: false); 188internal BicepValueProxy Identifier(ProvisionableResourceProxy resource) 202internal BicepValueProxy Function(string name, IEnumerable<BicepValueProxy> args) 208return BicepValueProxy.CreateExpression( 221internal BicepValueProxy Concat(IEnumerable<BicepValueProxy> values) 226return BicepValueProxy.Create( 227BicepFunction.Concat([.. items.Select(static value => BicepValueProxy.Convert<string>(value))]), 237internal BicepValueProxy CreateGuid(IEnumerable<BicepValueProxy> values) 242return BicepValueProxy.Create( 243BicepFunction.CreateGuid([.. items.Select(static value => BicepValueProxy.Convert<string>(value))]), 253internal BicepValueProxy UniqueString(IEnumerable<BicepValueProxy> values) 258return BicepValueProxy.Create( 259BicepFunction.GetUniqueString([.. items.Select(static value => BicepValueProxy.Convert<string>(value))]), 269internal BicepValueProxy SubscriptionResourceId(IEnumerable<BicepValueProxy> values) 274return BicepValueProxy.Create( 275BicepFunction.GetSubscriptionResourceId([.. items.Select(static value => BicepValueProxy.Convert<string>(value))]), 286internal BicepValueProxy Take( 287[AspireUnion(typeof(string), typeof(BicepValueProxy))] object value, 288[AspireUnion(typeof(int), typeof(BicepValueProxy))] object count) 290return BicepValueProxy.Create( 292BicepValueProxy.Convert<string>(value), 293BicepValueProxy.Convert<int>(count)), 303internal BicepValueProxy ToLower(BicepValueProxy value) 307return BicepValueProxy.Create(BicepFunction.ToLower(value.ToObjectBicepValue()), value.IsSecure); 316internal BicepValueProxy ToUpper(BicepValueProxy value) 320return BicepValueProxy.Create(BicepFunction.ToUpper(value.ToObjectBicepValue()), value.IsSecure); 329internal BicepValueProxy AsString(BicepValueProxy value) 333return BicepValueProxy.Create(BicepFunction.AsString(value.ToObjectBicepValue()), value.IsSecure); 342internal BicepValueProxy ParseJson(BicepValueProxy value) 346return BicepValueProxy.Create(BicepFunction.ParseJson(value.ToObjectBicepValue()), value.IsSecure); 354internal BicepValueProxy ResourceGroup() 356return BicepValueProxy.Create(BicepFunction.GetResourceGroup()); 364internal BicepValueProxy Subscription() 366return BicepValueProxy.Create(BicepFunction.GetSubscription()); 374internal BicepValueProxy Tenant() 376return BicepValueProxy.Create(BicepFunction.GetTenant()); 384internal BicepValueProxy Deployment() 386return BicepValueProxy.Create(BicepFunction.GetDeployment()); 396internal BicepValueProxy Member(BicepValueProxy value, string member) 411internal BicepValueProxy Index( 412BicepValueProxy value, 413[AspireUnion(typeof(string), typeof(int), typeof(BicepValueProxy))] object index) 430internal BicepValueProxy Binary( 431BicepValueProxy left, 433BicepValueProxy right) 450internal BicepValueProxy Unary(UnaryBicepOperator @operator, BicepValueProxy value) 465internal BicepValueProxy Conditional( 466BicepValueProxy condition, 467BicepValueProxy consequent, 468BicepValueProxy alternate) 493private static BicepValueProxy FromExpression(BicepExpression expression, bool isSecure) 495return BicepValueProxy.CreateExpression(expression, isSecure); 506BicepValueProxy proxy => proxy.ToBicepExpression(), 507_ => throw new ArgumentException($"Expected a string, integer, or {nameof(BicepValueProxy)}.", nameof(value)) 513return value is BicepValueProxy proxy && proxy.IsSecure;
BicepValueProxy.cs (8)
49public static BicepValueProxy Create<T>(BicepValue<T> value) 56internal static BicepValueProxy Create<T>(BicepValue<T> value, bool isSecure) 63internal static BicepValueProxy Create(IBicepValue value) 70internal static BicepValueProxy Create(IBicepValue value, Type valueType) 127/// <param name="value">A literal value, an IP address string when <typeparamref name="T"/> is <see cref="IPAddress"/>, or <see cref="BicepValueProxy"/>.</param> 135if (value is BicepValueProxy proxy) 156throw new ArgumentException($"Expected a {typeof(T).Name} literal or {nameof(BicepValueProxy)}.", nameof(value)); 159internal static BicepValueProxy CreateExpression(BicepExpression expression, bool isSecure)
ProvisioningDeclarationExtensions.cs (6)
36internal BicepValueProxy Value 38get => BicepValueProxy.Create(Inner.Value, _valueType); 85internal BicepValueProxy Value 87get => BicepValueProxy.Create(Inner.Value, _valueType); 106internal BicepValueProxy Value 108get => BicepValueProxy.Create(Inner.Value, _valueType);
Aspire.Hosting.Azure.Provisioning.Tests (75)
BicepValueProxyTests.cs (75)
22typeof(BicepValueProxy).Assembly.GetCustomAttributes(typeof(ExperimentalAttribute), inherit: false) 32var proxy = BicepValueProxy.Create(new BicepValue<string>("value")); 45var proxy = BicepValueProxy.Create(new BicepValue<string>("secret"), isSecure: true); 59var proxy = BicepValueProxy.Create( 74var proxy = CreateInfrastructure().Create().Parameter(parameter, "sku"); 86var proxy = BicepValueProxy.Create( 90var converted = BicepValueProxy.Convert<ProvisioningValueType>(proxy); 100var proxy = BicepValueProxy.Create(new BicepValue<string>("Standard")); 116var proxy = BicepValueProxy.Create(source); 128Assert.Throws<ArgumentException>(() => BicepValueProxy.Convert<ProvisioningValueType>(proxy)); 134var proxy = BicepValueProxy.CreateExpression(new IdentifierExpression("sku"), isSecure: false); 138var converted = BicepValueProxy.Convert<ProvisioningValueType>(proxy); 149var proxy = BicepValueProxy.Create( 165var proxy = BicepValueProxy.Create(new BicepValue<int>(42)); 179var proxy = BicepValueProxy.Create( 182var converted = BicepValueProxy.Convert<int>(proxy); 191var proxy = BicepValueProxy.Create(new BicepValue<string>("secret"), isSecure: true); 193var converted = BicepValueProxy.Convert<string>(proxy); 206var converted = BicepValueProxy.Convert<IPAddress>(address); 207var proxy = BicepValueProxy.Create(converted, isSecure: true); 208var roundTripped = BicepValueProxy.Convert<IPAddress>(proxy); 223Assert.Throws<FormatException>(() => BicepValueProxy.Convert<IPAddress>(address)); 231var proxy = CreateInfrastructure().Create().String(address); 233var converted = BicepValueProxy.Convert<IPAddress>(proxy); 244var proxy = BicepValueProxy.Create(new BicepValue<string>(address), isSecure: true); 262var proxy = CreateInfrastructure().Create().String(address); 265Assert.Throws<FormatException>(() => BicepValueProxy.Convert<IPAddress>(proxy)); 278var proxy = useReferenceExpression 282var converted = BicepValueProxy.Convert<IPAddress>(proxy); 283var roundTripped = BicepValueProxy.Convert<IPAddress>(BicepValueProxy.Create(converted)); 298var proxy = BicepValueProxy.Create(source); 300var converted = BicepValueProxy.Convert<IPAddress>(proxy); 311var proxy = BicepValueProxy.Create( 315var converted = BicepValueProxy.Convert<IPAddress>(proxy); 325var proxy = BicepValueProxy.CreateExpression(new IdentifierExpression("ipAddress"), isSecure: false); 327var converted = BicepValueProxy.Convert<IPAddress>(proxy); 336var proxy = BicepValueProxy.Create(new BicepValue<int>(42)); 338var exception = Assert.Throws<ArgumentException>(() => BicepValueProxy.Convert<IPAddress>(proxy)); 346var proxy = BicepValueProxy.Create(new BicepValue<AzureLocation>(AzureLocation.WestUS2)); 359var proxy = BicepValueProxy.Create(new BicepValue<int>(42)); 361var exception = Assert.Throws<ArgumentException>(() => BicepValueProxy.Convert<string>(proxy)); 467parameter.Value = BicepValueProxy.Create(initialValue); 468var secureValue = literal switch 470bool value => BicepValueProxy.Create(new BicepValue<bool>(value), isSecure: true), 471int value => BicepValueProxy.Create(new BicepValue<int>(value), isSecure: true), 486var secureValue = BicepValueProxy.Create( 493var result = builder.Build(); 551Action<BicepValueProxy> assign, 554assign(BicepValueProxy.Create(new BicepValue<int>(42))); 558() => assign(BicepValueProxy.Create(new BicepValue<string>("text")))); 567Action<BicepValueProxy> assign, 568Func<BicepValueProxy> read) 570assign(BicepValueProxy.Create(new BicepValue<int>(42))); 576assign(BicepValueProxy.Create(