@autorest/powershell 4.0.0-dev.1 → 4.0.0-dev.10

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 (306) hide show
  1. package/.rush/temp/package-deps_build.json +94 -60
  2. package/.rush/temp/shrinkwrap-deps.json +22 -22
  3. package/autorest-configuration-for-sdk.md +122 -0
  4. package/autorest-configuration.md +4 -2
  5. package/dist/cmdlets/class.d.ts +1 -0
  6. package/dist/cmdlets/class.d.ts.map +1 -1
  7. package/dist/cmdlets/class.js +218 -82
  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 +3 -1
  11. package/dist/cmdlets/namespace.js.map +1 -1
  12. package/dist/cmdlets/parameter.js +1 -0
  13. package/dist/cmdlets/parameter.js.map +1 -1
  14. package/dist/enums/namespace.js +2 -1
  15. package/dist/enums/namespace.js.map +1 -1
  16. package/dist/file-formats/md-file.js +1 -0
  17. package/dist/file-formats/md-file.js.map +1 -1
  18. package/dist/file-formats/psd-file.js +1 -0
  19. package/dist/file-formats/psd-file.js.map +1 -1
  20. package/dist/file-formats/psscript-file.js +1 -0
  21. package/dist/file-formats/psscript-file.js.map +1 -1
  22. package/dist/generators/csproj.js +1 -0
  23. package/dist/generators/csproj.js.map +1 -1
  24. package/dist/generators/gitattributes.js +1 -0
  25. package/dist/generators/gitattributes.js.map +1 -1
  26. package/dist/generators/gitignore.js +1 -0
  27. package/dist/generators/gitignore.js.map +1 -1
  28. package/dist/generators/inputhandler.custom.d.ts +3 -0
  29. package/dist/generators/inputhandler.custom.d.ts.map +1 -0
  30. package/dist/generators/inputhandler.custom.js +33 -0
  31. package/dist/generators/inputhandler.custom.js.map +1 -0
  32. package/dist/generators/nuspec.js +1 -0
  33. package/dist/generators/nuspec.js.map +1 -1
  34. package/dist/generators/psm1.custom.js +1 -0
  35. package/dist/generators/psm1.custom.js.map +1 -1
  36. package/dist/generators/psm1.internal.js +1 -0
  37. package/dist/generators/psm1.internal.js.map +1 -1
  38. package/dist/generators/psm1.js +3 -2
  39. package/dist/generators/psm1.js.map +1 -1
  40. package/dist/generators/readme.js +1 -0
  41. package/dist/generators/readme.js.map +1 -1
  42. package/dist/generators/script-cmdlet.js +2 -1
  43. package/dist/generators/script-cmdlet.js.map +1 -1
  44. package/dist/internal/name-inferrer.js +1 -0
  45. package/dist/internal/name-inferrer.js.map +1 -1
  46. package/dist/internal/powershell-declarations.d.ts +3 -0
  47. package/dist/internal/powershell-declarations.d.ts.map +1 -1
  48. package/dist/internal/powershell-declarations.js +3 -0
  49. package/dist/internal/powershell-declarations.js.map +1 -1
  50. package/dist/internal/project.d.ts +12 -9
  51. package/dist/internal/project.d.ts.map +1 -1
  52. package/dist/internal/project.js +31 -12
  53. package/dist/internal/project.js.map +1 -1
  54. package/dist/internal/state.js +1 -0
  55. package/dist/internal/state.js.map +1 -1
  56. package/dist/internal/verbs.js +1 -0
  57. package/dist/internal/verbs.js.map +1 -1
  58. package/dist/llcsharp/clientruntime.d.ts +3 -0
  59. package/dist/llcsharp/clientruntime.d.ts.map +1 -1
  60. package/dist/llcsharp/clientruntime.js +4 -0
  61. package/dist/llcsharp/clientruntime.js.map +1 -1
  62. package/dist/llcsharp/code-model.d.ts +1 -0
  63. package/dist/llcsharp/code-model.d.ts.map +1 -1
  64. package/dist/llcsharp/csharp-declarations.js +1 -0
  65. package/dist/llcsharp/csharp-declarations.js.map +1 -1
  66. package/dist/llcsharp/enums/enum.js +2 -1
  67. package/dist/llcsharp/enums/enum.js.map +1 -1
  68. package/dist/llcsharp/enums/namespace.js +1 -0
  69. package/dist/llcsharp/enums/namespace.js.map +1 -1
  70. package/dist/llcsharp/exports.js +23 -13
  71. package/dist/llcsharp/exports.js.map +1 -1
  72. package/dist/llcsharp/generator.js +1 -0
  73. package/dist/llcsharp/generator.js.map +1 -1
  74. package/dist/llcsharp/messages.js +1 -0
  75. package/dist/llcsharp/messages.js.map +1 -1
  76. package/dist/llcsharp/model/idictionary.js +1 -0
  77. package/dist/llcsharp/model/idictionary.js.map +1 -1
  78. package/dist/llcsharp/model/interface.d.ts.map +1 -1
  79. package/dist/llcsharp/model/interface.js +2 -1
  80. package/dist/llcsharp/model/interface.js.map +1 -1
  81. package/dist/llcsharp/model/model-class-dictionary.js +1 -0
  82. package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
  83. package/dist/llcsharp/model/model-class-json.d.ts.map +1 -1
  84. package/dist/llcsharp/model/model-class-json.js +12 -2
  85. package/dist/llcsharp/model/model-class-json.js.map +1 -1
  86. package/dist/llcsharp/model/model-class-serializer.js +1 -0
  87. package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
  88. package/dist/llcsharp/model/model-class.js +11 -10
  89. package/dist/llcsharp/model/model-class.js.map +1 -1
  90. package/dist/llcsharp/model/namespace.js +1 -0
  91. package/dist/llcsharp/model/namespace.js.map +1 -1
  92. package/dist/llcsharp/model/property.js +1 -0
  93. package/dist/llcsharp/model/property.js.map +1 -1
  94. package/dist/llcsharp/operation/api-class.js +1 -0
  95. package/dist/llcsharp/operation/api-class.js.map +1 -1
  96. package/dist/llcsharp/operation/method.d.ts.map +1 -1
  97. package/dist/llcsharp/operation/method.js +21 -27
  98. package/dist/llcsharp/operation/method.js.map +1 -1
  99. package/dist/llcsharp/operation/namespace.js +1 -0
  100. package/dist/llcsharp/operation/namespace.js.map +1 -1
  101. package/dist/llcsharp/operation/parameter.js +1 -0
  102. package/dist/llcsharp/operation/parameter.js.map +1 -1
  103. package/dist/llcsharp/project.d.ts.map +1 -1
  104. package/dist/llcsharp/project.js +3 -1
  105. package/dist/llcsharp/project.js.map +1 -1
  106. package/dist/llcsharp/schema/Uuid.js +1 -0
  107. package/dist/llcsharp/schema/Uuid.js.map +1 -1
  108. package/dist/llcsharp/schema/array.js +1 -0
  109. package/dist/llcsharp/schema/array.js.map +1 -1
  110. package/dist/llcsharp/schema/binary.js +1 -0
  111. package/dist/llcsharp/schema/binary.js.map +1 -1
  112. package/dist/llcsharp/schema/boolean.js +1 -0
  113. package/dist/llcsharp/schema/boolean.js.map +1 -1
  114. package/dist/llcsharp/schema/byte-array.js +1 -0
  115. package/dist/llcsharp/schema/byte-array.js.map +1 -1
  116. package/dist/llcsharp/schema/char.js +1 -0
  117. package/dist/llcsharp/schema/char.js.map +1 -1
  118. package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
  119. package/dist/llcsharp/schema/date-time.js +1 -0
  120. package/dist/llcsharp/schema/date-time.js.map +1 -1
  121. package/dist/llcsharp/schema/date.js +1 -0
  122. package/dist/llcsharp/schema/date.js.map +1 -1
  123. package/dist/llcsharp/schema/duration.js +1 -0
  124. package/dist/llcsharp/schema/duration.js.map +1 -1
  125. package/dist/llcsharp/schema/enum.js +1 -0
  126. package/dist/llcsharp/schema/enum.js.map +1 -1
  127. package/dist/llcsharp/schema/integer.js +1 -0
  128. package/dist/llcsharp/schema/integer.js.map +1 -1
  129. package/dist/llcsharp/schema/object.js +1 -0
  130. package/dist/llcsharp/schema/object.js.map +1 -1
  131. package/dist/llcsharp/schema/password.js +2 -1
  132. package/dist/llcsharp/schema/password.js.map +1 -1
  133. package/dist/llcsharp/schema/primitive.js +1 -0
  134. package/dist/llcsharp/schema/primitive.js.map +1 -1
  135. package/dist/llcsharp/schema/schema-resolver.d.ts +2 -3
  136. package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
  137. package/dist/llcsharp/schema/schema-resolver.js +4 -0
  138. package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
  139. package/dist/llcsharp/schema/string.d.ts.map +1 -1
  140. package/dist/llcsharp/schema/string.js +1 -0
  141. package/dist/llcsharp/schema/string.js.map +1 -1
  142. package/dist/llcsharp/schema/uri.d.ts +10 -0
  143. package/dist/llcsharp/schema/uri.d.ts.map +1 -0
  144. package/dist/llcsharp/schema/uri.js +25 -0
  145. package/dist/llcsharp/schema/uri.js.map +1 -0
  146. package/dist/llcsharp/validations.js +1 -0
  147. package/dist/llcsharp/validations.js.map +1 -1
  148. package/dist/main.d.ts.map +1 -1
  149. package/dist/main.js +11 -0
  150. package/dist/main.js.map +1 -1
  151. package/dist/models/model-extensions.js +7 -6
  152. package/dist/models/model-extensions.js.map +1 -1
  153. package/dist/module/module-class.js +2 -1
  154. package/dist/module/module-class.js.map +1 -1
  155. package/dist/module/module-namespace.js +1 -0
  156. package/dist/module/module-namespace.js.map +1 -1
  157. package/dist/plugins/add-azure-completers-v2.js +1 -0
  158. package/dist/plugins/add-azure-completers-v2.js.map +1 -1
  159. package/dist/plugins/create-commands-v2.d.ts.map +1 -1
  160. package/dist/plugins/create-commands-v2.js +6 -4
  161. package/dist/plugins/create-commands-v2.js.map +1 -1
  162. package/dist/plugins/cs-namer-v2.js +4 -3
  163. package/dist/plugins/cs-namer-v2.js.map +1 -1
  164. package/dist/plugins/llcsharp-v2.js +1 -0
  165. package/dist/plugins/llcsharp-v2.js.map +1 -1
  166. package/dist/plugins/modifiers-v2.d.ts +4 -0
  167. package/dist/plugins/modifiers-v2.d.ts.map +1 -1
  168. package/dist/plugins/modifiers-v2.js +69 -13
  169. package/dist/plugins/modifiers-v2.js.map +1 -1
  170. package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -1
  171. package/dist/plugins/plugin-create-inline-properties.js +16 -1
  172. package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
  173. package/dist/plugins/plugin-tweak-m4-model.js +4 -3
  174. package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
  175. package/dist/plugins/plugin-tweak-model-azure-v2.js +4 -3
  176. package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
  177. package/dist/plugins/plugin-tweak-model.js +15 -14
  178. package/dist/plugins/plugin-tweak-model.js.map +1 -1
  179. package/dist/plugins/powershell-v2.d.ts.map +1 -1
  180. package/dist/plugins/powershell-v2.js +8 -2
  181. package/dist/plugins/powershell-v2.js.map +1 -1
  182. package/dist/plugins/ps-namer-v2.js +1 -0
  183. package/dist/plugins/ps-namer-v2.js.map +1 -1
  184. package/dist/plugins/sdk-create-inline-properties.d.ts +4 -0
  185. package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -0
  186. package/dist/plugins/sdk-create-inline-properties.js +552 -0
  187. package/dist/plugins/sdk-create-inline-properties.js.map +1 -0
  188. package/dist/plugins/sdk-cs-namer.d.ts +3 -0
  189. package/dist/plugins/sdk-cs-namer.d.ts.map +1 -0
  190. package/dist/plugins/sdk-cs-namer.js +385 -0
  191. package/dist/plugins/sdk-cs-namer.js.map +1 -0
  192. package/dist/plugins/sdk-cs-simplifier.d.ts +3 -0
  193. package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -0
  194. package/dist/plugins/sdk-cs-simplifier.js +154 -0
  195. package/dist/plugins/sdk-cs-simplifier.js.map +1 -0
  196. package/dist/plugins/sdk-generate.d.ts +3 -0
  197. package/dist/plugins/sdk-generate.d.ts.map +1 -0
  198. package/dist/plugins/sdk-generate.js +106 -0
  199. package/dist/plugins/sdk-generate.js.map +1 -0
  200. package/dist/plugins/sdk-tweak-model.d.ts +3 -0
  201. package/dist/plugins/sdk-tweak-model.d.ts.map +1 -0
  202. package/dist/plugins/sdk-tweak-model.js +357 -0
  203. package/dist/plugins/sdk-tweak-model.js.map +1 -0
  204. package/dist/sdk/project.d.ts +45 -0
  205. package/dist/sdk/project.d.ts.map +1 -0
  206. package/dist/sdk/project.js +56 -0
  207. package/dist/sdk/project.js.map +1 -0
  208. package/dist/sdk/state.d.ts +23 -0
  209. package/dist/sdk/state.d.ts.map +1 -0
  210. package/dist/sdk/state.js +28 -0
  211. package/dist/sdk/state.js.map +1 -0
  212. package/dist/sdk/utility.d.ts +32 -0
  213. package/dist/sdk/utility.d.ts.map +1 -0
  214. package/dist/sdk/utility.js +414 -0
  215. package/dist/sdk/utility.js.map +1 -0
  216. package/dist/utils/PwshModel.js +1 -0
  217. package/dist/utils/PwshModel.js.map +1 -1
  218. package/dist/utils/SdkModel.d.ts +7 -0
  219. package/dist/utils/SdkModel.d.ts.map +1 -0
  220. package/dist/utils/SdkModel.js +17 -0
  221. package/dist/utils/SdkModel.js.map +1 -0
  222. package/dist/utils/TrieNode.d.ts +10 -0
  223. package/dist/utils/TrieNode.d.ts.map +1 -0
  224. package/dist/utils/TrieNode.js +45 -0
  225. package/dist/utils/TrieNode.js.map +1 -0
  226. package/dist/utils/WrapComments.d.ts +2 -0
  227. package/dist/utils/WrapComments.d.ts.map +1 -0
  228. package/dist/utils/WrapComments.js +46 -0
  229. package/dist/utils/WrapComments.js.map +1 -0
  230. package/dist/utils/code-namer.d.ts +3 -0
  231. package/dist/utils/code-namer.d.ts.map +1 -0
  232. package/dist/utils/code-namer.js +38 -0
  233. package/dist/utils/code-namer.js.map +1 -0
  234. package/dist/utils/command-operation.d.ts +1 -0
  235. package/dist/utils/command-operation.d.ts.map +1 -1
  236. package/dist/utils/command-operation.js +2 -2
  237. package/dist/utils/command-operation.js.map +1 -1
  238. package/dist/utils/components.d.ts +2 -0
  239. package/dist/utils/components.d.ts.map +1 -1
  240. package/dist/utils/components.js +1 -0
  241. package/dist/utils/components.js.map +1 -1
  242. package/dist/utils/extensions.js +1 -0
  243. package/dist/utils/extensions.js.map +1 -1
  244. package/dist/utils/http-definitions.js +1 -0
  245. package/dist/utils/http-definitions.js.map +1 -1
  246. package/dist/utils/http-operation.js +1 -0
  247. package/dist/utils/http-operation.js.map +1 -1
  248. package/dist/utils/info.js +1 -0
  249. package/dist/utils/info.js.map +1 -1
  250. package/dist/utils/model-state.js +1 -0
  251. package/dist/utils/model-state.js.map +1 -1
  252. package/dist/utils/powershell-comment.js +11 -10
  253. package/dist/utils/powershell-comment.js.map +1 -1
  254. package/dist/utils/programatic-operation.js +2 -2
  255. package/dist/utils/programatic-operation.js.map +1 -1
  256. package/dist/utils/resolve-conflicts.js +1 -0
  257. package/dist/utils/resolve-conflicts.js.map +1 -1
  258. package/dist/utils/schema.d.ts +4 -0
  259. package/dist/utils/schema.d.ts.map +1 -1
  260. package/dist/utils/schema.js +28 -0
  261. package/dist/utils/schema.js.map +1 -1
  262. package/dist/utils/security-scheme.js +1 -0
  263. package/dist/utils/security-scheme.js.map +1 -1
  264. package/dist/utils/uid.js +1 -0
  265. package/dist/utils/uid.js.map +1 -1
  266. package/package.json +6 -5
  267. package/readme.md +5 -1
  268. package/resources/assets/build-module.ps1 +9 -1
  269. package/resources/assets/create-model-cmdlets.ps1 +8 -5
  270. package/resources/assets/custom/README.md +1 -1
  271. package/resources/assets/docs/README.md +1 -1
  272. package/resources/assets/exports/README.md +1 -1
  273. package/resources/assets/generate-portal-ux.ps1 +379 -0
  274. package/resources/assets/how-to.md +1 -1
  275. package/resources/assets/internal/README.md +1 -1
  276. package/resources/assets/tools/Resources/docs/README.md +1 -1
  277. package/resources/assets/tools/Resources/how-to.md +1 -1
  278. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec +1 -1
  279. package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +1 -1
  280. package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +34 -34
  281. package/resources/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt +1 -1
  282. package/resources/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp +1 -1
  283. package/resources/psruntime/Attributes/ExternalDocsAttribute.cs +30 -0
  284. package/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs +39 -4
  285. package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +8 -2
  286. package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +6 -0
  287. package/resources/psruntime/BuildTime/PsAttributes.cs +7 -0
  288. package/resources/runtime/csharp/client/Context.cs +33 -0
  289. package/resources/runtime/csharp/client/InfoAttribute.cs +1 -0
  290. package/resources/runtime/csharp/client/InputHandler.cs +22 -0
  291. package/resources/runtime/csharp/pipeline/Events.cs +2 -2
  292. package/resources/templates/azureMethod.ejs +5 -0
  293. package/resources/templates/azureMethodGroup.ejs +46 -0
  294. package/resources/templates/azureServiceClient.ejs +80 -0
  295. package/resources/templates/enum.ejs +73 -0
  296. package/resources/templates/exception.ejs +52 -0
  297. package/resources/templates/extensionMethod.ejs +68 -0
  298. package/resources/templates/extensions.ejs +19 -0
  299. package/resources/templates/longRunningOperationMethod.ejs +43 -0
  300. package/resources/templates/method.ejs +65 -0
  301. package/resources/templates/methodBodyRestCall.ejs +317 -0
  302. package/resources/templates/methodGroupInterface.ejs +77 -0
  303. package/resources/templates/model.ejs +184 -0
  304. package/resources/templates/page.ejs +40 -0
  305. package/resources/templates/serviceClientBody.ejs +303 -0
  306. package/resources/templates/serviceClientInterface.ejs +55 -0
@@ -0,0 +1,303 @@
1
+ /// <summary>
2
+ /// The base URI of the service.
3
+ /// </summary>
4
+ <%# ToDo: Add support for customBaseUri, priority is low-%>
5
+ public System.Uri BaseUri { get; set; }
6
+ /// <summary>
7
+ /// Gets or sets json serialization settings.
8
+ /// </summary>
9
+ public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; }
10
+ /// <summary>
11
+ /// Gets or sets json deserialization settings.
12
+ /// </summary>
13
+ public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; }
14
+ <% (project.model.globalParameters || []).filter(p=>p.language.default.name != '$host').forEach(function(parameter) {-%>
15
+ /// <summary>
16
+ /// <%=parameter.language.default.description%>
17
+ /// </summary>
18
+ <% var type = parameter.schema.type == 'constant' ? parameter.schema.valueType.language.csharp.fullname : parameter.schema.language.csharp.fullname-%>
19
+ <%type = type.includes('.') || type == 'string' ? type : type + '?'-%>
20
+ <% if (parameter.readOnly || parameter.schema.type == 'constant') {-%>
21
+ public <%- type %> <%- parameter.language.default.name%> { get; private set; }
22
+ <% } else {-%>
23
+ public <%- type %> <%- parameter.language.default.name%> { get; set;}
24
+ <% }%>
25
+ <%});-%>
26
+ <% project.model.operationGroups.forEach(function(methodGroup){ -%>
27
+ <% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
28
+ /// <summary>
29
+ /// Gets the I<%- project.helper.PascalCase(key) %>Operations
30
+ /// </summary>
31
+ public virtual I<%- project.helper.PascalCase(key) %>Operations <%- project.helper.PascalCase(methodGroup.$key) %> { get; private set; }
32
+ <% }); -%>
33
+ /// <summary>
34
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
35
+ /// </summary>
36
+ /// <param name='httpClient'>
37
+ /// HttpClient to be used
38
+ /// </param>
39
+ /// <param name='disposeHttpClient'>
40
+ /// True: will dispose the provided httpClient on calling <%-project.model.info.title%>.Dispose(). False: will not dispose provided httpClient</param>
41
+ <%# ToDo: Add support for case that ContainsCredentials is false, low priority-%>
42
+ protected <%-project.model.info.title%>(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
43
+ {
44
+ this.Initialize();
45
+ }
46
+ /// <summary>
47
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
48
+ /// </summary>
49
+ /// <param name='handlers'>
50
+ /// Optional. The delegating handlers to add to the http client pipeline.
51
+ /// </param>
52
+ protected <%-project.model.info.title%>(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers)
53
+ {
54
+ this.Initialize();
55
+ }
56
+ /// <summary>
57
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
58
+ /// </summary>
59
+ /// <param name='rootHandler'>
60
+ /// Optional. The http client handler used to handle http transport.
61
+ /// </param>
62
+ /// <param name='handlers'>
63
+ /// Optional. The delegating handlers to add to the http client pipeline.
64
+ /// </param>
65
+ protected <%-project.model.info.title%>(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers)
66
+ {
67
+ this.Initialize();
68
+ }
69
+ <%# ToDo: following true means !IsCustomBaseUri, may need to implement IsCustomBaseUri, low priority -%>
70
+ <% if(true) {-%>
71
+ /// <summary>
72
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
73
+ /// </summary>
74
+ /// <param name='baseUri'>
75
+ /// Optional. The base URI of the service.
76
+ /// </param>
77
+ /// <param name='handlers'>
78
+ /// Optional. The delegating handlers to add to the http client pipeline.
79
+ /// </param>
80
+ /// <exception cref="System.ArgumentNullException">
81
+ /// Thrown when a required parameter is null
82
+ /// </exception>
83
+ protected <%-project.model.info.title%>(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
84
+ {
85
+ if (baseUri == null)
86
+ {
87
+ throw new System.ArgumentNullException("baseUri");
88
+ }
89
+ this.BaseUri = baseUri;
90
+ }
91
+ /// <summary>
92
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
93
+ /// </summary>
94
+ /// <param name='baseUri'>
95
+ /// Optional. The base URI of the service.
96
+ /// </param>
97
+ /// <param name='rootHandler'>
98
+ /// Optional. The http client handler used to handle http transport.
99
+ /// </param>
100
+ /// <param name='handlers'>
101
+ /// Optional. The delegating handlers to add to the http client pipeline.
102
+ /// </param>
103
+ /// <exception cref="System.ArgumentNullException">
104
+ /// Thrown when a required parameter is null
105
+ /// </exception>
106
+ protected <%-project.model.info.title%>(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
107
+ {
108
+ if (baseUri == null)
109
+ {
110
+ throw new System.ArgumentNullException("baseUri");
111
+ }
112
+
113
+ this.BaseUri = baseUri;
114
+ }
115
+ <% } -%>
116
+ <% var parameters = (project.model.globalParameters || []).filter(p => p.required && p.readOnly)
117
+ if (parameters.length > 0) {-%>
118
+ /// <summary>
119
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
120
+ /// </summary>
121
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter){-%>
122
+ /// <param name='<%-project.helper.CamelCase(parameter.language.default.name)%>'>
123
+ /// Required. <%-parameter.language.default.description%>
124
+ /// </param>
125
+ <%});-%>
126
+ /// <param name='handlers'>
127
+ /// Optional. The delegating handlers to add to the http client pipeline.
128
+ /// </param>
129
+ /// <exception cref="System.ArgumentNullException">
130
+ /// Thrown when a required parameter is null
131
+ /// </exception>
132
+ <%# ToDo: assume the access is public, need to figure the logic of ConstructorVisibility-%>
133
+ public <%-project.model.info.title%>(<%-project.model.language.default.requiredConstructorParametersDeclaration%>, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
134
+ {
135
+ <%parameters.forEach(function(parameter) {-%>
136
+ if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
137
+ {
138
+ throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
139
+ }
140
+ <%});-%>
141
+ <%parameters.forEach(function(parameter) {-%>
142
+ this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
143
+ <%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
144
+ if (this.Credentials != null)
145
+ {
146
+ this.Credentials.InitializeServiceClient(this);
147
+ }
148
+ <% }-%>
149
+ <%});-%>
150
+ }
151
+ /// <summary>
152
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
153
+ /// </summary>
154
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
155
+ /// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
156
+ /// Required. <%-parameter.language.default.description%>
157
+ /// </param>
158
+ <%});-%>
159
+ /// <param name='httpClient'>
160
+ /// HttpClient to be used
161
+ /// </param>
162
+ /// <param name='disposeHttpClient'>
163
+ /// True: will dispose the provided httpClient on calling <%-project.model.info.title%>.Dispose(). False: will not dispose provided httpClient</param>
164
+ /// <exception cref="System.ArgumentNullException">
165
+ /// Thrown when a required parameter is null
166
+ /// </exception>
167
+ public <%-project.model.info.title%>(<%-project.model.language.default.requiredConstructorParametersDeclaration%>, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
168
+ {
169
+ <%parameters.forEach(function(parameter) {-%>
170
+ if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
171
+ {
172
+ throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
173
+ }
174
+ <%});-%>
175
+ <%parameters.forEach(function(parameter) {-%>
176
+ this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
177
+ <%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
178
+ if (this.Credentials != null)
179
+ {
180
+ this.Credentials.InitializeServiceClient(this);
181
+ }
182
+ <% }-%>
183
+ <%});-%>
184
+ }
185
+ /// <summary>
186
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
187
+ /// </summary>
188
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
189
+ /// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
190
+ /// Required. <%-parameter.language.default.description%>
191
+ /// </param>
192
+ <%});-%>
193
+ /// <param name='rootHandler'>
194
+ /// Optional. The http client handler used to handle http transport.
195
+ /// </param>
196
+ /// <param name='handlers'>
197
+ /// Optional. The delegating handlers to add to the http client pipeline.
198
+ /// </param>
199
+ /// <exception cref="System.ArgumentNullException">
200
+ /// Thrown when a required parameter is null
201
+ /// </exception>
202
+ public <%-project.model.info.title%>(<%-project.model.language.default.requiredConstructorParametersDeclaration%>, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
203
+ {
204
+ <%parameters.forEach(function(parameter) {-%>
205
+ if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
206
+ {
207
+ throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
208
+ }
209
+ <%});-%>
210
+ <%parameters.forEach(function(parameter) {-%>
211
+ this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
212
+ <%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
213
+ if (this.Credentials != null)
214
+ {
215
+ this.Credentials.InitializeServiceClient(this);
216
+ }
217
+ <% }-%>
218
+ <%});-%>
219
+ }
220
+ <%# ToDo: following true means !IsCustomBaseUri, may need to implement IsCustomBaseUri, low priority -%>
221
+ <%if (true) {-%>
222
+ /// <summary>
223
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
224
+ /// </summary>
225
+ /// <param name='baseUri'>
226
+ /// Optional. The base URI of the service.
227
+ /// </param>
228
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
229
+ /// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
230
+ /// Required. <%-parameter.language.default.description%>
231
+ /// </param>
232
+ <%});-%>
233
+ /// <param name='handlers'>
234
+ /// Optional. The delegating handlers to add to the http client pipeline.
235
+ /// </param>
236
+ /// <exception cref="System.ArgumentNullException">
237
+ /// Thrown when a required parameter is null
238
+ /// </exception>
239
+ public <%-project.model.info.title%>(System.Uri baseUri, <%-project.model.language.default.requiredConstructorParametersDeclaration%>, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
240
+ {
241
+ if (baseUri == null)
242
+ {
243
+ throw new System.ArgumentNullException("baseUri");
244
+ }
245
+ <%parameters.forEach(function(parameter) {-%>
246
+ if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
247
+ {
248
+ throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
249
+ }
250
+ <%});-%>
251
+ this.BaseUri = baseUri;
252
+ <%parameters.forEach(function(parameter) {-%>
253
+ this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
254
+ <%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
255
+ if (this.Credentials != null)
256
+ {
257
+ this.Credentials.InitializeServiceClient(this);
258
+ }
259
+ <% }-%>
260
+ <%});-%>
261
+ }
262
+ /// <summary>
263
+ /// Initializes a new instance of the <%-project.model.info.title%> class.
264
+ /// </summary>
265
+ /// <param name='baseUri'>
266
+ /// Optional. The base URI of the service.
267
+ /// </param>
268
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
269
+ /// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
270
+ /// Required. <%-parameter.language.default.description%>
271
+ /// </param>
272
+ <%});-%>
273
+ /// <param name='rootHandler'>
274
+ /// Optional. The http client handler used to handle http transport.
275
+ /// </param>
276
+ /// <exception cref="System.ArgumentNullException">
277
+ /// Thrown when a required parameter is null
278
+ /// </exception>
279
+ public <%-project.model.info.title%>(System.Uri baseUri, <%-project.model.language.default.requiredConstructorParametersDeclaration%>, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
280
+ {
281
+ if (baseUri == null)
282
+ {
283
+ throw new System.ArgumentNullException("baseUri");
284
+ }
285
+ <%parameters.forEach(function(parameter) {-%>
286
+ if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
287
+ {
288
+ throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
289
+ }
290
+ <%});-%>
291
+ this.BaseUri = baseUri;
292
+ <%parameters.forEach(function(parameter) {-%>
293
+ this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
294
+ <%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
295
+ if (this.Credentials != null)
296
+ {
297
+ this.Credentials.InitializeServiceClient(this);
298
+ }
299
+ <% }-%>
300
+ <%});-%>
301
+ }
302
+ <%}-%>
303
+ <% }-%>
@@ -0,0 +1,55 @@
1
+ <%- project.commentHeader %>
2
+
3
+ namespace <%- project.namespace %>
4
+ {
5
+ using Microsoft.Rest;
6
+ <% project.model.usings.forEach(function(using){ -%>
7
+ using <%- using %>;
8
+ <% }); -%>
9
+
10
+ /// <summary>
11
+ /// <%- project.model.info.description %>
12
+ /// </summary>
13
+ <% var client = project.model.info.title -%>
14
+ public partial interface I<%- client %> : System.IDisposable
15
+ {
16
+ /// <summary>
17
+ /// The base URI of the service.
18
+ /// </summary>
19
+ System.Uri BaseUri { get; set; }
20
+
21
+ /// <summary>
22
+ /// Gets or sets json serialization settings.
23
+ /// </summary>
24
+ Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }
25
+
26
+ /// <summary>
27
+ /// Gets or sets json deserialization settings.
28
+ /// </summary>
29
+ Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }
30
+
31
+ <% (project.model.globalParameters || []).filter(p => p.language.default.name != '$host').forEach(function(parameter){ -%>
32
+ /// <summary>
33
+ /// <%- parameter.language.default.description %>
34
+ /// </summary>
35
+ <%# ToDo: need to use fullname instead of namespace + name -%>
36
+ <% var type = parameter.schema.type == 'constant' ? parameter.schema.valueType.language.csharp.fullname : parameter.schema.language.csharp.fullname-%>
37
+ <%type = type.includes('.') || type == 'string' ? type : type + '?'-%>
38
+ <% if (parameter.readOnly || parameter.schema.type == 'constant') {-%>
39
+ <%- type %> <%- parameter.language.default.name%> { get;}
40
+ <% } else {-%>
41
+ <%- type %> <%- parameter.language.default.name%> { get; set;}
42
+ <% }%>
43
+
44
+ <% }); -%>
45
+ <% project.model.operationGroups.forEach(function(methodGroup){ -%>
46
+ <% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
47
+ /// <summary>
48
+ /// Gets the I<%- project.helper.PascalCase(key) %>Operations
49
+ /// </summary>
50
+ I<%- project.helper.PascalCase(key) %>Operations <%- project.helper.PascalCase(methodGroup.$key) %> { get; }
51
+
52
+ <% }); -%>
53
+ <%# ToDo: Add method whose group is empty, and need to check in which case the group is empty.-%>
54
+ }
55
+ }