@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
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
<% var key = methodGroup.$key
|
|
1
|
+
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
|
2
|
+
<% var OperationsName = clientName != '' ? clientName : project.helper.PascalCase(key) + 'Operations'-%>
|
|
2
3
|
<%# ToDo: currently assume the SyncMethodsGenerationMode is Essential type, and need to add support for other types -%>
|
|
3
4
|
/// <summary>
|
|
4
|
-
/// <%=method.language.default.description%>
|
|
5
|
+
/// <%=project.helper.wrapComments(' ', '/// ', method.language.default.description)%>
|
|
5
6
|
<%# ToDo: add support for externaldocsurl -%>
|
|
6
7
|
/// </summary>
|
|
7
8
|
<%# ToDo: add <remarks> if there are both description and summary -%>
|
|
8
9
|
/// <param name='operations'>
|
|
9
10
|
/// The operations group for this extension method.
|
|
10
11
|
/// </param>
|
|
11
|
-
<% if(method.parameters && !method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.implementation != 'Client' && !project.helper.IsConstantParameter(p)).forEach(function (parameter) {-%>
|
|
12
|
+
<% if(method.parameters && !method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.implementation != 'Client' && !project.helper.IsConstantParameter(p) && p.protocol.http?.in != 'complexHeader' && !(p.extensions && p.extensions['x-ms-parameter-grouping'])).forEach(function (parameter) {-%>
|
|
12
13
|
/// <param name='<%-parameter.language.default.name%>'>
|
|
13
|
-
/// <%=parameter.language.default.description%>
|
|
14
|
+
/// <%=project.helper.wrapComments(' ', '/// ', parameter.language.default.description)%>
|
|
14
15
|
/// </param>
|
|
15
16
|
<% });}-%>
|
|
16
17
|
<% if(method.language.default.pageable?.nextPageOperation) {-%>
|
|
@@ -20,27 +21,27 @@
|
|
|
20
21
|
<% } -%>
|
|
21
22
|
<%# ToDo: add support for GetObsoleteAttribute-%>
|
|
22
23
|
<%# ToDo: add support for AccessModifier, assume public for the time being-%>
|
|
23
|
-
public static <%-method.language.default.returnType%> <%-method.language.default.name%>(this I<%-
|
|
24
|
+
public static <%-method.language.default.returnType%> <%-method.language.default.name%>(this I<%-OperationsName%> operations<%- method.language.default.syncMethodParameterDeclaration ? ', ' + method.language.default.syncMethodParameterDeclaration: '' %>)
|
|
24
25
|
{
|
|
25
26
|
<%# ToDo: need to handle different return type, body, header and the others including no return type-%>
|
|
26
27
|
<% if(method.language.default.returnType != 'void') {-%>
|
|
27
|
-
return ((I<%-
|
|
28
|
+
return ((I<%-OperationsName%>)operations).<%-method.language.default.name%>Async(<%-method.language.default.syncMethodInvocationArgs%>).GetAwaiter().GetResult();
|
|
28
29
|
<% } else { -%>
|
|
29
|
-
((I<%-
|
|
30
|
+
((I<%-OperationsName%>)operations).<%-method.language.default.name%>Async(<%-method.language.default.syncMethodInvocationArgs%>).GetAwaiter().GetResult();
|
|
30
31
|
<% } -%>
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/// <summary>
|
|
34
|
-
/// <%=method.language.default.description%>
|
|
35
|
+
/// <%=project.helper.wrapComments(' ', '/// ', method.language.default.description)%>
|
|
35
36
|
<%# ToDo: add support for externaldocsurl -%>
|
|
36
37
|
/// </summary>
|
|
37
38
|
<%# ToDo: add <remarks> if there are both description and summary -%>
|
|
38
39
|
/// <param name='operations'>
|
|
39
40
|
/// The operations group for this extension method.
|
|
40
41
|
/// </param>
|
|
41
|
-
<% if(method.parameters && !method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.implementation != 'Client' && !project.helper.IsConstantParameter(p)).forEach(function (parameter) {-%>
|
|
42
|
+
<% if(method.parameters && !method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.implementation != 'Client' && !project.helper.IsConstantParameter(p) && p.protocol.http?.in != 'complexHeader' && !p.readOnly && !(p.extensions && p.extensions['x-ms-parameter-grouping'])).forEach(function (parameter) {-%>
|
|
42
43
|
/// <param name='<%-parameter.language.default.name%>'>
|
|
43
|
-
/// <%=parameter.language.default.description%>
|
|
44
|
+
/// <%=project.helper.wrapComments(' ', '/// ', parameter.language.default.description)%>
|
|
44
45
|
/// </param>
|
|
45
46
|
<% });}-%>
|
|
46
47
|
<% if(method.language.default.pageable?.nextPageOperation) {-%>
|
|
@@ -53,15 +54,20 @@
|
|
|
53
54
|
/// </param>
|
|
54
55
|
<%# ToDo: add support for GetObsoleteAttribute-%>
|
|
55
56
|
<%# ToDo: add support for AccessModifier, assume public for the time being-%>
|
|
56
|
-
public static async System.Threading.Tasks.Task<%- method.language.default.returnType != 'void' ? '<' + method.language.default.returnType + '>' : ''%> <%-method.language.default.name%>Async(this I<%-
|
|
57
|
+
public static async System.Threading.Tasks.Task<%- method.language.default.returnType != 'void' ? '<' + method.language.default.returnType + '>' : ''%> <%-method.language.default.name%>Async(this I<%-OperationsName%> operations<%- method.language.default.asyncMethodParameterDeclaration ? ', ' + method.language.default.asyncMethodParameterDeclaration: '' %>)
|
|
57
58
|
{
|
|
58
59
|
<%# ToDo: need to handle different return type, body, header and the others including no return type-%>
|
|
59
60
|
<% if(method.language.default.returnType != 'void') {-%>
|
|
60
|
-
|
|
61
|
+
<% if(method.language.default.returnType == 'System.IO.Stream') {-%>
|
|
62
|
+
var _result = await operations.<%-method.language.default.name%>WithHttpMessagesAsync(<%-method.language.default.asyncMethodInvocationArgs%>).ConfigureAwait(false);
|
|
63
|
+
_result.Request.Dispose();
|
|
64
|
+
return _result.Body;
|
|
65
|
+
<% } else {-%>
|
|
61
66
|
using (var _result = await operations.<%-method.language.default.name%>WithHttpMessagesAsync(<%-method.language.default.asyncMethodInvocationArgs%>).ConfigureAwait(false))
|
|
62
67
|
{
|
|
63
68
|
return <%- method.language.default.responseType.startsWith('Microsoft.Rest.Azure.AzureOperationResponse') ? '_result.Body' : '_result.Headers'%>;
|
|
64
69
|
}
|
|
70
|
+
<% }-%>
|
|
65
71
|
<% } else { -%>
|
|
66
72
|
(await operations.<%-method.language.default.name%>WithHttpMessagesAsync(<%-method.language.default.asyncMethodInvocationArgs%>).ConfigureAwait(false)).Dispose();
|
|
67
73
|
<% }-%>
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
<%- project.commentHeader %>
|
|
2
|
-
<% var key = methodGroup.$key
|
|
2
|
+
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
|
3
3
|
namespace <%- project.namespace %>
|
|
4
4
|
{
|
|
5
5
|
<% project.model.usings.forEach(function(using){ -%>
|
|
6
6
|
using <%- using %>;
|
|
7
7
|
<% }); -%>
|
|
8
8
|
|
|
9
|
+
<%if (clientName != '') {-%>
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// Extension methods for <%- clientName %>
|
|
12
|
+
/// </summary>
|
|
13
|
+
public static partial class <%- clientName %>Extensions
|
|
14
|
+
<% } else {-%>
|
|
9
15
|
/// <summary>
|
|
10
16
|
/// Extension methods for <%- project.helper.PascalCase(key) %>Operations
|
|
11
17
|
/// </summary>
|
|
12
18
|
public static partial class <%- project.helper.PascalCase(key) %>OperationsExtensions
|
|
19
|
+
<% }-%>
|
|
13
20
|
{
|
|
14
21
|
<% methodGroup.operations.forEach(function(method){ -%>
|
|
15
22
|
<%# ToDo: add support for ExcludeFromInterface-%>
|
|
16
|
-
<%- include('extensionMethod', {method: method, group: methodGroup, project: project}) %>
|
|
23
|
+
<%- include('extensionMethod', {method: method, group: methodGroup, project: project, clientName: clientName}) %>
|
|
17
24
|
<% }); -%>
|
|
18
25
|
}
|
|
19
26
|
}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
<% if (method.language.default.description) {-%>
|
|
2
2
|
/// <summary>
|
|
3
|
-
/// <%= method.language.default.description%>
|
|
3
|
+
/// <%=project.helper.wrapComments(' ', '/// ', method.language.default.description)%>
|
|
4
4
|
<%# ToDo: add externaldocsurl -%>
|
|
5
5
|
/// </summary>
|
|
6
6
|
<% };-%>
|
|
7
7
|
<%# ToDo: add remark if both description and summary is provided, question here is in m4, there is no summary provided-%>
|
|
8
|
-
<% if(method.parameters&&!method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.implementation != 'Client' && !project.helper.IsConstantParameter(p)).forEach(function (parameter) {-%>
|
|
8
|
+
<% if(method.parameters&&!method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.implementation != 'Client' && !project.helper.IsConstantParameter(p) && !(p.extensions && p.extensions['x-ms-parameter-grouping'])).forEach(function (parameter) {-%>
|
|
9
9
|
<%# ToDo: should use camel name instead of pascal name here -%>
|
|
10
10
|
/// <param name='<%-parameter.language.default.name%>'>
|
|
11
|
-
/// <%=parameter.language.default.description%>
|
|
11
|
+
/// <%=project.helper.wrapComments(' ', '/// ', parameter.language.default.description)%>
|
|
12
12
|
/// </param>
|
|
13
13
|
<% });}-%>
|
|
14
|
-
<% (method.
|
|
14
|
+
<% if(!method.language.default.pageable?.nextPageOperation) {-%>
|
|
15
|
+
<% (method.requests[0].parameters || []).filter(p=>p.protocol.http.in == 'body' && !project.helper.IsConstantEnumParameter(p)).forEach(function(parameter){-%>
|
|
15
16
|
<%if(parameter.extensions && parameter.extensions['x-ms-client-flatten'] ) {-%>
|
|
16
|
-
<%project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties).filter(p => !project.helper.
|
|
17
|
+
<%project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties).filter(p => !project.helper.IsConstantEnumProperty(p) && !p.readOnly).forEach(function(vp) {-%>
|
|
17
18
|
/// <param name='<%-vp.property.language.default.name%>'>
|
|
18
|
-
/// <%= vp.property.language.default.description%>
|
|
19
|
+
/// <%=project.helper.wrapComments(' ', '/// ', vp.property.language.default.description)%>
|
|
19
20
|
/// </param>
|
|
20
21
|
<%});-%>
|
|
21
22
|
<%} else {-%>
|
|
22
23
|
/// <param name='<%-parameter.language.default.name%>'>
|
|
23
|
-
/// <%= parameter.language.default.description%>
|
|
24
|
+
/// <%=project.helper.wrapComments(' ', '/// ', parameter.language.default.description)%>
|
|
24
25
|
/// </param>
|
|
25
26
|
<%}-%>
|
|
26
27
|
<% });-%>
|
|
28
|
+
<% } -%>
|
|
27
29
|
<% if(method.language.default.pageable?.nextPageOperation) {-%>
|
|
28
30
|
/// <param name='nextPageLink'>
|
|
29
31
|
/// The NextLink from the previous successful call to List operation.
|
|
@@ -39,5 +41,5 @@
|
|
|
39
41
|
{
|
|
40
42
|
// Send Request
|
|
41
43
|
<%-method.language.default.responseType%> _response = await Begin<%-method.language.default.name%>WithHttpMessagesAsync(<%-method.language.default.asyncMethodInvocationArgsWithCustomerHeaders%>).ConfigureAwait(false);
|
|
42
|
-
return await this
|
|
44
|
+
return await this<%-clientPrefix%>.<%-(method.requests[0].protocol.http.method == 'put' || method.requests[0].protocol.http.method == 'patch')?'GetPutOrPatch':(method.requests[0].protocol.http.method == 'post' || method.requests[0].protocol.http.method == 'delete')?'GetPostOrDelete':''%>OperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
|
|
43
45
|
}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
<% if (method.language.default.description) {-%>
|
|
2
2
|
/// <summary>
|
|
3
|
-
/// <%= method.language.default.description%>
|
|
3
|
+
/// <%=project.helper.wrapComments(' ', '/// ', method.language.default.description)%>
|
|
4
4
|
<%# ToDo: add externaldocsurl -%>
|
|
5
5
|
/// </summary>
|
|
6
6
|
<% };-%>
|
|
7
7
|
<%# ToDo: add remark if both description and summary is provided, question here is in m4, there is no summary provided-%>
|
|
8
|
-
<% if(method.parameters&&!method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.implementation != 'Client' && !project.helper.IsConstantParameter(p)).forEach(function (parameter) {-%>
|
|
8
|
+
<% if(method.parameters&&!method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.implementation != 'Client' && !project.helper.IsConstantParameter(p) && p.protocol.http?.in != 'complexHeader' && !(p.extensions && p.extensions['x-ms-parameter-grouping'])).forEach(function (parameter) {-%>
|
|
9
9
|
<%# ToDo: should use camel name instead of pascal name here -%>
|
|
10
10
|
/// <param name='<%-parameter.language.default.name%>'>
|
|
11
|
-
/// <%=parameter.language.default.description%>
|
|
11
|
+
/// <%=project.helper.wrapComments(' ', '/// ', parameter.language.default.description)%>
|
|
12
12
|
/// </param>
|
|
13
13
|
<% });}-%>
|
|
14
|
-
<% (method.
|
|
14
|
+
<% if(!method.language.default.pageable?.nextPageOperation) {-%>
|
|
15
|
+
<% (method.requests[0].parameters || []).filter(p=>p.protocol.http.in == 'body' && !project.helper.IsConstantEnumParameter(p)).forEach(function(parameter){-%>
|
|
15
16
|
<%if(parameter.extensions && parameter.extensions['x-ms-client-flatten'] ) {-%>
|
|
16
|
-
<%project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties).filter(p => !project.helper.
|
|
17
|
+
<%project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties).filter(p => !project.helper.IsConstantEnumProperty(p) && !p.readOnly).forEach(function(vp) {-%>
|
|
17
18
|
/// <param name='<%-vp.property.language.default.name%>'>
|
|
18
|
-
/// <%= vp.property.language.default.description%>
|
|
19
|
+
/// <%=project.helper.wrapComments(' ', '/// ', vp.property.language.default.description)%>
|
|
19
20
|
/// </param>
|
|
20
21
|
<%});-%>
|
|
21
22
|
<%} else {-%>
|
|
22
23
|
/// <param name='<%-parameter.language.default.name%>'>
|
|
23
|
-
/// <%= parameter.language.default.description%>
|
|
24
|
+
/// <%=project.helper.wrapComments(' ', '/// ', parameter.language.default.description)%>
|
|
24
25
|
/// </param>
|
|
25
26
|
<%}-%>
|
|
26
27
|
<% });-%>
|
|
28
|
+
<% } -%>
|
|
27
29
|
<% if(method.language.default.pageable?.nextPageOperation) {-%>
|
|
28
30
|
/// <param name='nextPageLink'>
|
|
29
31
|
/// The NextLink from the previous successful call to List operation.
|
|
@@ -61,5 +63,5 @@
|
|
|
61
63
|
{
|
|
62
64
|
<%# ToDo: add support for method.Flavor, currently assume it is RestCall -%>
|
|
63
65
|
|
|
64
|
-
<%- include('methodBodyRestCall', {method: method}) -%>
|
|
66
|
+
<%- include('methodBodyRestCall', {method: method, clientPrefix: clientPrefix}) -%>
|
|
65
67
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
<% if(!method.language.default.pageable?.nextPageOperation) { %>
|
|
1
2
|
<%- project.helper.HandleConstParameters(method)%>
|
|
3
|
+
<% } -%>
|
|
2
4
|
<%# handle x-ms-client-request-id -%>
|
|
3
5
|
<% var clientRequestId = 'x-ms-client-request-id';
|
|
4
6
|
var requestId = 'x-ms-request-id';
|
|
@@ -17,30 +19,35 @@ if (method.extensions && method.extensions['x-ms-request-id']) {
|
|
|
17
19
|
{
|
|
18
20
|
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
|
|
19
21
|
}
|
|
22
|
+
<%(method.parameters || []).filter(p => p.protocol.http.in == 'complexHeader').forEach(function(parameter) {-%>
|
|
23
|
+
<%-project.helper.PopulateGroupParameters(parameter)%>
|
|
24
|
+
<%});-%>
|
|
20
25
|
<% }else{-%>
|
|
21
26
|
<% (method.requests[0].parameters || []).filter(p=>p.protocol.http.in == 'body').forEach(function(parameter){-%>
|
|
22
27
|
<%if(!(parameter.extensions && parameter.extensions['x-ms-client-flatten'])) {-%>
|
|
23
|
-
<% if (!project.helper.IsValueType(parameter.schema.type) && parameter.required && !project.helper.
|
|
28
|
+
<% if (!project.helper.IsValueType(parameter.schema.type) && !project.helper.IsEnum(parameter.schema) && parameter.required && !project.helper.IsConstantEnumParameter(parameter)) { -%>
|
|
24
29
|
if (<%-parameter.language.default.name%> == null)
|
|
25
30
|
{
|
|
26
31
|
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "<%-parameter.language.default.name%>");
|
|
27
32
|
}
|
|
28
33
|
<% } -%>
|
|
29
34
|
<%if(method.requests[0].protocol.http.method != 'patch') {-%>
|
|
30
|
-
|
|
35
|
+
<%# for odata, validation is not needed. -%>
|
|
36
|
+
<%-parameter.extensions && parameter.extensions['x-ms-odata'] ? '' : project.helper.ValidateType(parameter.schema, method, parameter.language.default.name, parameter.nullable != false)%>
|
|
31
37
|
<%}-%>
|
|
32
38
|
<%}-%>
|
|
33
39
|
<% });-%>
|
|
34
40
|
<% if(method.parameters) { method.parameters.filter(p => (p.schema.type != 'constant' && p.language.default.name != '$host') || p.language.default.name == 'ApiVersion').forEach(function (parameter) {-%>
|
|
35
41
|
<%# ToDo: add check IsNullable with required -%>
|
|
36
|
-
<% var prefix = parameter.implementation == 'Client' ?
|
|
37
|
-
<% if ( !(parameter.extensions && parameter.extensions['x-ms-parameter-grouping']) && parameter.required && !project.helper.IsValueType(parameter.schema.type) && !project.helper.
|
|
42
|
+
<% var prefix = parameter.implementation == 'Client' ? `this${clientPrefix}.` : ''-%>
|
|
43
|
+
<% if ( !(parameter.extensions && parameter.extensions['x-ms-parameter-grouping']) && parameter.required && !project.helper.IsValueType(parameter.schema.type) && !project.helper.IsEnum(parameter.schema) && !project.helper.IsConstantEnumParameter(parameter)) {-%>
|
|
38
44
|
if (<%-prefix%><%-parameter.language.default.name%> == null)
|
|
39
45
|
{
|
|
40
46
|
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "<%-prefix%><%-parameter.language.default.name%>");
|
|
41
47
|
}
|
|
42
48
|
<% } -%>
|
|
43
|
-
|
|
49
|
+
<%# for odata, validation is not needed. -%>
|
|
50
|
+
<%- parameter.extensions && parameter.extensions['x-ms-odata'] ? '' : project.helper.ValidateType(parameter.schema, method, prefix + parameter.language.default.name, parameter.nullable != false)%>
|
|
44
51
|
<%});}-%>
|
|
45
52
|
<%(method.parameters || []).filter(p => p.protocol.http.in == 'complex').forEach(function(parameter) {-%>
|
|
46
53
|
<%-project.helper.PopulateGroupParameters(parameter)%>
|
|
@@ -51,16 +58,27 @@ if (method.extensions && method.extensions['x-ms-request-id']) {
|
|
|
51
58
|
<%});-%>
|
|
52
59
|
<%# ToDo: add support for BuildInputMappings -%>
|
|
53
60
|
<% (method.requests[0].parameters || []).filter(p=>p.protocol.http.in == 'body').forEach(function(parameter){-%>
|
|
54
|
-
<%if(parameter.extensions && parameter.extensions['x-ms-client-flatten']) {
|
|
61
|
+
<%if(parameter.extensions && parameter.extensions['x-ms-client-flatten']) {
|
|
62
|
+
var vps = project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties).filter(vp => !project.helper.IsConstantEnumProperty(vp) && !vp.readOnly);
|
|
63
|
+
parameter.language.default.name = project.helper.GetUniqueName(parameter.language.default.name, vps.map(function(vp) {return vp.property.language.default.name;}));
|
|
64
|
+
|
|
65
|
+
-%>
|
|
55
66
|
<%-parameter.schema.language.default.name%> <%-parameter.language.default.name%> = new <%-parameter.schema.language.default.name%>();
|
|
56
|
-
<% var
|
|
57
|
-
|
|
67
|
+
<% var vpsWithNullCheck = vps.filter(virtualProperty => project.helper.IsNullCheckRequiredForVirtualProperty(virtualProperty));
|
|
68
|
+
var vpsWithoutNullCheck = vps.filter(virtualProperty => !project.helper.IsNullCheckRequiredForVirtualProperty(virtualProperty));
|
|
69
|
+
-%>
|
|
70
|
+
<% if(vpsWithNullCheck.length > 0) {-%>
|
|
71
|
+
if(<%-vpsWithNullCheck.map(vp=>`${vp.property.language.default.name} != null`).join('||')%>)
|
|
58
72
|
{
|
|
59
|
-
<%
|
|
73
|
+
<%vpsWithNullCheck.forEach(function(vp) {-%>
|
|
60
74
|
<%-parameter.language.default.name%>.<%-vp.property.language.csharp.name%> = <%-vp.property.language.default.name%>;
|
|
61
75
|
<%});-%>
|
|
62
76
|
}
|
|
63
77
|
<%}-%>
|
|
78
|
+
<%vpsWithoutNullCheck.forEach(function(vp) {-%>
|
|
79
|
+
<%-parameter.language.default.name%>.<%-vp.property.language.csharp.name%> = <%-vp.property.language.default.name%>;
|
|
80
|
+
<%});-%>
|
|
81
|
+
<%}-%>
|
|
64
82
|
<% });-%>
|
|
65
83
|
<%}-%>
|
|
66
84
|
// Tracing
|
|
@@ -72,9 +90,12 @@ if (method.extensions && method.extensions['x-ms-request-id']) {
|
|
|
72
90
|
System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>();
|
|
73
91
|
<% if(method.language.default.pageable?.nextPageOperation) {-%>
|
|
74
92
|
tracingParameters.Add("nextPageLink", nextPageLink);
|
|
93
|
+
<% (method.parameters || []).filter(p => p.protocol.http.in == 'header').forEach(function(p) {-%>
|
|
94
|
+
tracingParameters.Add("<%-p.language.default.name%>", <%-p.language.default.name%>);
|
|
95
|
+
<%});-%>
|
|
75
96
|
<% }else{-%>
|
|
76
97
|
<%# ToDo: add support for Model.LogicalParameters.Where(p => !p.IsClientProperty)-%>
|
|
77
|
-
<%method.parameters.filter(p => p.implementation != 'Client' && p.protocol.http.in != 'complex').forEach(function(p) {-%>
|
|
98
|
+
<%method.parameters.filter(p => p.implementation != 'Client' && p.protocol.http.in != 'complex' && p.protocol.http.in != 'complexHeader').forEach(function(p) {-%>
|
|
78
99
|
tracingParameters.Add("<%-p.language.default.name%>", <%-p.language.default.name%>);
|
|
79
100
|
<%});-%>
|
|
80
101
|
<%# ToDo: currently we just add the unexpanded body parameter, and need to be fixed in the future %>
|
|
@@ -91,18 +112,18 @@ if (method.extensions && method.extensions['x-ms-request-id']) {
|
|
|
91
112
|
_url = _url.Replace("{nextLink}", nextPageLink);
|
|
92
113
|
<% }else{%>
|
|
93
114
|
<%# ToDo: may need to support AbsoluteUrl -%>
|
|
94
|
-
var _baseUrl = this
|
|
115
|
+
var _baseUrl = this<%-clientPrefix%>.BaseUri.AbsoluteUri;
|
|
95
116
|
<%# ToDo: buildurl, currently only added simple cases, besides we need to handle skip url encoding -%>
|
|
96
117
|
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "<%-method.requests[0].protocol.http.path.substring(1)%>").ToString();
|
|
97
118
|
<%if (method.parameters) { method.parameters.filter(p => p.protocol.http.in == 'path').forEach(function (pathParameter) {
|
|
98
|
-
var prefix = pathParameter.implementation == 'Client' ?
|
|
119
|
+
var prefix = pathParameter.implementation == 'Client' ? `this${clientPrefix}.` : '';
|
|
99
120
|
-%>
|
|
100
|
-
_url = _url.Replace("{<%-pathParameter.language.default.serializedName%>}", <%-project.helper.PathParameterString(pathParameter)%>);
|
|
121
|
+
_url = _url.Replace("{<%-pathParameter.language.default.serializedName%>}", <%-project.helper.PathParameterString(pathParameter, clientPrefix)%>);
|
|
101
122
|
<% });}-%>
|
|
102
123
|
<% }%>
|
|
103
124
|
System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>();
|
|
104
125
|
<%if (method.parameters && !method.language.default.pageable?.nextPageOperation) { method.parameters.filter(p => p.protocol.http.in == 'query').forEach(function (queryParameter) { -%>
|
|
105
|
-
<% var prefix = queryParameter.implementation == 'Client' ?
|
|
126
|
+
<% var prefix = queryParameter.implementation == 'Client' ? `this${clientPrefix}.` : ''-%>
|
|
106
127
|
<% if (queryParameter.extensions && queryParameter.extensions['x-ms-odata']) {-%>
|
|
107
128
|
if (<%-queryParameter.language.default.name%> != null)
|
|
108
129
|
{
|
|
@@ -113,10 +134,14 @@ var prefix = pathParameter.implementation == 'Client' ? 'this.Client.' : '';
|
|
|
113
134
|
}
|
|
114
135
|
}
|
|
115
136
|
<% } else {-%>
|
|
137
|
+
<% if (!queryParameter.required || (!project.helper.IsValueType(queryParameter.schema.type) && !project.helper.IsEnum(queryParameter.schema) && !(queryParameter.schema.choiceType && project.helper.IsValueType(queryParameter.schema.choiceType.type)))) {-%>
|
|
116
138
|
if (<%-prefix%><%-queryParameter.language.default.name%> != null)
|
|
117
139
|
{
|
|
118
|
-
_queryParameters.Add(string.Format("<%-queryParameter.language.default.serializedName%>={0}", <%-project.helper.PathParameterString(queryParameter)%>));
|
|
140
|
+
_queryParameters.Add(string.Format("<%-queryParameter.language.default.serializedName%>={0}", <%-project.helper.PathParameterString(queryParameter, clientPrefix)%>));
|
|
119
141
|
}
|
|
142
|
+
<% } else {-%>
|
|
143
|
+
_queryParameters.Add(string.Format("<%-queryParameter.language.default.serializedName%>={0}", <%-project.helper.PathParameterString(queryParameter, clientPrefix)%>));
|
|
144
|
+
<% } -%>
|
|
120
145
|
<% }-%>
|
|
121
146
|
<% });}-%>
|
|
122
147
|
if (_queryParameters.Count > 0)
|
|
@@ -130,27 +155,31 @@ var prefix = pathParameter.implementation == 'Client' ? 'this.Client.' : '';
|
|
|
130
155
|
_httpRequest.RequestUri = new System.Uri(_url);
|
|
131
156
|
// Set Headers
|
|
132
157
|
<%# ToDo: Add headers except for following default ones -%>
|
|
133
|
-
if (this
|
|
158
|
+
if (this<%-clientPrefix%>.GenerateClientRequestId != null && this<%-clientPrefix%>.GenerateClientRequestId.Value)
|
|
134
159
|
{
|
|
135
160
|
_httpRequest.Headers.TryAddWithoutValidation("<%-clientRequestId%>", System.Guid.NewGuid().ToString());
|
|
136
161
|
}
|
|
137
|
-
if (this
|
|
162
|
+
if (this<%-clientPrefix%>.AcceptLanguage != null)
|
|
138
163
|
{
|
|
139
164
|
if (_httpRequest.Headers.Contains("accept-language"))
|
|
140
165
|
{
|
|
141
166
|
_httpRequest.Headers.Remove("accept-language");
|
|
142
167
|
}
|
|
143
|
-
_httpRequest.Headers.TryAddWithoutValidation("accept-language", this
|
|
168
|
+
_httpRequest.Headers.TryAddWithoutValidation("accept-language", this<%-clientPrefix%>.AcceptLanguage);
|
|
144
169
|
}
|
|
145
170
|
<% (method.parameters || []).filter(p => p.protocol.http.in == 'header').forEach(function(parameter) {
|
|
146
|
-
var prefix = parameter.implementation == 'Client' ?
|
|
171
|
+
var prefix = parameter.implementation == 'Client' ? `this${clientPrefix}.` : ''-%>
|
|
147
172
|
if (<%-prefix%><%-parameter.language.default.name%> != null)
|
|
148
173
|
{
|
|
149
174
|
if (_httpRequest.Headers.Contains("<%-parameter.language.default.serializedName%>"))
|
|
150
175
|
{
|
|
151
176
|
_httpRequest.Headers.Remove("<%-parameter.language.default.serializedName%>");
|
|
152
177
|
}
|
|
178
|
+
<% if (parameter.schema.type == 'uuid') { -%>
|
|
179
|
+
_httpRequest.Headers.TryAddWithoutValidation("<%-parameter.language.default.serializedName%>", Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(<%-prefix%><%-parameter.language.default.name%>, this<%-clientPrefix%>.SerializationSettings).Trim('"'));
|
|
180
|
+
<% } else {-%>
|
|
153
181
|
_httpRequest.Headers.TryAddWithoutValidation("<%-parameter.language.default.serializedName%>", <%-prefix%><%-parameter.language.default.name%>);
|
|
182
|
+
<% } -%>
|
|
154
183
|
}
|
|
155
184
|
<% });-%>
|
|
156
185
|
|
|
@@ -167,28 +196,42 @@ var prefix = parameter.implementation == 'Client' ? 'this.Client.' : ''-%>
|
|
|
167
196
|
}
|
|
168
197
|
// Serialize Request
|
|
169
198
|
string _requestContent = null;
|
|
199
|
+
<% if(!method.language.default.pageable?.nextPageOperation) {-%>
|
|
170
200
|
<%# ToDo: add RequestBody, formdata support-%>
|
|
171
201
|
<% (method.requests[0].parameters || []).filter(p =>p.protocol.http.in == 'body').forEach(function (parameter) {-%>
|
|
172
202
|
<%# ToDo: currently only support for an unexpanded nullable body, need other support in the future -%>
|
|
173
|
-
<% if (
|
|
203
|
+
<% if (parameter.schema.type == 'binary') {
|
|
204
|
+
if (parameter.required) {-%>
|
|
205
|
+
if (<%-parameter.language.default.name%> == null)
|
|
206
|
+
{
|
|
207
|
+
throw new System.ArgumentNullException("<%-parameter.language.default.name%>");
|
|
208
|
+
}
|
|
209
|
+
<% } -%>
|
|
210
|
+
if (<%-parameter.language.default.name%> != null && <%-parameter.language.default.name%> != System.IO.Stream.Null)
|
|
211
|
+
{
|
|
212
|
+
_httpRequest.Content = new System.Net.Http.StreamContent(<%-parameter.language.default.name%>);
|
|
213
|
+
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("<%-method.requests[0].protocol.http.mediaTypes[0]%>");
|
|
214
|
+
}
|
|
215
|
+
<% } else if (!parameter.required || (!project.helper.IsValueType(parameter.schema.type) && !project.helper.IsEnum(parameter.schema) && !(parameter.schema.choiceType && project.helper.IsValueType(parameter.schema.choiceType.type)))) {-%>
|
|
174
216
|
if(<%-parameter.language.default.name%> != null)
|
|
175
217
|
{
|
|
176
|
-
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(<%-parameter.language.default.name%>, <%-project.helper.GetSerializationSettings(parameter.schema,
|
|
218
|
+
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(<%-parameter.language.default.name%>, <%-project.helper.GetSerializationSettings(parameter.schema, `this${clientPrefix}`)%>);
|
|
177
219
|
_httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
|
|
178
220
|
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
|
|
179
221
|
}
|
|
180
222
|
<% } else { -%>
|
|
181
|
-
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(<%-parameter.language.default.name%>, <%-project.helper.GetSerializationSettings(parameter.schema,
|
|
223
|
+
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(<%-parameter.language.default.name%>, <%-project.helper.GetSerializationSettings(parameter.schema, `this${clientPrefix}`)%>);
|
|
182
224
|
_httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
|
|
183
225
|
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
|
|
184
226
|
<% } -%>
|
|
185
227
|
<% });-%>
|
|
228
|
+
<% } -%>
|
|
186
229
|
<%# ToDo: Need to confirm in which case Settings.AddCredentials is false -%>
|
|
187
230
|
// Set Credentials
|
|
188
|
-
if (this
|
|
231
|
+
if (this<%-clientPrefix%>.Credentials != null)
|
|
189
232
|
{
|
|
190
233
|
cancellationToken.ThrowIfCancellationRequested();
|
|
191
|
-
await this
|
|
234
|
+
await this<%-clientPrefix%>.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
|
|
192
235
|
}
|
|
193
236
|
// Send Request
|
|
194
237
|
if (_shouldTrace)
|
|
@@ -196,9 +239,8 @@ var prefix = parameter.implementation == 'Client' ? 'this.Client.' : ''-%>
|
|
|
196
239
|
Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
|
|
197
240
|
}
|
|
198
241
|
cancellationToken.ThrowIfCancellationRequested();
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
_httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, <%-responseHeadersRead%>cancellationToken).ConfigureAwait(false);
|
|
242
|
+
<% var responseHeadersRead = method.requests[0].protocol.http.method === 'head' || method.language.default.returnType == 'System.IO.Stream' ? 'System.Net.Http.HttpCompletionOption.ResponseHeadersRead, ': '' -%>
|
|
243
|
+
_httpResponse = await this<%-clientPrefix%>.HttpClient.SendAsync(_httpRequest, <%-responseHeadersRead%>cancellationToken).ConfigureAwait(false);
|
|
202
244
|
if (_shouldTrace)
|
|
203
245
|
{
|
|
204
246
|
Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
|
|
@@ -217,7 +259,7 @@ var prefix = parameter.implementation == 'Client' ? 'this.Client.' : ''-%>
|
|
|
217
259
|
<%# ToDo: Need to add support for primary type -%>
|
|
218
260
|
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
|
|
219
261
|
<%var errorClass = !project.helper.IsCloudErrorException(method) ? method.exceptions[0].schema.language.default.name : 'CloudError'-%>
|
|
220
|
-
<%-errorClass%> _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<<%-errorClass%>>(_responseContent, this
|
|
262
|
+
<%-errorClass%> _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<<%-errorClass%>>(_responseContent, this<%-clientPrefix%>.DeserializationSettings);
|
|
221
263
|
if (_errorBody != null)
|
|
222
264
|
{
|
|
223
265
|
<% if(project.helper.IsCloudErrorException(method)) { -%>
|
|
@@ -258,11 +300,13 @@ var prefix = parameter.implementation == 'Client' ? 'this.Client.' : ''-%>
|
|
|
258
300
|
{
|
|
259
301
|
_result.RequestId = _httpResponse.Headers.GetValues("<%-requestId%>").FirstOrDefault();
|
|
260
302
|
}
|
|
261
|
-
<%(method.responses || []).filter(r => r.schema).forEach(function(resp) {-%>
|
|
303
|
+
<%(method.responses || []).filter(r => r.schema || r.binary).forEach(function(resp) {-%>
|
|
262
304
|
// Deserialize Response
|
|
263
305
|
if ((int)_statusCode == <%-resp.protocol.http.statusCodes[0]%>)
|
|
264
306
|
{
|
|
265
|
-
|
|
307
|
+
<% if(method.language.default.returnType == 'System.IO.Stream') {-%>
|
|
308
|
+
_result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
|
|
309
|
+
<% } else { -%>
|
|
266
310
|
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
|
|
267
311
|
<%# ToDo: support for XmlSerialization, guess we do not need it actually -%>
|
|
268
312
|
try
|
|
@@ -275,7 +319,7 @@ if(resp.schema.type === 'choice' || (resp.schema.type === 'sealed-choice' && (re
|
|
|
275
319
|
var deserializeType = method.language.default.deserializeType ? method.language.default.deserializeType : respSchema.language.csharp.fullname;
|
|
276
320
|
const postfix = (project.helper.IsValueType(respSchema.type) || project.helper.IsEnum(resp.schema)) ? '?' : '';
|
|
277
321
|
-%>
|
|
278
|
-
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<<%-deserializeType + postfix%>>(_responseContent, <%-project.helper.GetDeserializationSettings(respSchema,
|
|
322
|
+
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<<%-deserializeType + postfix%>>(_responseContent, <%-project.helper.GetDeserializationSettings(respSchema, `this${clientPrefix}`)%>);
|
|
279
323
|
}
|
|
280
324
|
catch (Newtonsoft.Json.JsonException ex)
|
|
281
325
|
{
|
|
@@ -286,6 +330,7 @@ const postfix = (project.helper.IsValueType(respSchema.type) || project.helper.I
|
|
|
286
330
|
}
|
|
287
331
|
throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
|
|
288
332
|
}
|
|
333
|
+
<% } -%>
|
|
289
334
|
}
|
|
290
335
|
<% });-%>
|
|
291
336
|
<%# ToDo: add support for case Model.ReturnType.Body != null && Model.DefaultResponse.Body != null && !Model.Responses.Any()-%>
|
|
@@ -293,7 +338,7 @@ const postfix = (project.helper.IsValueType(respSchema.type) || project.helper.I
|
|
|
293
338
|
<% if (method.language.default.returnTypeHeader.name !== '') { -%>
|
|
294
339
|
try
|
|
295
340
|
{
|
|
296
|
-
_result.Headers = _httpResponse.GetHeadersAsJson().ToObject<<%-method.language.default.returnTypeHeader.name%>>(Newtonsoft.Json.JsonSerializer.Create(this
|
|
341
|
+
_result.Headers = _httpResponse.GetHeadersAsJson().ToObject<<%-method.language.default.returnTypeHeader.name%>>(Newtonsoft.Json.JsonSerializer.Create(this<%-clientPrefix%>.DeserializationSettings));
|
|
297
342
|
}
|
|
298
343
|
catch (Newtonsoft.Json.JsonException ex)
|
|
299
344
|
{
|
|
@@ -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
|
{
|
|
@@ -13,65 +13,6 @@ namespace <%- project.namespace %>
|
|
|
13
13
|
/// </summary>
|
|
14
14
|
public partial interface I<%- typeName%>
|
|
15
15
|
{
|
|
16
|
-
|
|
17
|
-
<%# ToDo: support for ExcludeFromInterface -%>
|
|
18
|
-
<% if(method.language.default.description) {-%>
|
|
19
|
-
/// <summary>
|
|
20
|
-
/// <%= method.language.default.description%>
|
|
21
|
-
<%# ToDo: support for ExternalDocsUrl -%>
|
|
22
|
-
/// </summary>
|
|
23
|
-
/// <remarks>
|
|
24
|
-
/// <%= method.language.default.description%>
|
|
25
|
-
/// </remarks>
|
|
26
|
-
<% };-%>
|
|
27
|
-
<% if(!method.language.default.pageable?.nextPageOperation) {-%>
|
|
28
|
-
<% method.parameters.filter(p=>p.implementation != 'Client' && !project.helper.IsConstantParameter(p)).forEach(function(parameter){-%>
|
|
29
|
-
/// <param name='<%-parameter.language.default.name%>'>
|
|
30
|
-
/// <%= parameter.language.default.description%>
|
|
31
|
-
/// </param>
|
|
32
|
-
<% }); -%>
|
|
33
|
-
<% (method.requests[0].parameters || []).filter(p=>p.protocol.http.in == 'body' && !project.helper.IsConstantParameter(p)).forEach(function(parameter){-%>
|
|
34
|
-
<%if(parameter.extensions && parameter.extensions['x-ms-client-flatten'] ) {-%>
|
|
35
|
-
<%project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties).filter(p => !project.helper.IsConstantProperty(p)).forEach(function(vp) {-%>
|
|
36
|
-
/// <param name='<%-vp.property.language.default.name%>'>
|
|
37
|
-
/// <%= vp.property.language.default.description%>
|
|
38
|
-
/// </param>
|
|
39
|
-
<%});-%>
|
|
40
|
-
<%} else {-%>
|
|
41
|
-
/// <param name='<%-parameter.language.default.name%>'>
|
|
42
|
-
/// <%= parameter.language.default.description%>
|
|
43
|
-
/// </param>
|
|
44
|
-
<%}-%>
|
|
45
|
-
<% });-%>
|
|
46
|
-
<% };-%>
|
|
47
|
-
<% if(method.language.default.pageable?.nextPageOperation) {-%>
|
|
48
|
-
/// <param name='nextPageLink'>
|
|
49
|
-
/// The NextLink from the previous successful call to List operation.
|
|
50
|
-
/// </param>
|
|
51
|
-
<% } -%>
|
|
52
|
-
/// <param name='customHeaders'>
|
|
53
|
-
/// The headers that will be added to request.
|
|
54
|
-
/// </param>
|
|
55
|
-
/// <param name='cancellationToken'>
|
|
56
|
-
/// The cancellation token.
|
|
57
|
-
/// </param>
|
|
58
|
-
<%# ToDo: Need to figure out whether we could hand code the exception here -%>
|
|
59
|
-
/// <exception cref="Microsoft.Rest.Azure.CloudException">
|
|
60
|
-
/// Thrown when the operation returned an invalid status code
|
|
61
|
-
/// </exception>
|
|
62
|
-
<% if ((method.responses || []).filter(r => r.schema).length > 0) {-%>
|
|
63
|
-
/// <exception cref="Microsoft.Rest.SerializationException">
|
|
64
|
-
/// Thrown when unable to deserialize the response
|
|
65
|
-
/// </exception>
|
|
66
|
-
<% }; -%>
|
|
67
|
-
<% if (method.parameters.filter(p => p.required && p.nullable).length > 0 || (method.requests[0].parameters || []).filter(p => p.required && p.nullable).length > 0) {-%>
|
|
68
|
-
/// <exception cref="Microsoft.Rest.ValidationException">
|
|
69
|
-
/// Thrown when a required parameter is null
|
|
70
|
-
/// </exception>
|
|
71
|
-
<% }; -%>
|
|
72
|
-
<%# ToDo: support GetObsoleteAttribute, deprecated message?-%>
|
|
73
|
-
System.Threading.Tasks.Task<<%-method.language.default.responseType %>> <%- method.language.default.name%>WithHttpMessagesAsync(<%-method.language.default.asyncMethodParameterDeclarationWithCustomHeader%>);
|
|
74
|
-
|
|
75
|
-
<% }); -%>
|
|
16
|
+
<%- include('methodGroupInterfaceBody', {methodGroup: methodGroup}) -%>
|
|
76
17
|
}
|
|
77
18
|
}
|