@autorest/powershell 2.1.401 → 3.0.0

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