@azure-typespec/http-client-csharp-mgmt 1.0.0-alpha.20250409.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emitter/emitter.d.ts +4 -0
- package/dist/emitter/emitter.d.ts.map +1 -0
- package/dist/emitter/emitter.js +77 -0
- package/dist/emitter/emitter.js.map +1 -0
- package/dist/emitter/index.d.ts +2 -0
- package/dist/emitter/index.d.ts.map +1 -0
- package/dist/emitter/index.js +4 -0
- package/dist/emitter/index.js.map +1 -0
- package/dist/emitter/resource-type.d.ts +2 -0
- package/dist/emitter/resource-type.d.ts.map +1 -0
- package/dist/emitter/resource-type.js +31 -0
- package/dist/emitter/resource-type.js.map +1 -0
- package/dist/emitter/sdk-context-options.d.ts +3 -0
- package/dist/emitter/sdk-context-options.d.ts.map +1 -0
- package/dist/emitter/sdk-context-options.js +23 -0
- package/dist/emitter/sdk-context-options.js.map +1 -0
- package/dist/generator/Azure.Core.dll +0 -0
- package/dist/generator/Azure.Generator.Mgmt.deps.json +998 -0
- package/dist/generator/Azure.Generator.Mgmt.dll +0 -0
- package/dist/generator/Azure.Generator.Mgmt.pdb +0 -0
- package/dist/generator/Azure.Generator.Mgmt.xml +818 -0
- package/dist/generator/Azure.Generator.dll +0 -0
- package/dist/generator/Azure.Generator.pdb +0 -0
- package/dist/generator/Azure.Generator.xml +163 -0
- package/dist/generator/Azure.ResourceManager.dll +0 -0
- package/dist/generator/CommandLine.dll +0 -0
- package/dist/generator/Humanizer.dll +0 -0
- package/dist/generator/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/dist/generator/Microsoft.Build.Framework.dll +0 -0
- package/dist/generator/Microsoft.Build.dll +0 -0
- package/dist/generator/Microsoft.CodeAnalysis.CSharp.Workspaces.dll +0 -0
- package/dist/generator/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/dist/generator/Microsoft.CodeAnalysis.Workspaces.dll +0 -0
- package/dist/generator/Microsoft.CodeAnalysis.dll +0 -0
- package/dist/generator/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/dist/generator/Microsoft.NET.StringTools.dll +0 -0
- package/dist/generator/Microsoft.TypeSpec.Generator.ClientModel.dll +0 -0
- package/dist/generator/Microsoft.TypeSpec.Generator.Input.dll +0 -0
- package/dist/generator/Microsoft.TypeSpec.Generator.dll +0 -0
- package/dist/generator/Microsoft.TypeSpec.Generator.runtimeconfig.json +12 -0
- package/dist/generator/NuGet.Common.dll +0 -0
- package/dist/generator/NuGet.Configuration.dll +0 -0
- package/dist/generator/NuGet.Frameworks.dll +0 -0
- package/dist/generator/Shared/Core/AppContextSwitchHelper.cs +42 -0
- package/dist/generator/Shared/Core/AsyncLockWithValue.cs +260 -0
- package/dist/generator/Shared/Core/AzureKeyCredentialPolicy.cs +50 -0
- package/dist/generator/Shared/Core/ClientDiagnostics.cs +73 -0
- package/dist/generator/Shared/Core/DiagnosticScope.cs +473 -0
- package/dist/generator/Shared/Core/DiagnosticScopeFactory.cs +104 -0
- package/dist/generator/Shared/Core/FixedDelayWithNoJitterStrategy.cs +26 -0
- package/dist/generator/Shared/Core/HttpMessageSanitizer.cs +198 -0
- package/dist/generator/Shared/Core/IOperationSource.cs +14 -0
- package/dist/generator/Shared/Core/NextLinkOperationImplementation.cs +690 -0
- package/dist/generator/Shared/Core/OperationFinalStateVia.cs +16 -0
- package/dist/generator/Shared/Core/OperationInternal.cs +256 -0
- package/dist/generator/Shared/Core/OperationInternalBase.cs +234 -0
- package/dist/generator/Shared/Core/OperationInternalOfT.cs +422 -0
- package/dist/generator/Shared/Core/OperationPoller.cs +114 -0
- package/dist/generator/Shared/Core/RawRequestUriBuilder.cs +192 -0
- package/dist/generator/Shared/Core/SequentialDelayStrategy.cs +38 -0
- package/dist/generator/Shared/Core/TaskExtensions.cs +313 -0
- package/dist/generator/Shared/Core/VoidValue.cs +10 -0
- package/dist/generator/System.ClientModel.dll +0 -0
- package/dist/generator/System.ComponentModel.Composition.dll +0 -0
- package/dist/generator/System.Composition.AttributedModel.dll +0 -0
- package/dist/generator/System.Composition.Convention.dll +0 -0
- package/dist/generator/System.Composition.Hosting.dll +0 -0
- package/dist/generator/System.Composition.Runtime.dll +0 -0
- package/dist/generator/System.Composition.TypedParts.dll +0 -0
- package/dist/generator/System.Configuration.ConfigurationManager.dll +0 -0
- package/dist/generator/System.Diagnostics.EventLog.dll +0 -0
- package/dist/generator/System.IO.Pipelines.dll +0 -0
- package/dist/generator/System.Memory.Data.dll +0 -0
- package/dist/generator/System.Reflection.MetadataLoadContext.dll +0 -0
- package/dist/generator/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/dist/generator/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/cs/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/cs/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/de/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/de/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/de/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/es/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/es/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/es/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/fr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/fr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/it/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/it/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/it/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/ja/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/ja/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/ko/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/ko/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/Azure.Core.dll +0 -0
- package/dist/generator/net8.0/Azure.Generator.Mgmt.deps.json +998 -0
- package/dist/generator/net8.0/Azure.Generator.Mgmt.dll +0 -0
- package/dist/generator/net8.0/Azure.Generator.Mgmt.pdb +0 -0
- package/dist/generator/net8.0/Azure.Generator.Mgmt.xml +818 -0
- package/dist/generator/net8.0/Azure.Generator.dll +0 -0
- package/dist/generator/net8.0/Azure.Generator.pdb +0 -0
- package/dist/generator/net8.0/Azure.Generator.xml +163 -0
- package/dist/generator/net8.0/Azure.ResourceManager.dll +0 -0
- package/dist/generator/net8.0/CommandLine.dll +0 -0
- package/dist/generator/net8.0/Humanizer.dll +0 -0
- package/dist/generator/net8.0/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/dist/generator/net8.0/Microsoft.Build.Framework.dll +0 -0
- package/dist/generator/net8.0/Microsoft.Build.dll +0 -0
- package/dist/generator/net8.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll +0 -0
- package/dist/generator/net8.0/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/dist/generator/net8.0/Microsoft.CodeAnalysis.Workspaces.dll +0 -0
- package/dist/generator/net8.0/Microsoft.CodeAnalysis.dll +0 -0
- package/dist/generator/net8.0/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/dist/generator/net8.0/Microsoft.NET.StringTools.dll +0 -0
- package/dist/generator/net8.0/Microsoft.TypeSpec.Generator.ClientModel.dll +0 -0
- package/dist/generator/net8.0/Microsoft.TypeSpec.Generator.Input.dll +0 -0
- package/dist/generator/net8.0/Microsoft.TypeSpec.Generator.dll +0 -0
- package/dist/generator/net8.0/NuGet.Common.dll +0 -0
- package/dist/generator/net8.0/NuGet.Configuration.dll +0 -0
- package/dist/generator/net8.0/NuGet.Frameworks.dll +0 -0
- package/dist/generator/net8.0/Shared/Core/AppContextSwitchHelper.cs +42 -0
- package/dist/generator/net8.0/Shared/Core/AsyncLockWithValue.cs +260 -0
- package/dist/generator/net8.0/Shared/Core/AzureKeyCredentialPolicy.cs +50 -0
- package/dist/generator/net8.0/Shared/Core/ClientDiagnostics.cs +73 -0
- package/dist/generator/net8.0/Shared/Core/DiagnosticScope.cs +473 -0
- package/dist/generator/net8.0/Shared/Core/DiagnosticScopeFactory.cs +104 -0
- package/dist/generator/net8.0/Shared/Core/FixedDelayWithNoJitterStrategy.cs +26 -0
- package/dist/generator/net8.0/Shared/Core/HttpMessageSanitizer.cs +198 -0
- package/dist/generator/net8.0/Shared/Core/IOperationSource.cs +14 -0
- package/dist/generator/net8.0/Shared/Core/NextLinkOperationImplementation.cs +690 -0
- package/dist/generator/net8.0/Shared/Core/OperationFinalStateVia.cs +16 -0
- package/dist/generator/net8.0/Shared/Core/OperationInternal.cs +256 -0
- package/dist/generator/net8.0/Shared/Core/OperationInternalBase.cs +234 -0
- package/dist/generator/net8.0/Shared/Core/OperationInternalOfT.cs +422 -0
- package/dist/generator/net8.0/Shared/Core/OperationPoller.cs +114 -0
- package/dist/generator/net8.0/Shared/Core/RawRequestUriBuilder.cs +192 -0
- package/dist/generator/net8.0/Shared/Core/SequentialDelayStrategy.cs +38 -0
- package/dist/generator/net8.0/Shared/Core/TaskExtensions.cs +313 -0
- package/dist/generator/net8.0/Shared/Core/VoidValue.cs +10 -0
- package/dist/generator/net8.0/System.ClientModel.dll +0 -0
- package/dist/generator/net8.0/System.ComponentModel.Composition.dll +0 -0
- package/dist/generator/net8.0/System.Composition.AttributedModel.dll +0 -0
- package/dist/generator/net8.0/System.Composition.Convention.dll +0 -0
- package/dist/generator/net8.0/System.Composition.Hosting.dll +0 -0
- package/dist/generator/net8.0/System.Composition.Runtime.dll +0 -0
- package/dist/generator/net8.0/System.Composition.TypedParts.dll +0 -0
- package/dist/generator/net8.0/System.Configuration.ConfigurationManager.dll +0 -0
- package/dist/generator/net8.0/System.Diagnostics.EventLog.dll +0 -0
- package/dist/generator/net8.0/System.IO.Pipelines.dll +0 -0
- package/dist/generator/net8.0/System.Memory.Data.dll +0 -0
- package/dist/generator/net8.0/System.Reflection.MetadataLoadContext.dll +0 -0
- package/dist/generator/net8.0/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/dist/generator/net8.0/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/cs/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/de/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/de/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/es/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/es/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/fr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/it/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/it/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ja/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ko/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/pl/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/pt-BR/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ru/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll +0 -0
- package/dist/generator/net8.0/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll +0 -0
- package/dist/generator/net8.0/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/tr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/pl/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/pl/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/pt-BR/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/ru/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/ru/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll +0 -0
- package/dist/generator/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll +0 -0
- package/dist/generator/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/tr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/tr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/zh-Hans/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/zh-Hant/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/package.json +67 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<doc>
|
|
3
|
+
<assembly>
|
|
4
|
+
<name>Azure.Generator</name>
|
|
5
|
+
</assembly>
|
|
6
|
+
<members>
|
|
7
|
+
<member name="T:Azure.Generator.AzureClientGenerator">
|
|
8
|
+
<summary>
|
|
9
|
+
The Azure client generator to generate the Azure client SDK.
|
|
10
|
+
</summary>
|
|
11
|
+
</member>
|
|
12
|
+
<member name="P:Azure.Generator.AzureClientGenerator.TypeFactory">
|
|
13
|
+
<inheritdoc/>
|
|
14
|
+
</member>
|
|
15
|
+
<member name="P:Azure.Generator.AzureClientGenerator.OutputLibrary">
|
|
16
|
+
<inheritdoc/>
|
|
17
|
+
</member>
|
|
18
|
+
<member name="M:Azure.Generator.AzureClientGenerator.#ctor(Microsoft.TypeSpec.Generator.GeneratorContext)">
|
|
19
|
+
<summary>
|
|
20
|
+
Constructs the Azure client generator used to generate the Azure client SDK.
|
|
21
|
+
</summary>
|
|
22
|
+
<param name="context"></param>
|
|
23
|
+
</member>
|
|
24
|
+
<member name="M:Azure.Generator.AzureClientGenerator.Configure">
|
|
25
|
+
<summary>
|
|
26
|
+
Customize the generation output for Azure client SDK.
|
|
27
|
+
</summary>
|
|
28
|
+
</member>
|
|
29
|
+
<member name="T:Azure.Generator.AzureOutputLibrary">
|
|
30
|
+
<inheritdoc/>
|
|
31
|
+
</member>
|
|
32
|
+
<member name="M:Azure.Generator.AzureOutputLibrary.BuildTypeProviders">
|
|
33
|
+
<inheritdoc/>
|
|
34
|
+
</member>
|
|
35
|
+
<member name="T:Azure.Generator.AzureTypeFactory">
|
|
36
|
+
<inheritdoc/>
|
|
37
|
+
</member>
|
|
38
|
+
<member name="P:Azure.Generator.AzureTypeFactory.ClientResponseApi">
|
|
39
|
+
<inheritdoc/>
|
|
40
|
+
</member>
|
|
41
|
+
<member name="P:Azure.Generator.AzureTypeFactory.HttpResponseApi">
|
|
42
|
+
<inheritdoc/>
|
|
43
|
+
</member>
|
|
44
|
+
<member name="P:Azure.Generator.AzureTypeFactory.ClientPipelineApi">
|
|
45
|
+
<inheritdoc/>
|
|
46
|
+
</member>
|
|
47
|
+
<member name="P:Azure.Generator.AzureTypeFactory.HttpMessageApi">
|
|
48
|
+
<inheritdoc/>
|
|
49
|
+
</member>
|
|
50
|
+
<member name="P:Azure.Generator.AzureTypeFactory.HttpRequestApi">
|
|
51
|
+
<inheritdoc/>
|
|
52
|
+
</member>
|
|
53
|
+
<member name="P:Azure.Generator.AzureTypeFactory.StatusCodeClassifierApi">
|
|
54
|
+
<inheritdoc/>
|
|
55
|
+
</member>
|
|
56
|
+
<member name="P:Azure.Generator.AzureTypeFactory.RequestContentApi">
|
|
57
|
+
<inheritdoc/>
|
|
58
|
+
</member>
|
|
59
|
+
<member name="P:Azure.Generator.AzureTypeFactory.HttpRequestOptionsApi">
|
|
60
|
+
<inheritdoc/>
|
|
61
|
+
</member>
|
|
62
|
+
<member name="P:Azure.Generator.AzureTypeFactory.AzureDependencyPackages">
|
|
63
|
+
<summary>
|
|
64
|
+
Get dependency packages for Azure.
|
|
65
|
+
</summary>
|
|
66
|
+
</member>
|
|
67
|
+
<member name="M:Azure.Generator.AzureTypeFactory.CreateCSharpTypeCore(Microsoft.TypeSpec.Generator.Input.InputType)">
|
|
68
|
+
<inheritdoc/>
|
|
69
|
+
</member>
|
|
70
|
+
<member name="M:Azure.Generator.AzureTypeFactory.DeserializeJsonValue(System.Type,Microsoft.TypeSpec.Generator.Snippets.ScopedApi{System.Text.Json.JsonElement},Microsoft.TypeSpec.Generator.Input.SerializationFormat)">
|
|
71
|
+
<inheritdoc/>
|
|
72
|
+
</member>
|
|
73
|
+
<member name="M:Azure.Generator.AzureTypeFactory.SerializeJsonValue(System.Type,Microsoft.TypeSpec.Generator.Expressions.ValueExpression,Microsoft.TypeSpec.Generator.Snippets.ScopedApi{System.Text.Json.Utf8JsonWriter},Microsoft.TypeSpec.Generator.Snippets.ScopedApi{System.ClientModel.Primitives.ModelReaderWriterOptions},Microsoft.TypeSpec.Generator.Input.SerializationFormat)">
|
|
74
|
+
<inheritdoc/>
|
|
75
|
+
</member>
|
|
76
|
+
<member name="M:Azure.Generator.AzureTypeFactory.CreateNewProjectScaffolding">
|
|
77
|
+
<inheritdoc/>
|
|
78
|
+
</member>
|
|
79
|
+
<member name="M:Azure.Generator.Management.Models.RequestPath.IsAncestorOf(Azure.Generator.Management.Models.RequestPath)">
|
|
80
|
+
<summary>
|
|
81
|
+
Check if this <see cref="T:Azure.Generator.Management.Models.RequestPath"/> is a prefix path of the other request path.
|
|
82
|
+
Note that this.IsAncestorOf(this) will return false which indicates that this method is testing the "proper ancestor" like a proper subset.
|
|
83
|
+
</summary>
|
|
84
|
+
<param name="other"></param>
|
|
85
|
+
<returns></returns>
|
|
86
|
+
</member>
|
|
87
|
+
<member name="M:Azure.Generator.Management.Models.RequestPath.TrimAncestorFrom(Azure.Generator.Management.Models.RequestPath)">
|
|
88
|
+
<summary>
|
|
89
|
+
Trim this from the other and return the <see cref="T:Azure.Generator.Management.Models.RequestPath"/>that remain.
|
|
90
|
+
The result is "other - this" by removing this as a prefix of other.
|
|
91
|
+
If this == other, return empty request path
|
|
92
|
+
</summary>
|
|
93
|
+
<param name="other"></param>
|
|
94
|
+
<returns></returns>
|
|
95
|
+
<exception cref="T:System.InvalidOperationException">if this.IsAncestorOf(other) is false</exception>
|
|
96
|
+
</member>
|
|
97
|
+
<member name="T:Azure.Generator.Primitives.NewAzureProjectScaffolding">
|
|
98
|
+
<summary>
|
|
99
|
+
Defines the new project scaffolding needed for an azure sdk.
|
|
100
|
+
</summary>
|
|
101
|
+
</member>
|
|
102
|
+
<member name="M:Azure.Generator.Primitives.NewAzureProjectScaffolding.GetSourceProjectFileContent">
|
|
103
|
+
<inheritdoc/>
|
|
104
|
+
</member>
|
|
105
|
+
<member name="T:Azure.Generator.Providers.Abstraction.HttpPipelineProvider">
|
|
106
|
+
<inheritdoc/>
|
|
107
|
+
</member>
|
|
108
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.#ctor(Microsoft.TypeSpec.Generator.Expressions.ValueExpression)">
|
|
109
|
+
<inheritdoc/>
|
|
110
|
+
</member>
|
|
111
|
+
<member name="P:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.ClientPipelineType">
|
|
112
|
+
<inheritdoc/>
|
|
113
|
+
</member>
|
|
114
|
+
<member name="P:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.ClientPipelineOptionsType">
|
|
115
|
+
<inheritdoc/>
|
|
116
|
+
</member>
|
|
117
|
+
<member name="P:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.PipelinePolicyType">
|
|
118
|
+
<inheritdoc/>
|
|
119
|
+
</member>
|
|
120
|
+
<member name="P:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.KeyCredentialType">
|
|
121
|
+
<inheritdoc/>
|
|
122
|
+
</member>
|
|
123
|
+
<member name="P:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.TokenCredentialType">
|
|
124
|
+
<inheritdoc/>
|
|
125
|
+
</member>
|
|
126
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.Create(Microsoft.TypeSpec.Generator.Expressions.ValueExpression,Microsoft.TypeSpec.Generator.Expressions.ValueExpression)">
|
|
127
|
+
<inheritdoc/>
|
|
128
|
+
</member>
|
|
129
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.CreateMessage(Microsoft.TypeSpec.Generator.ClientModel.Providers.HttpRequestOptionsApi,Microsoft.TypeSpec.Generator.Expressions.ValueExpression)">
|
|
130
|
+
<inheritdoc/>
|
|
131
|
+
</member>
|
|
132
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.FromExpression(Microsoft.TypeSpec.Generator.Expressions.ValueExpression)">
|
|
133
|
+
<inheritdoc/>
|
|
134
|
+
</member>
|
|
135
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.KeyAuthorizationPolicy(Microsoft.TypeSpec.Generator.Expressions.ValueExpression,Microsoft.TypeSpec.Generator.Expressions.ValueExpression,Microsoft.TypeSpec.Generator.Expressions.ValueExpression)">
|
|
136
|
+
<inheritdoc/>
|
|
137
|
+
</member>
|
|
138
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.TokenAuthorizationPolicy(Microsoft.TypeSpec.Generator.Expressions.ValueExpression,Microsoft.TypeSpec.Generator.Expressions.ValueExpression)">
|
|
139
|
+
<inheritdoc/>
|
|
140
|
+
</member>
|
|
141
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.ToExpression">
|
|
142
|
+
<inheritdoc/>
|
|
143
|
+
</member>
|
|
144
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.ProcessMessage(Microsoft.TypeSpec.Generator.ClientModel.Providers.HttpMessageApi,Microsoft.TypeSpec.Generator.ClientModel.Providers.HttpRequestOptionsApi)">
|
|
145
|
+
<inheritdoc/>
|
|
146
|
+
</member>
|
|
147
|
+
<member name="M:Azure.Generator.Providers.Abstraction.HttpPipelineProvider.ProcessMessageAsync(Microsoft.TypeSpec.Generator.ClientModel.Providers.HttpMessageApi,Microsoft.TypeSpec.Generator.ClientModel.Providers.HttpRequestOptionsApi)">
|
|
148
|
+
<inheritdoc/>
|
|
149
|
+
</member>
|
|
150
|
+
<member name="M:Azure.Core.AzureKeyCredentialPolicy.#ctor(Azure.AzureKeyCredential,System.String,System.String)">
|
|
151
|
+
<summary>
|
|
152
|
+
Initializes a new instance of the <see cref="T:Azure.Core.AzureKeyCredentialPolicy"/> class.
|
|
153
|
+
</summary>
|
|
154
|
+
<param name="credential">The <see cref="T:Azure.AzureKeyCredential"/> used to authenticate requests.</param>
|
|
155
|
+
<param name="name">The name of the key header used for the credential.</param>
|
|
156
|
+
<param name="prefix">The prefix to apply before the credential key. For example, a prefix of "SharedAccessKey" would result in
|
|
157
|
+
a value of "SharedAccessKey {credential.Key}" being stamped on the request header with header key of <paramref name="name"/>.</param>
|
|
158
|
+
</member>
|
|
159
|
+
<member name="M:Azure.Core.AzureKeyCredentialPolicy.OnSendingRequest(Azure.Core.HttpMessage)">
|
|
160
|
+
<inheritdoc/>
|
|
161
|
+
</member>
|
|
162
|
+
</members>
|
|
163
|
+
</doc>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using System;
|
|
5
|
+
|
|
6
|
+
#nullable enable
|
|
7
|
+
|
|
8
|
+
namespace Azure.Core
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// Helper for interacting with AppConfig settings and their related Environment variable settings.
|
|
12
|
+
/// </summary>
|
|
13
|
+
internal static class AppContextSwitchHelper
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
/// Determines if either an AppContext switch or its corresponding Environment Variable is set
|
|
17
|
+
/// </summary>
|
|
18
|
+
/// <param name="appContexSwitchName">Name of the AppContext switch.</param>
|
|
19
|
+
/// <param name="environmentVariableName">Name of the Environment variable.</param>
|
|
20
|
+
/// <returns>If the AppContext switch has been set, returns the value of the switch.
|
|
21
|
+
/// If the AppContext switch has not been set, returns the value of the environment variable.
|
|
22
|
+
/// False if neither is set.
|
|
23
|
+
/// </returns>
|
|
24
|
+
public static bool GetConfigValue(string appContexSwitchName, string environmentVariableName)
|
|
25
|
+
{
|
|
26
|
+
// First check for the AppContext switch, giving it priority over the environment variable.
|
|
27
|
+
if (AppContext.TryGetSwitch(appContexSwitchName, out bool value))
|
|
28
|
+
{
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
// AppContext switch wasn't used. Check the environment variable.
|
|
32
|
+
string? envVar = Environment.GetEnvironmentVariable(environmentVariableName);
|
|
33
|
+
if (envVar != null && (envVar.Equals("true", StringComparison.OrdinalIgnoreCase) || envVar.Equals("1")))
|
|
34
|
+
{
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Default to false.
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#nullable enable
|
|
5
|
+
|
|
6
|
+
using System;
|
|
7
|
+
using System.Collections.Generic;
|
|
8
|
+
using System.Diagnostics.CodeAnalysis;
|
|
9
|
+
using System.Threading;
|
|
10
|
+
using System.Threading.Tasks;
|
|
11
|
+
using Azure.Core.Pipeline;
|
|
12
|
+
|
|
13
|
+
namespace Azure.Core
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
/// Primitive that combines async lock and value cache
|
|
17
|
+
/// </summary>
|
|
18
|
+
/// <typeparam name="T"></typeparam>
|
|
19
|
+
internal sealed class AsyncLockWithValue<T>
|
|
20
|
+
{
|
|
21
|
+
private readonly object _syncObj = new();
|
|
22
|
+
private Queue<TaskCompletionSource<LockOrValue>>? _waiters;
|
|
23
|
+
private bool _isLocked;
|
|
24
|
+
private bool _hasValue;
|
|
25
|
+
private long _index;
|
|
26
|
+
private T? _value;
|
|
27
|
+
|
|
28
|
+
public bool HasValue
|
|
29
|
+
{
|
|
30
|
+
get
|
|
31
|
+
{
|
|
32
|
+
lock (_syncObj)
|
|
33
|
+
{
|
|
34
|
+
return _hasValue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public AsyncLockWithValue() { }
|
|
40
|
+
|
|
41
|
+
public AsyncLockWithValue(T value)
|
|
42
|
+
{
|
|
43
|
+
_hasValue = true;
|
|
44
|
+
_value = value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public bool TryGetValue(out T? value)
|
|
48
|
+
{
|
|
49
|
+
lock (_syncObj)
|
|
50
|
+
{
|
|
51
|
+
if (_hasValue)
|
|
52
|
+
{
|
|
53
|
+
value = _value;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
value = default;
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// <summary>
|
|
63
|
+
/// Method that either returns cached value or acquire a lock.
|
|
64
|
+
/// If one caller has acquired a lock, other callers will be waiting for the lock to be released.
|
|
65
|
+
/// If value is set, lock is released and all waiters get that value.
|
|
66
|
+
/// If value isn't set, the next waiter in the queue will get the lock.
|
|
67
|
+
/// </summary>
|
|
68
|
+
/// <param name="async"></param>
|
|
69
|
+
/// <param name="cancellationToken"></param>
|
|
70
|
+
/// <returns></returns>
|
|
71
|
+
public async ValueTask<LockOrValue> GetLockOrValueAsync(bool async, CancellationToken cancellationToken = default)
|
|
72
|
+
{
|
|
73
|
+
TaskCompletionSource<LockOrValue> valueTcs;
|
|
74
|
+
lock (_syncObj)
|
|
75
|
+
{
|
|
76
|
+
// If there is a value, just return it
|
|
77
|
+
if (_hasValue)
|
|
78
|
+
{
|
|
79
|
+
return new LockOrValue(_value!);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// If lock isn't acquire yet, acquire it and return to the caller
|
|
83
|
+
if (!_isLocked)
|
|
84
|
+
{
|
|
85
|
+
_isLocked = true;
|
|
86
|
+
_index = unchecked(_index + 1);
|
|
87
|
+
return new LockOrValue(this, _index);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Check cancellationToken before instantiating waiter
|
|
91
|
+
cancellationToken.ThrowIfCancellationRequested();
|
|
92
|
+
|
|
93
|
+
// If lock is already taken, create a waiter and wait either until value is set or lock can be acquired by this waiter
|
|
94
|
+
_waiters ??= new Queue<TaskCompletionSource<LockOrValue>>();
|
|
95
|
+
// if async == false, valueTcs will be waited only in this thread and only synchronously, so RunContinuationsAsynchronously isn't needed.
|
|
96
|
+
valueTcs = new TaskCompletionSource<LockOrValue>(async ? TaskCreationOptions.RunContinuationsAsynchronously : TaskCreationOptions.None);
|
|
97
|
+
_waiters.Enqueue(valueTcs);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
try
|
|
101
|
+
{
|
|
102
|
+
if (async)
|
|
103
|
+
{
|
|
104
|
+
return await valueTcs.Task.AwaitWithCancellation(cancellationToken);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
#pragma warning disable AZC0104 // Use EnsureCompleted() directly on asynchronous method return value.
|
|
108
|
+
#pragma warning disable AZC0111 // DO NOT use EnsureCompleted in possibly asynchronous scope.
|
|
109
|
+
valueTcs.Task.Wait(cancellationToken);
|
|
110
|
+
return valueTcs.Task.EnsureCompleted();
|
|
111
|
+
#pragma warning restore AZC0111 // DO NOT use EnsureCompleted in possibly asynchronous scope.
|
|
112
|
+
#pragma warning restore AZC0104 // Use EnsureCompleted() directly on asynchronous method return value.
|
|
113
|
+
}
|
|
114
|
+
catch (OperationCanceledException)
|
|
115
|
+
{
|
|
116
|
+
// Throw OperationCanceledException only if another thread hasn't set a value to this waiter
|
|
117
|
+
// by calling either Reset or SetValue
|
|
118
|
+
if (valueTcs.TrySetCanceled(cancellationToken))
|
|
119
|
+
{
|
|
120
|
+
throw;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return valueTcs.Task.Result;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/// <summary>
|
|
128
|
+
/// Set value to the cache and to all the waiters
|
|
129
|
+
/// </summary>
|
|
130
|
+
/// <param name="value"></param>
|
|
131
|
+
/// <param name="lockIndex"></param>
|
|
132
|
+
private void SetValue(T value, in long lockIndex)
|
|
133
|
+
{
|
|
134
|
+
Queue<TaskCompletionSource<LockOrValue>> waiters;
|
|
135
|
+
lock (_syncObj)
|
|
136
|
+
{
|
|
137
|
+
if (lockIndex != _index)
|
|
138
|
+
{
|
|
139
|
+
throw new InvalidOperationException($"Disposed {nameof(LockOrValue)} tries to set value. Current index: {_index}, {nameof(LockOrValue)} index: {lockIndex}");
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_value = value;
|
|
143
|
+
_hasValue = true;
|
|
144
|
+
_index = 0;
|
|
145
|
+
_isLocked = false;
|
|
146
|
+
if (_waiters == default)
|
|
147
|
+
{
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
waiters = _waiters;
|
|
152
|
+
_waiters = default;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
while (waiters.Count > 0)
|
|
156
|
+
{
|
|
157
|
+
waiters.Dequeue().TrySetResult(new LockOrValue(value));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/// <summary>
|
|
162
|
+
/// Release the lock and allow next waiter acquire it
|
|
163
|
+
/// </summary>
|
|
164
|
+
private void Reset(in long lockIndex)
|
|
165
|
+
{
|
|
166
|
+
UnlockOrGetNextWaiter(lockIndex, out var nextWaiter);
|
|
167
|
+
while (nextWaiter != default && !nextWaiter.TrySetResult(new LockOrValue(this, unchecked(lockIndex + 1))))
|
|
168
|
+
{
|
|
169
|
+
UnlockOrGetNextWaiter(lockIndex, out nextWaiter);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
private void UnlockOrGetNextWaiter(in long lockIndex, out TaskCompletionSource<LockOrValue>? nextWaiter)
|
|
174
|
+
{
|
|
175
|
+
lock (_syncObj)
|
|
176
|
+
{
|
|
177
|
+
nextWaiter = default;
|
|
178
|
+
// If lock isn't acquired, just return
|
|
179
|
+
if (!_isLocked || lockIndex != _index)
|
|
180
|
+
{
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
_index = unchecked(lockIndex + 1);
|
|
185
|
+
|
|
186
|
+
// If lock was acquired, but there are no waiters, unlock and return
|
|
187
|
+
if (_waiters == default)
|
|
188
|
+
{
|
|
189
|
+
_isLocked = false;
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Find the next waiter
|
|
194
|
+
while (_waiters.Count > 0)
|
|
195
|
+
{
|
|
196
|
+
nextWaiter = _waiters.Dequeue();
|
|
197
|
+
if (!nextWaiter.Task.IsCompleted)
|
|
198
|
+
{
|
|
199
|
+
// Return the waiter only if it wasn't canceled already
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// If no next waiter has been found, unlock and return
|
|
205
|
+
_isLocked = false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
public readonly struct LockOrValue : IDisposable
|
|
210
|
+
{
|
|
211
|
+
private readonly AsyncLockWithValue<T>? _owner;
|
|
212
|
+
private readonly T? _value;
|
|
213
|
+
private readonly long _index;
|
|
214
|
+
|
|
215
|
+
/// <summary>
|
|
216
|
+
/// Returns true if lock contains the cached value. Otherwise false.
|
|
217
|
+
/// </summary>
|
|
218
|
+
public bool HasValue => _owner == default;
|
|
219
|
+
|
|
220
|
+
/// <summary>
|
|
221
|
+
/// Returns cached value if it was set when lock has been created. Throws exception otherwise.
|
|
222
|
+
/// </summary>
|
|
223
|
+
/// <exception cref="InvalidOperationException">Value isn't set.</exception>
|
|
224
|
+
public T Value => HasValue ? _value! : throw new InvalidOperationException("Value isn't set");
|
|
225
|
+
|
|
226
|
+
public LockOrValue(T value)
|
|
227
|
+
{
|
|
228
|
+
_owner = default;
|
|
229
|
+
_value = value;
|
|
230
|
+
_index = 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
public LockOrValue(AsyncLockWithValue<T> owner, long index)
|
|
234
|
+
{
|
|
235
|
+
_owner = owner;
|
|
236
|
+
_index = index;
|
|
237
|
+
_value = default;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/// <summary>
|
|
241
|
+
/// Set value to the cache and to all the waiters.
|
|
242
|
+
/// </summary>
|
|
243
|
+
/// <param name="value"></param>
|
|
244
|
+
/// <exception cref="InvalidOperationException">Value is set already.</exception>
|
|
245
|
+
public void SetValue(T value)
|
|
246
|
+
{
|
|
247
|
+
if (_owner != null)
|
|
248
|
+
{
|
|
249
|
+
_owner.SetValue(value, _index);
|
|
250
|
+
}
|
|
251
|
+
else
|
|
252
|
+
{
|
|
253
|
+
throw new InvalidOperationException("Value for the lock is set already");
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public void Dispose() => _owner?.Reset(_index);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using System;
|
|
5
|
+
using Azure.Core.Pipeline;
|
|
6
|
+
|
|
7
|
+
#nullable enable
|
|
8
|
+
|
|
9
|
+
namespace Azure.Core
|
|
10
|
+
{
|
|
11
|
+
internal class AzureKeyCredentialPolicy : HttpPipelineSynchronousPolicy
|
|
12
|
+
{
|
|
13
|
+
private readonly string _name;
|
|
14
|
+
private readonly AzureKeyCredential _credential;
|
|
15
|
+
private readonly string? _prefix;
|
|
16
|
+
|
|
17
|
+
/// <summary>
|
|
18
|
+
/// Initializes a new instance of the <see cref="AzureKeyCredentialPolicy"/> class.
|
|
19
|
+
/// </summary>
|
|
20
|
+
/// <param name="credential">The <see cref="AzureKeyCredential"/> used to authenticate requests.</param>
|
|
21
|
+
/// <param name="name">The name of the key header used for the credential.</param>
|
|
22
|
+
/// <param name="prefix">The prefix to apply before the credential key. For example, a prefix of "SharedAccessKey" would result in
|
|
23
|
+
/// a value of "SharedAccessKey {credential.Key}" being stamped on the request header with header key of <paramref name="name"/>.</param>
|
|
24
|
+
public AzureKeyCredentialPolicy(AzureKeyCredential credential, string name, string? prefix = null)
|
|
25
|
+
{
|
|
26
|
+
if (credential is null)
|
|
27
|
+
{
|
|
28
|
+
throw new ArgumentNullException(nameof(credential));
|
|
29
|
+
}
|
|
30
|
+
if (name is null)
|
|
31
|
+
{
|
|
32
|
+
throw new ArgumentNullException(nameof(name));
|
|
33
|
+
}
|
|
34
|
+
if (name.Length == 0)
|
|
35
|
+
{
|
|
36
|
+
throw new ArgumentException("Value cannot be an empty string.", nameof(name));
|
|
37
|
+
}
|
|
38
|
+
_credential = credential;
|
|
39
|
+
_name = name;
|
|
40
|
+
_prefix = prefix;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/// <inheritdoc/>
|
|
44
|
+
public override void OnSendingRequest(HttpMessage message)
|
|
45
|
+
{
|
|
46
|
+
base.OnSendingRequest(message);
|
|
47
|
+
message.Request.Headers.SetValue(_name, _prefix != null ? $"{_prefix} {_credential.Key}" : _credential.Key);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using System;
|
|
5
|
+
using System.Collections.Generic;
|
|
6
|
+
using System.Linq;
|
|
7
|
+
using System.Reflection;
|
|
8
|
+
|
|
9
|
+
#nullable enable
|
|
10
|
+
|
|
11
|
+
namespace Azure.Core.Pipeline
|
|
12
|
+
{
|
|
13
|
+
internal class ClientDiagnostics : DiagnosticScopeFactory
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
/// Initializes a new instance of the <see cref="ClientDiagnostics"/> class.
|
|
17
|
+
/// </summary>
|
|
18
|
+
/// <param name="options">The customer provided client options object.</param>
|
|
19
|
+
/// <param name="suppressNestedClientActivities">Flag controlling if <see cref="System.Diagnostics.Activity"/>
|
|
20
|
+
/// created by this <see cref="ClientDiagnostics"/> for client method calls should be suppressed when called
|
|
21
|
+
/// by other Azure SDK client methods. It's recommended to set it to true for new clients; use default (null)
|
|
22
|
+
/// for backward compatibility reasons, or set it to false to explicitly disable suppression for specific cases.
|
|
23
|
+
/// The default value could change in the future, the flag should be only set to false if suppression for the client
|
|
24
|
+
/// should never be enabled.</param>
|
|
25
|
+
public ClientDiagnostics(ClientOptions options, bool? suppressNestedClientActivities = null)
|
|
26
|
+
: this(options.GetType().Namespace!,
|
|
27
|
+
GetResourceProviderNamespace(options.GetType().Assembly),
|
|
28
|
+
options.Diagnostics,
|
|
29
|
+
suppressNestedClientActivities)
|
|
30
|
+
{
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
/// Initializes a new instance of the <see cref="ClientDiagnostics"/> class.
|
|
35
|
+
/// </summary>
|
|
36
|
+
/// <param name="optionsNamespace">Namespace of the client class, such as Azure.Storage or Azure.AppConfiguration.</param>
|
|
37
|
+
/// <param name="providerNamespace">Azure Resource Provider namespace of the Azure service SDK is primarily used for.</param>
|
|
38
|
+
/// <param name="diagnosticsOptions">The customer provided client diagnostics options.</param>
|
|
39
|
+
/// <param name="suppressNestedClientActivities">Flag controlling if <see cref="System.Diagnostics.Activity"/>
|
|
40
|
+
/// created by this <see cref="ClientDiagnostics"/> for client method calls should be suppressed when called
|
|
41
|
+
/// by other Azure SDK client methods. It's recommended to set it to true for new clients, use default (null) for old clients
|
|
42
|
+
/// for backward compatibility reasons, or set it to false to explicitly disable suppression for specific cases.
|
|
43
|
+
/// The default value could change in the future, the flag should be only set to false if suppression for the client
|
|
44
|
+
/// should never be enabled.</param>
|
|
45
|
+
public ClientDiagnostics(string optionsNamespace, string? providerNamespace, DiagnosticsOptions diagnosticsOptions, bool? suppressNestedClientActivities = null)
|
|
46
|
+
: base(optionsNamespace, providerNamespace, diagnosticsOptions.IsDistributedTracingEnabled, suppressNestedClientActivities.GetValueOrDefault(true), true)
|
|
47
|
+
{
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
internal static HttpMessageSanitizer CreateMessageSanitizer(DiagnosticsOptions diagnostics)
|
|
51
|
+
{
|
|
52
|
+
return new HttpMessageSanitizer(
|
|
53
|
+
diagnostics.LoggedQueryParameters.ToArray(),
|
|
54
|
+
diagnostics.LoggedHeaderNames.ToArray());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
internal static string? GetResourceProviderNamespace(Assembly assembly)
|
|
58
|
+
{
|
|
59
|
+
foreach (var customAttribute in assembly.GetCustomAttributesData())
|
|
60
|
+
{
|
|
61
|
+
// Weak bind internal shared type
|
|
62
|
+
Type attributeType = customAttribute.AttributeType!;
|
|
63
|
+
if (attributeType.FullName == ("Azure.Core.AzureResourceProviderNamespaceAttribute"))
|
|
64
|
+
{
|
|
65
|
+
IList<CustomAttributeTypedArgument> namedArguments = customAttribute.ConstructorArguments;
|
|
66
|
+
return namedArguments.Single().Value as string;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|