@autorest/powershell 4.0.0-dev.8 → 4.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 +214 -206
- package/.rush/temp/shrinkwrap-deps.json +253 -280
- package/autorest-configuration-for-sdk.md +9 -3
- package/autorest-configuration.md +1 -1
- package/dist/cmdlets/class.d.ts +27 -2
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +913 -549
- package/dist/cmdlets/class.js.map +1 -1
- package/dist/cmdlets/namespace.d.ts.map +1 -1
- package/dist/cmdlets/namespace.js +39 -5
- package/dist/cmdlets/namespace.js.map +1 -1
- package/dist/enums/namespace.js +5 -5
- package/dist/enums/namespace.js.map +1 -1
- package/dist/exports.d.ts +3 -0
- package/dist/exports.d.ts.map +1 -0
- package/dist/exports.js +19 -0
- package/dist/exports.js.map +1 -0
- package/dist/generators/gitignore.d.ts.map +1 -1
- package/dist/generators/gitignore.js +2 -0
- package/dist/generators/gitignore.js.map +1 -1
- package/dist/generators/psm1.custom.js +2 -2
- package/dist/generators/psm1.custom.js.map +1 -1
- package/dist/generators/psm1.d.ts.map +1 -1
- package/dist/generators/psm1.internal.js +2 -2
- package/dist/generators/psm1.internal.js.map +1 -1
- package/dist/generators/psm1.js +17 -11
- package/dist/generators/psm1.js.map +1 -1
- package/dist/generators/readme.d.ts.map +1 -1
- package/dist/generators/readme.js +0 -3
- package/dist/generators/readme.js.map +1 -1
- package/dist/generators/script-cmdlet.js +18 -18
- package/dist/generators/script-cmdlet.js.map +1 -1
- package/dist/internal/name-inferrer.d.ts +1 -1
- package/dist/internal/name-inferrer.d.ts.map +1 -1
- package/dist/internal/name-inferrer.js +12 -12
- package/dist/internal/name-inferrer.js.map +1 -1
- package/dist/internal/powershell-declarations.d.ts +3 -0
- package/dist/internal/powershell-declarations.d.ts.map +1 -1
- package/dist/internal/powershell-declarations.js +5 -2
- package/dist/internal/powershell-declarations.js.map +1 -1
- package/dist/internal/project.d.ts +14 -8
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +27 -20
- 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.map +1 -1
- package/dist/llcsharp/clientruntime.d.ts +1 -0
- package/dist/llcsharp/clientruntime.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.js +12 -11
- package/dist/llcsharp/clientruntime.js.map +1 -1
- package/dist/llcsharp/code-model.d.ts +7 -7
- package/dist/llcsharp/code-model.d.ts.map +1 -1
- package/dist/llcsharp/enums/enum.d.ts +1 -1
- package/dist/llcsharp/enums/enum.d.ts.map +1 -1
- package/dist/llcsharp/enums/enum.js +42 -42
- package/dist/llcsharp/enums/enum.js.map +1 -1
- package/dist/llcsharp/exports.js +5 -1
- package/dist/llcsharp/exports.js.map +1 -1
- package/dist/llcsharp/generator.d.ts +3 -2
- package/dist/llcsharp/generator.d.ts.map +1 -1
- package/dist/llcsharp/generator.js.map +1 -1
- package/dist/llcsharp/model/idictionary.js +16 -16
- package/dist/llcsharp/model/idictionary.js.map +1 -1
- package/dist/llcsharp/model/interface.d.ts +1 -1
- package/dist/llcsharp/model/interface.d.ts.map +1 -1
- package/dist/llcsharp/model/interface.js +25 -11
- package/dist/llcsharp/model/interface.js.map +1 -1
- package/dist/llcsharp/model/model-class-dictionary.js +18 -18
- package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
- package/dist/llcsharp/model/model-class-json.js +20 -20
- package/dist/llcsharp/model/model-class-json.js.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.d.ts +1 -1
- package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.js +6 -6
- package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
- package/dist/llcsharp/model/model-class.d.ts +1 -1
- package/dist/llcsharp/model/model-class.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class.js +108 -97
- package/dist/llcsharp/model/model-class.js.map +1 -1
- package/dist/llcsharp/model/namespace.d.ts +1 -1
- package/dist/llcsharp/model/namespace.d.ts.map +1 -1
- package/dist/llcsharp/model/namespace.js +4 -12
- package/dist/llcsharp/model/namespace.js.map +1 -1
- package/dist/llcsharp/model/property.d.ts +1 -1
- package/dist/llcsharp/model/property.d.ts.map +1 -1
- package/dist/llcsharp/model/property.js +20 -20
- 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 +26 -1
- package/dist/llcsharp/operation/api-class.js.map +1 -1
- package/dist/llcsharp/operation/method.d.ts +10 -5
- package/dist/llcsharp/operation/method.d.ts.map +1 -1
- package/dist/llcsharp/operation/method.js +287 -134
- package/dist/llcsharp/operation/method.js.map +1 -1
- package/dist/llcsharp/operation/parameter.d.ts +1 -1
- package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
- package/dist/llcsharp/operation/parameter.js +10 -10
- package/dist/llcsharp/operation/parameter.js.map +1 -1
- package/dist/llcsharp/project.d.ts +10 -5
- package/dist/llcsharp/project.d.ts.map +1 -1
- package/dist/llcsharp/project.js +15 -4
- package/dist/llcsharp/project.js.map +1 -1
- package/dist/llcsharp/schema/Uuid.d.ts +1 -1
- package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
- package/dist/llcsharp/schema/Uuid.js +2 -2
- package/dist/llcsharp/schema/Uuid.js.map +1 -1
- package/dist/llcsharp/schema/array.d.ts +1 -1
- package/dist/llcsharp/schema/array.d.ts.map +1 -1
- package/dist/llcsharp/schema/array.js +45 -43
- package/dist/llcsharp/schema/array.js.map +1 -1
- package/dist/llcsharp/schema/binary.d.ts +1 -1
- package/dist/llcsharp/schema/binary.d.ts.map +1 -1
- package/dist/llcsharp/schema/binary.js +9 -9
- package/dist/llcsharp/schema/binary.js.map +1 -1
- package/dist/llcsharp/schema/boolean.d.ts +1 -1
- package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
- package/dist/llcsharp/schema/byte-array.d.ts +1 -1
- package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
- package/dist/llcsharp/schema/byte-array.js +24 -24
- package/dist/llcsharp/schema/byte-array.js.map +1 -1
- package/dist/llcsharp/schema/char.d.ts +1 -1
- package/dist/llcsharp/schema/char.d.ts.map +1 -1
- package/dist/llcsharp/schema/char.js +1 -1
- package/dist/llcsharp/schema/char.js.map +1 -1
- package/dist/llcsharp/schema/date-time.d.ts +1 -1
- package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
- package/dist/llcsharp/schema/date-time.js +45 -41
- package/dist/llcsharp/schema/date-time.js.map +1 -1
- package/dist/llcsharp/schema/date.d.ts +1 -1
- package/dist/llcsharp/schema/date.d.ts.map +1 -1
- package/dist/llcsharp/schema/duration.d.ts +1 -1
- package/dist/llcsharp/schema/duration.d.ts.map +1 -1
- package/dist/llcsharp/schema/duration.js +9 -7
- package/dist/llcsharp/schema/duration.js.map +1 -1
- package/dist/llcsharp/schema/enum.d.ts +6 -2
- package/dist/llcsharp/schema/enum.d.ts.map +1 -1
- package/dist/llcsharp/schema/enum.js +13 -4
- package/dist/llcsharp/schema/enum.js.map +1 -1
- package/dist/llcsharp/schema/extended-type-declaration.d.ts +1 -1
- package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
- package/dist/llcsharp/schema/fixed-array.d.ts +1 -1
- package/dist/llcsharp/schema/fixed-array.d.ts.map +1 -1
- package/dist/llcsharp/schema/fixed-array.js +44 -42
- package/dist/llcsharp/schema/fixed-array.js.map +1 -1
- package/dist/llcsharp/schema/integer.d.ts +1 -1
- package/dist/llcsharp/schema/integer.d.ts.map +1 -1
- package/dist/llcsharp/schema/integer.js +5 -5
- package/dist/llcsharp/schema/integer.js.map +1 -1
- package/dist/llcsharp/schema/object.d.ts +1 -1
- package/dist/llcsharp/schema/object.d.ts.map +1 -1
- package/dist/llcsharp/schema/object.js +28 -28
- package/dist/llcsharp/schema/object.js.map +1 -1
- package/dist/llcsharp/schema/password.d.ts +1 -1
- package/dist/llcsharp/schema/password.d.ts.map +1 -1
- package/dist/llcsharp/schema/password.js +13 -13
- package/dist/llcsharp/schema/password.js.map +1 -1
- package/dist/llcsharp/schema/primitive.d.ts +1 -1
- package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
- package/dist/llcsharp/schema/primitive.js +40 -37
- package/dist/llcsharp/schema/primitive.js.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.js +5 -9
- package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
- package/dist/llcsharp/schema/string.d.ts +1 -1
- package/dist/llcsharp/schema/string.d.ts.map +1 -1
- package/dist/llcsharp/schema/string.js +48 -44
- package/dist/llcsharp/schema/string.js.map +1 -1
- package/dist/llcsharp/schema/uri.d.ts +1 -1
- package/dist/llcsharp/schema/uri.d.ts.map +1 -1
- package/dist/llcsharp/schema/uri.js +2 -2
- package/dist/llcsharp/schema/uri.js.map +1 -1
- package/dist/llcsharp/validations.js +2 -2
- package/dist/llcsharp/validations.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +5 -2
- package/dist/main.js.map +1 -1
- package/dist/models/model-extensions.d.ts +1 -1
- package/dist/models/model-extensions.d.ts.map +1 -1
- package/dist/models/model-extensions.js +39 -39
- package/dist/models/model-extensions.js.map +1 -1
- package/dist/module/module-class.d.ts.map +1 -1
- package/dist/module/module-class.js +45 -15
- package/dist/module/module-class.js.map +1 -1
- package/dist/module/module-namespace.js +3 -3
- package/dist/module/module-namespace.js.map +1 -1
- package/dist/plugins/add-azure-completers-v2.d.ts +6 -1
- package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -1
- package/dist/plugins/add-azure-completers-v2.js +5 -4
- package/dist/plugins/add-azure-completers-v2.js.map +1 -1
- package/dist/plugins/create-commands-v2.d.ts +17 -7
- package/dist/plugins/create-commands-v2.d.ts.map +1 -1
- package/dist/plugins/create-commands-v2.js +302 -66
- package/dist/plugins/create-commands-v2.js.map +1 -1
- package/dist/plugins/cs-namer-v2.d.ts +6 -1
- package/dist/plugins/cs-namer-v2.d.ts.map +1 -1
- package/dist/plugins/cs-namer-v2.js +42 -41
- package/dist/plugins/cs-namer-v2.js.map +1 -1
- package/dist/plugins/llcsharp-v2.d.ts +5 -2
- package/dist/plugins/llcsharp-v2.d.ts.map +1 -1
- package/dist/plugins/llcsharp-v2.js +14 -9
- package/dist/plugins/llcsharp-v2.js.map +1 -1
- package/dist/plugins/modifiers-v2.d.ts +6 -1
- package/dist/plugins/modifiers-v2.d.ts.map +1 -1
- package/dist/plugins/modifiers-v2.js +135 -88
- package/dist/plugins/modifiers-v2.js.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.d.ts +6 -1
- package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.js +44 -32
- package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
- package/dist/plugins/plugin-tweak-m4-model.d.ts +7 -1
- package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-m4-model.js +39 -10
- package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +6 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.js +32 -22
- package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
- package/dist/plugins/plugin-tweak-model.d.ts +6 -1
- package/dist/plugins/plugin-tweak-model.d.ts.map +1 -1
- package/dist/plugins/plugin-tweak-model.js +33 -32
- package/dist/plugins/plugin-tweak-model.js.map +1 -1
- package/dist/plugins/powershell-v2.d.ts +5 -2
- package/dist/plugins/powershell-v2.d.ts.map +1 -1
- package/dist/plugins/powershell-v2.js +32 -28
- package/dist/plugins/powershell-v2.js.map +1 -1
- package/dist/plugins/ps-namer-v2.d.ts +6 -1
- package/dist/plugins/ps-namer-v2.d.ts.map +1 -1
- package/dist/plugins/ps-namer-v2.js +33 -32
- package/dist/plugins/ps-namer-v2.js.map +1 -1
- package/dist/plugins/sdk-create-inline-properties.d.ts +1 -1
- package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -1
- package/dist/plugins/sdk-create-inline-properties.js +129 -39
- package/dist/plugins/sdk-create-inline-properties.js.map +1 -1
- package/dist/plugins/sdk-cs-namer.d.ts +1 -1
- package/dist/plugins/sdk-cs-namer.d.ts.map +1 -1
- package/dist/plugins/sdk-cs-namer.js +59 -34
- package/dist/plugins/sdk-cs-namer.js.map +1 -1
- package/dist/plugins/sdk-cs-simplifier.d.ts +1 -1
- package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -1
- package/dist/plugins/sdk-cs-simplifier.js +3 -3
- package/dist/plugins/sdk-cs-simplifier.js.map +1 -1
- package/dist/plugins/sdk-generate.d.ts +1 -1
- package/dist/plugins/sdk-generate.d.ts.map +1 -1
- package/dist/plugins/sdk-generate.js +23 -18
- package/dist/plugins/sdk-generate.js.map +1 -1
- package/dist/plugins/sdk-modifiers.d.ts +4 -0
- package/dist/plugins/sdk-modifiers.d.ts.map +1 -0
- package/dist/plugins/sdk-modifiers.js +175 -0
- package/dist/plugins/sdk-modifiers.js.map +1 -0
- package/dist/plugins/sdk-tweak-model.d.ts +1 -1
- package/dist/plugins/sdk-tweak-model.d.ts.map +1 -1
- package/dist/plugins/sdk-tweak-model.js +140 -44
- package/dist/plugins/sdk-tweak-model.js.map +1 -1
- package/dist/sdk/project.d.ts +2 -2
- package/dist/sdk/project.d.ts.map +1 -1
- package/dist/sdk/project.js +10 -9
- package/dist/sdk/project.js.map +1 -1
- package/dist/sdk/state.d.ts +2 -2
- package/dist/sdk/state.d.ts.map +1 -1
- package/dist/sdk/utility.d.ts +12 -3
- package/dist/sdk/utility.d.ts.map +1 -1
- package/dist/sdk/utility.js +122 -30
- package/dist/sdk/utility.js.map +1 -1
- package/dist/utils/PwshModel.d.ts +1 -1
- package/dist/utils/PwshModel.d.ts.map +1 -1
- package/dist/utils/PwshModel.js +1 -1
- package/dist/utils/PwshModel.js.map +1 -1
- package/dist/utils/SdkModel.d.ts +1 -1
- package/dist/utils/SdkModel.d.ts.map +1 -1
- package/dist/utils/SdkModel.js +1 -1
- package/dist/utils/SdkModel.js.map +1 -1
- package/dist/utils/command-operation.d.ts +11 -3
- package/dist/utils/command-operation.d.ts.map +1 -1
- package/dist/utils/command-operation.js +26 -4
- package/dist/utils/command-operation.js.map +1 -1
- package/dist/utils/components.d.ts +1 -1
- package/dist/utils/components.d.ts.map +1 -1
- package/dist/utils/components.js +2 -2
- package/dist/utils/components.js.map +1 -1
- package/dist/utils/http-operation.d.ts +2 -0
- package/dist/utils/http-operation.d.ts.map +1 -1
- package/dist/utils/http-operation.js +16 -12
- package/dist/utils/http-operation.js.map +1 -1
- package/dist/utils/model-state.d.ts +7 -5
- package/dist/utils/model-state.d.ts.map +1 -1
- package/dist/utils/model-state.js +28 -20
- package/dist/utils/model-state.js.map +1 -1
- package/dist/utils/programatic-operation.d.ts +1 -1
- package/dist/utils/programatic-operation.d.ts.map +1 -1
- package/dist/utils/programatic-operation.js +1 -1
- package/dist/utils/programatic-operation.js.map +1 -1
- package/dist/utils/resolve-conflicts.js +8 -8
- package/dist/utils/resolve-conflicts.js.map +1 -1
- package/dist/utils/resourceName.d.ts +3 -0
- package/dist/utils/resourceName.d.ts.map +1 -0
- package/dist/utils/resourceName.js +29 -0
- package/dist/utils/resourceName.js.map +1 -0
- package/dist/utils/schema.d.ts +1 -1
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +11 -11
- package/dist/utils/schema.js.map +1 -1
- package/dist/utils/security-scheme.d.ts +2 -2
- package/dist/utils/security-scheme.d.ts.map +1 -1
- package/dist/utils/security-scheme.js +2 -2
- package/dist/utils/security-scheme.js.map +1 -1
- package/dist/utils/sort-parameters.d.ts +3 -0
- package/dist/utils/sort-parameters.d.ts.map +1 -0
- package/dist/utils/sort-parameters.js +33 -0
- package/dist/utils/sort-parameters.js.map +1 -0
- package/dist/utils/tsp-generator.d.ts +3 -0
- package/dist/utils/tsp-generator.d.ts.map +1 -0
- package/dist/utils/tsp-generator.js +65 -0
- package/dist/utils/tsp-generator.js.map +1 -0
- package/dist/utils/tsp-host.d.ts +42 -0
- package/dist/utils/tsp-host.d.ts.map +1 -0
- package/dist/utils/tsp-host.js +56 -0
- package/dist/utils/tsp-host.js.map +1 -0
- package/generators/readme.ts +0 -3
- package/package.json +11 -10
- package/resources/assets/build-module.ps1 +31 -4
- package/resources/assets/check-dependencies.ps1 +3 -3
- package/resources/assets/create-model-cmdlets.ps1 +34 -5
- package/resources/assets/export-surface.ps1 +3 -3
- package/resources/assets/generate-help.ps1 +5 -5
- package/resources/assets/generate-portal-ux.ps1 +9 -25
- package/resources/assets/run-module.ps1 +4 -4
- package/resources/assets/test/loadEnv.ps1 +1 -1
- package/resources/assets/test-module.ps1 +11 -7
- package/resources/assets/tools/Resources/README.md +0 -3
- package/resources/assets/tools/Resources/custom/New-AzDeployment.ps1 +2 -2
- package/resources/assets/tools/Resources/how-to.md +2 -0
- package/resources/built-time-cmdlets.csproj +1 -0
- package/resources/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml +554 -0
- package/resources/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml +471 -0
- package/resources/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml +306 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Az.Accounts.nuspec +4 -5
- package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 +389 -0
- package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 +365 -0
- package/resources/modules/Az.Accounts/2.13.1/FuzzySharp.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +2510 -779
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 +222 -0
- package/resources/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 +281 -0
- package/resources/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 +242 -0
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/[Content_Types].xml +2 -3
- package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/_rels/.rels +2 -2
- package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll +0 -0
- package/resources/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp +11 -0
- package/resources/psruntime/Attributes/PSArgumentCompleterAttribute.cs +52 -0
- package/resources/psruntime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +4 -1
- package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +6 -3
- package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +7 -4
- package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +130 -81
- package/resources/psruntime/BuildTime/Cmdlets/NewAssemblyInfo.cs +64 -0
- package/resources/psruntime/BuildTime/MarkdownRenderer.cs +17 -9
- package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +53 -8
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +35 -11
- package/resources/psruntime/BuildTime/PsAttributes.cs +5 -0
- package/resources/psruntime/BuildTime/PsHelpers.cs +4 -3
- package/resources/psruntime/MessageAttribute.cs +45 -55
- package/resources/psruntime/MessageAttributeHelper.cs +30 -7
- package/resources/psruntime/Properties/Resources.Designer.cs +25 -3
- package/resources/psruntime/Properties/Resources.resx +8 -2
- package/resources/runtime/csharp/pipeline/ISendAsync.cs +113 -0
- package/resources/runtime/csharp/pipeline/PipelineMocking.cs +1 -1
- package/resources/templates/azureMethod.ejs +2 -2
- package/resources/templates/azureMethodGroup.ejs +2 -2
- package/resources/templates/azureServiceClient.ejs +11 -4
- package/resources/templates/enum.ejs +3 -3
- package/resources/templates/extensionMethod.ejs +18 -12
- package/resources/templates/extensions.ejs +9 -2
- package/resources/templates/longRunningOperationMethod.ejs +10 -8
- package/resources/templates/method.ejs +10 -8
- package/resources/templates/methodBodyRestCall.ejs +77 -32
- package/resources/templates/methodGroupInterface.ejs +2 -61
- package/resources/templates/methodGroupInterfaceBody.ejs +60 -0
- package/resources/templates/model.ejs +15 -15
- package/resources/templates/serviceClientBody.ejs +8 -8
- package/resources/templates/serviceClientInterface.ejs +10 -4
- package/resources/utils/Get-SubscriptionIdTestSafe.ps1 +7 -0
- package/dist/utils/WrapComments.d.ts +0 -2
- package/dist/utils/WrapComments.d.ts.map +0 -1
- package/dist/utils/WrapComments.js +0 -46
- package/dist/utils/WrapComments.js.map +0 -1
- package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +0 -496
- package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +0 -468
- package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +0 -303
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +0 -387
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +0 -375
- 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/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/Microsoft.ApplicationInsights.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +0 -2309
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json +0 -2273
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json +0 -1316
- 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/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.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/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +0 -2413
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
- 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/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +0 -219
- 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/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll +0 -0
- package/resources/modules/Az.Accounts/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/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
- package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +0 -278
- package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +0 -234
- package/resources/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp +0 -11
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Hyak.Common.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.Common.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/en-US/about_az.help.txt +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Numerics.Vectors.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Security.Cryptography.Cng.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Text.Encodings.Web.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Xml.ReaderWriter.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Buffers.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.Data.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Net.Http.WinHttpHandler.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Private.ServiceModel.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.ServiceModel.Primitives.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Text.Json.dll +0 -0
- /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Threading.Tasks.Extensions.dll +0 -0
|
@@ -39,9 +39,10 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
39
39
|
public static IEnumerable<FunctionInfo> GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder)
|
|
40
40
|
{
|
|
41
41
|
// https://stackoverflow.com/a/40969712/294804
|
|
42
|
+
var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'";
|
|
42
43
|
var getCmdletsCommand = $@"
|
|
43
44
|
$currentFunctions = Get-ChildItem function:
|
|
44
|
-
Get-ChildItem -Path
|
|
45
|
+
Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }}
|
|
45
46
|
Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }}
|
|
46
47
|
";
|
|
47
48
|
return cmdlet?.RunScript<FunctionInfo>(getCmdletsCommand) ?? RunScript<FunctionInfo>(getCmdletsCommand);
|
|
@@ -66,7 +67,7 @@ Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -a
|
|
|
66
67
|
|
|
67
68
|
public static IEnumerable<CmdletAndHelpInfo> GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths)
|
|
68
69
|
{
|
|
69
|
-
var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp =>
|
|
70
|
+
var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp =>
|
|
70
71
|
$@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})"
|
|
71
72
|
));
|
|
72
73
|
return (cmdlet?.RunScript<Hashtable>(getCmdletAndHelp) ?? RunScript<Hashtable>(getCmdletAndHelp))
|
|
@@ -87,7 +88,7 @@ Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -a
|
|
|
87
88
|
if (File.Exists(psd1Path))
|
|
88
89
|
{
|
|
89
90
|
var currentGuid = File.ReadAllLines(psd1Path)
|
|
90
|
-
.FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries)
|
|
91
|
+
.FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries)
|
|
91
92
|
.LastOrDefault()?.Replace("'", String.Empty);
|
|
92
93
|
guid = currentGuid != null ? Guid.Parse(currentGuid) : guid;
|
|
93
94
|
}
|
|
@@ -21,7 +21,7 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
21
21
|
|
|
22
22
|
//The version the change is effective from, non mandatory
|
|
23
23
|
public string DeprecateByVersion { get; }
|
|
24
|
-
public
|
|
24
|
+
public string DeprecateByAzVersion { get; }
|
|
25
25
|
|
|
26
26
|
//The date on which the change comes in effect
|
|
27
27
|
public DateTime ChangeInEfectByDate { get; }
|
|
@@ -32,23 +32,18 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
32
32
|
//New way fo calling the cmdlet
|
|
33
33
|
public string NewWay { get; set; }
|
|
34
34
|
|
|
35
|
-
public GenericBreakingChangeAttribute(string message)
|
|
36
|
-
{
|
|
37
|
-
_message = message;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public GenericBreakingChangeAttribute(string message, string deprecateByVersion)
|
|
35
|
+
public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion)
|
|
41
36
|
{
|
|
42
37
|
_message = message;
|
|
38
|
+
this.DeprecateByAzVersion = deprecateByAzVersion;
|
|
43
39
|
this.DeprecateByVersion = deprecateByVersion;
|
|
44
|
-
this.DeprecateByVersionSet = true;
|
|
45
40
|
}
|
|
46
41
|
|
|
47
|
-
public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate)
|
|
42
|
+
public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate)
|
|
48
43
|
{
|
|
49
44
|
_message = message;
|
|
50
45
|
this.DeprecateByVersion = deprecateByVersion;
|
|
51
|
-
this.
|
|
46
|
+
this.DeprecateByAzVersion = deprecateByAzVersion;
|
|
52
47
|
|
|
53
48
|
if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result))
|
|
54
49
|
{
|
|
@@ -86,10 +81,8 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
86
81
|
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d")));
|
|
87
82
|
}
|
|
88
83
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion));
|
|
92
|
-
}
|
|
84
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion));
|
|
85
|
+
writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion));
|
|
93
86
|
|
|
94
87
|
if (OldWay != null && NewWay != null)
|
|
95
88
|
{
|
|
@@ -114,18 +107,13 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
114
107
|
|
|
115
108
|
public string ReplacementCmdletName { get; set; }
|
|
116
109
|
|
|
117
|
-
public CmdletBreakingChangeAttribute() :
|
|
118
|
-
|
|
110
|
+
public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion) :
|
|
111
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion)
|
|
119
112
|
{
|
|
120
113
|
}
|
|
121
114
|
|
|
122
|
-
public CmdletBreakingChangeAttribute(string
|
|
123
|
-
base(string.Empty,
|
|
124
|
-
{
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) :
|
|
128
|
-
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
115
|
+
public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) :
|
|
116
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate)
|
|
129
117
|
{
|
|
130
118
|
}
|
|
131
119
|
|
|
@@ -146,20 +134,15 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
146
134
|
public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute
|
|
147
135
|
{
|
|
148
136
|
public string[] ChangedParameterSet { set; get; }
|
|
149
|
-
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) :
|
|
150
|
-
base(string.Empty)
|
|
151
|
-
{
|
|
152
|
-
ChangedParameterSet = changedParameterSet;
|
|
153
|
-
}
|
|
154
137
|
|
|
155
|
-
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string
|
|
156
|
-
base(string.Empty,
|
|
138
|
+
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion) :
|
|
139
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion)
|
|
157
140
|
{
|
|
158
141
|
ChangedParameterSet = changedParameterSet;
|
|
159
142
|
}
|
|
160
143
|
|
|
161
|
-
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) :
|
|
162
|
-
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
144
|
+
public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) :
|
|
145
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate)
|
|
163
146
|
{
|
|
164
147
|
ChangedParameterSet = changedParameterSet;
|
|
165
148
|
}
|
|
@@ -185,6 +168,11 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
185
168
|
{
|
|
186
169
|
public string _message;
|
|
187
170
|
|
|
171
|
+
public DateTime EstimatedGaDate { get; }
|
|
172
|
+
|
|
173
|
+
public bool IsEstimatedGaDateSet { get; } = false;
|
|
174
|
+
|
|
175
|
+
|
|
188
176
|
public PreviewMessageAttribute()
|
|
189
177
|
{
|
|
190
178
|
this._message = Resources.PreviewCmdletMessage;
|
|
@@ -192,12 +180,26 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
192
180
|
|
|
193
181
|
public PreviewMessageAttribute(string message)
|
|
194
182
|
{
|
|
195
|
-
this._message = message;
|
|
183
|
+
this._message = string.IsNullOrEmpty(message) ? Resources.PreviewCmdletMessage : message;
|
|
196
184
|
}
|
|
197
185
|
|
|
198
|
-
public
|
|
186
|
+
public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this(message)
|
|
199
187
|
{
|
|
200
|
-
|
|
188
|
+
if (DateTime.TryParse(estimatedDateOfGa, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result))
|
|
189
|
+
{
|
|
190
|
+
this.EstimatedGaDate = result;
|
|
191
|
+
this.IsEstimatedGaDateSet = true;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
public void PrintCustomAttributeInfo(Action<string> writeOutput)
|
|
196
|
+
{
|
|
197
|
+
writeOutput(this._message);
|
|
198
|
+
|
|
199
|
+
if (IsEstimatedGaDateSet)
|
|
200
|
+
{
|
|
201
|
+
writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString()));
|
|
202
|
+
}
|
|
201
203
|
}
|
|
202
204
|
|
|
203
205
|
public virtual bool IsApplicableToInvocation(InvocationInfo invocation)
|
|
@@ -219,20 +221,14 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
219
221
|
|
|
220
222
|
public String NewParameterType { get; set; }
|
|
221
223
|
|
|
222
|
-
public ParameterBreakingChangeAttribute(string nameOfParameterChanging) :
|
|
223
|
-
|
|
224
|
+
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion) :
|
|
225
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion)
|
|
224
226
|
{
|
|
225
227
|
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
226
228
|
}
|
|
227
229
|
|
|
228
|
-
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) :
|
|
229
|
-
base(string.Empty, deprecateByVersion)
|
|
230
|
-
{
|
|
231
|
-
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) :
|
|
235
|
-
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
230
|
+
public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) :
|
|
231
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate)
|
|
236
232
|
{
|
|
237
233
|
this.NameOfParameterChanging = nameOfParameterChanging;
|
|
238
234
|
}
|
|
@@ -298,20 +294,14 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
298
294
|
|
|
299
295
|
public string[] NewOutputProperties { get; set; }
|
|
300
296
|
|
|
301
|
-
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) :
|
|
302
|
-
|
|
303
|
-
{
|
|
304
|
-
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) :
|
|
308
|
-
base(string.Empty, deprecateByVersion)
|
|
297
|
+
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion) :
|
|
298
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion)
|
|
309
299
|
{
|
|
310
300
|
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
311
301
|
}
|
|
312
302
|
|
|
313
|
-
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) :
|
|
314
|
-
base(string.Empty, deprecateByVersion, changeInEfectByDate)
|
|
303
|
+
public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) :
|
|
304
|
+
base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate)
|
|
315
305
|
{
|
|
316
306
|
this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType;
|
|
317
307
|
}
|
|
@@ -23,6 +23,7 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
23
23
|
using System.Threading.Tasks;
|
|
24
24
|
public class MessageAttributeHelper
|
|
25
25
|
{
|
|
26
|
+
private static readonly bool IsAzure = Convert.ToBoolean(@"${$project.azure}");
|
|
26
27
|
public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings";
|
|
27
28
|
public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings";
|
|
28
29
|
|
|
@@ -34,7 +35,7 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
34
35
|
* the boundParameterNames is a list of parameters bound to the cmdlet at runtime,
|
|
35
36
|
* We only process the Parameter beaking change attributes attached only params listed in this list (if present)
|
|
36
37
|
* */
|
|
37
|
-
public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet)
|
|
38
|
+
public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet, bool showPreviewMessage = true)
|
|
38
39
|
{
|
|
39
40
|
bool supressWarningOrError = false;
|
|
40
41
|
|
|
@@ -52,37 +53,53 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
52
53
|
//Do not process the attributes at runtime... The env variable to override the warning messages is set
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
56
|
+
if (IsAzure && invocationInfo.BoundParameters.ContainsKey("DefaultProfile"))
|
|
57
|
+
{
|
|
58
|
+
psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ProcessBreakingChangeAttributesAtRuntime(commandInfo, invocationInfo, parameterSet, psCmdlet);
|
|
62
|
+
|
|
63
|
+
}
|
|
55
64
|
|
|
65
|
+
private static void ProcessBreakingChangeAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet)
|
|
66
|
+
{
|
|
56
67
|
List<GenericBreakingChangeAttribute> attributes = new List<GenericBreakingChangeAttribute>(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet));
|
|
57
68
|
StringBuilder sb = new StringBuilder();
|
|
58
|
-
Action<string>
|
|
69
|
+
Action<string> appendAttributeMessage = (string s) => sb.Append(s);
|
|
59
70
|
|
|
60
71
|
if (attributes != null && attributes.Count > 0)
|
|
61
72
|
{
|
|
62
|
-
|
|
73
|
+
appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0]));
|
|
63
74
|
|
|
64
75
|
foreach (GenericBreakingChangeAttribute attribute in attributes)
|
|
65
76
|
{
|
|
66
|
-
attribute.PrintCustomAttributeInfo(
|
|
77
|
+
attribute.PrintCustomAttributeInfo(appendAttributeMessage);
|
|
67
78
|
}
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK));
|
|
70
81
|
|
|
71
82
|
psCmdlet.WriteWarning(sb.ToString());
|
|
72
83
|
}
|
|
84
|
+
}
|
|
85
|
+
|
|
73
86
|
|
|
87
|
+
public static void ProcessPreviewMessageAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet)
|
|
88
|
+
{
|
|
74
89
|
List<PreviewMessageAttribute> previewAttributes = new List<PreviewMessageAttribute>(GetAllPreviewAttributesInType(commandInfo, invocationInfo));
|
|
90
|
+
StringBuilder sb = new StringBuilder();
|
|
91
|
+
Action<string> appendAttributeMessage = (string s) => sb.Append(s);
|
|
75
92
|
|
|
76
93
|
if (previewAttributes != null && previewAttributes.Count > 0)
|
|
77
94
|
{
|
|
78
95
|
foreach (PreviewMessageAttribute attribute in previewAttributes)
|
|
79
96
|
{
|
|
80
|
-
attribute.PrintCustomAttributeInfo(
|
|
97
|
+
attribute.PrintCustomAttributeInfo(appendAttributeMessage);
|
|
81
98
|
}
|
|
99
|
+
psCmdlet.WriteWarning(sb.ToString());
|
|
82
100
|
}
|
|
83
101
|
}
|
|
84
102
|
|
|
85
|
-
|
|
86
103
|
/**
|
|
87
104
|
* This function takes in a CommandInfo (CmdletInfo or FunctionInfo)
|
|
88
105
|
* And returns all the deprecation attributes attached to it
|
|
@@ -124,6 +141,12 @@ namespace Microsoft.Message.ClientRuntime
|
|
|
124
141
|
}
|
|
125
142
|
return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo));
|
|
126
143
|
}
|
|
144
|
+
|
|
145
|
+
public static bool ContainsPreviewAttribute(CommandInfo commandInfo, InvocationInfo invocationInfo)
|
|
146
|
+
{
|
|
147
|
+
return GetAllPreviewAttributesInType(commandInfo, invocationInfo)?.Count() > 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
127
150
|
private static IEnumerable<PreviewMessageAttribute> GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo)
|
|
128
151
|
{
|
|
129
152
|
List<PreviewMessageAttribute> attributeList = new List<PreviewMessageAttribute>();
|
|
@@ -734,7 +734,7 @@ namespace Microsoft.generated.runtime.Properties
|
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
/// <summary>
|
|
737
|
-
/// Looks up a localized string similar to Note :The change is expected to take effect from
|
|
737
|
+
/// Looks up a localized string similar to Note :The change is expected to take effect from version : '{0}'
|
|
738
738
|
///
|
|
739
739
|
///.
|
|
740
740
|
/// </summary>
|
|
@@ -746,6 +746,19 @@ namespace Microsoft.generated.runtime.Properties
|
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
|
|
749
|
+
/// <summary>
|
|
750
|
+
/// Looks up a localized string similar to Note :The change is expected to take effect from az version : '{0}'
|
|
751
|
+
///
|
|
752
|
+
///.
|
|
753
|
+
/// </summary>
|
|
754
|
+
public static string BreakingChangesAttributesInEffectByAzVersion
|
|
755
|
+
{
|
|
756
|
+
get
|
|
757
|
+
{
|
|
758
|
+
return ResourceManager.GetString("BreakingChangesAttributesInEffectByAzVersion", resourceCulture);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
|
|
749
762
|
/// <summary>
|
|
750
763
|
/// Looks up a localized string similar to ```powershell
|
|
751
764
|
///# Old
|
|
@@ -3122,7 +3135,16 @@ namespace Microsoft.generated.runtime.Properties
|
|
|
3122
3135
|
}
|
|
3123
3136
|
|
|
3124
3137
|
/// <summary>
|
|
3125
|
-
///
|
|
3138
|
+
/// Looks up a localized string similar to The estimated generally available date is '{0}'..
|
|
3139
|
+
/// </summary>
|
|
3140
|
+
public static string PreviewCmdletETAMessage {
|
|
3141
|
+
get {
|
|
3142
|
+
return ResourceManager.GetString("PreviewCmdletETAMessage", resourceCulture);
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
/// <summary>
|
|
3147
|
+
/// Looks up a localized string similar to This cmdlet is in preview. Its behavior is subject to change based on customer feedback..
|
|
3126
3148
|
/// </summary>
|
|
3127
3149
|
public static string PreviewCmdletMessage
|
|
3128
3150
|
{
|
|
@@ -5630,4 +5652,4 @@ namespace Microsoft.generated.runtime.Properties
|
|
|
5630
5652
|
}
|
|
5631
5653
|
}
|
|
5632
5654
|
}
|
|
5633
|
-
}
|
|
5655
|
+
}
|
|
@@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can
|
|
|
1705
1705
|
</data>
|
|
1706
1706
|
<data name="BreakingChangesAttributesInEffectByVersion" xml:space="preserve">
|
|
1707
1707
|
<value>
|
|
1708
|
-
- The change is expected to take effect from
|
|
1708
|
+
- The change is expected to take effect from version : '{0}'</value>
|
|
1709
1709
|
</data>
|
|
1710
1710
|
<data name="BreakingChangesAttributesUsageChangeMessage" xml:space="preserve">
|
|
1711
1711
|
<value>```powershell
|
|
@@ -1736,6 +1736,12 @@ The type of the parameter is changing from '{0}' to '{1}'.</value>
|
|
|
1736
1736
|
Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.</value>
|
|
1737
1737
|
</data>
|
|
1738
1738
|
<data name="PreviewCmdletMessage" xml:space="preserve">
|
|
1739
|
-
<value>This cmdlet is in preview.
|
|
1739
|
+
<value>This cmdlet is in preview. Its behavior is subject to change based on customer feedback.</value>
|
|
1740
|
+
</data>
|
|
1741
|
+
<data name="PreviewCmdletETAMessage" xml:space="preserve">
|
|
1742
|
+
<value> The estimated generally available date is '{0}'.</value>
|
|
1743
|
+
</data>
|
|
1744
|
+
<data name="BreakingChangesAttributesInEffectByAzVersion" xml:space="preserve">
|
|
1745
|
+
<value>- The change is expected to take effect from Az version : '{0}'</value>
|
|
1740
1746
|
</data>
|
|
1741
1747
|
</root>
|
|
@@ -11,6 +11,8 @@ namespace Microsoft.Rest.ClientRuntime
|
|
|
11
11
|
using System.Threading.Tasks;
|
|
12
12
|
using System.Collections;
|
|
13
13
|
using System.Linq;
|
|
14
|
+
using System;
|
|
15
|
+
|
|
14
16
|
|
|
15
17
|
/// <summary>
|
|
16
18
|
/// The interface for sending an HTTP request across the wire.
|
|
@@ -70,6 +72,7 @@ namespace Microsoft.Rest.ClientRuntime
|
|
|
70
72
|
|
|
71
73
|
public partial class HttpPipeline : ISendAsync
|
|
72
74
|
{
|
|
75
|
+
private const int DefaultMaxRetry = 3;
|
|
73
76
|
private ISendAsync pipeline;
|
|
74
77
|
private ISendAsyncTerminalFactory terminal;
|
|
75
78
|
private List<ISendAsyncFactory> steps = new List<ISendAsyncFactory>();
|
|
@@ -92,6 +95,111 @@ namespace Microsoft.Rest.ClientRuntime
|
|
|
92
95
|
/// </summary>
|
|
93
96
|
public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline };
|
|
94
97
|
|
|
98
|
+
private bool shouldRetry429(HttpResponseMessage response)
|
|
99
|
+
{
|
|
100
|
+
if (response.StatusCode == (System.Net.HttpStatusCode)429)
|
|
101
|
+
{
|
|
102
|
+
var retryAfter = response.Headers.RetryAfter;
|
|
103
|
+
if (retryAfter != null && retryAfter.Delta.HasValue)
|
|
104
|
+
{
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
/// <summary>
|
|
111
|
+
/// The step to handle 429 response with retry-after header.
|
|
112
|
+
/// </summary>
|
|
113
|
+
public async Task<HttpResponseMessage> Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next)
|
|
114
|
+
{
|
|
115
|
+
int retryCount = int.MaxValue;
|
|
116
|
+
|
|
117
|
+
try
|
|
118
|
+
{
|
|
119
|
+
try
|
|
120
|
+
{
|
|
121
|
+
retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429"));
|
|
122
|
+
}
|
|
123
|
+
finally
|
|
124
|
+
{
|
|
125
|
+
retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429"));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (System.Exception)
|
|
129
|
+
{
|
|
130
|
+
//no action
|
|
131
|
+
}
|
|
132
|
+
var cloneRequest = await request.CloneWithContent();
|
|
133
|
+
var response = await next.SendAsync(request, callback);
|
|
134
|
+
int count = 0;
|
|
135
|
+
while (shouldRetry429(response) && count++ < retryCount)
|
|
136
|
+
{
|
|
137
|
+
request = await cloneRequest.CloneWithContent();
|
|
138
|
+
var retryAfter = response.Headers.RetryAfter;
|
|
139
|
+
await Task.Delay(retryAfter.Delta.Value, callback.Token);
|
|
140
|
+
await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds.");
|
|
141
|
+
response = await next.SendAsync(request, callback);
|
|
142
|
+
}
|
|
143
|
+
return response;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private bool shouldRetryError(HttpResponseMessage response)
|
|
147
|
+
{
|
|
148
|
+
if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError)
|
|
149
|
+
{
|
|
150
|
+
if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented &&
|
|
151
|
+
response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported)
|
|
152
|
+
{
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout)
|
|
157
|
+
{
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null)
|
|
161
|
+
{
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/// <summary>
|
|
168
|
+
/// Returns true if status code in HttpRequestExceptionWithStatus exception is greater
|
|
169
|
+
/// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505).
|
|
170
|
+
/// Or it's 429 (TOO MANY REQUESTS) without Retry-After header.
|
|
171
|
+
/// </summary>
|
|
172
|
+
public async Task<HttpResponseMessage> RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next)
|
|
173
|
+
{
|
|
174
|
+
int retryCount = DefaultMaxRetry;
|
|
175
|
+
|
|
176
|
+
try
|
|
177
|
+
{
|
|
178
|
+
try
|
|
179
|
+
{
|
|
180
|
+
retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES"));
|
|
181
|
+
}
|
|
182
|
+
finally
|
|
183
|
+
{
|
|
184
|
+
retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES"));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch (System.Exception)
|
|
188
|
+
{
|
|
189
|
+
//no action
|
|
190
|
+
}
|
|
191
|
+
var cloneRequest = await request.CloneWithContent();
|
|
192
|
+
var response = await next.SendAsync(request, callback);
|
|
193
|
+
int count = 0;
|
|
194
|
+
while (shouldRetryError(response) && count++ < retryCount)
|
|
195
|
+
{
|
|
196
|
+
await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}");
|
|
197
|
+
request = await cloneRequest.CloneWithContent();
|
|
198
|
+
response = await next.SendAsync(request, callback);
|
|
199
|
+
}
|
|
200
|
+
return response;
|
|
201
|
+
}
|
|
202
|
+
|
|
95
203
|
public ISendAsyncTerminalFactory TerminalFactory
|
|
96
204
|
{
|
|
97
205
|
get => terminal;
|
|
@@ -117,6 +225,11 @@ namespace Microsoft.Rest.ClientRuntime
|
|
|
117
225
|
|
|
118
226
|
// create the pipeline from scratch.
|
|
119
227
|
var next = terminal.Create();
|
|
228
|
+
if (Convert.ToBoolean(@"${$project.enableApiRetry}"))
|
|
229
|
+
{
|
|
230
|
+
next = (new SendAsyncFactory(Retry429)).Create(next) ?? next;
|
|
231
|
+
next = (new SendAsyncFactory(RetryError)).Create(next) ?? next;
|
|
232
|
+
}
|
|
120
233
|
foreach (var factory in steps)
|
|
121
234
|
{
|
|
122
235
|
// skip factories that return null.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%if(!method.extensions || !method.extensions['x-ms-long-running-operation']) {-%>
|
|
2
|
-
<%- include('method', {method: method}) %>
|
|
2
|
+
<%- include('method', {method: method, clientPrefix: clientPrefix}) %>
|
|
3
3
|
<%} else {-%>
|
|
4
|
-
<%- include('longRunningOperationMethod', {method: method}) %>
|
|
4
|
+
<%- include('longRunningOperationMethod', {method: method, clientPrefix: clientPrefix}) %>
|
|
5
5
|
<%};-%>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- project.commentHeader %>
|
|
2
|
-
<% var key = methodGroup.$key
|
|
2
|
+
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
|
3
3
|
|
|
4
4
|
namespace <%- project.namespace %>
|
|
5
5
|
{
|
|
@@ -40,7 +40,7 @@ namespace <%- project.namespace %>
|
|
|
40
40
|
public <%-client%> Client { get; private set; }
|
|
41
41
|
|
|
42
42
|
<% methodGroup.operations.forEach(function(method){ -%>
|
|
43
|
-
<%- include('azureMethod', {method: method}) -%>
|
|
43
|
+
<%- include('azureMethod', {method: method, clientPrefix: '.Client'}) -%>
|
|
44
44
|
<% }); -%>
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -10,7 +10,7 @@ namespace <%- project.namespace %>
|
|
|
10
10
|
|
|
11
11
|
<% if (project.model.info.description) { -%>
|
|
12
12
|
/// <summary>
|
|
13
|
-
///
|
|
13
|
+
/// <%=project.helper.wrapComments(' ', '/// ', project.model.info.description)%>
|
|
14
14
|
/// </summary>
|
|
15
15
|
<% } -%>
|
|
16
16
|
<% var client = project.model.info.title -%>
|
|
@@ -28,8 +28,8 @@ namespace <%- project.namespace %>
|
|
|
28
28
|
/// </summary>
|
|
29
29
|
private void Initialize()
|
|
30
30
|
{
|
|
31
|
-
<% project.model.operationGroups.forEach(function(methodGroup){ -%>
|
|
32
|
-
<% var key = methodGroup.$key
|
|
31
|
+
<% project.model.operationGroups.filter(methodGroup => methodGroup.$key != '').forEach(function(methodGroup){ -%>
|
|
32
|
+
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
|
33
33
|
this.<%- project.helper.PascalCase(methodGroup.$key) %> = new <%- project.helper.PascalCase(key) %>Operations(this);
|
|
34
34
|
<% }); -%>
|
|
35
35
|
this.BaseUri = new System.Uri("https://management.azure.com");
|
|
@@ -74,7 +74,14 @@ namespace <%- project.namespace %>
|
|
|
74
74
|
DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter());
|
|
75
75
|
<% } -%>
|
|
76
76
|
DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter());
|
|
77
|
-
<%# ToDo: Add method whose group is empty, and need to check in which case the group is empty.-%>
|
|
78
77
|
}
|
|
78
|
+
<%# ToDo: Add method whose group is empty, and need to check in which case the group is empty.-%>
|
|
79
|
+
<% var methodGroupWithoutKey = (project.state.model.operationGroups || []).filter(op => op.$key == '')
|
|
80
|
+
if (methodGroupWithoutKey.length > 0) {
|
|
81
|
+
var methodGroup = methodGroupWithoutKey[0]
|
|
82
|
+
methodGroup.operations.forEach(function(method){
|
|
83
|
+
-%>
|
|
84
|
+
<%- include('azureMethod', {method: method, clientPrefix: ''}) -%>
|
|
85
|
+
<% });} -%>
|
|
79
86
|
}
|
|
80
87
|
}
|
|
@@ -17,7 +17,7 @@ namespace <%- project.namespace %>.Models
|
|
|
17
17
|
if (item.language.default.description) {
|
|
18
18
|
-%>
|
|
19
19
|
/// <summary>
|
|
20
|
-
///
|
|
20
|
+
/// <%=project.helper.wrapComments(' ', '/// ', item.language.default.description)%>
|
|
21
21
|
/// </summary>
|
|
22
22
|
<% } -%>
|
|
23
23
|
[System.Runtime.Serialization.EnumMember(Value = "<%-item.value%>")]
|
|
@@ -63,10 +63,10 @@ if (item.language.default.description) {
|
|
|
63
63
|
<%model.choices.forEach(function(choice){-%>
|
|
64
64
|
<%if(choice.language.default.description){-%>
|
|
65
65
|
/// <summary>
|
|
66
|
-
///
|
|
66
|
+
/// <%=project.helper.wrapComments(' ', '/// ', choice.language.default.description)%>
|
|
67
67
|
/// </summary>
|
|
68
68
|
<%}-%>
|
|
69
|
-
public const string <%-choice.language.default.name%> = "<%-choice.value%>";
|
|
69
|
+
public const string <%-project.helper.GetValidCsharpName(choice.language.default.name)%> = "<%-choice.value%>";
|
|
70
70
|
<%});-%>
|
|
71
71
|
}
|
|
72
72
|
<% } -%>
|