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);
167 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 (63)
BicepValueProxyTests.cs (63)
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( 72var proxy = BicepValueProxy.Create( 88var proxy = BicepValueProxy.Create(new BicepValue<int>(42)); 102var proxy = BicepValueProxy.Create( 105var converted = BicepValueProxy.Convert<int>(proxy); 114var proxy = BicepValueProxy.Create(new BicepValue<string>("secret"), isSecure: true); 116var converted = BicepValueProxy.Convert<string>(proxy); 129var converted = BicepValueProxy.Convert<IPAddress>(address); 130var proxy = BicepValueProxy.Create(converted, isSecure: true); 131var roundTripped = BicepValueProxy.Convert<IPAddress>(proxy); 146Assert.Throws<FormatException>(() => BicepValueProxy.Convert<IPAddress>(address)); 154var proxy = CreateInfrastructure().Create().String(address); 156var converted = BicepValueProxy.Convert<IPAddress>(proxy); 167var proxy = BicepValueProxy.Create(new BicepValue<string>(address), isSecure: true); 185var proxy = CreateInfrastructure().Create().String(address); 188Assert.Throws<FormatException>(() => BicepValueProxy.Convert<IPAddress>(proxy)); 201var proxy = useReferenceExpression 205var converted = BicepValueProxy.Convert<IPAddress>(proxy); 206var roundTripped = BicepValueProxy.Convert<IPAddress>(BicepValueProxy.Create(converted)); 221var proxy = BicepValueProxy.Create(source); 223var converted = BicepValueProxy.Convert<IPAddress>(proxy); 234var proxy = BicepValueProxy.Create( 238var converted = BicepValueProxy.Convert<IPAddress>(proxy); 248var proxy = BicepValueProxy.CreateExpression(new IdentifierExpression("ipAddress"), isSecure: false); 250var converted = BicepValueProxy.Convert<IPAddress>(proxy); 259var proxy = BicepValueProxy.Create(new BicepValue<int>(42)); 261var exception = Assert.Throws<ArgumentException>(() => BicepValueProxy.Convert<IPAddress>(proxy)); 269var proxy = BicepValueProxy.Create(new BicepValue<AzureLocation>(AzureLocation.WestUS2)); 282var proxy = BicepValueProxy.Create(new BicepValue<int>(42)); 284var exception = Assert.Throws<ArgumentException>(() => BicepValueProxy.Convert<string>(proxy)); 390parameter.Value = BicepValueProxy.Create(initialValue); 391var secureValue = literal switch 393bool value => BicepValueProxy.Create(new BicepValue<bool>(value), isSecure: true), 394int value => BicepValueProxy.Create(new BicepValue<int>(value), isSecure: true), 409var secureValue = BicepValueProxy.Create( 416var result = builder.Build(); 474Action<BicepValueProxy> assign, 477assign(BicepValueProxy.Create(new BicepValue<int>(42))); 481() => assign(BicepValueProxy.Create(new BicepValue<string>("text")))); 490Action<BicepValueProxy> assign, 491Func<BicepValueProxy> read) 493assign(BicepValueProxy.Create(new BicepValue<int>(42))); 499assign(BicepValueProxy.Create(