-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
TemplateClientBuilderExtensions.cs
34 lines (29 loc) · 1.66 KB
/
TemplateClientBuilderExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using Azure.Core.Extensions;
using Azure.Template;
namespace Microsoft.Extensions.Azure
{
/// <summary> Extension methods to add <see cref="TemplateClient"/> to client builder. </summary>
public static partial class TemplateClientBuilderExtensions
{
/// <summary> Registers a <see cref="TemplateClient"/> instance. </summary>
/// <param name="builder"> The builder to register with. </param>
/// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
public static IAzureClientBuilder<TemplateClient, TemplateClientOptions> AddTemplateClient<TBuilder>(this TBuilder builder, string vaultBaseUrl)
where TBuilder : IAzureClientFactoryBuilderWithCredential
{
return builder.RegisterClientFactory<TemplateClient, TemplateClientOptions>((options, cred) => new TemplateClient(vaultBaseUrl, cred, options));
}
/// <summary> Registers a <see cref="TemplateClient"/> instance. </summary>
/// <param name="builder"> The builder to register with. </param>
/// <param name="configuration"> The configuration values. </param>
public static IAzureClientBuilder<TemplateClient, TemplateClientOptions> AddTemplateClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration)
where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration>
{
return builder.RegisterClientFactory<TemplateClient, TemplateClientOptions>(configuration);
}
}
}