@autorest/powershell 2.1.400 → 3.0.0
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/.rush/temp/package-deps_build.json +350 -0
- package/.rush/temp/shrinkwrap-deps.json +433 -0
- package/autorest-configuration.md +60 -47
- package/dist/cmdlets/class.d.ts +21 -8
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +475 -151
- package/dist/cmdlets/class.js.map +1 -1
- package/dist/cmdlets/namespace.d.ts.map +1 -1
- package/dist/cmdlets/namespace.js +1 -0
- package/dist/cmdlets/namespace.js.map +1 -1
- package/dist/enums/namespace.d.ts.map +1 -1
- package/dist/enums/namespace.js +17 -10
- package/dist/enums/namespace.js.map +1 -1
- package/dist/generators/csproj.d.ts.map +1 -1
- package/dist/generators/csproj.js +2 -1
- package/dist/generators/csproj.js.map +1 -1
- package/dist/generators/gitignore.d.ts.map +1 -1
- package/dist/generators/gitignore.js +1 -0
- package/dist/generators/gitignore.js.map +1 -1
- package/dist/generators/nuspec.d.ts.map +1 -1
- package/dist/generators/nuspec.js +4 -3
- package/dist/generators/nuspec.js.map +1 -1
- package/dist/generators/psm1.d.ts.map +1 -1
- package/dist/generators/psm1.js +24 -15
- package/dist/generators/psm1.js.map +1 -1
- package/dist/generators/script-cmdlet.d.ts.map +1 -1
- package/dist/generators/script-cmdlet.js +1 -1
- package/dist/generators/script-cmdlet.js.map +1 -1
- package/dist/internal/name-inferrer.d.ts.map +1 -1
- package/dist/internal/name-inferrer.js +2 -0
- package/dist/internal/name-inferrer.js.map +1 -1
- package/dist/internal/project.d.ts +46 -5
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +72 -13
- package/dist/internal/project.js.map +1 -1
- package/dist/internal/state.d.ts +3 -2
- package/dist/internal/state.d.ts.map +1 -1
- package/dist/internal/state.js +3 -3
- package/dist/internal/state.js.map +1 -1
- package/dist/llcsharp/clientruntime.d.ts +5 -0
- package/dist/llcsharp/clientruntime.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.js +5 -0
- package/dist/llcsharp/clientruntime.js.map +1 -1
- package/dist/llcsharp/enums/enum.d.ts +2 -2
- package/dist/llcsharp/enums/enum.d.ts.map +1 -1
- package/dist/llcsharp/enums/enum.js +11 -10
- package/dist/llcsharp/enums/enum.js.map +1 -1
- package/dist/llcsharp/generator.d.ts +3 -3
- package/dist/llcsharp/generator.d.ts.map +1 -1
- package/dist/llcsharp/generator.js +4 -2
- package/dist/llcsharp/generator.js.map +1 -1
- package/dist/llcsharp/model/interface.d.ts +3 -2
- package/dist/llcsharp/model/interface.d.ts.map +1 -1
- package/dist/llcsharp/model/interface.js +68 -17
- package/dist/llcsharp/model/interface.js.map +1 -1
- package/dist/llcsharp/model/model-class-dictionary.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-dictionary.js +12 -6
- package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
- package/dist/llcsharp/model/model-class-json.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-json.js +20 -12
- package/dist/llcsharp/model/model-class-json.js.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.d.ts +9 -21
- package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.js +21 -50
- package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
- package/dist/llcsharp/model/model-class.d.ts +7 -4
- package/dist/llcsharp/model/model-class.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class.js +147 -82
- package/dist/llcsharp/model/model-class.js.map +1 -1
- package/dist/llcsharp/model/namespace.d.ts +4 -4
- package/dist/llcsharp/model/namespace.d.ts.map +1 -1
- package/dist/llcsharp/model/namespace.js +40 -18
- package/dist/llcsharp/model/namespace.js.map +1 -1
- package/dist/llcsharp/model/property.d.ts +4 -4
- package/dist/llcsharp/model/property.d.ts.map +1 -1
- package/dist/llcsharp/model/property.js +9 -7
- package/dist/llcsharp/model/property.js.map +1 -1
- package/dist/llcsharp/operation/api-class.d.ts.map +1 -1
- package/dist/llcsharp/operation/api-class.js +24 -23
- package/dist/llcsharp/operation/api-class.js.map +1 -1
- package/dist/llcsharp/operation/method.d.ts +7 -5
- package/dist/llcsharp/operation/method.d.ts.map +1 -1
- package/dist/llcsharp/operation/method.js +157 -93
- package/dist/llcsharp/operation/method.js.map +1 -1
- package/dist/llcsharp/operation/namespace.js +2 -1
- package/dist/llcsharp/operation/namespace.js.map +1 -1
- package/dist/llcsharp/operation/parameter.d.ts +4 -4
- package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
- package/dist/llcsharp/operation/parameter.js +7 -5
- package/dist/llcsharp/operation/parameter.js.map +1 -1
- package/dist/llcsharp/project.d.ts +4 -0
- package/dist/llcsharp/project.d.ts.map +1 -1
- package/dist/llcsharp/project.js +7 -2
- package/dist/llcsharp/project.js.map +1 -1
- package/dist/llcsharp/schema/Uuid.d.ts +2 -2
- package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
- package/dist/llcsharp/schema/Uuid.js.map +1 -1
- package/dist/llcsharp/schema/array.d.ts +3 -3
- package/dist/llcsharp/schema/array.d.ts.map +1 -1
- package/dist/llcsharp/schema/array.js +15 -8
- package/dist/llcsharp/schema/array.js.map +1 -1
- package/dist/llcsharp/schema/binary.d.ts +3 -3
- package/dist/llcsharp/schema/binary.d.ts.map +1 -1
- package/dist/llcsharp/schema/binary.js.map +1 -1
- package/dist/llcsharp/schema/boolean.d.ts +4 -4
- package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
- package/dist/llcsharp/schema/boolean.js +1 -1
- package/dist/llcsharp/schema/boolean.js.map +1 -1
- package/dist/llcsharp/schema/byte-array.d.ts +3 -3
- package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
- package/dist/llcsharp/schema/byte-array.js +12 -2
- package/dist/llcsharp/schema/byte-array.js.map +1 -1
- package/dist/llcsharp/schema/char.d.ts +4 -4
- package/dist/llcsharp/schema/char.d.ts.map +1 -1
- package/dist/llcsharp/schema/char.js +3 -3
- package/dist/llcsharp/schema/char.js.map +1 -1
- package/dist/llcsharp/schema/date-time.d.ts +7 -7
- package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
- package/dist/llcsharp/schema/date-time.js +4 -4
- package/dist/llcsharp/schema/date-time.js.map +1 -1
- package/dist/llcsharp/schema/date.d.ts +2 -2
- package/dist/llcsharp/schema/date.d.ts.map +1 -1
- package/dist/llcsharp/schema/date.js.map +1 -1
- package/dist/llcsharp/schema/duration.d.ts +5 -5
- package/dist/llcsharp/schema/duration.d.ts.map +1 -1
- package/dist/llcsharp/schema/duration.js +2 -2
- package/dist/llcsharp/schema/duration.js.map +1 -1
- package/dist/llcsharp/schema/enum.d.ts +2 -2
- package/dist/llcsharp/schema/enum.d.ts.map +1 -1
- package/dist/llcsharp/schema/enum.js +5 -3
- package/dist/llcsharp/schema/enum.js.map +1 -1
- package/dist/llcsharp/schema/extended-type-declaration.d.ts +2 -2
- package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
- package/dist/llcsharp/schema/integer.d.ts +4 -4
- package/dist/llcsharp/schema/integer.d.ts.map +1 -1
- package/dist/llcsharp/schema/integer.js +1 -1
- package/dist/llcsharp/schema/integer.js.map +1 -1
- package/dist/llcsharp/schema/object.d.ts +3 -3
- package/dist/llcsharp/schema/object.d.ts.map +1 -1
- package/dist/llcsharp/schema/object.js +25 -21
- package/dist/llcsharp/schema/object.js.map +1 -1
- package/dist/llcsharp/schema/password.d.ts +23 -0
- package/dist/llcsharp/schema/password.d.ts.map +1 -0
- package/dist/llcsharp/schema/password.js +89 -0
- package/dist/llcsharp/schema/password.js.map +1 -0
- package/dist/llcsharp/schema/primitive.d.ts +4 -4
- package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
- package/dist/llcsharp/schema/primitive.js +7 -3
- package/dist/llcsharp/schema/primitive.js.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts +4 -3
- package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.js +61 -64
- package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
- package/dist/llcsharp/schema/string.d.ts +3 -3
- package/dist/llcsharp/schema/string.d.ts.map +1 -1
- package/dist/llcsharp/schema/string.js +14 -10
- package/dist/llcsharp/schema/string.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +23 -14
- package/dist/main.js.map +1 -1
- package/dist/models/model-extensions.d.ts +3 -2
- package/dist/models/model-extensions.d.ts.map +1 -1
- package/dist/models/model-extensions.js +195 -168
- package/dist/models/model-extensions.js.map +1 -1
- package/dist/module/module-class.d.ts +4 -2
- package/dist/module/module-class.d.ts.map +1 -1
- package/dist/module/module-class.js +67 -13
- package/dist/module/module-class.js.map +1 -1
- package/dist/module/module-namespace.d.ts +2 -2
- package/dist/module/module-namespace.d.ts.map +1 -1
- package/dist/module/module-namespace.js +3 -2
- package/dist/module/module-namespace.js.map +1 -1
- package/dist/plugins/add-azure-completers-v2.d.ts +3 -0
- package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -0
- package/dist/plugins/{add-azure-completers.js → add-azure-completers-v2.js} +7 -5
- package/dist/plugins/add-azure-completers-v2.js.map +1 -0
- package/dist/plugins/create-commands-v2.d.ts +40 -0
- package/dist/plugins/create-commands-v2.d.ts.map +1 -0
- package/dist/plugins/{create-commands.js → create-commands-v2.js} +128 -78
- package/dist/plugins/create-commands-v2.js.map +1 -0
- package/dist/plugins/cs-namer-v2.d.ts +3 -0
- package/dist/plugins/cs-namer-v2.d.ts.map +1 -0
- package/dist/plugins/cs-namer-v2.js +230 -0
- package/dist/plugins/cs-namer-v2.js.map +1 -0
- package/dist/plugins/llcsharp-v2.d.ts +3 -0
- package/dist/plugins/llcsharp-v2.d.ts.map +1 -0
- package/dist/plugins/{llcsharp.js → llcsharp-v2.js} +3 -3
- package/dist/plugins/llcsharp-v2.js.map +1 -0
- package/dist/plugins/modifiers-v2.d.ts +3 -0
- package/dist/plugins/modifiers-v2.d.ts.map +1 -0
- package/dist/plugins/{modifiers.js → modifiers-v2.js} +151 -32
- package/dist/plugins/modifiers-v2.js.map +1 -0
- package/dist/plugins/plugin-create-inline-properties.d.ts +4 -0
- package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -0
- package/dist/plugins/plugin-create-inline-properties.js +356 -0
- package/dist/plugins/plugin-create-inline-properties.js.map +1 -0
- package/dist/plugins/plugin-tweak-m4-model.d.ts +3 -0
- package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -0
- package/dist/plugins/plugin-tweak-m4-model.js +166 -0
- package/dist/plugins/plugin-tweak-m4-model.js.map +1 -0
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +3 -0
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -0
- package/dist/plugins/plugin-tweak-model-azure-v2.js +169 -0
- package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -0
- package/dist/plugins/plugin-tweak-model.d.ts +9 -0
- package/dist/plugins/plugin-tweak-model.d.ts.map +1 -0
- package/dist/plugins/plugin-tweak-model.js +572 -0
- package/dist/plugins/plugin-tweak-model.js.map +1 -0
- package/dist/plugins/powershell-v2.d.ts +3 -0
- package/dist/plugins/powershell-v2.d.ts.map +1 -0
- package/dist/plugins/{powershell.js → powershell-v2.js} +9 -4
- package/dist/plugins/powershell-v2.js.map +1 -0
- package/dist/plugins/{ps-namer.d.ts → ps-namer-v2.d.ts} +2 -2
- package/dist/plugins/ps-namer-v2.d.ts.map +1 -0
- package/dist/plugins/{ps-namer.js → ps-namer-v2.js} +64 -49
- package/dist/plugins/ps-namer-v2.js.map +1 -0
- package/dist/utils/PwshModel.d.ts +8 -0
- package/dist/utils/PwshModel.d.ts.map +1 -0
- package/dist/utils/PwshModel.js +17 -0
- package/dist/utils/PwshModel.js.map +1 -0
- package/dist/utils/command-operation.d.ts +51 -0
- package/dist/utils/command-operation.d.ts.map +1 -0
- package/dist/utils/command-operation.js +33 -0
- package/dist/utils/command-operation.js.map +1 -0
- package/dist/utils/components.d.ts +133 -0
- package/dist/utils/components.d.ts.map +1 -0
- package/dist/utils/components.js +100 -0
- package/dist/utils/components.js.map +1 -0
- package/dist/utils/extensions.d.ts +11 -0
- package/dist/utils/extensions.d.ts.map +1 -0
- package/dist/utils/extensions.js +16 -0
- package/dist/utils/extensions.js.map +1 -0
- package/dist/utils/http-definitions.d.ts +45 -0
- package/dist/utils/http-definitions.d.ts.map +1 -0
- package/dist/utils/http-definitions.js +47 -0
- package/dist/utils/http-definitions.js.map +1 -0
- package/dist/utils/http-operation.d.ts +8 -0
- package/dist/utils/http-operation.d.ts.map +1 -0
- package/dist/utils/http-operation.js +254 -0
- package/dist/utils/http-operation.js.map +1 -0
- package/dist/utils/info.d.ts +36 -0
- package/dist/utils/info.d.ts.map +1 -0
- package/dist/utils/info.js +36 -0
- package/dist/utils/info.js.map +1 -0
- package/dist/utils/model-state.d.ts +44 -0
- package/dist/utils/model-state.d.ts.map +1 -0
- package/dist/utils/model-state.js +206 -0
- package/dist/utils/model-state.js.map +1 -0
- package/dist/utils/powershell-comment.d.ts +2 -0
- package/dist/utils/powershell-comment.d.ts.map +1 -0
- package/dist/utils/powershell-comment.js +25 -0
- package/dist/utils/powershell-comment.js.map +1 -0
- package/dist/utils/programatic-operation.d.ts +20 -0
- package/dist/utils/programatic-operation.d.ts.map +1 -0
- package/dist/utils/programatic-operation.js +29 -0
- package/dist/utils/programatic-operation.js.map +1 -0
- package/dist/utils/resolve-conflicts.d.ts +7 -0
- package/dist/utils/resolve-conflicts.d.ts.map +1 -0
- package/dist/utils/resolve-conflicts.js +57 -0
- package/dist/utils/resolve-conflicts.js.map +1 -0
- package/dist/utils/schema.d.ts +116 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/dist/utils/schema.js +186 -0
- package/dist/utils/schema.js.map +1 -0
- package/dist/utils/security-scheme.d.ts +123 -0
- package/dist/utils/security-scheme.d.ts.map +1 -0
- package/dist/utils/security-scheme.js +119 -0
- package/dist/utils/security-scheme.js.map +1 -0
- package/dist/utils/uid.d.ts +2 -0
- package/dist/utils/uid.d.ts.map +1 -0
- package/dist/utils/uid.js +8 -0
- package/dist/utils/uid.js.map +1 -0
- package/package.json +22 -21
- package/resources/assets/build-module.ps1 +12 -15
- package/resources/assets/check-dependencies.ps1 +4 -14
- package/resources/assets/create-model-cmdlets.ps1 +157 -0
- package/resources/assets/custom/{readme.md → README.md} +7 -7
- package/resources/assets/docs/README.md +11 -0
- package/resources/assets/examples/{readme.md → README.md} +0 -0
- package/resources/assets/export-surface.ps1 +1 -11
- package/resources/assets/exports/{readme.md → README.md} +2 -2
- package/resources/assets/generate-help.ps1 +2 -12
- package/resources/assets/how-to.md +5 -5
- package/resources/assets/internal/{readme.md → README.md} +3 -3
- package/resources/assets/pack-module.ps1 +1 -11
- package/resources/assets/resources/{readme.md → README.md} +0 -0
- package/resources/assets/run-module.ps1 +3 -11
- package/resources/assets/test/{readme.md → README.md} +0 -0
- package/resources/assets/test/loadEnv.ps1 +1 -11
- package/resources/assets/test-module.ps1 +39 -24
- package/resources/assets/tools/Resources/{readme.md → README.md} +3 -2
- package/resources/assets/tools/Resources/docs/{readme.md → README.md} +1 -1
- package/resources/assets/tools/Resources/examples/{readme.md → README.md} +0 -0
- package/resources/assets/tools/Resources/how-to.md +5 -5
- package/resources/assets/tools/Resources/resources/{readme.md → README.md} +0 -0
- package/resources/assets/tools/Resources/test/{readme.md → README.md} +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +496 -0
- package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +468 -0
- package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +303 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Az.Accounts.nuspec +5 -3
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +387 -0
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +375 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies → 2.7.5/AzSharedAlcAssemblies}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Hyak.Common.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.Common.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +945 -404
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json → 2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json} +906 -488
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/Microsoft.Azure.PowerShell.Authentication.deps.json → 2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json} +301 -719
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +2413 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +3567 -1995
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/Microsoft.WindowsAzure.Storage.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +219 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/Newtonsoft.Json.10.dll → 2.7.5/PreloadAssemblies/Newtonsoft.Json.dll} +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Diagnostics.DiagnosticSource.4.0.4.0.dll → 2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll} +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Memory.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.5.0.dll → 2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll} +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.Permissions.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/{1.8.1/PreloadAssemblies/System.Threading.Tasks.Extensions.4.2.0.0.dll → 2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll} +0 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/PreloadAssemblies/System.Xml.ReaderWriter.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +278 -0
- package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +234 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/[Content_Types].xml +1 -0
- package/resources/modules/Az.Accounts/{1.8.1 → 2.7.5}/_rels/.rels +2 -2
- package/resources/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt +50 -0
- package/resources/modules/Az.Accounts/{1.8.1/package/services/metadata/core-properties/b4e383786e734eb49545960a9feff173.psmdcp → 2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp} +2 -2
- package/resources/psruntime/AsyncCommandRuntime.cs +4 -0
- package/resources/psruntime/AsyncOperationResponse.cs +10 -11
- package/resources/psruntime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +3 -1
- package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +94 -87
- package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +168 -102
- package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +22 -11
- package/resources/psruntime/BuildTime/Cmdlets/GetScriptCmdlet.cs +2 -1
- package/resources/psruntime/BuildTime/MarkdownRenderer.cs +1 -8
- package/resources/psruntime/BuildTime/Models/PsHelpMarkdownOutputs.cs +33 -11
- package/resources/psruntime/BuildTime/Models/PsHelpTypes.cs +3 -0
- package/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs +17 -14
- package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +111 -13
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +18 -3
- package/resources/psruntime/BuildTime/PsAttributes.cs +1 -1
- package/resources/psruntime/BuildTime/PsExtensions.cs +9 -0
- package/resources/psruntime/BuildTime/PsHelpers.cs +2 -1
- package/resources/psruntime/DictionaryExtensions.cs +8 -11
- package/resources/psruntime/EventDataExtensions.cs +1 -1
- package/resources/psruntime/MessageAttribute.cs +360 -0
- package/resources/psruntime/MessageAttributeHelper.cs +161 -0
- package/resources/psruntime/Properties/Resources.Designer.cs +5633 -0
- package/resources/psruntime/Properties/Resources.resx +1741 -0
- package/resources/psruntime/TypeConverterExtensions.cs +31 -10
- package/resources/runtime/csharp/client/Extensions.cs +7 -1
- package/resources/runtime/csharp/client/IAssociativeArray.cs +4 -1
- package/resources/runtime/csharp/client/UndeclaredResponseException.cs +10 -2
- package/resources/runtime/csharp/json/Customizations/IJsonSerializable.cs +21 -7
- package/resources/runtime/csharp/json/Nodes/JsonNumber.cs +5 -5
- package/resources/runtime/csharp/pipeline/ISendAsync.cs +7 -3
- package/resources/runtime/csharp/pipeline/PipelineMocking.cs +17 -9
- package/resources/utils/Unprotect-SecureString.ps1 +16 -0
- package/changelog.md +0 -4
- package/dist/llcsharp/enums/json-serializer.d.ts +0 -9
- package/dist/llcsharp/enums/json-serializer.d.ts.map +0 -1
- package/dist/llcsharp/enums/json-serializer.js +0 -41
- package/dist/llcsharp/enums/json-serializer.js.map +0 -1
- package/dist/llcsharp/model/model-class-xml.d.ts +0 -15
- package/dist/llcsharp/model/model-class-xml.d.ts.map +0 -1
- package/dist/llcsharp/model/model-class-xml.js +0 -145
- package/dist/llcsharp/model/model-class-xml.js.map +0 -1
- package/dist/plugins/add-azure-completers.d.ts +0 -3
- package/dist/plugins/add-azure-completers.d.ts.map +0 -1
- package/dist/plugins/add-azure-completers.js.map +0 -1
- package/dist/plugins/create-commands.d.ts +0 -38
- package/dist/plugins/create-commands.d.ts.map +0 -1
- package/dist/plugins/create-commands.js.map +0 -1
- package/dist/plugins/cs-namer.d.ts +0 -3
- package/dist/plugins/cs-namer.d.ts.map +0 -1
- package/dist/plugins/cs-namer.js +0 -203
- package/dist/plugins/cs-namer.js.map +0 -1
- package/dist/plugins/llcsharp.d.ts +0 -3
- package/dist/plugins/llcsharp.d.ts.map +0 -1
- package/dist/plugins/llcsharp.js.map +0 -1
- package/dist/plugins/modifiers.d.ts +0 -3
- package/dist/plugins/modifiers.d.ts.map +0 -1
- package/dist/plugins/modifiers.js.map +0 -1
- package/dist/plugins/powershell.d.ts +0 -3
- package/dist/plugins/powershell.d.ts.map +0 -1
- package/dist/plugins/powershell.js.map +0 -1
- package/dist/plugins/ps-namer.d.ts.map +0 -1
- package/dist/plugins/ps-namer.js.map +0 -1
- package/resources/assets/docs/readme.md +0 -11
- package/resources/modules/Az.Accounts/1.8.1/Accounts.format.ps1xml +0 -368
- package/resources/modules/Az.Accounts/1.8.1/Accounts.generated.format.ps1xml +0 -422
- package/resources/modules/Az.Accounts/1.8.1/Accounts.types.ps1xml +0 -281
- package/resources/modules/Az.Accounts/1.8.1/Az.Accounts.psd1 +0 -360
- package/resources/modules/Az.Accounts/1.8.1/Az.Accounts.psm1 +0 -339
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.ApplicationInsights.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Numerics.Vectors.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Text.Encodings.Web.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/NetCoreAssemblies/System.Threading.Tasks.Extensions.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PostImportScripts/LoadAuthenticators.ps1 +0 -197
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Buffers.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Numerics.Vectors.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Private.ServiceModel.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.4.0.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.4.0.4.1.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.ServiceModel.Primitives.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Text.Encodings.Web.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/PreloadAssemblies/System.Threading.Tasks.Extensions.4.3.1.0.dll +0 -0
- package/resources/modules/Az.Accounts/1.8.1/StartupScripts/AzError.ps1 +0 -256
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const codemodel_v3_1 = require("@azure-tools/codemodel-v3");
|
|
8
|
+
const codemodel_1 = require("@azure-tools/codemodel");
|
|
8
9
|
const linq_1 = require("@azure-tools/linq");
|
|
9
10
|
const codegen_1 = require("@azure-tools/codegen");
|
|
10
11
|
const codegen_csharp_1 = require("@azure-tools/codegen-csharp");
|
|
12
|
+
const binary_1 = require("../schema/binary");
|
|
11
13
|
const codegen_csharp_2 = require("@azure-tools/codegen-csharp");
|
|
12
14
|
const codegen_csharp_3 = require("@azure-tools/codegen-csharp");
|
|
13
15
|
const codegen_csharp_4 = require("@azure-tools/codegen-csharp");
|
|
@@ -67,7 +69,8 @@ class EventListener {
|
|
|
67
69
|
exports.EventListener = EventListener;
|
|
68
70
|
class OperationMethod extends codegen_csharp_3.Method {
|
|
69
71
|
constructor(parent, operation, viaIdentity, state, objectInitializer) {
|
|
70
|
-
|
|
72
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
73
|
+
super(viaIdentity ? `${(_a = operation.language.csharp) === null || _a === void 0 ? void 0 : _a.name}ViaIdentity` : ((_b = operation.language.csharp) === null || _b === void 0 ? void 0 : _b.name) || '', codegen_csharp_13.System.Threading.Tasks.Task());
|
|
71
74
|
this.parent = parent;
|
|
72
75
|
this.operation = operation;
|
|
73
76
|
this.viaIdentity = viaIdentity;
|
|
@@ -77,7 +80,7 @@ class OperationMethod extends codegen_csharp_3.Method {
|
|
|
77
80
|
this.async = codegen_csharp_1.Modifier.Async;
|
|
78
81
|
this.returnsDescription = `A <see cref="${codegen_csharp_13.System.Threading.Tasks.Task()}" /> that will be complete when handling of the response is completed.`;
|
|
79
82
|
const $this = this;
|
|
80
|
-
this.callName = `${operation.
|
|
83
|
+
this.callName = `${(_c = operation.language.csharp) === null || _c === void 0 ? void 0 : _c.name}_Call`;
|
|
81
84
|
this.push(codegen_csharp_11.Using('NoSynchronizationContext', ''));
|
|
82
85
|
// add parameters
|
|
83
86
|
this.methodParameters = [];
|
|
@@ -85,15 +88,20 @@ class OperationMethod extends codegen_csharp_3.Method {
|
|
|
85
88
|
if (this.viaIdentity) {
|
|
86
89
|
this.addParameter(identity);
|
|
87
90
|
}
|
|
88
|
-
|
|
91
|
+
let baseUrl = '';
|
|
92
|
+
for (let index = 0; index < linq_1.length(this.operation.parameters) && this.operation.parameters; index++) {
|
|
89
93
|
const value = this.operation.parameters[index];
|
|
94
|
+
if (value.language.default.name === '$host') {
|
|
95
|
+
baseUrl = value.clientDefaultValue;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
90
98
|
const p = new parameter_1.OperationParameter(this, value, this.state.path('parameters', index));
|
|
91
|
-
if (value.
|
|
92
|
-
const constTd = state.project.modelsNamespace.
|
|
93
|
-
p.defaultInitializer = constTd.deserializeFromString(codemodel_v3_2.KnownMediaType.UriParameter, new codegen_csharp_2.StringExpression(`${value.
|
|
99
|
+
if ((_d = value.language.csharp) === null || _d === void 0 ? void 0 : _d.constantValue) {
|
|
100
|
+
const constTd = state.project.modelsNamespace.NewResolveTypeDeclaration(value.schema, true, state);
|
|
101
|
+
p.defaultInitializer = constTd.deserializeFromString(codemodel_v3_2.KnownMediaType.UriParameter, new codegen_csharp_2.StringExpression(`${value.language.csharp.constantValue}`), codegen_csharp_2.toExpression(constTd.defaultOfType));
|
|
94
102
|
}
|
|
95
103
|
// don't add path parameters when we're in identity mode
|
|
96
|
-
if (!this.viaIdentity || value.in !== codemodel_v3_1.ParameterLocation.Path) {
|
|
104
|
+
if (!this.viaIdentity || ((_e = value.protocol.http) === null || _e === void 0 ? void 0 : _e.in) !== codemodel_v3_1.ParameterLocation.Path) {
|
|
97
105
|
this.addParameter(p);
|
|
98
106
|
}
|
|
99
107
|
else {
|
|
@@ -103,58 +111,65 @@ class OperationMethod extends codegen_csharp_3.Method {
|
|
|
103
111
|
}
|
|
104
112
|
this.methodParameters.push(p);
|
|
105
113
|
}
|
|
106
|
-
|
|
114
|
+
if (baseUrl === '') {
|
|
115
|
+
// Some services will make the host as an input parameter
|
|
116
|
+
baseUrl = this.operation.requests ? (_f = this.operation.requests[0].protocol.http) === null || _f === void 0 ? void 0 : _f.uri : '';
|
|
117
|
+
}
|
|
118
|
+
this.description = ((_g = this.operation.language.csharp) === null || _g === void 0 ? void 0 : _g.description) || '';
|
|
107
119
|
// add body paramter if there should be one.
|
|
108
|
-
if (this.operation.
|
|
120
|
+
if (this.operation.requests && this.operation.requests.length && this.operation.requests[0].parameters && this.operation.requests[0].parameters.length) {
|
|
109
121
|
// this request does have a request body.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const responseType = response.schema ? state.project.modelsNamespace.resolveTypeDeclaration(response.schema, true, state) : null;
|
|
119
|
-
const headerType = response.headerSchema ? state.project.modelsNamespace.resolveTypeDeclaration(response.headerSchema, true, state) : null;
|
|
120
|
-
const newCallbackParameter = new parameter_1.CallbackParameter(response.details.csharp.name, responseType, headerType, this.state, { description: response.details.csharp.description });
|
|
121
|
-
this.addParameter(newCallbackParameter);
|
|
122
|
-
this.callbacks.push(newCallbackParameter);
|
|
122
|
+
const param = this.operation.requests[0].parameters.find((p) => !p.origin || p.origin.indexOf('modelerfour:synthesized') < 0);
|
|
123
|
+
if (param) {
|
|
124
|
+
this.bodyParameter = new parameter_1.OperationBodyParameter(this, 'body', param.language.default.description, param.schema, (_h = param.required, (_h !== null && _h !== void 0 ? _h : false)), this.state, {
|
|
125
|
+
// TODO: temp solution. We need a class like NewKnowMediaType
|
|
126
|
+
mediaType: codemodel_v3_2.knownMediaType(codemodel_v3_2.KnownMediaType.Json),
|
|
127
|
+
contentType: codemodel_v3_2.KnownMediaType.Json
|
|
128
|
+
});
|
|
129
|
+
this.addParameter(this.bodyParameter);
|
|
123
130
|
}
|
|
124
131
|
}
|
|
132
|
+
for (const response of [...linq_1.values(this.operation.responses), ...linq_1.values(this.operation.exceptions)]) {
|
|
133
|
+
const responseType = response.binary ? new binary_1.Binary(new codemodel_1.BinarySchema(""), true) : (response.schema ? state.project.modelsNamespace.NewResolveTypeDeclaration((response.schema), true, state) : null);
|
|
134
|
+
const headerType = response.language.default.headerSchema ? state.project.modelsNamespace.NewResolveTypeDeclaration(response.language.default.headerSchema, true, state) : null;
|
|
135
|
+
const newCallbackParameter = new parameter_1.CallbackParameter(((_j = response.language.csharp) === null || _j === void 0 ? void 0 : _j.name) || '', responseType, headerType, this.state, { description: (_k = response.language.csharp) === null || _k === void 0 ? void 0 : _k.description });
|
|
136
|
+
this.addParameter(newCallbackParameter);
|
|
137
|
+
this.callbacks.push(newCallbackParameter);
|
|
138
|
+
}
|
|
125
139
|
// add eventhandler parameter
|
|
126
140
|
this.contextParameter = this.addParameter(new codegen_csharp_4.Parameter('eventListener', clientruntime_1.ClientRuntime.IEventListener, { description: `an <see cref="${clientruntime_1.ClientRuntime.IEventListener}" /> instance that will receive events.` }));
|
|
127
141
|
// add optional parameter for sender
|
|
128
142
|
this.senderParameter = this.addParameter(new codegen_csharp_4.Parameter('sender', clientruntime_1.ClientRuntime.ISendAsync, { description: `an instance of an ${clientruntime_1.ClientRuntime.ISendAsync} pipeline to use to make the request.` }));
|
|
129
|
-
let rx = this.operation.path;
|
|
143
|
+
let rx = this.operation.requests ? (_l = this.operation.requests[0].protocol.http) === null || _l === void 0 ? void 0 : _l.path : '';
|
|
144
|
+
const path = rx;
|
|
130
145
|
// For post API, Some URI may contain an action string .e.x '/start' at the end
|
|
131
146
|
// of the URI, for such cases, we will drop the action string if identityCorrection
|
|
132
147
|
// is set in the configuration
|
|
133
|
-
if (this.operation.method === 'post' && this.state.project.identityCorrection) {
|
|
148
|
+
if (this.operation.requests && this.operation.requests.length && ((_m = this.operation.requests[0].protocol.http) === null || _m === void 0 ? void 0 : _m.method) === 'post' && this.state.project.identityCorrection) {
|
|
134
149
|
const idx = rx.lastIndexOf('/');
|
|
135
150
|
rx = rx.substr(0, idx);
|
|
136
151
|
}
|
|
137
|
-
let url =
|
|
138
|
-
const serverParams = this.methodParameters.filter(each => each.param.in === codemodel_v3_1.ParameterLocation.Uri);
|
|
139
|
-
const headerParams = this.methodParameters.filter(each => each.param.in === codemodel_v3_1.ParameterLocation.Header);
|
|
140
|
-
const pathParams = this.methodParameters.filter(each => each.param.in === codemodel_v3_1.ParameterLocation.Path);
|
|
141
|
-
const queryParams = this.methodParameters.filter(each => each.param.in === codemodel_v3_1.ParameterLocation.Query);
|
|
142
|
-
const cookieParams = this.methodParameters.filter(each => each.param.in === codemodel_v3_1.ParameterLocation.Cookie);
|
|
152
|
+
let url = `/${path.startsWith('/') ? path.substr(1) : path}`;
|
|
153
|
+
const serverParams = this.methodParameters.filter(each => { var _a; return ((_a = each.param.protocol.http) === null || _a === void 0 ? void 0 : _a.in) === codemodel_v3_1.ParameterLocation.Uri; });
|
|
154
|
+
const headerParams = this.methodParameters.filter(each => { var _a; return ((_a = each.param.protocol.http) === null || _a === void 0 ? void 0 : _a.in) === codemodel_v3_1.ParameterLocation.Header; });
|
|
155
|
+
const pathParams = this.methodParameters.filter(each => { var _a; return ((_a = each.param.protocol.http) === null || _a === void 0 ? void 0 : _a.in) === codemodel_v3_1.ParameterLocation.Path; });
|
|
156
|
+
const queryParams = this.methodParameters.filter(each => { var _a; return ((_a = each.param.protocol.http) === null || _a === void 0 ? void 0 : _a.in) === codemodel_v3_1.ParameterLocation.Query; });
|
|
157
|
+
const cookieParams = this.methodParameters.filter(each => { var _a; return ((_a = each.param.protocol.http) === null || _a === void 0 ? void 0 : _a.in) === codemodel_v3_1.ParameterLocation.Cookie; });
|
|
143
158
|
// replace any server params in the uri
|
|
144
159
|
for (const pp of serverParams) {
|
|
145
|
-
url = url.replace(`{${pp.param.
|
|
160
|
+
url = url.replace(`{${pp.param.language.default.serializedName}}`, `"
|
|
146
161
|
+ ${pp.name}
|
|
147
162
|
+ "`);
|
|
148
163
|
}
|
|
149
164
|
for (const pp of pathParams) {
|
|
150
|
-
rx = rx.replace(`{${pp.param.
|
|
165
|
+
rx = rx.replace(`{${pp.param.language.default.serializedName}}`, `(?<${pp.param.language.default.serializedName}>[^/]+)`);
|
|
151
166
|
if (this.viaIdentity) {
|
|
152
|
-
url = url.replace(`{${pp.param.
|
|
167
|
+
url = url.replace(`{${pp.param.language.default.serializedName}}`, `"
|
|
153
168
|
+ ${pp.name}
|
|
154
169
|
+ "`);
|
|
155
170
|
}
|
|
156
171
|
else {
|
|
157
|
-
url = url.replace(`{${pp.param.
|
|
172
|
+
url = url.replace(`{${pp.param.language.default.serializedName}}`, `"
|
|
158
173
|
+ ${removeEncoding(pp, '', codemodel_v3_2.KnownMediaType.UriParameter)}
|
|
159
174
|
+ "`);
|
|
160
175
|
}
|
|
@@ -164,54 +179,58 @@ class OperationMethod extends codegen_csharp_3.Method {
|
|
|
164
179
|
const bp = this.bodyParameter;
|
|
165
180
|
// add method implementation...
|
|
166
181
|
this.add(function* () {
|
|
182
|
+
var _a;
|
|
167
183
|
const eventListener = new EventListener($this.contextParameter, $this.state.project.emitSignals);
|
|
168
184
|
yield codegen_1.EOL;
|
|
169
185
|
if ($this.viaIdentity) {
|
|
170
186
|
yield '// verify that Identity format is an exact match for uri';
|
|
171
187
|
yield codegen_1.EOL;
|
|
172
|
-
const match = codegen_csharp_12.Local('_match', `${codegen_csharp_13.System.Text.RegularExpressions.Regex.new(rx).value}.Match(${identity.value})`);
|
|
188
|
+
const match = codegen_csharp_12.Local('_match', `${codegen_csharp_13.System.Text.RegularExpressions.Regex.new(rx, "global::System.Text.RegularExpressions.RegexOptions.IgnoreCase").value}.Match(${identity.value})`);
|
|
173
189
|
yield match.declarationStatement;
|
|
174
|
-
yield codegen_csharp_7.If(`!${match}.Success`, `throw new global::System.Exception("Invalid identity for URI '${
|
|
190
|
+
yield codegen_csharp_7.If(`!${match}.Success`, `throw new global::System.Exception("Invalid identity for URI '${path}'");`);
|
|
175
191
|
yield codegen_1.EOL;
|
|
176
192
|
yield '// replace URI parameters with values from identity';
|
|
177
193
|
for (const pp of pathParams) {
|
|
178
|
-
yield `var ${pp.name} = ${match.value}.Groups["${pp.param.
|
|
194
|
+
yield `var ${pp.name} = ${match.value}.Groups["${pp.param.language.default.serializedName}"].Value;`;
|
|
179
195
|
}
|
|
180
196
|
}
|
|
181
197
|
yield '// construct URL';
|
|
182
|
-
const
|
|
183
|
-
initializer: codegen_csharp_13.System.Uri.new(`${codegen_csharp_13.System.Text.RegularExpressions.Regex.declaration}.Replace(
|
|
198
|
+
const pathAndQueryV = codegen_csharp_12.Local('pathAndQuery', `${codegen_csharp_13.System.Text.RegularExpressions.Regex.declaration}.Replace(
|
|
184
199
|
"${url}"
|
|
185
200
|
${queryParams.length > 0 ? '+ "?"' : ''}${queryParams.joinWith(pp => `
|
|
186
|
-
+ ${removeEncoding(pp, pp.param.
|
|
201
|
+
+ ${removeEncoding(pp, pp.param.language.default.serializedName, codemodel_v3_2.KnownMediaType.QueryParameter)}`, `
|
|
187
202
|
+ "&"`)}
|
|
188
|
-
,"\\\\?&*$|&*$|(\\\\?)&+|(&)&+","$1$2")`.replace(/\s*\+ ""/gm, ''))
|
|
189
|
-
|
|
190
|
-
yield urlV.declarationStatement;
|
|
203
|
+
,"\\\\?&*$|&*$|(\\\\?)&+|(&)&+","$1$2")`.replace(/\s*\+ ""/gm, ''));
|
|
204
|
+
yield pathAndQueryV.declarationStatement;
|
|
191
205
|
yield codegen_1.EOL;
|
|
192
|
-
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.URLCreated,
|
|
206
|
+
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.URLCreated, pathAndQueryV.value);
|
|
193
207
|
yield codegen_1.EOL;
|
|
194
208
|
yield '// generate request object ';
|
|
195
|
-
|
|
196
|
-
|
|
209
|
+
const urlV = new codegen_csharp_12.LocalVariable('_url', codegen_csharp_13.dotnet.Var, {
|
|
210
|
+
initializer: codegen_csharp_13.System.Uri.new(`$"${baseUrl}{${pathAndQueryV.value}}"`)
|
|
211
|
+
});
|
|
212
|
+
yield urlV.declarationStatement;
|
|
213
|
+
const method = $this.operation.requests ? (_a = $this.operation.requests[0].protocol.http) === null || _a === void 0 ? void 0 : _a.method : '';
|
|
214
|
+
yield `var request = ${codegen_csharp_13.System.Net.Http.HttpRequestMessage.new(`${clientruntime_1.ClientRuntime.fullName}.Method.${method.capitalize()}, ${urlV.value}`)};`;
|
|
215
|
+
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.RequestCreated, `request.RequestUri.PathAndQuery`);
|
|
197
216
|
yield codegen_1.EOL;
|
|
198
217
|
if (linq_1.length(headerParams) > 0) {
|
|
199
218
|
yield '// add headers parameters';
|
|
200
219
|
for (const hp of headerParams) {
|
|
201
|
-
if (hp.param.name === 'Content-Length') {
|
|
220
|
+
if (hp.param.language.default.name === 'Content-Length') {
|
|
202
221
|
// content length is set when the request body is set
|
|
203
222
|
continue;
|
|
204
223
|
}
|
|
205
|
-
yield hp.serializeToContainerMember(codemodel_v3_2.KnownMediaType.Header, new codegen_csharp_12.LocalVariable('request.Headers', codegen_csharp_13.dotnet.Var), hp.param.
|
|
224
|
+
yield hp.serializeToContainerMember(codemodel_v3_2.KnownMediaType.Header, new codegen_csharp_12.LocalVariable('request.Headers', codegen_csharp_13.dotnet.Var), hp.param.language.default.serializedName, clientruntime_1.ClientRuntime.SerializationMode.None);
|
|
206
225
|
}
|
|
207
226
|
yield codegen_1.EOL;
|
|
208
227
|
}
|
|
209
|
-
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.HeaderParametersAdded
|
|
228
|
+
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.HeaderParametersAdded);
|
|
210
229
|
if (bp) {
|
|
211
230
|
yield '// set body content';
|
|
212
231
|
yield `request.Content = ${bp.serializeToContent(bp.mediaType, clientruntime_1.ClientRuntime.SerializationMode.None)};`;
|
|
213
232
|
yield `request.Content.Headers.ContentType = ${codegen_csharp_13.System.Net.Http.Headers.MediaTypeHeaderValue.Parse(bp.contentType)};`;
|
|
214
|
-
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.BodyContentSet
|
|
233
|
+
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.BodyContentSet);
|
|
215
234
|
}
|
|
216
235
|
yield '// make the call ';
|
|
217
236
|
});
|
|
@@ -236,12 +255,12 @@ class OperationMethod extends codegen_csharp_3.Method {
|
|
|
236
255
|
exports.OperationMethod = OperationMethod;
|
|
237
256
|
class CallMethod extends codegen_csharp_3.Method {
|
|
238
257
|
constructor(parent, opMethod, state, objectInitializer) {
|
|
239
|
-
super(`${opMethod.
|
|
258
|
+
super(`${opMethod.name}_Call`, codegen_csharp_13.System.Threading.Tasks.Task());
|
|
240
259
|
this.parent = parent;
|
|
241
260
|
this.opMethod = opMethod;
|
|
242
261
|
this.state = state;
|
|
243
262
|
this.returnNull = false;
|
|
244
|
-
this.description = `Actual wire call for <see cref="${opMethod.
|
|
263
|
+
this.description = `Actual wire call for <see cref="${opMethod.name}" /> method.`;
|
|
245
264
|
this.returnsDescription = opMethod.returnsDescription;
|
|
246
265
|
this.apply(objectInitializer);
|
|
247
266
|
this.access = codegen_csharp_1.Access.Internal;
|
|
@@ -260,6 +279,7 @@ class CallMethod extends codegen_csharp_3.Method {
|
|
|
260
279
|
const response = codegen_csharp_12.Local('_response', codegen_csharp_13.dotnet.Null, codegen_csharp_13.System.Net.Http.HttpResponseMessage);
|
|
261
280
|
yield response;
|
|
262
281
|
yield codegen_csharp_10.Try(function* () {
|
|
282
|
+
var _a, _b, _c, _d;
|
|
263
283
|
const responder = function* () {
|
|
264
284
|
// TODO: omit generating _contentType var if it will never be used
|
|
265
285
|
// const contentType = new LocalVariable('_contentType', dotnet.Var, { initializer: `_response.Content.Headers.ContentType?.MediaType` });
|
|
@@ -267,17 +287,21 @@ class CallMethod extends codegen_csharp_3.Method {
|
|
|
267
287
|
yield contentType;
|
|
268
288
|
// add response handlers
|
|
269
289
|
yield codegen_csharp_9.Switch(`${response}.StatusCode`, function* () {
|
|
270
|
-
|
|
271
|
-
|
|
290
|
+
var _a, _b;
|
|
291
|
+
var responses = [...linq_1.values(opMethod.operation.responses), ...linq_1.values(opMethod.operation.exceptions)].sort(function (a, b) { var _a, _b; return ((_a = a.protocol.http) === null || _a === void 0 ? void 0 : _a.statusCodes[0]).localeCompare(((_b = b.protocol.http) === null || _b === void 0 ? void 0 : _b.statusCodes[0])); });
|
|
292
|
+
for (const resp of responses) {
|
|
293
|
+
if (((_a = resp.protocol.http) === null || _a === void 0 ? void 0 : _a.statusCodes[0]) !== 'default') {
|
|
294
|
+
const responseCode = (_b = resp.protocol.http) === null || _b === void 0 ? void 0 : _b.statusCodes[0];
|
|
295
|
+
var leadNum = parseInt(responseCode[0]);
|
|
272
296
|
// will use enum when it can, fall back to casting int when it can't
|
|
273
|
-
yield codegen_csharp_5.Case(codegen_csharp_13.System.Net.HttpStatusCode[responseCode] ? codegen_csharp_13.System.Net.HttpStatusCode[responseCode].value :
|
|
297
|
+
yield codegen_csharp_5.Case(codegen_csharp_13.System.Net.HttpStatusCode[responseCode] ? codegen_csharp_13.System.Net.HttpStatusCode[responseCode].value : `${codegen_csharp_13.System.Net.HttpStatusCode.declaration} n when((int)n >= ${leadNum * 100} && (int)n < ${leadNum * 100 + 100})`, $this.responsesEmitter($this, opMethod, [resp], eventListener));
|
|
274
298
|
}
|
|
275
299
|
else {
|
|
276
|
-
yield codegen_csharp_5.DefaultCase($this.responsesEmitter($this, opMethod,
|
|
300
|
+
yield codegen_csharp_5.DefaultCase($this.responsesEmitter($this, opMethod, [resp], eventListener));
|
|
277
301
|
}
|
|
278
302
|
}
|
|
279
303
|
// missing default response?
|
|
280
|
-
if (!opMethod.operation.
|
|
304
|
+
if (!opMethod.operation.exceptions) {
|
|
281
305
|
// if no default, we need one that handles the rest of the stuff.
|
|
282
306
|
yield codegen_csharp_5.TerminalDefaultCase(function* () {
|
|
283
307
|
yield `throw new ${clientruntime_1.ClientRuntime.fullName}.UndeclaredResponseException(_response);`;
|
|
@@ -286,17 +310,20 @@ class CallMethod extends codegen_csharp_3.Method {
|
|
|
286
310
|
});
|
|
287
311
|
};
|
|
288
312
|
// try statements
|
|
313
|
+
const sendTask = codegen_csharp_12.Local('sendTask', new codegen_csharp_2.LiteralExpression(`${opMethod.senderParameter.value}.SendAsync(${reqParameter.use}, ${opMethod.contextParameter.value})`));
|
|
314
|
+
yield sendTask;
|
|
315
|
+
// delay sending BeforeCall event until URI has been replaced by HTTP pipeline
|
|
289
316
|
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.BeforeCall, reqParameter.use);
|
|
290
|
-
yield `${response.value} = await ${
|
|
317
|
+
yield `${response.value} = await ${sendTask.value};`;
|
|
291
318
|
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.ResponseCreated, response.value);
|
|
292
319
|
const EOL = 'EOL';
|
|
293
320
|
// LRO processing (if appropriate)
|
|
294
|
-
if ($this.opMethod.operation.
|
|
321
|
+
if ((_a = $this.opMethod.operation.language.csharp) === null || _a === void 0 ? void 0 : _a.lro) {
|
|
295
322
|
yield '// this operation supports x-ms-long-running-operation';
|
|
296
323
|
const originalUri = codegen_csharp_12.Local('_originalUri', new codegen_csharp_2.LiteralExpression(`${reqParameter.use}.RequestUri.AbsoluteUri`));
|
|
297
324
|
yield originalUri;
|
|
298
|
-
yield `// declared final-state-via: ${$this.opMethod.operation.
|
|
299
|
-
const fsv = $this.opMethod.operation.
|
|
325
|
+
yield `// declared final-state-via: ${$this.opMethod.operation.language.csharp.lro['final-state-via']}`;
|
|
326
|
+
const fsv = $this.opMethod.operation.language.csharp.lro['final-state-via'];
|
|
300
327
|
let finalUri;
|
|
301
328
|
switch (fsv) {
|
|
302
329
|
case 'original-uri':
|
|
@@ -310,8 +337,8 @@ class CallMethod extends codegen_csharp_3.Method {
|
|
|
310
337
|
break;
|
|
311
338
|
case 'azure-asyncoperation':
|
|
312
339
|
case 'azure-async-operation':
|
|
313
|
-
//
|
|
314
|
-
switch ($this.opMethod.operation.method.toLowerCase()) {
|
|
340
|
+
//depending on the type of request, do the appropriate behavior
|
|
341
|
+
switch ((_c = (_b = $this.opMethod.operation.requests) === null || _b === void 0 ? void 0 : _b[0].protocol.http) === null || _c === void 0 ? void 0 : _c.method.toLowerCase()) {
|
|
315
342
|
case 'post':
|
|
316
343
|
case 'delete':
|
|
317
344
|
finalUri = codegen_csharp_12.Local('_finalUri', response.invokeMethod('GetFirstHeader', new codegen_csharp_2.StringExpression('Azure-AsyncOperation')));
|
|
@@ -326,17 +353,19 @@ class CallMethod extends codegen_csharp_3.Method {
|
|
|
326
353
|
break;
|
|
327
354
|
default:
|
|
328
355
|
// depending on the type of request, fall back to the appropriate behavior
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
356
|
+
if ($this.opMethod.operation.requests) {
|
|
357
|
+
switch ((_d = $this.opMethod.operation.requests[0].protocol.http) === null || _d === void 0 ? void 0 : _d.method.toLowerCase()) {
|
|
358
|
+
case 'post':
|
|
359
|
+
case 'delete':
|
|
360
|
+
finalUri = codegen_csharp_12.Local('_finalUri', response.invokeMethod('GetFirstHeader', new codegen_csharp_2.StringExpression('Location')));
|
|
361
|
+
yield finalUri;
|
|
362
|
+
break;
|
|
363
|
+
case 'patch':
|
|
364
|
+
case 'put':
|
|
365
|
+
// perform a final GET on the original URI.
|
|
366
|
+
finalUri = originalUri;
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
340
369
|
}
|
|
341
370
|
break;
|
|
342
371
|
}
|
|
@@ -344,7 +373,7 @@ class CallMethod extends codegen_csharp_3.Method {
|
|
|
344
373
|
yield asyncOperation;
|
|
345
374
|
const location = codegen_csharp_12.Local('location', response.invokeMethod('GetFirstHeader', new codegen_csharp_2.StringExpression('Location')));
|
|
346
375
|
yield location;
|
|
347
|
-
yield codegen_csharp_7.While(new codegen_csharp_2.LiteralExpression(`${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCode[201].value} || ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCode[202].value} `), function* () {
|
|
376
|
+
yield codegen_csharp_7.While(new codegen_csharp_2.LiteralExpression(`${reqParameter.use}.Method == System.Net.Http.HttpMethod.Put && ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCode[200].value} || ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCode[201].value} || ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCode[202].value} `), function* () {
|
|
348
377
|
yield EOL;
|
|
349
378
|
yield '// get the delay before polling. (default to 30 seconds if not present)';
|
|
350
379
|
yield `int delay = (int)(${response.value}.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30);`;
|
|
@@ -373,34 +402,36 @@ class CallMethod extends codegen_csharp_3.Method {
|
|
|
373
402
|
yield EOL;
|
|
374
403
|
yield '// check for cancellation';
|
|
375
404
|
yield `if( ${$this.opMethod.contextParameter}.Token.IsCancellationRequested ) { return; }`;
|
|
376
|
-
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.Polling, `$"Polling {${uriLocal}}."`, response.value);
|
|
377
405
|
yield EOL;
|
|
378
406
|
yield '// drop the old response';
|
|
379
407
|
yield `${response.value}?.Dispose();`;
|
|
380
408
|
yield EOL;
|
|
381
409
|
yield '// make the polling call';
|
|
382
410
|
yield `${response.value} = await ${opMethod.senderParameter}.SendAsync(${reqParameter.value}, ${opMethod.contextParameter});`;
|
|
411
|
+
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.Polling, response.value);
|
|
383
412
|
yield EOL;
|
|
384
413
|
yield `
|
|
385
414
|
// if we got back an OK, take a peek inside and see if it's done
|
|
386
415
|
if( ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCode.OK})
|
|
387
416
|
{
|
|
417
|
+
var error = false;
|
|
388
418
|
try {
|
|
389
419
|
if( ${clientruntime_1.ClientRuntime.JsonNode.Parse(codegen_csharp_2.toExpression(`await ${response.value}.Content.ReadAsStringAsync()`))} is ${clientruntime_1.ClientRuntime.JsonObject} json)
|
|
390
420
|
{
|
|
391
421
|
var state = json.Property("properties")?.PropertyT<${clientruntime_1.ClientRuntime.JsonString}>("provisioningState") ?? json.PropertyT<${clientruntime_1.ClientRuntime.JsonString}>("status");
|
|
392
422
|
if( state is null )
|
|
393
423
|
{
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
424
|
+
// the body doesn't contain any information that has the state of the LRO
|
|
425
|
+
// we're going to just get out, and let the consumer have the result
|
|
426
|
+
break;
|
|
397
427
|
}
|
|
398
|
-
await ${$this.opMethod.contextParameter}.Signal(${clientruntime_1.ClientRuntime.Events.Polling}, $"Polled {${uriLocal}} provisioning state {state}.", ${response.value}); if( ${$this.opMethod.contextParameter}.Token.IsCancellationRequested ) { return; }
|
|
399
428
|
|
|
400
429
|
switch( state?.ToString()?.ToLower() )
|
|
401
430
|
{
|
|
402
|
-
case "succeeded":
|
|
403
431
|
case "failed":
|
|
432
|
+
error = true;
|
|
433
|
+
break;
|
|
434
|
+
case "succeeded":
|
|
404
435
|
case "canceled":
|
|
405
436
|
// we're done polling.
|
|
406
437
|
break;
|
|
@@ -415,6 +446,9 @@ if( ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCod
|
|
|
415
446
|
// if we run into a problem peeking into the result,
|
|
416
447
|
// we really don't want to do anything special.
|
|
417
448
|
}
|
|
449
|
+
if (error) {
|
|
450
|
+
throw new ${clientruntime_1.ClientRuntime.fullName}.UndeclaredResponseException(${response.value});
|
|
451
|
+
}
|
|
418
452
|
}`;
|
|
419
453
|
yield EOL;
|
|
420
454
|
yield '// check for terminal status code';
|
|
@@ -426,11 +460,11 @@ if( ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCod
|
|
|
426
460
|
case 'azure-async-operation':
|
|
427
461
|
case 'location':
|
|
428
462
|
// perform a final GET on the specified final URI.
|
|
429
|
-
yield $this.finalGet(finalUri, reqParameter, response);
|
|
463
|
+
yield $this.finalGet(eventListener, finalUri, reqParameter, response);
|
|
430
464
|
break;
|
|
431
465
|
default:
|
|
432
466
|
yield codegen_csharp_7.If(`!string.IsNullOrWhiteSpace(${finalUri})`, function* () {
|
|
433
|
-
yield $this.finalGet(finalUri, reqParameter, response);
|
|
467
|
+
yield $this.finalGet(eventListener, finalUri, reqParameter, response);
|
|
434
468
|
});
|
|
435
469
|
break;
|
|
436
470
|
}
|
|
@@ -451,7 +485,7 @@ if( ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCod
|
|
|
451
485
|
});
|
|
452
486
|
this.opMethod.emitCall($this.returnNull);
|
|
453
487
|
}
|
|
454
|
-
*finalGet(finalLocation, reqParameter, response) {
|
|
488
|
+
*finalGet(eventListener, finalLocation, reqParameter, response) {
|
|
455
489
|
yield '// create a new request with the final uri';
|
|
456
490
|
yield reqParameter.assign(`${codegen_csharp_2.valueOf(reqParameter)}.CloneAndDispose(${codegen_csharp_13.System.Uri.new(finalLocation)}, ${clientruntime_1.ClientRuntime.Method.Get})`);
|
|
457
491
|
yield codegen_1.EOL;
|
|
@@ -460,22 +494,25 @@ if( ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCod
|
|
|
460
494
|
yield codegen_1.EOL;
|
|
461
495
|
yield '// make the final call';
|
|
462
496
|
yield response.assign(`await ${this.opMethod.senderParameter}.SendAsync(${codegen_csharp_2.valueOf(reqParameter)}, ${this.opMethod.contextParameter})`);
|
|
497
|
+
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.Polling, response.value);
|
|
463
498
|
// make sure we're not polling anymore.
|
|
464
499
|
yield 'break;';
|
|
465
500
|
}
|
|
466
501
|
*responsesEmitter($this, opMethod, responses, eventListener) {
|
|
502
|
+
var _a;
|
|
467
503
|
if (linq_1.length(responses) > 1) {
|
|
468
504
|
yield codegen_csharp_9.Switch('_contentType', function* () {
|
|
505
|
+
var _a, _b, _c, _d;
|
|
469
506
|
for (const eachResponse of linq_1.values(responses)) {
|
|
470
|
-
const mimetype = linq_1.length(eachResponse.
|
|
471
|
-
const callbackParameter = linq_1.values(opMethod.callbacks).first(each => each.name === eachResponse.
|
|
472
|
-
let count = linq_1.length(eachResponse.
|
|
473
|
-
for (const mt of linq_1.values(eachResponse.
|
|
507
|
+
const mimetype = linq_1.length((_a = eachResponse.protocol.http) === null || _a === void 0 ? void 0 : _a.mediaTypes) > 0 ? (_b = eachResponse.protocol.http) === null || _b === void 0 ? void 0 : _b.mimeTypes[0] : '';
|
|
508
|
+
const callbackParameter = linq_1.values(opMethod.callbacks).first(each => { var _a; return each.name === ((_a = eachResponse.language.csharp) === null || _a === void 0 ? void 0 : _a.name); });
|
|
509
|
+
let count = linq_1.length((_c = eachResponse.protocol.http) === null || _c === void 0 ? void 0 : _c.mediaTypes);
|
|
510
|
+
for (const mt of linq_1.values((_d = eachResponse.protocol.http) === null || _d === void 0 ? void 0 : _d.mediaTypes)) {
|
|
474
511
|
count--;
|
|
475
512
|
const mediaType = codemodel_v3_2.normalizeMediaType(mt);
|
|
476
513
|
if (mediaType) {
|
|
477
514
|
if (count === 0) {
|
|
478
|
-
yield codegen_csharp_5.Case(new codegen_csharp_2.StringExpression(mediaType).toString(), $this.
|
|
515
|
+
yield codegen_csharp_5.Case(new codegen_csharp_2.StringExpression(mediaType).toString(), $this.NewResponseHandler(mimetype, eachResponse, callbackParameter));
|
|
479
516
|
}
|
|
480
517
|
else {
|
|
481
518
|
yield codegen_csharp_5.TerminalCase(new codegen_csharp_2.StringExpression(mediaType).toString(), '');
|
|
@@ -487,10 +524,10 @@ if( ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCod
|
|
|
487
524
|
}
|
|
488
525
|
else {
|
|
489
526
|
const response = responses[0];
|
|
490
|
-
const callbackParameter = linq_1.values(opMethod.callbacks).first(each => each.name === response.
|
|
527
|
+
const callbackParameter = linq_1.values(opMethod.callbacks).first(each => { var _a; return each.name === ((_a = response.language.csharp) === null || _a === void 0 ? void 0 : _a.name); });
|
|
491
528
|
// all mimeTypes per for this response code.
|
|
492
529
|
yield eventListener.signal(clientruntime_1.ClientRuntime.Events.BeforeResponseDispatch, '_response');
|
|
493
|
-
yield $this.
|
|
530
|
+
yield $this.NewResponseHandler(linq_1.values((_a = response.protocol.http) === null || _a === void 0 ? void 0 : _a.mediaTypes).first() || '', response, callbackParameter);
|
|
494
531
|
}
|
|
495
532
|
}
|
|
496
533
|
*responseHandlerForNormalPipeline(mimetype, eachResponse, callbackParameter) {
|
|
@@ -516,19 +553,46 @@ if( ${response.value}.StatusCode == ${codegen_csharp_13.System.Net.HttpStatusCod
|
|
|
516
553
|
// make the callback with the appropriate parameters
|
|
517
554
|
yield `await ${eachResponse.details.csharp.name}(_response${callbackParameters.length === 0 ? '' : ','}${callbackParameters.joinWith(codegen_csharp_2.valueOf)});`;
|
|
518
555
|
}
|
|
556
|
+
*NewResponseHandlerForNormalPipeline(mimetype, eachResponse, callbackParameter) {
|
|
557
|
+
var _a;
|
|
558
|
+
const callbackParameters = new Array();
|
|
559
|
+
if (callbackParameter.responseType) {
|
|
560
|
+
// hande the body response
|
|
561
|
+
const r = callbackParameter.responseType.deserializeFromResponse(codemodel_v3_2.knownMediaType(mimetype), codegen_csharp_2.toExpression('_response'), codegen_csharp_2.toExpression('null'));
|
|
562
|
+
if (r) {
|
|
563
|
+
callbackParameters.push(r);
|
|
564
|
+
}
|
|
565
|
+
// if (parseMediaType(mimetype)) {
|
|
566
|
+
// this media type isn't directly supported by deserialization
|
|
567
|
+
// we can return a stream to the consumer instead
|
|
568
|
+
// }
|
|
569
|
+
}
|
|
570
|
+
if (callbackParameter.headerType) {
|
|
571
|
+
// header model deserialization...
|
|
572
|
+
const r = callbackParameter.headerType.deserializeFromResponse(codemodel_v3_2.KnownMediaType.Header, codegen_csharp_2.toExpression('_response'), codegen_csharp_2.toExpression('null'));
|
|
573
|
+
if (r) {
|
|
574
|
+
callbackParameters.push(r);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
// make the callback with the appropriate parameters
|
|
578
|
+
yield `await ${(_a = eachResponse.language.csharp) === null || _a === void 0 ? void 0 : _a.name}(_response${callbackParameters.length === 0 ? '' : ','}${callbackParameters.joinWith(codegen_csharp_2.valueOf)});`;
|
|
579
|
+
}
|
|
519
580
|
responseHandler(mimetype, eachResponse, callbackParameter) {
|
|
520
581
|
return this.responseHandlerForNormalPipeline(mimetype, eachResponse, callbackParameter);
|
|
521
582
|
}
|
|
583
|
+
NewResponseHandler(mimetype, eachResponse, callbackParameter) {
|
|
584
|
+
return this.NewResponseHandlerForNormalPipeline(mimetype, eachResponse, callbackParameter);
|
|
585
|
+
}
|
|
522
586
|
}
|
|
523
587
|
exports.CallMethod = CallMethod;
|
|
524
588
|
class ValidationMethod extends codegen_csharp_3.Method {
|
|
525
589
|
constructor(parent, opMethod, state, objectInitializer) {
|
|
526
|
-
super(`${opMethod.
|
|
590
|
+
super(`${opMethod.name}_Validate`, codegen_csharp_13.System.Threading.Tasks.Task());
|
|
527
591
|
this.parent = parent;
|
|
528
592
|
this.opMethod = opMethod;
|
|
529
593
|
this.state = state;
|
|
530
594
|
this.apply(objectInitializer);
|
|
531
|
-
this.description = `Validation method for <see cref="${opMethod.
|
|
595
|
+
this.description = `Validation method for <see cref="${opMethod.name}" /> method. Call this like the actual call, but you will get validation events back.`;
|
|
532
596
|
this.returnsDescription = opMethod.returnsDescription;
|
|
533
597
|
this.access = codegen_csharp_1.Access.Internal;
|
|
534
598
|
this.async = codegen_csharp_1.Modifier.Async;
|