4 instantiations of BicepValueProxy
Aspire.Hosting.Azure.Provisioning (4)
BicepValueProxy.cs (4)
53
return
new
(value, typeof(T), forcedSecure: false);
60
return
new
(value, typeof(T), isSecure);
75
return
new
(value, valueType, forcedSecure: false);
163
return
new
(new BicepValue<object>(expression), typeof(object), isSecure);
167 references to BicepValueProxy
Aspire.Hosting.Azure.Provisioning (104)
BicepStringBuilderProxy.cs (3)
41
internal BicepStringBuilderProxy AppendValue(
BicepValueProxy
value)
55
internal
BicepValueProxy
Build()
57
return
BicepValueProxy
.Create(_builder.Build(), _isSecure);
BicepValueFactory.cs (87)
47
internal
BicepValueProxy
String(string value)
51
return
BicepValueProxy
.Create(new BicepValue<string>(value));
60
internal
BicepValueProxy
Integer(int value)
62
return
BicepValueProxy
.Create(new BicepValue<int>(value));
71
internal
BicepValueProxy
Boolean(bool value)
73
return
BicepValueProxy
.Create(new BicepValue<bool>(value));
82
internal
BicepValueProxy
Double(double value)
84
return
BicepValueProxy
.Create(new BicepValue<double>(value));
93
internal
BicepValueProxy
Guid(Guid value)
95
return
BicepValueProxy
.Create(new BicepValue<Guid>(value));
104
internal
BicepValueProxy
Uri(Uri value)
108
return
BicepValueProxy
.Create(new BicepValue<Uri>(value));
117
internal
BicepValueProxy
Location(string name)
121
return
BicepValueProxy
.Create(new BicepValue<AzureLocation>(new AzureLocation(name)));
130
internal
BicepValueProxy
TimeSpan(TimeSpan value)
132
return
BicepValueProxy
.Create(new BicepValue<TimeSpan>(value));
142
internal
BicepValueProxy
Parameter(
148
return
BicepValueProxy
.Create<string>(parameter.AsProvisioningParameter(_infrastructure, bicepIdentifier));
159
internal
BicepValueProxy
ReferenceExpression(
166
return
BicepValueProxy
.Create<string>(expression.AsProvisioningParameter(_infrastructure, bicepIdentifier, isSecure));
175
internal
BicepValueProxy
Identifier(string bicepIdentifier)
179
return
BicepValueProxy
.CreateExpression(new IdentifierExpression(bicepIdentifier), isSecure: false);
188
internal
BicepValueProxy
Identifier(ProvisionableResourceProxy resource)
202
internal
BicepValueProxy
Function(string name, IEnumerable<
BicepValueProxy
> args)
208
return
BicepValueProxy
.CreateExpression(
221
internal
BicepValueProxy
Concat(IEnumerable<
BicepValueProxy
> values)
226
return
BicepValueProxy
.Create(
227
BicepFunction.Concat([.. items.Select(static value =>
BicepValueProxy
.Convert<string>(value))]),
237
internal
BicepValueProxy
CreateGuid(IEnumerable<
BicepValueProxy
> values)
242
return
BicepValueProxy
.Create(
243
BicepFunction.CreateGuid([.. items.Select(static value =>
BicepValueProxy
.Convert<string>(value))]),
253
internal
BicepValueProxy
UniqueString(IEnumerable<
BicepValueProxy
> values)
258
return
BicepValueProxy
.Create(
259
BicepFunction.GetUniqueString([.. items.Select(static value =>
BicepValueProxy
.Convert<string>(value))]),
269
internal
BicepValueProxy
SubscriptionResourceId(IEnumerable<
BicepValueProxy
> values)
274
return
BicepValueProxy
.Create(
275
BicepFunction.GetSubscriptionResourceId([.. items.Select(static value =>
BicepValueProxy
.Convert<string>(value))]),
286
internal
BicepValueProxy
Take(
287
[AspireUnion(typeof(string), typeof(
BicepValueProxy
))] object value,
288
[AspireUnion(typeof(int), typeof(
BicepValueProxy
))] object count)
290
return
BicepValueProxy
.Create(
292
BicepValueProxy
.Convert<string>(value),
293
BicepValueProxy
.Convert<int>(count)),
303
internal
BicepValueProxy
ToLower(
BicepValueProxy
value)
307
return
BicepValueProxy
.Create(BicepFunction.ToLower(value.ToObjectBicepValue()), value.IsSecure);
316
internal
BicepValueProxy
ToUpper(
BicepValueProxy
value)
320
return
BicepValueProxy
.Create(BicepFunction.ToUpper(value.ToObjectBicepValue()), value.IsSecure);
329
internal
BicepValueProxy
AsString(
BicepValueProxy
value)
333
return
BicepValueProxy
.Create(BicepFunction.AsString(value.ToObjectBicepValue()), value.IsSecure);
342
internal
BicepValueProxy
ParseJson(
BicepValueProxy
value)
346
return
BicepValueProxy
.Create(BicepFunction.ParseJson(value.ToObjectBicepValue()), value.IsSecure);
354
internal
BicepValueProxy
ResourceGroup()
356
return
BicepValueProxy
.Create(BicepFunction.GetResourceGroup());
364
internal
BicepValueProxy
Subscription()
366
return
BicepValueProxy
.Create(BicepFunction.GetSubscription());
374
internal
BicepValueProxy
Tenant()
376
return
BicepValueProxy
.Create(BicepFunction.GetTenant());
384
internal
BicepValueProxy
Deployment()
386
return
BicepValueProxy
.Create(BicepFunction.GetDeployment());
396
internal
BicepValueProxy
Member(
BicepValueProxy
value, string member)
411
internal
BicepValueProxy
Index(
412
BicepValueProxy
value,
413
[AspireUnion(typeof(string), typeof(int), typeof(
BicepValueProxy
))] object index)
430
internal
BicepValueProxy
Binary(
431
BicepValueProxy
left,
433
BicepValueProxy
right)
450
internal
BicepValueProxy
Unary(UnaryBicepOperator @operator,
BicepValueProxy
value)
465
internal
BicepValueProxy
Conditional(
466
BicepValueProxy
condition,
467
BicepValueProxy
consequent,
468
BicepValueProxy
alternate)
493
private static
BicepValueProxy
FromExpression(BicepExpression expression, bool isSecure)
495
return
BicepValueProxy
.CreateExpression(expression, isSecure);
506
BicepValueProxy
proxy => proxy.ToBicepExpression(),
507
_ => throw new ArgumentException($"Expected a string, integer, or {nameof(
BicepValueProxy
)}.", nameof(value))
513
return value is
BicepValueProxy
proxy && proxy.IsSecure;
BicepValueProxy.cs (8)
49
public static
BicepValueProxy
Create<T>(BicepValue<T> value)
56
internal static
BicepValueProxy
Create<T>(BicepValue<T> value, bool isSecure)
63
internal static
BicepValueProxy
Create(IBicepValue value)
70
internal 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>
135
if (value is
BicepValueProxy
proxy)
156
throw new ArgumentException($"Expected a {typeof(T).Name} literal or {nameof(
BicepValueProxy
)}.", nameof(value));
159
internal static
BicepValueProxy
CreateExpression(BicepExpression expression, bool isSecure)
ProvisioningDeclarationExtensions.cs (6)
36
internal
BicepValueProxy
Value
38
get =>
BicepValueProxy
.Create(Inner.Value, _valueType);
85
internal
BicepValueProxy
Value
87
get =>
BicepValueProxy
.Create(Inner.Value, _valueType);
106
internal
BicepValueProxy
Value
108
get =>
BicepValueProxy
.Create(Inner.Value, _valueType);
Aspire.Hosting.Azure.Provisioning.Tests (63)
BicepValueProxyTests.cs (63)
22
typeof(
BicepValueProxy
).Assembly.GetCustomAttributes(typeof(ExperimentalAttribute), inherit: false)
32
var
proxy =
BicepValueProxy
.Create(new BicepValue<string>("value"));
45
var
proxy =
BicepValueProxy
.Create(new BicepValue<string>("secret"), isSecure: true);
59
var
proxy =
BicepValueProxy
.Create(
72
var
proxy =
BicepValueProxy
.Create(
88
var
proxy =
BicepValueProxy
.Create(new BicepValue<int>(42));
102
var
proxy =
BicepValueProxy
.Create(
105
var converted =
BicepValueProxy
.Convert<int>(proxy);
114
var
proxy =
BicepValueProxy
.Create(new BicepValue<string>("secret"), isSecure: true);
116
var converted =
BicepValueProxy
.Convert<string>(proxy);
129
var converted =
BicepValueProxy
.Convert<IPAddress>(address);
130
var
proxy =
BicepValueProxy
.Create(converted, isSecure: true);
131
var roundTripped =
BicepValueProxy
.Convert<IPAddress>(proxy);
146
Assert.Throws<FormatException>(() =>
BicepValueProxy
.Convert<IPAddress>(address));
154
var
proxy = CreateInfrastructure().Create().String(address);
156
var converted =
BicepValueProxy
.Convert<IPAddress>(proxy);
167
var
proxy =
BicepValueProxy
.Create(new BicepValue<string>(address), isSecure: true);
185
var
proxy = CreateInfrastructure().Create().String(address);
188
Assert.Throws<FormatException>(() =>
BicepValueProxy
.Convert<IPAddress>(proxy));
201
var
proxy = useReferenceExpression
205
var converted =
BicepValueProxy
.Convert<IPAddress>(proxy);
206
var roundTripped =
BicepValueProxy
.Convert<IPAddress>(
BicepValueProxy
.Create(converted));
221
var
proxy =
BicepValueProxy
.Create(source);
223
var converted =
BicepValueProxy
.Convert<IPAddress>(proxy);
234
var
proxy =
BicepValueProxy
.Create(
238
var converted =
BicepValueProxy
.Convert<IPAddress>(proxy);
248
var
proxy =
BicepValueProxy
.CreateExpression(new IdentifierExpression("ipAddress"), isSecure: false);
250
var converted =
BicepValueProxy
.Convert<IPAddress>(proxy);
259
var
proxy =
BicepValueProxy
.Create(new BicepValue<int>(42));
261
var exception = Assert.Throws<ArgumentException>(() =>
BicepValueProxy
.Convert<IPAddress>(proxy));
269
var
proxy =
BicepValueProxy
.Create(new BicepValue<AzureLocation>(AzureLocation.WestUS2));
282
var
proxy =
BicepValueProxy
.Create(new BicepValue<int>(42));
284
var exception = Assert.Throws<ArgumentException>(() =>
BicepValueProxy
.Convert<string>(proxy));
390
parameter.Value =
BicepValueProxy
.Create(initialValue);
391
var
secureValue = literal switch
393
bool value =>
BicepValueProxy
.Create(new BicepValue<bool>(value), isSecure: true),
394
int value =>
BicepValueProxy
.Create(new BicepValue<int>(value), isSecure: true),
409
var
secureValue =
BicepValueProxy
.Create(
416
var
result = builder.Build();
474
Action<
BicepValueProxy
> assign,
477
assign(
BicepValueProxy
.Create(new BicepValue<int>(42)));
481
() => assign(
BicepValueProxy
.Create(new BicepValue<string>("text"))));
490
Action<
BicepValueProxy
> assign,
491
Func<
BicepValueProxy
> read)
493
assign(
BicepValueProxy
.Create(new BicepValue<int>(42)));
499
assign(
BicepValueProxy
.Create(