@autorest/powershell 4.0.0-dev.9 → 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.
Files changed (483) hide show
  1. package/.rush/temp/package-deps_build.json +208 -203
  2. package/.rush/temp/shrinkwrap-deps.json +253 -280
  3. package/autorest-configuration-for-sdk.md +9 -3
  4. package/autorest-configuration.md +1 -1
  5. package/dist/cmdlets/class.d.ts +24 -3
  6. package/dist/cmdlets/class.d.ts.map +1 -1
  7. package/dist/cmdlets/class.js +888 -603
  8. package/dist/cmdlets/class.js.map +1 -1
  9. package/dist/cmdlets/namespace.d.ts.map +1 -1
  10. package/dist/cmdlets/namespace.js +39 -5
  11. package/dist/cmdlets/namespace.js.map +1 -1
  12. package/dist/enums/namespace.js +5 -5
  13. package/dist/enums/namespace.js.map +1 -1
  14. package/dist/exports.d.ts +3 -0
  15. package/dist/exports.d.ts.map +1 -0
  16. package/dist/exports.js +19 -0
  17. package/dist/exports.js.map +1 -0
  18. package/dist/generators/gitignore.d.ts.map +1 -1
  19. package/dist/generators/gitignore.js +2 -0
  20. package/dist/generators/gitignore.js.map +1 -1
  21. package/dist/generators/psm1.custom.js +2 -2
  22. package/dist/generators/psm1.custom.js.map +1 -1
  23. package/dist/generators/psm1.d.ts.map +1 -1
  24. package/dist/generators/psm1.internal.js +2 -2
  25. package/dist/generators/psm1.internal.js.map +1 -1
  26. package/dist/generators/psm1.js +17 -11
  27. package/dist/generators/psm1.js.map +1 -1
  28. package/dist/generators/readme.d.ts.map +1 -1
  29. package/dist/generators/readme.js +0 -3
  30. package/dist/generators/readme.js.map +1 -1
  31. package/dist/generators/script-cmdlet.js +18 -18
  32. package/dist/generators/script-cmdlet.js.map +1 -1
  33. package/dist/internal/name-inferrer.d.ts +1 -1
  34. package/dist/internal/name-inferrer.d.ts.map +1 -1
  35. package/dist/internal/name-inferrer.js +12 -12
  36. package/dist/internal/name-inferrer.js.map +1 -1
  37. package/dist/internal/powershell-declarations.d.ts +2 -0
  38. package/dist/internal/powershell-declarations.d.ts.map +1 -1
  39. package/dist/internal/powershell-declarations.js +4 -2
  40. package/dist/internal/powershell-declarations.js.map +1 -1
  41. package/dist/internal/project.d.ts +14 -6
  42. package/dist/internal/project.d.ts.map +1 -1
  43. package/dist/internal/project.js +24 -13
  44. package/dist/internal/project.js.map +1 -1
  45. package/dist/internal/state.d.ts +3 -2
  46. package/dist/internal/state.d.ts.map +1 -1
  47. package/dist/internal/state.js.map +1 -1
  48. package/dist/llcsharp/clientruntime.d.ts +1 -0
  49. package/dist/llcsharp/clientruntime.d.ts.map +1 -1
  50. package/dist/llcsharp/clientruntime.js +12 -11
  51. package/dist/llcsharp/clientruntime.js.map +1 -1
  52. package/dist/llcsharp/code-model.d.ts +7 -7
  53. package/dist/llcsharp/code-model.d.ts.map +1 -1
  54. package/dist/llcsharp/enums/enum.d.ts +1 -1
  55. package/dist/llcsharp/enums/enum.d.ts.map +1 -1
  56. package/dist/llcsharp/enums/enum.js +42 -42
  57. package/dist/llcsharp/enums/enum.js.map +1 -1
  58. package/dist/llcsharp/exports.js +5 -1
  59. package/dist/llcsharp/exports.js.map +1 -1
  60. package/dist/llcsharp/generator.d.ts +3 -2
  61. package/dist/llcsharp/generator.d.ts.map +1 -1
  62. package/dist/llcsharp/generator.js.map +1 -1
  63. package/dist/llcsharp/model/idictionary.js +16 -16
  64. package/dist/llcsharp/model/idictionary.js.map +1 -1
  65. package/dist/llcsharp/model/interface.d.ts +1 -1
  66. package/dist/llcsharp/model/interface.d.ts.map +1 -1
  67. package/dist/llcsharp/model/interface.js +19 -19
  68. package/dist/llcsharp/model/interface.js.map +1 -1
  69. package/dist/llcsharp/model/model-class-dictionary.js +18 -18
  70. package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
  71. package/dist/llcsharp/model/model-class-json.js +20 -20
  72. package/dist/llcsharp/model/model-class-json.js.map +1 -1
  73. package/dist/llcsharp/model/model-class-serializer.d.ts +1 -1
  74. package/dist/llcsharp/model/model-class-serializer.d.ts.map +1 -1
  75. package/dist/llcsharp/model/model-class-serializer.js +6 -6
  76. package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
  77. package/dist/llcsharp/model/model-class.d.ts +1 -1
  78. package/dist/llcsharp/model/model-class.d.ts.map +1 -1
  79. package/dist/llcsharp/model/model-class.js +108 -97
  80. package/dist/llcsharp/model/model-class.js.map +1 -1
  81. package/dist/llcsharp/model/namespace.d.ts +1 -1
  82. package/dist/llcsharp/model/namespace.d.ts.map +1 -1
  83. package/dist/llcsharp/model/namespace.js +2 -2
  84. package/dist/llcsharp/model/namespace.js.map +1 -1
  85. package/dist/llcsharp/model/property.d.ts +1 -1
  86. package/dist/llcsharp/model/property.d.ts.map +1 -1
  87. package/dist/llcsharp/model/property.js +20 -20
  88. package/dist/llcsharp/model/property.js.map +1 -1
  89. package/dist/llcsharp/operation/api-class.d.ts.map +1 -1
  90. package/dist/llcsharp/operation/api-class.js +26 -1
  91. package/dist/llcsharp/operation/api-class.js.map +1 -1
  92. package/dist/llcsharp/operation/method.d.ts +10 -5
  93. package/dist/llcsharp/operation/method.d.ts.map +1 -1
  94. package/dist/llcsharp/operation/method.js +287 -134
  95. package/dist/llcsharp/operation/method.js.map +1 -1
  96. package/dist/llcsharp/operation/parameter.d.ts +1 -1
  97. package/dist/llcsharp/operation/parameter.d.ts.map +1 -1
  98. package/dist/llcsharp/operation/parameter.js +10 -10
  99. package/dist/llcsharp/operation/parameter.js.map +1 -1
  100. package/dist/llcsharp/project.d.ts +8 -4
  101. package/dist/llcsharp/project.d.ts.map +1 -1
  102. package/dist/llcsharp/project.js +10 -1
  103. package/dist/llcsharp/project.js.map +1 -1
  104. package/dist/llcsharp/schema/Uuid.d.ts +1 -1
  105. package/dist/llcsharp/schema/Uuid.d.ts.map +1 -1
  106. package/dist/llcsharp/schema/Uuid.js +2 -2
  107. package/dist/llcsharp/schema/Uuid.js.map +1 -1
  108. package/dist/llcsharp/schema/array.d.ts +1 -1
  109. package/dist/llcsharp/schema/array.d.ts.map +1 -1
  110. package/dist/llcsharp/schema/array.js +45 -43
  111. package/dist/llcsharp/schema/array.js.map +1 -1
  112. package/dist/llcsharp/schema/binary.d.ts +1 -1
  113. package/dist/llcsharp/schema/binary.d.ts.map +1 -1
  114. package/dist/llcsharp/schema/binary.js +9 -9
  115. package/dist/llcsharp/schema/binary.js.map +1 -1
  116. package/dist/llcsharp/schema/boolean.d.ts +1 -1
  117. package/dist/llcsharp/schema/boolean.d.ts.map +1 -1
  118. package/dist/llcsharp/schema/byte-array.d.ts +1 -1
  119. package/dist/llcsharp/schema/byte-array.d.ts.map +1 -1
  120. package/dist/llcsharp/schema/byte-array.js +24 -24
  121. package/dist/llcsharp/schema/byte-array.js.map +1 -1
  122. package/dist/llcsharp/schema/char.d.ts +1 -1
  123. package/dist/llcsharp/schema/char.d.ts.map +1 -1
  124. package/dist/llcsharp/schema/char.js +1 -1
  125. package/dist/llcsharp/schema/char.js.map +1 -1
  126. package/dist/llcsharp/schema/date-time.d.ts +1 -1
  127. package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
  128. package/dist/llcsharp/schema/date-time.js +45 -41
  129. package/dist/llcsharp/schema/date-time.js.map +1 -1
  130. package/dist/llcsharp/schema/date.d.ts +1 -1
  131. package/dist/llcsharp/schema/date.d.ts.map +1 -1
  132. package/dist/llcsharp/schema/duration.d.ts +1 -1
  133. package/dist/llcsharp/schema/duration.d.ts.map +1 -1
  134. package/dist/llcsharp/schema/duration.js +9 -7
  135. package/dist/llcsharp/schema/duration.js.map +1 -1
  136. package/dist/llcsharp/schema/enum.d.ts +6 -2
  137. package/dist/llcsharp/schema/enum.d.ts.map +1 -1
  138. package/dist/llcsharp/schema/enum.js +13 -4
  139. package/dist/llcsharp/schema/enum.js.map +1 -1
  140. package/dist/llcsharp/schema/extended-type-declaration.d.ts +1 -1
  141. package/dist/llcsharp/schema/extended-type-declaration.d.ts.map +1 -1
  142. package/dist/llcsharp/schema/fixed-array.d.ts +1 -1
  143. package/dist/llcsharp/schema/fixed-array.d.ts.map +1 -1
  144. package/dist/llcsharp/schema/fixed-array.js +44 -42
  145. package/dist/llcsharp/schema/fixed-array.js.map +1 -1
  146. package/dist/llcsharp/schema/integer.d.ts +1 -1
  147. package/dist/llcsharp/schema/integer.d.ts.map +1 -1
  148. package/dist/llcsharp/schema/integer.js +5 -5
  149. package/dist/llcsharp/schema/integer.js.map +1 -1
  150. package/dist/llcsharp/schema/object.d.ts +1 -1
  151. package/dist/llcsharp/schema/object.d.ts.map +1 -1
  152. package/dist/llcsharp/schema/object.js +28 -28
  153. package/dist/llcsharp/schema/object.js.map +1 -1
  154. package/dist/llcsharp/schema/password.d.ts +1 -1
  155. package/dist/llcsharp/schema/password.d.ts.map +1 -1
  156. package/dist/llcsharp/schema/password.js +13 -13
  157. package/dist/llcsharp/schema/password.js.map +1 -1
  158. package/dist/llcsharp/schema/primitive.d.ts +1 -1
  159. package/dist/llcsharp/schema/primitive.d.ts.map +1 -1
  160. package/dist/llcsharp/schema/primitive.js +40 -37
  161. package/dist/llcsharp/schema/primitive.js.map +1 -1
  162. package/dist/llcsharp/schema/schema-resolver.d.ts +1 -1
  163. package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
  164. package/dist/llcsharp/schema/schema-resolver.js +2 -1
  165. package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
  166. package/dist/llcsharp/schema/string.d.ts +1 -1
  167. package/dist/llcsharp/schema/string.d.ts.map +1 -1
  168. package/dist/llcsharp/schema/string.js +48 -44
  169. package/dist/llcsharp/schema/string.js.map +1 -1
  170. package/dist/llcsharp/schema/uri.d.ts +1 -1
  171. package/dist/llcsharp/schema/uri.d.ts.map +1 -1
  172. package/dist/llcsharp/schema/uri.js +2 -2
  173. package/dist/llcsharp/schema/uri.js.map +1 -1
  174. package/dist/llcsharp/validations.js +2 -2
  175. package/dist/llcsharp/validations.js.map +1 -1
  176. package/dist/main.d.ts.map +1 -1
  177. package/dist/main.js +5 -2
  178. package/dist/main.js.map +1 -1
  179. package/dist/models/model-extensions.d.ts +1 -1
  180. package/dist/models/model-extensions.d.ts.map +1 -1
  181. package/dist/models/model-extensions.js +39 -39
  182. package/dist/models/model-extensions.js.map +1 -1
  183. package/dist/module/module-class.d.ts.map +1 -1
  184. package/dist/module/module-class.js +45 -15
  185. package/dist/module/module-class.js.map +1 -1
  186. package/dist/module/module-namespace.js +3 -3
  187. package/dist/module/module-namespace.js.map +1 -1
  188. package/dist/plugins/add-azure-completers-v2.d.ts +6 -1
  189. package/dist/plugins/add-azure-completers-v2.d.ts.map +1 -1
  190. package/dist/plugins/add-azure-completers-v2.js +5 -4
  191. package/dist/plugins/add-azure-completers-v2.js.map +1 -1
  192. package/dist/plugins/create-commands-v2.d.ts +16 -7
  193. package/dist/plugins/create-commands-v2.d.ts.map +1 -1
  194. package/dist/plugins/create-commands-v2.js +269 -66
  195. package/dist/plugins/create-commands-v2.js.map +1 -1
  196. package/dist/plugins/cs-namer-v2.d.ts +6 -1
  197. package/dist/plugins/cs-namer-v2.d.ts.map +1 -1
  198. package/dist/plugins/cs-namer-v2.js +42 -41
  199. package/dist/plugins/cs-namer-v2.js.map +1 -1
  200. package/dist/plugins/llcsharp-v2.d.ts +5 -2
  201. package/dist/plugins/llcsharp-v2.d.ts.map +1 -1
  202. package/dist/plugins/llcsharp-v2.js +11 -9
  203. package/dist/plugins/llcsharp-v2.js.map +1 -1
  204. package/dist/plugins/modifiers-v2.d.ts +6 -1
  205. package/dist/plugins/modifiers-v2.d.ts.map +1 -1
  206. package/dist/plugins/modifiers-v2.js +120 -92
  207. package/dist/plugins/modifiers-v2.js.map +1 -1
  208. package/dist/plugins/plugin-create-inline-properties.d.ts +6 -1
  209. package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -1
  210. package/dist/plugins/plugin-create-inline-properties.js +44 -32
  211. package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
  212. package/dist/plugins/plugin-tweak-m4-model.d.ts +7 -1
  213. package/dist/plugins/plugin-tweak-m4-model.d.ts.map +1 -1
  214. package/dist/plugins/plugin-tweak-m4-model.js +28 -11
  215. package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
  216. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts +6 -1
  217. package/dist/plugins/plugin-tweak-model-azure-v2.d.ts.map +1 -1
  218. package/dist/plugins/plugin-tweak-model-azure-v2.js +32 -22
  219. package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
  220. package/dist/plugins/plugin-tweak-model.d.ts +6 -1
  221. package/dist/plugins/plugin-tweak-model.d.ts.map +1 -1
  222. package/dist/plugins/plugin-tweak-model.js +33 -32
  223. package/dist/plugins/plugin-tweak-model.js.map +1 -1
  224. package/dist/plugins/powershell-v2.d.ts +5 -2
  225. package/dist/plugins/powershell-v2.d.ts.map +1 -1
  226. package/dist/plugins/powershell-v2.js +32 -28
  227. package/dist/plugins/powershell-v2.js.map +1 -1
  228. package/dist/plugins/ps-namer-v2.d.ts +6 -1
  229. package/dist/plugins/ps-namer-v2.d.ts.map +1 -1
  230. package/dist/plugins/ps-namer-v2.js +33 -32
  231. package/dist/plugins/ps-namer-v2.js.map +1 -1
  232. package/dist/plugins/sdk-create-inline-properties.d.ts +1 -1
  233. package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -1
  234. package/dist/plugins/sdk-create-inline-properties.js +129 -39
  235. package/dist/plugins/sdk-create-inline-properties.js.map +1 -1
  236. package/dist/plugins/sdk-cs-namer.d.ts +1 -1
  237. package/dist/plugins/sdk-cs-namer.d.ts.map +1 -1
  238. package/dist/plugins/sdk-cs-namer.js +59 -34
  239. package/dist/plugins/sdk-cs-namer.js.map +1 -1
  240. package/dist/plugins/sdk-cs-simplifier.d.ts +1 -1
  241. package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -1
  242. package/dist/plugins/sdk-cs-simplifier.js +3 -3
  243. package/dist/plugins/sdk-cs-simplifier.js.map +1 -1
  244. package/dist/plugins/sdk-generate.d.ts +1 -1
  245. package/dist/plugins/sdk-generate.d.ts.map +1 -1
  246. package/dist/plugins/sdk-generate.js +23 -18
  247. package/dist/plugins/sdk-generate.js.map +1 -1
  248. package/dist/plugins/sdk-modifiers.d.ts +4 -0
  249. package/dist/plugins/sdk-modifiers.d.ts.map +1 -0
  250. package/dist/plugins/sdk-modifiers.js +175 -0
  251. package/dist/plugins/sdk-modifiers.js.map +1 -0
  252. package/dist/plugins/sdk-tweak-model.d.ts +1 -1
  253. package/dist/plugins/sdk-tweak-model.d.ts.map +1 -1
  254. package/dist/plugins/sdk-tweak-model.js +140 -44
  255. package/dist/plugins/sdk-tweak-model.js.map +1 -1
  256. package/dist/sdk/project.d.ts +2 -2
  257. package/dist/sdk/project.d.ts.map +1 -1
  258. package/dist/sdk/project.js +10 -9
  259. package/dist/sdk/project.js.map +1 -1
  260. package/dist/sdk/state.d.ts +2 -2
  261. package/dist/sdk/state.d.ts.map +1 -1
  262. package/dist/sdk/utility.d.ts +12 -3
  263. package/dist/sdk/utility.d.ts.map +1 -1
  264. package/dist/sdk/utility.js +122 -30
  265. package/dist/sdk/utility.js.map +1 -1
  266. package/dist/utils/PwshModel.d.ts +1 -1
  267. package/dist/utils/PwshModel.d.ts.map +1 -1
  268. package/dist/utils/PwshModel.js +1 -1
  269. package/dist/utils/PwshModel.js.map +1 -1
  270. package/dist/utils/SdkModel.d.ts +1 -1
  271. package/dist/utils/SdkModel.d.ts.map +1 -1
  272. package/dist/utils/SdkModel.js +1 -1
  273. package/dist/utils/SdkModel.js.map +1 -1
  274. package/dist/utils/command-operation.d.ts +11 -3
  275. package/dist/utils/command-operation.d.ts.map +1 -1
  276. package/dist/utils/command-operation.js +26 -4
  277. package/dist/utils/command-operation.js.map +1 -1
  278. package/dist/utils/components.d.ts +1 -1
  279. package/dist/utils/components.d.ts.map +1 -1
  280. package/dist/utils/components.js +2 -2
  281. package/dist/utils/components.js.map +1 -1
  282. package/dist/utils/http-operation.d.ts +2 -0
  283. package/dist/utils/http-operation.d.ts.map +1 -1
  284. package/dist/utils/http-operation.js +16 -12
  285. package/dist/utils/http-operation.js.map +1 -1
  286. package/dist/utils/model-state.d.ts +7 -5
  287. package/dist/utils/model-state.d.ts.map +1 -1
  288. package/dist/utils/model-state.js +28 -20
  289. package/dist/utils/model-state.js.map +1 -1
  290. package/dist/utils/programatic-operation.d.ts +1 -1
  291. package/dist/utils/programatic-operation.d.ts.map +1 -1
  292. package/dist/utils/programatic-operation.js +1 -1
  293. package/dist/utils/programatic-operation.js.map +1 -1
  294. package/dist/utils/resolve-conflicts.js +8 -8
  295. package/dist/utils/resolve-conflicts.js.map +1 -1
  296. package/dist/utils/schema.d.ts +1 -1
  297. package/dist/utils/schema.d.ts.map +1 -1
  298. package/dist/utils/schema.js +11 -11
  299. package/dist/utils/schema.js.map +1 -1
  300. package/dist/utils/security-scheme.d.ts +2 -2
  301. package/dist/utils/security-scheme.d.ts.map +1 -1
  302. package/dist/utils/security-scheme.js +2 -2
  303. package/dist/utils/security-scheme.js.map +1 -1
  304. package/dist/utils/sort-parameters.d.ts +1 -1
  305. package/dist/utils/sort-parameters.d.ts.map +1 -1
  306. package/dist/utils/tsp-generator.d.ts +3 -0
  307. package/dist/utils/tsp-generator.d.ts.map +1 -0
  308. package/dist/utils/tsp-generator.js +65 -0
  309. package/dist/utils/tsp-generator.js.map +1 -0
  310. package/dist/utils/tsp-host.d.ts +42 -0
  311. package/dist/utils/tsp-host.d.ts.map +1 -0
  312. package/dist/utils/tsp-host.js +56 -0
  313. package/dist/utils/tsp-host.js.map +1 -0
  314. package/generators/readme.ts +0 -3
  315. package/package.json +11 -10
  316. package/resources/assets/build-module.ps1 +29 -2
  317. package/resources/assets/create-model-cmdlets.ps1 +1 -0
  318. package/resources/assets/generate-help.ps1 +2 -2
  319. package/resources/assets/generate-portal-ux.ps1 +6 -22
  320. package/resources/assets/test/loadEnv.ps1 +1 -1
  321. package/resources/assets/test-module.ps1 +9 -5
  322. package/resources/assets/tools/Resources/README.md +0 -3
  323. package/resources/assets/tools/Resources/custom/New-AzDeployment.ps1 +2 -2
  324. package/resources/assets/tools/Resources/how-to.md +2 -0
  325. package/resources/built-time-cmdlets.csproj +1 -0
  326. package/resources/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml +554 -0
  327. package/resources/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml +471 -0
  328. package/resources/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml +306 -0
  329. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Az.Accounts.nuspec +4 -5
  330. package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 +389 -0
  331. package/resources/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 +365 -0
  332. package/resources/modules/Az.Accounts/2.13.1/FuzzySharp.dll +0 -0
  333. package/resources/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll +0 -0
  334. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll +0 -0
  335. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  336. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  337. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  338. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
  339. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  340. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
  341. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Authorization.dll +0 -0
  342. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Compute.dll +0 -0
  343. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  344. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.KeyVault.dll +0 -0
  345. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Monitor.dll +0 -0
  346. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Network.dll +0 -0
  347. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll +0 -0
  348. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  349. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll +0 -0
  350. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Clients.Websites.dll +0 -0
  351. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  352. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +2510 -779
  353. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
  354. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll +0 -0
  355. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Storage.dll +0 -0
  356. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.PowerShell.Strategies.dll +0 -0
  357. package/resources/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll +0 -0
  358. package/resources/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 +222 -0
  359. package/resources/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 +281 -0
  360. package/resources/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 +242 -0
  361. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/[Content_Types].xml +2 -3
  362. package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/_rels/.rels +2 -2
  363. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll +0 -0
  364. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll +0 -0
  365. package/resources/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  366. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll +0 -0
  367. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  368. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll +0 -0
  369. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll +0 -0
  370. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll +0 -0
  371. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll +0 -0
  372. package/resources/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  373. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll +0 -0
  374. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll +0 -0
  375. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll +0 -0
  376. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll +0 -0
  377. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll +0 -0
  378. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll +0 -0
  379. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll +0 -0
  380. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll +0 -0
  381. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll +0 -0
  382. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll +0 -0
  383. package/resources/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll +0 -0
  384. package/resources/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp +11 -0
  385. package/resources/psruntime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +4 -1
  386. package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +6 -3
  387. package/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs +7 -4
  388. package/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs +130 -81
  389. package/resources/psruntime/BuildTime/Cmdlets/NewAssemblyInfo.cs +64 -0
  390. package/resources/psruntime/BuildTime/MarkdownRenderer.cs +17 -9
  391. package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +36 -8
  392. package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +21 -10
  393. package/resources/psruntime/BuildTime/PsAttributes.cs +5 -0
  394. package/resources/psruntime/BuildTime/PsHelpers.cs +4 -3
  395. package/resources/psruntime/MessageAttribute.cs +45 -55
  396. package/resources/psruntime/MessageAttributeHelper.cs +30 -7
  397. package/resources/psruntime/Properties/Resources.Designer.cs +25 -3
  398. package/resources/psruntime/Properties/Resources.resx +8 -2
  399. package/resources/runtime/csharp/pipeline/PipelineMocking.cs +1 -1
  400. package/resources/templates/azureMethod.ejs +2 -2
  401. package/resources/templates/azureMethodGroup.ejs +2 -2
  402. package/resources/templates/azureServiceClient.ejs +11 -4
  403. package/resources/templates/enum.ejs +3 -3
  404. package/resources/templates/extensionMethod.ejs +18 -12
  405. package/resources/templates/extensions.ejs +9 -2
  406. package/resources/templates/longRunningOperationMethod.ejs +10 -8
  407. package/resources/templates/method.ejs +10 -8
  408. package/resources/templates/methodBodyRestCall.ejs +77 -32
  409. package/resources/templates/methodGroupInterface.ejs +2 -61
  410. package/resources/templates/methodGroupInterfaceBody.ejs +60 -0
  411. package/resources/templates/model.ejs +15 -15
  412. package/resources/templates/serviceClientBody.ejs +8 -8
  413. package/resources/templates/serviceClientInterface.ejs +10 -4
  414. package/resources/utils/Get-SubscriptionIdTestSafe.ps1 +7 -0
  415. package/dist/utils/WrapComments.d.ts +0 -2
  416. package/dist/utils/WrapComments.d.ts.map +0 -1
  417. package/dist/utils/WrapComments.js +0 -46
  418. package/dist/utils/WrapComments.js.map +0 -1
  419. package/resources/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml +0 -496
  420. package/resources/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml +0 -468
  421. package/resources/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml +0 -303
  422. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +0 -387
  423. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 +0 -375
  424. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll +0 -0
  425. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll +0 -0
  426. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  427. package/resources/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll +0 -0
  428. package/resources/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll +0 -0
  429. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll +0 -0
  430. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json +0 -2309
  431. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll +0 -0
  432. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json +0 -2273
  433. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll +0 -0
  434. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json +0 -1316
  435. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll +0 -0
  436. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  437. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll +0 -0
  438. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll +0 -0
  439. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll +0 -0
  440. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json +0 -2413
  441. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll +0 -0
  442. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll +0 -0
  443. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll +0 -0
  444. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll +0 -0
  445. package/resources/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 +0 -219
  446. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll +0 -0
  447. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll +0 -0
  448. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll +0 -0
  449. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  450. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  451. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll +0 -0
  452. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll +0 -0
  453. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll +0 -0
  454. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll +0 -0
  455. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll +0 -0
  456. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll +0 -0
  457. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  458. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll +0 -0
  459. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll +0 -0
  460. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll +0 -0
  461. package/resources/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll +0 -0
  462. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 +0 -278
  463. package/resources/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 +0 -234
  464. package/resources/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp +0 -11
  465. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Hyak.Common.dll +0 -0
  466. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Azure.Common.dll +0 -0
  467. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.Rest.ClientRuntime.Azure.dll +0 -0
  468. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.DataMovement.dll +0 -0
  469. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/Microsoft.WindowsAzure.Storage.dll +0 -0
  470. /package/resources/modules/Az.Accounts/{2.7.5 → 2.13.1}/en-US/about_az.help.txt +0 -0
  471. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Numerics.Vectors.dll +0 -0
  472. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Security.Cryptography.Cng.dll +0 -0
  473. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Text.Encodings.Web.dll +0 -0
  474. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netfx}/System.Xml.ReaderWriter.dll +0 -0
  475. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  476. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Buffers.dll +0 -0
  477. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.Data.dll +0 -0
  478. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Memory.dll +0 -0
  479. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Net.Http.WinHttpHandler.dll +0 -0
  480. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Private.ServiceModel.dll +0 -0
  481. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.ServiceModel.Primitives.dll +0 -0
  482. /package/resources/modules/Az.Accounts/{2.7.5/AzSharedAlcAssemblies → 2.13.1/lib/netstandard2.0}/System.Text.Json.dll +0 -0
  483. /package/resources/modules/Az.Accounts/{2.7.5/PreloadAssemblies → 2.13.1/lib/netstandard2.0}/System.Threading.Tasks.Extensions.dll +0 -0
@@ -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.requests[0].parameters || []).filter(p=>p.protocol.http.in == 'body' && !project.helper.IsConstantParameter(p)).forEach(function(parameter){-%>
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.IsConstantProperty(p)).forEach(function(vp) {-%>
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.IsConstantParameter(parameter)) { -%>
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
- <%-project.helper.ValidateType(parameter.schema, method, parameter.language.default.name, parameter.nullable)%>
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' ? 'this.Client.' : ''-%>
37
- <% if ( !(parameter.extensions && parameter.extensions['x-ms-parameter-grouping']) && parameter.required && !project.helper.IsValueType(parameter.schema.type) && !project.helper.IsConstantParameter(parameter)) {-%>
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
- <%-project.helper.ValidateType(parameter.schema, method, prefix + parameter.language.default.name, parameter.nullable)%>
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 vps = project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties)-%>
57
- if(<%-vps.map(vp=>`${vp.property.language.default.name} != null`).join('||')%>)
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
- <%vps.forEach(function(vp) {-%>
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.Client.BaseUri.AbsoluteUri;
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' ? 'this.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' ? 'this.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.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
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.Client.AcceptLanguage != null)
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.Client.AcceptLanguage);
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' ? 'this.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 (!project.helper.IsValueType(parameter.schema.type) && !project.helper.IsConstantParameter(parameter)) {-%>
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, 'this.Client')%>);
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, 'this.Client')%>);
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.Client.Credentials != null)
231
+ if (this<%-clientPrefix%>.Credentials != null)
189
232
  {
190
233
  cancellationToken.ThrowIfCancellationRequested();
191
- await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
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
- <%# ToDo: Add support for primary type return -%>
200
- <% var responseHeadersRead = method.requests[0].protocol.http.method === 'head' ? 'System.Net.Http.HttpCompletionOption.ResponseHeadersRead, ': '' -%>
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.Client.DeserializationSettings);
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
- <%# ToDo: Need to add support for primary type -%>
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, 'this.Client')%>);
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.Client.DeserializationSettings));
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 == 'Operations' ? '' : 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
- <% methodGroup.operations.forEach(function(method){ -%>
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
  }
@@ -0,0 +1,60 @@
1
+ <% methodGroup.operations.forEach(function(method){ -%>
2
+ <%# ToDo: support for ExcludeFromInterface -%>
3
+ <% if(method.language.default.description) {-%>
4
+ /// <summary>
5
+ /// <%=project.helper.wrapComments(' ', '/// ', method.language.default.description)%>
6
+ <%# ToDo: support for ExternalDocsUrl -%>
7
+ /// </summary>
8
+ /// <remarks>
9
+ /// <%=project.helper.wrapComments(' ', '/// ', method.language.default.description)%>
10
+ /// </remarks>
11
+ <% };-%>
12
+ <% if(!method.language.default.pageable?.nextPageOperation) {-%>
13
+ <% 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){-%>
14
+ /// <param name='<%-parameter.language.default.name%>'>
15
+ /// <%=project.helper.wrapComments(' ', '/// ', parameter.language.default.description)%>
16
+ /// </param>
17
+ <% }); -%>
18
+ <% (method.requests[0].parameters || []).filter(p=>p.protocol.http.in == 'body' && !project.helper.IsConstantEnumParameter(p)).forEach(function(parameter){-%>
19
+ <%if(parameter.extensions && parameter.extensions['x-ms-client-flatten'] ) {-%>
20
+ <%project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties).filter(p => !project.helper.IsConstantEnumProperty(p) && !p.readOnly).forEach(function(vp) {-%>
21
+ /// <param name='<%-vp.property.language.default.name%>'>
22
+ /// <%=project.helper.wrapComments(' ', '/// ', vp.property.language.default.description)%>
23
+ /// </param>
24
+ <%});-%>
25
+ <%} else {-%>
26
+ /// <param name='<%-parameter.language.default.name%>'>
27
+ /// <%=project.helper.wrapComments(' ', '/// ', parameter.language.default.description)%>
28
+ /// </param>
29
+ <%}-%>
30
+ <% });-%>
31
+ <% };-%>
32
+ <% if(method.language.default.pageable?.nextPageOperation) {-%>
33
+ /// <param name='nextPageLink'>
34
+ /// The NextLink from the previous successful call to List operation.
35
+ /// </param>
36
+ <% } -%>
37
+ /// <param name='customHeaders'>
38
+ /// The headers that will be added to request.
39
+ /// </param>
40
+ /// <param name='cancellationToken'>
41
+ /// The cancellation token.
42
+ /// </param>
43
+ <%# ToDo: Need to figure out whether we could hand code the exception here -%>
44
+ /// <exception cref="Microsoft.Rest.Azure.CloudException">
45
+ /// Thrown when the operation returned an invalid status code
46
+ /// </exception>
47
+ <% if ((method.responses || []).filter(r => r.schema).length > 0) {-%>
48
+ /// <exception cref="Microsoft.Rest.SerializationException">
49
+ /// Thrown when unable to deserialize the response
50
+ /// </exception>
51
+ <% }; -%>
52
+ <% if (method.parameters.filter(p => p.required && p.nullable).length > 0 || (method.requests[0].parameters || []).filter(p => p.required && p.nullable).length > 0) {-%>
53
+ /// <exception cref="Microsoft.Rest.ValidationException">
54
+ /// Thrown when a required parameter is null
55
+ /// </exception>
56
+ <% }; -%>
57
+ <%# ToDo: support GetObsoleteAttribute, deprecated message?-%>
58
+ System.Threading.Tasks.Task<<%-method.language.default.responseType %>> <%- method.language.default.name%>WithHttpMessagesAsync(<%-method.language.default.asyncMethodParameterDeclarationWithCustomHeader%>);
59
+
60
+ <% }); -%>
@@ -7,12 +7,12 @@ namespace <%- project.namespace %>.Models
7
7
  <%# ToDo: need to populate effectiveDocumentation in the model-%>
8
8
  <% if (model.language.default.description) {-%>
9
9
  /// <summary>
10
- /// <%=wrapComments(' ', '/// ', model.language.default.description)%>
10
+ /// <%=project.helper.wrapComments(' ', '/// ', model.language.default.description)%>
11
11
  /// </summary>
12
12
  <% }-%>
13
13
  <% if (model.summary && model.language.default.description) { -%>
14
14
  /// <remarks>
15
- /// <%=wrapComments(' ', '/// ', model.language.default.description)%>
15
+ /// <%=project.helper.wrapComments(' ', '/// ', model.language.default.description)%>
16
16
  /// </remarks>
17
17
  <% } -%>
18
18
  <%# ToDo: support NeedsPolymorphicConverter-%>
@@ -39,11 +39,12 @@ namespace <%- project.namespace %>.Models
39
39
  CustomInit();
40
40
  }
41
41
  <%#ToDo support for constructorParameters in the model, the constructorParameter is mapped to properties for the time being%>
42
- <% if ((model.properties || []).filter(p => !p.isDiscriminator).length > 0 || model.parents) {-%>
42
+ <% if (((model.properties || []).filter(p => !p.isDiscriminator).length > 0 || model.parents) && model.language.default.constructorParametersDeclaration != '') {-%>
43
43
  /// <summary>
44
44
  /// Initializes a new instance of the <%=model.language.default.name%> class.
45
45
  /// </summary>
46
- <%project.helper.GetAllPublicVirtualProperties(model.language.default.virtualProperties).filter(p => !project.helper.IsConstantProperty(p)).forEach(function(p) {-%>
46
+ <% var publicVirtualProperties = (model.extensions && model.extensions["x-ms-azure-resource"]) ? project.helper.GetAllPublicVirtualPropertiesWithoutInherited(model.language.default.virtualProperties) : project.helper.GetAllPublicVirtualProperties(model.language.default.virtualProperties);
47
+ publicVirtualProperties.filter(p => !project.helper.IsConstantEnumProperty(p)).forEach(function(p) {-%>
47
48
  <%
48
49
  var additionInfo = '';
49
50
  if (p.property.schema.type == 'sealed-choice' || p.property.schema.type == 'choice')
@@ -53,27 +54,26 @@ if (p.property.schema.type == 'sealed-choice' || p.property.schema.type == 'choi
53
54
  additionInfo = additionInfo + choices.join(', ');
54
55
  }
55
56
  %>
56
- /// <param name="<%-project.helper.CamelCase(p.name)%>"><%=wrapComments(' ', '/// ', p.property.language.default.description)%>
57
- /// <%-wrapComments(' ', '/// ', additionInfo)%></param>
57
+ /// <param name="<%-project.helper.CamelCase(p.name)%>"><%=project.helper.wrapComments(' ', '/// ', p.property.language.default.description)%>
58
+ /// <%=project.helper.wrapComments(' ', '/// ', additionInfo)%></param>
58
59
  <%});-%>
59
60
  public <%- model.language.default.name%>(<%-model.language.default.constructorParametersDeclaration%>)
60
61
  <%# If there is only one direct parent, will implement it as parent%>
61
- <% var publicVirtualProperties = project.helper.GetAllPublicVirtualProperties(model.language.default.virtualProperties);
62
- if (model.language.default.baseConstructorCall) {
62
+ <% if (model.language.default.baseConstructorCall) {
63
63
  publicVirtualProperties = project.helper.GetAllPublicVirtualPropertiesWithoutInherited(model.language.default.virtualProperties);
64
64
  -%>
65
65
  : <%-model.language.default.baseConstructorCall%>
66
66
  <%}-%>
67
67
  {
68
68
  <%#ToDo support for InstanceProperties in the model, non const properties, priority 0-%>
69
- <%publicVirtualProperties.filter(p => !project.helper.IsConstantProperty(p)).forEach(function(p) {-%>
69
+ <%publicVirtualProperties.filter(p => !project.helper.IsConstantEnumProperty(p)).forEach(function(p) {-%>
70
70
  this.<%-p.name%> = <%-project.helper.CamelCase(p.name)%>;
71
71
  <%});-%>
72
72
  CustomInit();
73
73
  }
74
74
  <% };-%>
75
75
  <%#Below is support for ClassProperties in the model, const properties-%>
76
- <% const constantProperties = (publicVirtualProperties || []).filter(p => p.property.schema.type === 'constant' || project.helper.IsConstantProperty(p));
76
+ <% const constantProperties = (publicVirtualProperties || []).filter(p => p.property.schema.type === 'constant' || project.helper.IsConstantEnumProperty(p));
77
77
  if (constantProperties.length > 0) {-%>
78
78
  /// <summary>
79
79
  /// Static constructor for <%-model.language.default.name%> class.
@@ -94,7 +94,7 @@ const quote = p.property.schema.choiceType.type !== 'string' ? '' : '"';
94
94
  partial void CustomInit();
95
95
 
96
96
  <%#ToDo support for InstanceProperties in the model, non const properties, priority 0, line 407-%>
97
- <% (publicVirtualProperties || []).filter(p => p.property.schema.type != 'constant' && !project.helper.IsConstantProperty(p)).forEach(function(p){-%>
97
+ <% (publicVirtualProperties || []).filter(p => p.property.schema.type != 'constant' && !project.helper.IsConstantEnumProperty(p)).forEach(function(p){-%>
98
98
  <%
99
99
  var additionInfo = '';
100
100
  if (p.property.schema.type == 'sealed-choice' || p.property.schema.type == 'choice')
@@ -105,7 +105,7 @@ const quote = p.property.schema.choiceType.type !== 'string' ? '' : '"';
105
105
  }
106
106
  %>
107
107
  /// <summary>
108
- /// <%=wrapComments(' ', '/// ', p.property.language.csharp.formattedPropertySummary)%><%=additionInfo%>
108
+ /// <%=project.helper.wrapComments(' ', '/// ', p.property.language.csharp.formattedPropertySummary)%><%=additionInfo%>
109
109
  /// </summary>
110
110
  <% (p.property.schema.language.csharp.jsonConverters || []).forEach(function(ct) {-%>
111
111
  [Newtonsoft.Json.JsonConverter(typeof(<%-ct%>))]
@@ -125,11 +125,11 @@ switch(p.property.language.default.flavor) {
125
125
  [Newtonsoft.Json.JsonProperty(PropertyName = "<%-p.serializedName%>")]
126
126
  <% } -%>
127
127
  <% var type = p.property.schema.language.csharp.fullname-%>
128
- <%type = (!project.helper.IsValueType(p.property.schema.type) && !project.helper.IsEnum(p.property.schema) && !(p.property.schema.choiceType && project.helper.IsValueType(p.property.schema.choiceType.type))) || p.required ? type : type + '?'-%>
128
+ <%type = (!project.helper.IsValueType(p.property.schema.type) && !project.helper.IsEnum(p.property.schema) && !(p.property.schema.choiceType && project.helper.IsValueType(p.property.schema.choiceType.type))) || p.required || p.property.nullable == false ? type : type + '?'-%>
129
129
  public <%-type %> <%-p.name%> {get; <%- p.readOnly ? "private " : ""-%>set; }
130
130
  <% }); -%>
131
131
  <%#Below is support for ClassProperties in the model, const properties -%>
132
- <% (publicVirtualProperties || []).filter(p => p.property.schema.type === 'constant' || project.helper.IsConstantProperty(p)).forEach(function(p){-%>
132
+ <% (publicVirtualProperties || []).filter(p => p.property.schema.type === 'constant' || project.helper.IsConstantEnumProperty(p)).forEach(function(p){-%>
133
133
  /// <summary>
134
134
  /// <%=p.property.language.csharp.formattedPropertySummary%>
135
135
  /// </summary>
@@ -161,7 +161,7 @@ var anythingToValidate = false;-%>
161
161
  -%>
162
162
  base.Validate();
163
163
  <% } -%>
164
- <%publicVirtualProperties.filter(p=> p.required && !p.readOnly && !project.helper.IsValueType(p.property.schema.type) && !project.helper.IsConstantProperty(p) && !project.helper.IsEnum(p.property.schema)).forEach(function(p) {
164
+ <%publicVirtualProperties.filter(p=> p.required && !p.readOnly && !project.helper.IsValueType(p.property.schema.type) && !project.helper.IsConstantEnumProperty(p) && !project.helper.IsEnum(p.property.schema)).forEach(function(p) {
165
165
  anythingToValidate = true;
166
166
  -%>
167
167
  if (this.<%-p.name%> == null)