@azure-tools/typespec-ts 0.11.0-alpha.20230413.3

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 (514) hide show
  1. package/.eslintrc.json +23 -0
  2. package/.prettierignore +1 -0
  3. package/.prettierrc +7 -0
  4. package/.rush/temp/package-deps_build.json +392 -0
  5. package/.rush/temp/shrinkwrap-deps.json +472 -0
  6. package/CHANGELOG.md +65 -0
  7. package/CONTRIBUTING.md +137 -0
  8. package/README.md +150 -0
  9. package/dist/src/casingUtils.d.ts +4 -0
  10. package/dist/src/casingUtils.d.ts.map +1 -0
  11. package/dist/src/casingUtils.js +39 -0
  12. package/dist/src/casingUtils.js.map +1 -0
  13. package/dist/src/emitUtil.d.ts +6 -0
  14. package/dist/src/emitUtil.d.ts.map +1 -0
  15. package/dist/src/emitUtil.js +45 -0
  16. package/dist/src/emitUtil.js.map +1 -0
  17. package/dist/src/index.d.ts +3 -0
  18. package/dist/src/index.d.ts.map +1 -0
  19. package/dist/src/index.js +90 -0
  20. package/dist/src/index.js.map +1 -0
  21. package/dist/src/lib.d.ts +159 -0
  22. package/dist/src/lib.d.ts.map +1 -0
  23. package/dist/src/lib.js +190 -0
  24. package/dist/src/lib.js.map +1 -0
  25. package/dist/src/modelUtils.d.ts +33 -0
  26. package/dist/src/modelUtils.d.ts.map +1 -0
  27. package/dist/src/modelUtils.js +900 -0
  28. package/dist/src/modelUtils.js.map +1 -0
  29. package/dist/src/modular/buildApiIndex.d.ts +3 -0
  30. package/dist/src/modular/buildApiIndex.d.ts.map +1 -0
  31. package/dist/src/modular/buildApiIndex.js +12 -0
  32. package/dist/src/modular/buildApiIndex.js.map +1 -0
  33. package/dist/src/modular/buildClassicalClient.d.ts +4 -0
  34. package/dist/src/modular/buildClassicalClient.d.ts.map +1 -0
  35. package/dist/src/modular/buildClassicalClient.js +116 -0
  36. package/dist/src/modular/buildClassicalClient.js.map +1 -0
  37. package/dist/src/modular/buildClientContext.d.ts +7 -0
  38. package/dist/src/modular/buildClientContext.d.ts.map +1 -0
  39. package/dist/src/modular/buildClientContext.js +65 -0
  40. package/dist/src/modular/buildClientContext.js.map +1 -0
  41. package/dist/src/modular/buildCodeModel.d.ts +14 -0
  42. package/dist/src/modular/buildCodeModel.d.ts.map +1 -0
  43. package/dist/src/modular/buildCodeModel.js +1106 -0
  44. package/dist/src/modular/buildCodeModel.js.map +1 -0
  45. package/dist/src/modular/buildOperations.d.ts +13 -0
  46. package/dist/src/modular/buildOperations.d.ts.map +1 -0
  47. package/dist/src/modular/buildOperations.js +68 -0
  48. package/dist/src/modular/buildOperations.js.map +1 -0
  49. package/dist/src/modular/buildProjectFiles.d.ts +5 -0
  50. package/dist/src/modular/buildProjectFiles.d.ts.map +1 -0
  51. package/dist/src/modular/buildProjectFiles.js +188 -0
  52. package/dist/src/modular/buildProjectFiles.js.map +1 -0
  53. package/dist/src/modular/buildRootIndex.d.ts +4 -0
  54. package/dist/src/modular/buildRootIndex.d.ts.map +1 -0
  55. package/dist/src/modular/buildRootIndex.js +49 -0
  56. package/dist/src/modular/buildRootIndex.js.map +1 -0
  57. package/dist/src/modular/buildSharedTypes.d.ts +6 -0
  58. package/dist/src/modular/buildSharedTypes.d.ts.map +1 -0
  59. package/dist/src/modular/buildSharedTypes.js +33 -0
  60. package/dist/src/modular/buildSharedTypes.js.map +1 -0
  61. package/dist/src/modular/emitModels.d.ts +7 -0
  62. package/dist/src/modular/emitModels.d.ts.map +1 -0
  63. package/dist/src/modular/emitModels.js +63 -0
  64. package/dist/src/modular/emitModels.js.map +1 -0
  65. package/dist/src/modular/helpers/clientHelpers.d.ts +4 -0
  66. package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -0
  67. package/dist/src/modular/helpers/clientHelpers.js +31 -0
  68. package/dist/src/modular/helpers/clientHelpers.js.map +1 -0
  69. package/dist/src/modular/helpers/credentialHelpers.d.ts +7 -0
  70. package/dist/src/modular/helpers/credentialHelpers.d.ts.map +1 -0
  71. package/dist/src/modular/helpers/credentialHelpers.js +22 -0
  72. package/dist/src/modular/helpers/credentialHelpers.js.map +1 -0
  73. package/dist/src/modular/helpers/namingHelpers.d.ts +3 -0
  74. package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -0
  75. package/dist/src/modular/helpers/namingHelpers.js +4 -0
  76. package/dist/src/modular/helpers/namingHelpers.js.map +1 -0
  77. package/dist/src/modular/helpers/operationHelpers.d.ts +8 -0
  78. package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -0
  79. package/dist/src/modular/helpers/operationHelpers.js +191 -0
  80. package/dist/src/modular/helpers/operationHelpers.js.map +1 -0
  81. package/dist/src/modular/helpers/parameterHelpers.d.ts +3 -0
  82. package/dist/src/modular/helpers/parameterHelpers.d.ts.map +1 -0
  83. package/dist/src/modular/helpers/parameterHelpers.js +11 -0
  84. package/dist/src/modular/helpers/parameterHelpers.js.map +1 -0
  85. package/dist/src/modular/helpers/typeHelpers.d.ts +16 -0
  86. package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -0
  87. package/dist/src/modular/helpers/typeHelpers.js +71 -0
  88. package/dist/src/modular/helpers/typeHelpers.js.map +1 -0
  89. package/dist/src/modular/interfaces.d.ts +10 -0
  90. package/dist/src/modular/interfaces.d.ts.map +1 -0
  91. package/dist/src/modular/interfaces.js +2 -0
  92. package/dist/src/modular/interfaces.js.map +1 -0
  93. package/dist/src/modular/modularCodeModel.d.ts +120 -0
  94. package/dist/src/modular/modularCodeModel.d.ts.map +1 -0
  95. package/dist/src/modular/modularCodeModel.js +2 -0
  96. package/dist/src/modular/modularCodeModel.js.map +1 -0
  97. package/dist/src/operationUtil.d.ts +16 -0
  98. package/dist/src/operationUtil.d.ts.map +1 -0
  99. package/dist/src/operationUtil.js +142 -0
  100. package/dist/src/operationUtil.js.map +1 -0
  101. package/dist/src/transform/transform.d.ts +6 -0
  102. package/dist/src/transform/transform.d.ts.map +1 -0
  103. package/dist/src/transform/transform.js +87 -0
  104. package/dist/src/transform/transform.js.map +1 -0
  105. package/dist/src/transform/transformAnnotationDetails.d.ts +6 -0
  106. package/dist/src/transform/transformAnnotationDetails.d.ts.map +1 -0
  107. package/dist/src/transform/transformAnnotationDetails.js +188 -0
  108. package/dist/src/transform/transformAnnotationDetails.js.map +1 -0
  109. package/dist/src/transform/transformApiVersionInfo.d.ts +5 -0
  110. package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -0
  111. package/dist/src/transform/transformApiVersionInfo.js +64 -0
  112. package/dist/src/transform/transformApiVersionInfo.js.map +1 -0
  113. package/dist/src/transform/transformParameters.d.ts +14 -0
  114. package/dist/src/transform/transformParameters.d.ts.map +1 -0
  115. package/dist/src/transform/transformParameters.js +314 -0
  116. package/dist/src/transform/transformParameters.js.map +1 -0
  117. package/dist/src/transform/transformPaths.d.ts +10 -0
  118. package/dist/src/transform/transformPaths.d.ts.map +1 -0
  119. package/dist/src/transform/transformPaths.js +124 -0
  120. package/dist/src/transform/transformPaths.js.map +1 -0
  121. package/dist/src/transform/transformResponses.d.ts +5 -0
  122. package/dist/src/transform/transformResponses.d.ts.map +1 -0
  123. package/dist/src/transform/transformResponses.js +136 -0
  124. package/dist/src/transform/transformResponses.js.map +1 -0
  125. package/dist/src/transform/transformSchemas.d.ts +4 -0
  126. package/dist/src/transform/transformSchemas.d.ts.map +1 -0
  127. package/dist/src/transform/transformSchemas.js +161 -0
  128. package/dist/src/transform/transformSchemas.js.map +1 -0
  129. package/dist/src/transform/transfromRLCOptions.d.ts +10 -0
  130. package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -0
  131. package/dist/src/transform/transfromRLCOptions.js +156 -0
  132. package/dist/src/transform/transfromRLCOptions.js.map +1 -0
  133. package/dist/tsconfig.tsbuildinfo +1 -0
  134. package/package.json +80 -0
  135. package/src/casingUtils.ts +48 -0
  136. package/src/emitUtil.ts +63 -0
  137. package/src/index.ts +148 -0
  138. package/src/lib.ts +208 -0
  139. package/src/modelUtils.ts +1080 -0
  140. package/src/modular/buildApiIndex.ts +13 -0
  141. package/src/modular/buildClassicalClient.ts +154 -0
  142. package/src/modular/buildClientContext.ts +96 -0
  143. package/src/modular/buildCodeModel.ts +1444 -0
  144. package/src/modular/buildOperations.ts +93 -0
  145. package/src/modular/buildProjectFiles.ts +217 -0
  146. package/src/modular/buildRootIndex.ts +75 -0
  147. package/src/modular/buildSharedTypes.ts +40 -0
  148. package/src/modular/emitModels.ts +72 -0
  149. package/src/modular/helpers/clientHelpers.ts +38 -0
  150. package/src/modular/helpers/credentialHelpers.ts +29 -0
  151. package/src/modular/helpers/namingHelpers.ts +5 -0
  152. package/src/modular/helpers/operationHelpers.ts +289 -0
  153. package/src/modular/helpers/parameterHelpers.ts +12 -0
  154. package/src/modular/helpers/typeHelpers.ts +84 -0
  155. package/src/modular/interfaces.ts +10 -0
  156. package/src/modular/modularCodeModel.ts +148 -0
  157. package/src/operationUtil.ts +203 -0
  158. package/src/transform/transform.ts +154 -0
  159. package/src/transform/transformAnnotationDetails.ts +231 -0
  160. package/src/transform/transformApiVersionInfo.ts +108 -0
  161. package/src/transform/transformParameters.ts +480 -0
  162. package/src/transform/transformPaths.ts +187 -0
  163. package/src/transform/transformResponses.ts +190 -0
  164. package/src/transform/transformSchemas.ts +197 -0
  165. package/src/transform/transfromRLCOptions.ts +202 -0
  166. package/test/commands/cadl-ranch-list.ts +111 -0
  167. package/test/commands/check-clean-tree.ts +55 -0
  168. package/test/commands/childProcessOnExit.ts +16 -0
  169. package/test/commands/gen-cadl-ranch.ts +21 -0
  170. package/test/commands/run.ts +31 -0
  171. package/test/integration/arrayItemTypes.spec.ts +96 -0
  172. package/test/integration/authApiKey.spec.ts +38 -0
  173. package/test/integration/authOauth2.spec.ts +65 -0
  174. package/test/integration/authUnion.spec.ts +72 -0
  175. package/test/integration/collectionFormat.spec.ts +74 -0
  176. package/test/integration/dictionary.spec.ts +106 -0
  177. package/test/integration/extensibleEnums.spec.ts +61 -0
  178. package/test/integration/fixedEnums.spec.ts +52 -0
  179. package/test/integration/generated/arrays/itemTypes/src/arrayItemTypesClient.ts +31 -0
  180. package/test/integration/generated/arrays/itemTypes/src/clientDefinitions.ts +165 -0
  181. package/test/integration/generated/arrays/itemTypes/src/index.ts +13 -0
  182. package/test/integration/generated/arrays/itemTypes/src/models.ts +9 -0
  183. package/test/integration/generated/arrays/itemTypes/src/outputModels.ts +9 -0
  184. package/test/integration/generated/arrays/itemTypes/src/parameters.ts +86 -0
  185. package/test/integration/generated/arrays/itemTypes/src/responses.ts +115 -0
  186. package/test/integration/generated/arrays/itemTypes/tspconfig.yaml +15 -0
  187. package/test/integration/generated/authentication/apiKey/.eslintrc.json +11 -0
  188. package/test/integration/generated/authentication/apiKey/README.md +56 -0
  189. package/test/integration/generated/authentication/apiKey/api-extractor.json +18 -0
  190. package/test/integration/generated/authentication/apiKey/karma.conf.js +133 -0
  191. package/test/integration/generated/authentication/apiKey/package.json +103 -0
  192. package/test/integration/generated/authentication/apiKey/rollup.config.js +118 -0
  193. package/test/integration/generated/authentication/apiKey/src/authApiKeyClient.ts +41 -0
  194. package/test/integration/generated/authentication/apiKey/src/clientDefinitions.ts +33 -0
  195. package/test/integration/generated/authentication/apiKey/src/index.ts +12 -0
  196. package/test/integration/generated/authentication/apiKey/src/outputModels.ts +6 -0
  197. package/test/integration/generated/authentication/apiKey/src/parameters.ts +7 -0
  198. package/test/integration/generated/authentication/apiKey/src/responses.ts +21 -0
  199. package/test/integration/generated/authentication/apiKey/test/public/sampleTest.spec.ts +23 -0
  200. package/test/integration/generated/authentication/apiKey/test/public/utils/env.browser.ts +2 -0
  201. package/test/integration/generated/authentication/apiKey/test/public/utils/env.ts +6 -0
  202. package/test/integration/generated/authentication/apiKey/test/public/utils/recordedClient.ts +29 -0
  203. package/test/integration/generated/authentication/apiKey/tsconfig.json +25 -0
  204. package/test/integration/generated/authentication/apiKey/tspconfig.yaml +13 -0
  205. package/test/integration/generated/authentication/oauth2/karma.conf.js +133 -0
  206. package/test/integration/generated/authentication/oauth2/src/authOauth2Client.ts +41 -0
  207. package/test/integration/generated/authentication/oauth2/src/clientDefinitions.ts +33 -0
  208. package/test/integration/generated/authentication/oauth2/src/index.ts +12 -0
  209. package/test/integration/generated/authentication/oauth2/src/outputModels.ts +6 -0
  210. package/test/integration/generated/authentication/oauth2/src/parameters.ts +7 -0
  211. package/test/integration/generated/authentication/oauth2/src/responses.ts +21 -0
  212. package/test/integration/generated/authentication/oauth2/test/public/sampleTest.spec.ts +23 -0
  213. package/test/integration/generated/authentication/oauth2/test/public/utils/env.browser.ts +2 -0
  214. package/test/integration/generated/authentication/oauth2/test/public/utils/env.ts +6 -0
  215. package/test/integration/generated/authentication/oauth2/test/public/utils/recordedClient.ts +29 -0
  216. package/test/integration/generated/authentication/oauth2/tspconfig.yaml +15 -0
  217. package/test/integration/generated/authentication/union/karma.conf.js +133 -0
  218. package/test/integration/generated/authentication/union/src/authUnionClient.ts +42 -0
  219. package/test/integration/generated/authentication/union/src/clientDefinitions.ts +27 -0
  220. package/test/integration/generated/authentication/union/src/index.ts +11 -0
  221. package/test/integration/generated/authentication/union/src/parameters.ts +7 -0
  222. package/test/integration/generated/authentication/union/src/responses.ts +14 -0
  223. package/test/integration/generated/authentication/union/test/public/sampleTest.spec.ts +23 -0
  224. package/test/integration/generated/authentication/union/test/public/utils/env.browser.ts +2 -0
  225. package/test/integration/generated/authentication/union/test/public/utils/env.ts +6 -0
  226. package/test/integration/generated/authentication/union/test/public/utils/recordedClient.ts +29 -0
  227. package/test/integration/generated/authentication/union/tspconfig.yaml +15 -0
  228. package/test/integration/generated/dictionary/.eslintrc.json +11 -0
  229. package/test/integration/generated/dictionary/README.md +56 -0
  230. package/test/integration/generated/dictionary/api-extractor.json +18 -0
  231. package/test/integration/generated/dictionary/package.json +80 -0
  232. package/test/integration/generated/dictionary/rollup.config.js +118 -0
  233. package/test/integration/generated/dictionary/src/clientDefinitions.ts +180 -0
  234. package/test/integration/generated/dictionary/src/dictClient.ts +29 -0
  235. package/test/integration/generated/dictionary/src/index.ts +13 -0
  236. package/test/integration/generated/dictionary/src/models.ts +9 -0
  237. package/test/integration/generated/dictionary/src/outputModels.ts +9 -0
  238. package/test/integration/generated/dictionary/src/parameters.ts +94 -0
  239. package/test/integration/generated/dictionary/src/responses.ts +126 -0
  240. package/test/integration/generated/dictionary/tsconfig.json +25 -0
  241. package/test/integration/generated/dictionary/tspconfig.yaml +15 -0
  242. package/test/integration/generated/enums/extensible/.eslintrc.json +11 -0
  243. package/test/integration/generated/enums/extensible/README.md +56 -0
  244. package/test/integration/generated/enums/extensible/api-extractor.json +18 -0
  245. package/test/integration/generated/enums/extensible/package.json +80 -0
  246. package/test/integration/generated/enums/extensible/rollup.config.js +118 -0
  247. package/test/integration/generated/enums/extensible/src/clientDefinitions.ts +45 -0
  248. package/test/integration/generated/enums/extensible/src/enumsExtensible.ts +31 -0
  249. package/test/integration/generated/enums/extensible/src/index.ts +11 -0
  250. package/test/integration/generated/enums/extensible/src/parameters.ts +23 -0
  251. package/test/integration/generated/enums/extensible/src/responses.ts +26 -0
  252. package/test/integration/generated/enums/extensible/tsconfig.json +25 -0
  253. package/test/integration/generated/enums/extensible/tspconfig.yaml +14 -0
  254. package/test/integration/generated/enums/fixed/.eslintrc.json +11 -0
  255. package/test/integration/generated/enums/fixed/README.md +56 -0
  256. package/test/integration/generated/enums/fixed/api-extractor.json +18 -0
  257. package/test/integration/generated/enums/fixed/package.json +80 -0
  258. package/test/integration/generated/enums/fixed/rollup.config.js +118 -0
  259. package/test/integration/generated/enums/fixed/src/clientDefinitions.ts +43 -0
  260. package/test/integration/generated/enums/fixed/src/enumsFixed.ts +31 -0
  261. package/test/integration/generated/enums/fixed/src/index.ts +11 -0
  262. package/test/integration/generated/enums/fixed/src/parameters.ts +36 -0
  263. package/test/integration/generated/enums/fixed/src/responses.ts +27 -0
  264. package/test/integration/generated/enums/fixed/tsconfig.json +25 -0
  265. package/test/integration/generated/enums/fixed/tspconfig.yaml +14 -0
  266. package/test/integration/generated/hello/.eslintrc.json +11 -0
  267. package/test/integration/generated/hello/README.md +56 -0
  268. package/test/integration/generated/hello/api-extractor.json +18 -0
  269. package/test/integration/generated/hello/package.json +80 -0
  270. package/test/integration/generated/hello/rollup.config.js +118 -0
  271. package/test/integration/generated/hello/src/clientDefinitions.ts +19 -0
  272. package/test/integration/generated/hello/src/hello.ts +29 -0
  273. package/test/integration/generated/hello/src/index.ts +11 -0
  274. package/test/integration/generated/hello/src/parameters.ts +6 -0
  275. package/test/integration/generated/hello/src/responses.ts +10 -0
  276. package/test/integration/generated/hello/tsconfig.json +25 -0
  277. package/test/integration/generated/hello/tspconfig.yaml +14 -0
  278. package/test/integration/generated/internal/src/clientDefinitions.ts +27 -0
  279. package/test/integration/generated/internal/src/index.ts +13 -0
  280. package/test/integration/generated/internal/src/internalClient.ts +31 -0
  281. package/test/integration/generated/internal/src/models.ts +8 -0
  282. package/test/integration/generated/internal/src/outputModels.ts +13 -0
  283. package/test/integration/generated/internal/src/parameters.ts +21 -0
  284. package/test/integration/generated/internal/src/responses.ts +20 -0
  285. package/test/integration/generated/internal/tspconfig.yaml +14 -0
  286. package/test/integration/generated/lro/lroBasic/.eslintrc.json +11 -0
  287. package/test/integration/generated/lro/lroBasic/README.md +56 -0
  288. package/test/integration/generated/lro/lroBasic/api-extractor.json +18 -0
  289. package/test/integration/generated/lro/lroBasic/package.json +82 -0
  290. package/test/integration/generated/lro/lroBasic/rollup.config.js +118 -0
  291. package/test/integration/generated/lro/lroBasic/src/azureLro.ts +31 -0
  292. package/test/integration/generated/lro/lroBasic/src/clientDefinitions.ts +37 -0
  293. package/test/integration/generated/lro/lroBasic/src/index.ts +13 -0
  294. package/test/integration/generated/lro/lroBasic/src/outputModels.ts +8 -0
  295. package/test/integration/generated/lro/lroBasic/src/parameters.ts +8 -0
  296. package/test/integration/generated/lro/lroBasic/src/pollingHelper.ts +75 -0
  297. package/test/integration/generated/lro/lroBasic/src/responses.ts +23 -0
  298. package/test/integration/generated/lro/lroBasic/tsconfig.json +25 -0
  299. package/test/integration/generated/lro/lroBasic/tspconfig.yaml +14 -0
  300. package/test/integration/generated/lro/lroCore/.eslintrc.json +11 -0
  301. package/test/integration/generated/lro/lroCore/README.md +56 -0
  302. package/test/integration/generated/lro/lroCore/api-extractor.json +18 -0
  303. package/test/integration/generated/lro/lroCore/package.json +82 -0
  304. package/test/integration/generated/lro/lroCore/rollup.config.js +118 -0
  305. package/test/integration/generated/lro/lroCore/src/azureLroCore.ts +31 -0
  306. package/test/integration/generated/lro/lroCore/src/clientDefinitions.ts +51 -0
  307. package/test/integration/generated/lro/lroCore/src/index.ts +15 -0
  308. package/test/integration/generated/lro/lroCore/src/isUnexpected.ts +128 -0
  309. package/test/integration/generated/lro/lroCore/src/models.ts +8 -0
  310. package/test/integration/generated/lro/lroCore/src/outputModels.ts +53 -0
  311. package/test/integration/generated/lro/lroCore/src/parameters.ts +25 -0
  312. package/test/integration/generated/lro/lroCore/src/pollingHelper.ts +75 -0
  313. package/test/integration/generated/lro/lroCore/src/responses.ts +91 -0
  314. package/test/integration/generated/lro/lroCore/tsconfig.json +25 -0
  315. package/test/integration/generated/lro/lroCore/tspconfig.yaml +14 -0
  316. package/test/integration/generated/models/inheritance/.eslintrc.json +11 -0
  317. package/test/integration/generated/models/inheritance/README.md +56 -0
  318. package/test/integration/generated/models/inheritance/api-extractor.json +18 -0
  319. package/test/integration/generated/models/inheritance/package.json +80 -0
  320. package/test/integration/generated/models/inheritance/rollup.config.js +118 -0
  321. package/test/integration/generated/models/inheritance/src/clientDefinitions.ts +79 -0
  322. package/test/integration/generated/models/inheritance/src/index.ts +13 -0
  323. package/test/integration/generated/models/inheritance/src/models.ts +52 -0
  324. package/test/integration/generated/models/inheritance/src/modelsInheritance.ts +31 -0
  325. package/test/integration/generated/models/inheritance/src/outputModels.ts +52 -0
  326. package/test/integration/generated/models/inheritance/src/parameters.ts +35 -0
  327. package/test/integration/generated/models/inheritance/src/responses.ts +56 -0
  328. package/test/integration/generated/models/inheritance/tsconfig.json +25 -0
  329. package/test/integration/generated/models/inheritance/tspconfig.yaml +14 -0
  330. package/test/integration/generated/models/propertyNullable/.eslintrc.json +11 -0
  331. package/test/integration/generated/models/propertyNullable/README.md +56 -0
  332. package/test/integration/generated/models/propertyNullable/api-extractor.json +18 -0
  333. package/test/integration/generated/models/propertyNullable/package.json +80 -0
  334. package/test/integration/generated/models/propertyNullable/rollup.config.js +118 -0
  335. package/test/integration/generated/models/propertyNullable/src/clientDefinitions.ts +227 -0
  336. package/test/integration/generated/models/propertyNullable/src/index.ts +13 -0
  337. package/test/integration/generated/models/propertyNullable/src/models.ts +56 -0
  338. package/test/integration/generated/models/propertyNullable/src/modelsPropertyNullable.ts +31 -0
  339. package/test/integration/generated/models/propertyNullable/src/outputModels.ts +56 -0
  340. package/test/integration/generated/models/propertyNullable/src/parameters.ts +195 -0
  341. package/test/integration/generated/models/propertyNullable/src/responses.ts +144 -0
  342. package/test/integration/generated/models/propertyNullable/tsconfig.json +25 -0
  343. package/test/integration/generated/models/propertyNullable/tspconfig.yaml +14 -0
  344. package/test/integration/generated/models/propertyOptional/.eslintrc.json +11 -0
  345. package/test/integration/generated/models/propertyOptional/README.md +56 -0
  346. package/test/integration/generated/models/propertyOptional/api-extractor.json +18 -0
  347. package/test/integration/generated/models/propertyOptional/package.json +80 -0
  348. package/test/integration/generated/models/propertyOptional/rollup.config.js +118 -0
  349. package/test/integration/generated/models/propertyOptional/src/clientDefinitions.ts +263 -0
  350. package/test/integration/generated/models/propertyOptional/src/index.ts +13 -0
  351. package/test/integration/generated/models/propertyOptional/src/models.ts +46 -0
  352. package/test/integration/generated/models/propertyOptional/src/modelsPropertyOptional.ts +31 -0
  353. package/test/integration/generated/models/propertyOptional/src/outputModels.ts +46 -0
  354. package/test/integration/generated/models/propertyOptional/src/parameters.ts +124 -0
  355. package/test/integration/generated/models/propertyOptional/src/responses.ts +169 -0
  356. package/test/integration/generated/models/propertyOptional/tsconfig.json +25 -0
  357. package/test/integration/generated/models/propertyOptional/tspconfig.yaml +14 -0
  358. package/test/integration/generated/models/propertyTypes/.eslintrc.json +11 -0
  359. package/test/integration/generated/models/propertyTypes/README.md +56 -0
  360. package/test/integration/generated/models/propertyTypes/api-extractor.json +18 -0
  361. package/test/integration/generated/models/propertyTypes/package.json +80 -0
  362. package/test/integration/generated/models/propertyTypes/rollup.config.js +118 -0
  363. package/test/integration/generated/models/propertyTypes/src/clientDefinitions.ts +234 -0
  364. package/test/integration/generated/models/propertyTypes/src/index.ts +13 -0
  365. package/test/integration/generated/models/propertyTypes/src/models.ts +99 -0
  366. package/test/integration/generated/models/propertyTypes/src/modelsPropertyTypes.ts +31 -0
  367. package/test/integration/generated/models/propertyTypes/src/outputModels.ts +99 -0
  368. package/test/integration/generated/models/propertyTypes/src/parameters.ts +147 -0
  369. package/test/integration/generated/models/propertyTypes/src/responses.ts +186 -0
  370. package/test/integration/generated/models/propertyTypes/tsconfig.json +25 -0
  371. package/test/integration/generated/models/propertyTypes/tspconfig.yaml +14 -0
  372. package/test/integration/generated/models/usage/.eslintrc.json +11 -0
  373. package/test/integration/generated/models/usage/README.md +56 -0
  374. package/test/integration/generated/models/usage/api-extractor.json +18 -0
  375. package/test/integration/generated/models/usage/package.json +80 -0
  376. package/test/integration/generated/models/usage/rollup.config.js +118 -0
  377. package/test/integration/generated/models/usage/src/clientDefinitions.ts +41 -0
  378. package/test/integration/generated/models/usage/src/index.ts +13 -0
  379. package/test/integration/generated/models/usage/src/models.ts +12 -0
  380. package/test/integration/generated/models/usage/src/modelsUsage.ts +31 -0
  381. package/test/integration/generated/models/usage/src/outputModels.ts +12 -0
  382. package/test/integration/generated/models/usage/src/parameters.ts +19 -0
  383. package/test/integration/generated/models/usage/src/responses.ts +22 -0
  384. package/test/integration/generated/models/usage/tsconfig.json +25 -0
  385. package/test/integration/generated/models/usage/tspconfig.yaml +14 -0
  386. package/test/integration/generated/models/visibility/.eslintrc.json +11 -0
  387. package/test/integration/generated/models/visibility/README.md +56 -0
  388. package/test/integration/generated/models/visibility/api-extractor.json +18 -0
  389. package/test/integration/generated/models/visibility/package.json +80 -0
  390. package/test/integration/generated/models/visibility/rollup.config.js +118 -0
  391. package/test/integration/generated/models/visibility/src/clientDefinitions.ts +40 -0
  392. package/test/integration/generated/models/visibility/src/index.ts +13 -0
  393. package/test/integration/generated/models/visibility/src/models.ts +14 -0
  394. package/test/integration/generated/models/visibility/src/modelsVisibilityAutomatic.ts +31 -0
  395. package/test/integration/generated/models/visibility/src/outputModels.ts +16 -0
  396. package/test/integration/generated/models/visibility/src/parameters.ts +41 -0
  397. package/test/integration/generated/models/visibility/src/responses.ts +36 -0
  398. package/test/integration/generated/models/visibility/tsconfig.json +25 -0
  399. package/test/integration/generated/models/visibility/tspconfig.yaml +14 -0
  400. package/test/integration/generated/parameters/collection-format/src/clientDefinitions.ts +39 -0
  401. package/test/integration/generated/parameters/collection-format/src/collectionFormatClient.ts +31 -0
  402. package/test/integration/generated/parameters/collection-format/src/index.ts +12 -0
  403. package/test/integration/generated/parameters/collection-format/src/parameters.ts +38 -0
  404. package/test/integration/generated/parameters/collection-format/src/responses.ts +19 -0
  405. package/test/integration/generated/parameters/collection-format/src/serializeHelper.ts +16 -0
  406. package/test/integration/generated/parameters/collection-format/tspconfig.yaml +14 -0
  407. package/test/integration/generated/projection/src/clientDefinitions.ts +45 -0
  408. package/test/integration/generated/projection/src/index.ts +12 -0
  409. package/test/integration/generated/projection/src/models.ts +11 -0
  410. package/test/integration/generated/projection/src/parameters.ts +26 -0
  411. package/test/integration/generated/projection/src/projectionClient.ts +31 -0
  412. package/test/integration/generated/projection/src/responses.ts +19 -0
  413. package/test/integration/generated/projection/tspconfig.yaml +14 -0
  414. package/test/integration/generated/resiliency/devDriven/.eslintrc.json +11 -0
  415. package/test/integration/generated/resiliency/devDriven/README.md +56 -0
  416. package/test/integration/generated/resiliency/devDriven/api-extractor.json +18 -0
  417. package/test/integration/generated/resiliency/devDriven/package.json +81 -0
  418. package/test/integration/generated/resiliency/devDriven/rollup.config.js +118 -0
  419. package/test/integration/generated/resiliency/devDriven/src/clientDefinitions.ts +75 -0
  420. package/test/integration/generated/resiliency/devDriven/src/index.ts +15 -0
  421. package/test/integration/generated/resiliency/devDriven/src/isUnexpected.ts +117 -0
  422. package/test/integration/generated/resiliency/devDriven/src/models.ts +8 -0
  423. package/test/integration/generated/resiliency/devDriven/src/outputModels.ts +25 -0
  424. package/test/integration/generated/resiliency/devDriven/src/paginateHelper.ts +154 -0
  425. package/test/integration/generated/resiliency/devDriven/src/parameters.ts +17 -0
  426. package/test/integration/generated/resiliency/devDriven/src/resiliencyDevDriven.ts +31 -0
  427. package/test/integration/generated/resiliency/devDriven/src/responses.ts +62 -0
  428. package/test/integration/generated/resiliency/devDriven/tsconfig.json +25 -0
  429. package/test/integration/generated/resiliency/devDriven/tspconfig.yaml +14 -0
  430. package/test/integration/generated/resiliency/srvDriven1/.eslintrc.json +11 -0
  431. package/test/integration/generated/resiliency/srvDriven1/README.md +56 -0
  432. package/test/integration/generated/resiliency/srvDriven1/api-extractor.json +18 -0
  433. package/test/integration/generated/resiliency/srvDriven1/package.json +80 -0
  434. package/test/integration/generated/resiliency/srvDriven1/rollup.config.js +118 -0
  435. package/test/integration/generated/resiliency/srvDriven1/src/clientDefinitions.ts +70 -0
  436. package/test/integration/generated/resiliency/srvDriven1/src/index.ts +13 -0
  437. package/test/integration/generated/resiliency/srvDriven1/src/models.ts +6 -0
  438. package/test/integration/generated/resiliency/srvDriven1/src/outputModels.ts +6 -0
  439. package/test/integration/generated/resiliency/srvDriven1/src/parameters.ts +51 -0
  440. package/test/integration/generated/resiliency/srvDriven1/src/resiliencyServiceDriven1.ts +31 -0
  441. package/test/integration/generated/resiliency/srvDriven1/src/responses.ts +34 -0
  442. package/test/integration/generated/resiliency/srvDriven1/tsconfig.json +25 -0
  443. package/test/integration/generated/resiliency/srvDriven1/tspconfig.yaml +14 -0
  444. package/test/integration/generated/resiliency/srvDriven2/.eslintrc.json +11 -0
  445. package/test/integration/generated/resiliency/srvDriven2/README.md +56 -0
  446. package/test/integration/generated/resiliency/srvDriven2/api-extractor.json +18 -0
  447. package/test/integration/generated/resiliency/srvDriven2/package.json +80 -0
  448. package/test/integration/generated/resiliency/srvDriven2/rollup.config.js +118 -0
  449. package/test/integration/generated/resiliency/srvDriven2/src/clientDefinitions.ts +93 -0
  450. package/test/integration/generated/resiliency/srvDriven2/src/index.ts +13 -0
  451. package/test/integration/generated/resiliency/srvDriven2/src/models.ts +6 -0
  452. package/test/integration/generated/resiliency/srvDriven2/src/outputModels.ts +6 -0
  453. package/test/integration/generated/resiliency/srvDriven2/src/parameters.ts +68 -0
  454. package/test/integration/generated/resiliency/srvDriven2/src/resiliencyServiceDriven2.ts +31 -0
  455. package/test/integration/generated/resiliency/srvDriven2/src/responses.ts +45 -0
  456. package/test/integration/generated/resiliency/srvDriven2/tsconfig.json +25 -0
  457. package/test/integration/generated/resiliency/srvDriven2/tspconfig.yaml +14 -0
  458. package/test/integration/generated/server/path/multiple/src/clientDefinitions.ts +35 -0
  459. package/test/integration/generated/server/path/multiple/src/index.ts +11 -0
  460. package/test/integration/generated/server/path/multiple/src/multipleParamInServerPathClient.ts +39 -0
  461. package/test/integration/generated/server/path/multiple/src/parameters.ts +7 -0
  462. package/test/integration/generated/server/path/multiple/src/responses.ts +14 -0
  463. package/test/integration/generated/server/path/multiple/tspconfig.yaml +14 -0
  464. package/test/integration/generated/server/path/single/src/clientDefinitions.ts +19 -0
  465. package/test/integration/generated/server/path/single/src/index.ts +11 -0
  466. package/test/integration/generated/server/path/single/src/parameters.ts +6 -0
  467. package/test/integration/generated/server/path/single/src/responses.ts +9 -0
  468. package/test/integration/generated/server/path/single/src/singleParamInServerPathClient.ts +34 -0
  469. package/test/integration/generated/server/path/single/tspconfig.yaml +14 -0
  470. package/test/integration/generated/specialWords/src/clientDefinitions.ts +61 -0
  471. package/test/integration/generated/specialWords/src/index.ts +13 -0
  472. package/test/integration/generated/specialWords/src/models.ts +17 -0
  473. package/test/integration/generated/specialWords/src/outputModels.ts +17 -0
  474. package/test/integration/generated/specialWords/src/parameters.ts +37 -0
  475. package/test/integration/generated/specialWords/src/responses.ts +31 -0
  476. package/test/integration/generated/specialWords/src/specialWordsClient.ts +31 -0
  477. package/test/integration/generated/specialWords/tspconfig.yaml +14 -0
  478. package/test/integration/generated/unions/src/clientDefinitions.ts +53 -0
  479. package/test/integration/generated/unions/src/index.ts +12 -0
  480. package/test/integration/generated/unions/src/models.ts +27 -0
  481. package/test/integration/generated/unions/src/parameters.ts +34 -0
  482. package/test/integration/generated/unions/src/responses.ts +24 -0
  483. package/test/integration/generated/unions/src/unionsClient.ts +31 -0
  484. package/test/integration/generated/unions/tspconfig.yaml +14 -0
  485. package/test/integration/helloWorld.spec.ts +20 -0
  486. package/test/integration/internal.spec.ts +43 -0
  487. package/test/integration/lroBasic.spec.ts +25 -0
  488. package/test/integration/modelInheritance.spec.ts +192 -0
  489. package/test/integration/modelPropertyNullable.spec.ts +115 -0
  490. package/test/integration/modelPropertyOptional.spec.ts +362 -0
  491. package/test/integration/modelPropertyType.spec.ts +119 -0
  492. package/test/integration/modelUsage.spec.ts +47 -0
  493. package/test/integration/projection.spec.ts +55 -0
  494. package/test/integration/resiliencyDpgCustomization.spec.ts +52 -0
  495. package/test/integration/server.spec.ts +59 -0
  496. package/test/integration/specialWords.spec.ts +73 -0
  497. package/test/integration/unions.spec.ts +69 -0
  498. package/test/tsconfig.json +4 -0
  499. package/test/unit/apiVersion.spec.ts +388 -0
  500. package/test/unit/azureCoreOperationsGenerator.spec.ts +71 -0
  501. package/test/unit/clientDefinitionGenerator.spec.ts +73 -0
  502. package/test/unit/clientFactoryGenerator.spec.ts +376 -0
  503. package/test/unit/docsGenerator.spec.ts +201 -0
  504. package/test/unit/modelsGenerator.spec.ts +1319 -0
  505. package/test/unit/parametersGenerator.spec.ts +561 -0
  506. package/test/unit/responsesGenerator.spec.ts +462 -0
  507. package/test/unit/spreadAndAlias.spec.ts +200 -0
  508. package/test/unit/util/emitUtil.ts +157 -0
  509. package/test/unit/util/testUtil.ts +83 -0
  510. package/test/util/customBearerTokenTestingPolicy.ts +78 -0
  511. package/test/util/matrix.ts +48 -0
  512. package/tsconfig.json +36 -0
  513. package/tsconfig.test.json +7 -0
  514. package/typespec-ts.build.log +2 -0
@@ -0,0 +1,227 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ import {
5
+ StringGetNonNullParameters,
6
+ StringPatchNonNullParameters,
7
+ StringGetNullParameters,
8
+ StringPatchNullParameters,
9
+ BytesGetNonNullParameters,
10
+ BytesPatchNonNullParameters,
11
+ BytesGetNullParameters,
12
+ BytesPatchNullParameters,
13
+ DatetimeGetNonNullParameters,
14
+ DatetimePatchNonNullParameters,
15
+ DatetimeGetNullParameters,
16
+ DatetimePatchNullParameters,
17
+ DurationGetNonNullParameters,
18
+ DurationPatchNonNullParameters,
19
+ DurationGetNullParameters,
20
+ DurationPatchNullParameters,
21
+ CollectionsByteGetNonNullParameters,
22
+ CollectionsBytePatchNonNullParameters,
23
+ CollectionsByteGetNullParameters,
24
+ CollectionsBytePatchNullParameters,
25
+ CollectionsModelGetNonNullParameters,
26
+ CollectionsModelPatchNonNullParameters,
27
+ CollectionsModelGetNullParameters,
28
+ CollectionsModelPatchNullParameters,
29
+ } from "./parameters";
30
+ import {
31
+ StringGetNonNull200Response,
32
+ StringPatchNonNull204Response,
33
+ StringGetNull200Response,
34
+ StringPatchNull204Response,
35
+ BytesGetNonNull200Response,
36
+ BytesPatchNonNull204Response,
37
+ BytesGetNull200Response,
38
+ BytesPatchNull204Response,
39
+ DatetimeGetNonNull200Response,
40
+ DatetimePatchNonNull204Response,
41
+ DatetimeGetNull200Response,
42
+ DatetimePatchNull204Response,
43
+ DurationGetNonNull200Response,
44
+ DurationPatchNonNull204Response,
45
+ DurationGetNull200Response,
46
+ DurationPatchNull204Response,
47
+ CollectionsByteGetNonNull200Response,
48
+ CollectionsBytePatchNonNull204Response,
49
+ CollectionsByteGetNull200Response,
50
+ CollectionsBytePatchNull204Response,
51
+ CollectionsModelGetNonNull200Response,
52
+ CollectionsModelPatchNonNull204Response,
53
+ CollectionsModelGetNull200Response,
54
+ CollectionsModelPatchNull204Response,
55
+ } from "./responses";
56
+ import { Client, StreamableMethod } from "@azure-rest/core-client";
57
+
58
+ export interface StringGetNonNull {
59
+ /** Get models that will return all properties in the model */
60
+ get(
61
+ options?: StringGetNonNullParameters
62
+ ): StreamableMethod<StringGetNonNull200Response>;
63
+ /** Put a body with all properties present. */
64
+ patch(
65
+ options: StringPatchNonNullParameters
66
+ ): StreamableMethod<StringPatchNonNull204Response>;
67
+ }
68
+
69
+ export interface StringGetNull {
70
+ /** Get models that will return the default object */
71
+ get(
72
+ options?: StringGetNullParameters
73
+ ): StreamableMethod<StringGetNull200Response>;
74
+ /** Put a body with default properties. */
75
+ patch(
76
+ options: StringPatchNullParameters
77
+ ): StreamableMethod<StringPatchNull204Response>;
78
+ }
79
+
80
+ export interface BytesGetNonNull {
81
+ /** Get models that will return all properties in the model */
82
+ get(
83
+ options?: BytesGetNonNullParameters
84
+ ): StreamableMethod<BytesGetNonNull200Response>;
85
+ /** Put a body with all properties present. */
86
+ patch(
87
+ options: BytesPatchNonNullParameters
88
+ ): StreamableMethod<BytesPatchNonNull204Response>;
89
+ }
90
+
91
+ export interface BytesGetNull {
92
+ /** Get models that will return the default object */
93
+ get(
94
+ options?: BytesGetNullParameters
95
+ ): StreamableMethod<BytesGetNull200Response>;
96
+ /** Put a body with default properties. */
97
+ patch(
98
+ options: BytesPatchNullParameters
99
+ ): StreamableMethod<BytesPatchNull204Response>;
100
+ }
101
+
102
+ export interface DatetimeGetNonNull {
103
+ /** Get models that will return all properties in the model */
104
+ get(
105
+ options?: DatetimeGetNonNullParameters
106
+ ): StreamableMethod<DatetimeGetNonNull200Response>;
107
+ /** Put a body with all properties present. */
108
+ patch(
109
+ options: DatetimePatchNonNullParameters
110
+ ): StreamableMethod<DatetimePatchNonNull204Response>;
111
+ }
112
+
113
+ export interface DatetimeGetNull {
114
+ /** Get models that will return the default object */
115
+ get(
116
+ options?: DatetimeGetNullParameters
117
+ ): StreamableMethod<DatetimeGetNull200Response>;
118
+ /** Put a body with default properties. */
119
+ patch(
120
+ options: DatetimePatchNullParameters
121
+ ): StreamableMethod<DatetimePatchNull204Response>;
122
+ }
123
+
124
+ export interface DurationGetNonNull {
125
+ /** Get models that will return all properties in the model */
126
+ get(
127
+ options?: DurationGetNonNullParameters
128
+ ): StreamableMethod<DurationGetNonNull200Response>;
129
+ /** Put a body with all properties present. */
130
+ patch(
131
+ options: DurationPatchNonNullParameters
132
+ ): StreamableMethod<DurationPatchNonNull204Response>;
133
+ }
134
+
135
+ export interface DurationGetNull {
136
+ /** Get models that will return the default object */
137
+ get(
138
+ options?: DurationGetNullParameters
139
+ ): StreamableMethod<DurationGetNull200Response>;
140
+ /** Put a body with default properties. */
141
+ patch(
142
+ options: DurationPatchNullParameters
143
+ ): StreamableMethod<DurationPatchNull204Response>;
144
+ }
145
+
146
+ export interface CollectionsByteGetNonNull {
147
+ /** Get models that will return all properties in the model */
148
+ get(
149
+ options?: CollectionsByteGetNonNullParameters
150
+ ): StreamableMethod<CollectionsByteGetNonNull200Response>;
151
+ /** Put a body with all properties present. */
152
+ patch(
153
+ options: CollectionsBytePatchNonNullParameters
154
+ ): StreamableMethod<CollectionsBytePatchNonNull204Response>;
155
+ }
156
+
157
+ export interface CollectionsByteGetNull {
158
+ /** Get models that will return the default object */
159
+ get(
160
+ options?: CollectionsByteGetNullParameters
161
+ ): StreamableMethod<CollectionsByteGetNull200Response>;
162
+ /** Put a body with default properties. */
163
+ patch(
164
+ options: CollectionsBytePatchNullParameters
165
+ ): StreamableMethod<CollectionsBytePatchNull204Response>;
166
+ }
167
+
168
+ export interface CollectionsModelGetNonNull {
169
+ /** Get models that will return all properties in the model */
170
+ get(
171
+ options?: CollectionsModelGetNonNullParameters
172
+ ): StreamableMethod<CollectionsModelGetNonNull200Response>;
173
+ /** Put a body with all properties present. */
174
+ patch(
175
+ options: CollectionsModelPatchNonNullParameters
176
+ ): StreamableMethod<CollectionsModelPatchNonNull204Response>;
177
+ }
178
+
179
+ export interface CollectionsModelGetNull {
180
+ /** Get models that will return the default object */
181
+ get(
182
+ options?: CollectionsModelGetNullParameters
183
+ ): StreamableMethod<CollectionsModelGetNull200Response>;
184
+ /** Put a body with default properties. */
185
+ patch(
186
+ options: CollectionsModelPatchNullParameters
187
+ ): StreamableMethod<CollectionsModelPatchNull204Response>;
188
+ }
189
+
190
+ export interface Routes {
191
+ /** Resource for '/models/properties/nullable/string/non-null' has methods for the following verbs: get, patch */
192
+ (path: "/models/properties/nullable/string/non-null"): StringGetNonNull;
193
+ /** Resource for '/models/properties/nullable/string/null' has methods for the following verbs: get, patch */
194
+ (path: "/models/properties/nullable/string/null"): StringGetNull;
195
+ /** Resource for '/models/properties/nullable/bytes/non-null' has methods for the following verbs: get, patch */
196
+ (path: "/models/properties/nullable/bytes/non-null"): BytesGetNonNull;
197
+ /** Resource for '/models/properties/nullable/bytes/null' has methods for the following verbs: get, patch */
198
+ (path: "/models/properties/nullable/bytes/null"): BytesGetNull;
199
+ /** Resource for '/models/properties/nullable/datetime/non-null' has methods for the following verbs: get, patch */
200
+ (path: "/models/properties/nullable/datetime/non-null"): DatetimeGetNonNull;
201
+ /** Resource for '/models/properties/nullable/datetime/null' has methods for the following verbs: get, patch */
202
+ (path: "/models/properties/nullable/datetime/null"): DatetimeGetNull;
203
+ /** Resource for '/models/properties/nullable/duration/non-null' has methods for the following verbs: get, patch */
204
+ (path: "/models/properties/nullable/duration/non-null"): DurationGetNonNull;
205
+ /** Resource for '/models/properties/nullable/duration/null' has methods for the following verbs: get, patch */
206
+ (path: "/models/properties/nullable/duration/null"): DurationGetNull;
207
+ /** Resource for '/models/properties/nullable/collections/bytes/non-null' has methods for the following verbs: get, patch */
208
+ (
209
+ path: "/models/properties/nullable/collections/bytes/non-null"
210
+ ): CollectionsByteGetNonNull;
211
+ /** Resource for '/models/properties/nullable/collections/bytes/null' has methods for the following verbs: get, patch */
212
+ (
213
+ path: "/models/properties/nullable/collections/bytes/null"
214
+ ): CollectionsByteGetNull;
215
+ /** Resource for '/models/properties/nullable/collections/model/non-null' has methods for the following verbs: get, patch */
216
+ (
217
+ path: "/models/properties/nullable/collections/model/non-null"
218
+ ): CollectionsModelGetNonNull;
219
+ /** Resource for '/models/properties/nullable/collections/model/null' has methods for the following verbs: get, patch */
220
+ (
221
+ path: "/models/properties/nullable/collections/model/null"
222
+ ): CollectionsModelGetNull;
223
+ }
224
+
225
+ export type ModelsPropertyNullableClient = Client & {
226
+ path: Routes;
227
+ };
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ import ModelsPropertyNullable from "./modelsPropertyNullable";
5
+
6
+ export * from "./modelsPropertyNullable";
7
+ export * from "./parameters";
8
+ export * from "./responses";
9
+ export * from "./clientDefinitions";
10
+ export * from "./models";
11
+ export * from "./outputModels";
12
+
13
+ export default ModelsPropertyNullable;
@@ -0,0 +1,56 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ /** Template type for testing models with nullable property. Pass in the type of the property you are looking for */
5
+ export interface StringProperty {
6
+ /** Required property */
7
+ requiredProperty: string;
8
+ /** Property */
9
+ nullableProperty: string | null;
10
+ }
11
+
12
+ /** Template type for testing models with nullable property. Pass in the type of the property you are looking for */
13
+ export interface BytesProperty {
14
+ /** Required property */
15
+ requiredProperty: string;
16
+ /** Property */
17
+ nullableProperty: string | null;
18
+ }
19
+
20
+ /** Model with a datetime property */
21
+ export interface DatetimeProperty {
22
+ /** Required property */
23
+ requiredProperty: string;
24
+ /** Property */
25
+ nullableProperty: Date | string | null;
26
+ }
27
+
28
+ /** Model with a duration property */
29
+ export interface DurationProperty {
30
+ /** Required property */
31
+ requiredProperty: string;
32
+ /** Property */
33
+ nullableProperty: string | null;
34
+ }
35
+
36
+ /** Model with collection bytes properties */
37
+ export interface CollectionsByteProperty {
38
+ /** Required property */
39
+ requiredProperty: string;
40
+ /** Property */
41
+ nullableProperty: string[] | null;
42
+ }
43
+
44
+ /** Model with collection models properties */
45
+ export interface CollectionsModelProperty {
46
+ /** Required property */
47
+ requiredProperty: string;
48
+ /** Property */
49
+ nullableProperty: Array<InnerModel> | null;
50
+ }
51
+
52
+ /** Inner model used in collections model property */
53
+ export interface InnerModel {
54
+ /** Inner model property */
55
+ property: string;
56
+ }
@@ -0,0 +1,31 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ import { getClient, ClientOptions } from "@azure-rest/core-client";
5
+ import { ModelsPropertyNullableClient } from "./clientDefinitions";
6
+
7
+ /**
8
+ * Initialize a new instance of `ModelsPropertyNullableClient`
9
+ * @param options type: ClientOptions, the parameter for all optional parameters
10
+ */
11
+ export default function createClient(
12
+ options: ClientOptions = {}
13
+ ): ModelsPropertyNullableClient {
14
+ const baseUrl = options.baseUrl ?? `http://localhost:3000`;
15
+ options.apiVersion = options.apiVersion ?? "1.0.0";
16
+ const userAgentInfo = `azsdk-js-nullable-property-rest/1.0.0`;
17
+ const userAgentPrefix =
18
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
19
+ ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
20
+ : `${userAgentInfo}`;
21
+ options = {
22
+ ...options,
23
+ userAgentOptions: {
24
+ userAgentPrefix,
25
+ },
26
+ };
27
+
28
+ const client = getClient(baseUrl, options) as ModelsPropertyNullableClient;
29
+
30
+ return client;
31
+ }
@@ -0,0 +1,56 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ /** Template type for testing models with nullable property. Pass in the type of the property you are looking for */
5
+ export interface StringPropertyOutput {
6
+ /** Required property */
7
+ requiredProperty: string;
8
+ /** Property */
9
+ nullableProperty: string | null;
10
+ }
11
+
12
+ /** Template type for testing models with nullable property. Pass in the type of the property you are looking for */
13
+ export interface BytesPropertyOutput {
14
+ /** Required property */
15
+ requiredProperty: string;
16
+ /** Property */
17
+ nullableProperty: string | null;
18
+ }
19
+
20
+ /** Model with a datetime property */
21
+ export interface DatetimePropertyOutput {
22
+ /** Required property */
23
+ requiredProperty: string;
24
+ /** Property */
25
+ nullableProperty: string | null;
26
+ }
27
+
28
+ /** Model with a duration property */
29
+ export interface DurationPropertyOutput {
30
+ /** Required property */
31
+ requiredProperty: string;
32
+ /** Property */
33
+ nullableProperty: string | null;
34
+ }
35
+
36
+ /** Model with collection bytes properties */
37
+ export interface CollectionsBytePropertyOutput {
38
+ /** Required property */
39
+ requiredProperty: string;
40
+ /** Property */
41
+ nullableProperty: string[] | null;
42
+ }
43
+
44
+ /** Model with collection models properties */
45
+ export interface CollectionsModelPropertyOutput {
46
+ /** Required property */
47
+ requiredProperty: string;
48
+ /** Property */
49
+ nullableProperty: Array<InnerModelOutput> | null;
50
+ }
51
+
52
+ /** Inner model used in collections model property */
53
+ export interface InnerModelOutput {
54
+ /** Inner model property */
55
+ property: string;
56
+ }
@@ -0,0 +1,195 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ import { RequestParameters } from "@azure-rest/core-client";
5
+ import {
6
+ StringProperty,
7
+ BytesProperty,
8
+ DatetimeProperty,
9
+ DurationProperty,
10
+ CollectionsByteProperty,
11
+ CollectionsModelProperty,
12
+ } from "./models";
13
+
14
+ export type StringGetNonNullParameters = RequestParameters;
15
+ export type StringGetNullParameters = RequestParameters;
16
+ export type StringPropertyResourceMergeAndPatch = Partial<StringProperty>;
17
+
18
+ export interface StringPatchNonNullBodyParam {
19
+ body: StringPropertyResourceMergeAndPatch;
20
+ }
21
+
22
+ export interface StringPatchNonNullMediaTypesParam {
23
+ /** content-type is application/merge-patch+json */
24
+ contentType: "application/merge-patch+json";
25
+ }
26
+
27
+ export type StringPatchNonNullParameters = StringPatchNonNullMediaTypesParam &
28
+ StringPatchNonNullBodyParam &
29
+ RequestParameters;
30
+
31
+ export interface StringPatchNullBodyParam {
32
+ body: StringPropertyResourceMergeAndPatch;
33
+ }
34
+
35
+ export interface StringPatchNullMediaTypesParam {
36
+ /** content-type is application/merge-patch+json */
37
+ contentType: "application/merge-patch+json";
38
+ }
39
+
40
+ export type StringPatchNullParameters = StringPatchNullMediaTypesParam &
41
+ StringPatchNullBodyParam &
42
+ RequestParameters;
43
+ export type BytesGetNonNullParameters = RequestParameters;
44
+ export type BytesGetNullParameters = RequestParameters;
45
+ export type BytesPropertyResourceMergeAndPatch = Partial<BytesProperty>;
46
+
47
+ export interface BytesPatchNonNullBodyParam {
48
+ body: BytesPropertyResourceMergeAndPatch;
49
+ }
50
+
51
+ export interface BytesPatchNonNullMediaTypesParam {
52
+ /** content-type is application/merge-patch+json */
53
+ contentType: "application/merge-patch+json";
54
+ }
55
+
56
+ export type BytesPatchNonNullParameters = BytesPatchNonNullMediaTypesParam &
57
+ BytesPatchNonNullBodyParam &
58
+ RequestParameters;
59
+
60
+ export interface BytesPatchNullBodyParam {
61
+ body: BytesPropertyResourceMergeAndPatch;
62
+ }
63
+
64
+ export interface BytesPatchNullMediaTypesParam {
65
+ /** content-type is application/merge-patch+json */
66
+ contentType: "application/merge-patch+json";
67
+ }
68
+
69
+ export type BytesPatchNullParameters = BytesPatchNullMediaTypesParam &
70
+ BytesPatchNullBodyParam &
71
+ RequestParameters;
72
+ export type DatetimeGetNonNullParameters = RequestParameters;
73
+ export type DatetimeGetNullParameters = RequestParameters;
74
+ export type DatetimePropertyResourceMergeAndPatch = Partial<DatetimeProperty>;
75
+
76
+ export interface DatetimePatchNonNullBodyParam {
77
+ body: DatetimePropertyResourceMergeAndPatch;
78
+ }
79
+
80
+ export interface DatetimePatchNonNullMediaTypesParam {
81
+ /** content-type is application/merge-patch+json */
82
+ contentType: "application/merge-patch+json";
83
+ }
84
+
85
+ export type DatetimePatchNonNullParameters =
86
+ DatetimePatchNonNullMediaTypesParam &
87
+ DatetimePatchNonNullBodyParam &
88
+ RequestParameters;
89
+
90
+ export interface DatetimePatchNullBodyParam {
91
+ body: DatetimePropertyResourceMergeAndPatch;
92
+ }
93
+
94
+ export interface DatetimePatchNullMediaTypesParam {
95
+ /** content-type is application/merge-patch+json */
96
+ contentType: "application/merge-patch+json";
97
+ }
98
+
99
+ export type DatetimePatchNullParameters = DatetimePatchNullMediaTypesParam &
100
+ DatetimePatchNullBodyParam &
101
+ RequestParameters;
102
+ export type DurationGetNonNullParameters = RequestParameters;
103
+ export type DurationGetNullParameters = RequestParameters;
104
+ export type DurationPropertyResourceMergeAndPatch = Partial<DurationProperty>;
105
+
106
+ export interface DurationPatchNonNullBodyParam {
107
+ body: DurationPropertyResourceMergeAndPatch;
108
+ }
109
+
110
+ export interface DurationPatchNonNullMediaTypesParam {
111
+ /** content-type is application/merge-patch+json */
112
+ contentType: "application/merge-patch+json";
113
+ }
114
+
115
+ export type DurationPatchNonNullParameters =
116
+ DurationPatchNonNullMediaTypesParam &
117
+ DurationPatchNonNullBodyParam &
118
+ RequestParameters;
119
+
120
+ export interface DurationPatchNullBodyParam {
121
+ body: DurationPropertyResourceMergeAndPatch;
122
+ }
123
+
124
+ export interface DurationPatchNullMediaTypesParam {
125
+ /** content-type is application/merge-patch+json */
126
+ contentType: "application/merge-patch+json";
127
+ }
128
+
129
+ export type DurationPatchNullParameters = DurationPatchNullMediaTypesParam &
130
+ DurationPatchNullBodyParam &
131
+ RequestParameters;
132
+ export type CollectionsByteGetNonNullParameters = RequestParameters;
133
+ export type CollectionsByteGetNullParameters = RequestParameters;
134
+ export type CollectionsBytePropertyResourceMergeAndPatch =
135
+ Partial<CollectionsByteProperty>;
136
+
137
+ export interface CollectionsBytePatchNonNullBodyParam {
138
+ body: CollectionsBytePropertyResourceMergeAndPatch;
139
+ }
140
+
141
+ export interface CollectionsBytePatchNonNullMediaTypesParam {
142
+ /** content-type is application/merge-patch+json */
143
+ contentType: "application/merge-patch+json";
144
+ }
145
+
146
+ export type CollectionsBytePatchNonNullParameters =
147
+ CollectionsBytePatchNonNullMediaTypesParam &
148
+ CollectionsBytePatchNonNullBodyParam &
149
+ RequestParameters;
150
+
151
+ export interface CollectionsBytePatchNullBodyParam {
152
+ body: CollectionsBytePropertyResourceMergeAndPatch;
153
+ }
154
+
155
+ export interface CollectionsBytePatchNullMediaTypesParam {
156
+ /** content-type is application/merge-patch+json */
157
+ contentType: "application/merge-patch+json";
158
+ }
159
+
160
+ export type CollectionsBytePatchNullParameters =
161
+ CollectionsBytePatchNullMediaTypesParam &
162
+ CollectionsBytePatchNullBodyParam &
163
+ RequestParameters;
164
+ export type CollectionsModelGetNonNullParameters = RequestParameters;
165
+ export type CollectionsModelGetNullParameters = RequestParameters;
166
+ export type CollectionsModelPropertyResourceMergeAndPatch =
167
+ Partial<CollectionsModelProperty>;
168
+
169
+ export interface CollectionsModelPatchNonNullBodyParam {
170
+ body: CollectionsModelPropertyResourceMergeAndPatch;
171
+ }
172
+
173
+ export interface CollectionsModelPatchNonNullMediaTypesParam {
174
+ /** content-type is application/merge-patch+json */
175
+ contentType: "application/merge-patch+json";
176
+ }
177
+
178
+ export type CollectionsModelPatchNonNullParameters =
179
+ CollectionsModelPatchNonNullMediaTypesParam &
180
+ CollectionsModelPatchNonNullBodyParam &
181
+ RequestParameters;
182
+
183
+ export interface CollectionsModelPatchNullBodyParam {
184
+ body: CollectionsModelPropertyResourceMergeAndPatch;
185
+ }
186
+
187
+ export interface CollectionsModelPatchNullMediaTypesParam {
188
+ /** content-type is application/merge-patch+json */
189
+ contentType: "application/merge-patch+json";
190
+ }
191
+
192
+ export type CollectionsModelPatchNullParameters =
193
+ CollectionsModelPatchNullMediaTypesParam &
194
+ CollectionsModelPatchNullBodyParam &
195
+ RequestParameters;