@azure/arm-mixedreality 2.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/LICENSE.txt +1 -1
  4. package/README.md +72 -73
  5. package/dist/index.js +2016 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.min.js +1 -0
  8. package/dist/index.min.js.map +1 -0
  9. package/dist-esm/samples-dev/checkLocalNameAvailability.d.ts +2 -0
  10. package/dist-esm/samples-dev/checkLocalNameAvailability.d.ts.map +1 -0
  11. package/dist-esm/samples-dev/checkLocalNameAvailability.js +34 -0
  12. package/dist-esm/samples-dev/checkLocalNameAvailability.js.map +1 -0
  13. package/dist-esm/samples-dev/createRemoteRenderingAccount.d.ts +2 -0
  14. package/dist-esm/samples-dev/createRemoteRenderingAccount.d.ts.map +1 -0
  15. package/dist-esm/samples-dev/createRemoteRenderingAccount.js +35 -0
  16. package/dist-esm/samples-dev/createRemoteRenderingAccount.js.map +1 -0
  17. package/dist-esm/samples-dev/createSpatialAnchorAccount.d.ts +2 -0
  18. package/dist-esm/samples-dev/createSpatialAnchorAccount.d.ts.map +1 -0
  19. package/dist-esm/samples-dev/createSpatialAnchorAccount.js +34 -0
  20. package/dist-esm/samples-dev/createSpatialAnchorAccount.js.map +1 -0
  21. package/dist-esm/samples-dev/deleteRemoteRenderingAccount.d.ts +2 -0
  22. package/dist-esm/samples-dev/deleteRemoteRenderingAccount.d.ts.map +1 -0
  23. package/dist-esm/samples-dev/deleteRemoteRenderingAccount.js +31 -0
  24. package/dist-esm/samples-dev/deleteRemoteRenderingAccount.js.map +1 -0
  25. package/dist-esm/samples-dev/deleteSpatialAnchorsAccount.d.ts +2 -0
  26. package/dist-esm/samples-dev/deleteSpatialAnchorsAccount.d.ts.map +1 -0
  27. package/dist-esm/samples-dev/deleteSpatialAnchorsAccount.js +31 -0
  28. package/dist-esm/samples-dev/deleteSpatialAnchorsAccount.js.map +1 -0
  29. package/dist-esm/samples-dev/getRemoteRenderingAccount.d.ts +2 -0
  30. package/dist-esm/samples-dev/getRemoteRenderingAccount.d.ts.map +1 -0
  31. package/dist-esm/samples-dev/getRemoteRenderingAccount.js +31 -0
  32. package/dist-esm/samples-dev/getRemoteRenderingAccount.js.map +1 -0
  33. package/dist-esm/samples-dev/getSpatialAnchorsAccount.d.ts +2 -0
  34. package/dist-esm/samples-dev/getSpatialAnchorsAccount.d.ts.map +1 -0
  35. package/dist-esm/samples-dev/getSpatialAnchorsAccount.js +31 -0
  36. package/dist-esm/samples-dev/getSpatialAnchorsAccount.js.map +1 -0
  37. package/dist-esm/samples-dev/listAvailableOperations.d.ts +2 -0
  38. package/dist-esm/samples-dev/listAvailableOperations.d.ts.map +1 -0
  39. package/dist-esm/samples-dev/listAvailableOperations.js +43 -0
  40. package/dist-esm/samples-dev/listAvailableOperations.js.map +1 -0
  41. package/dist-esm/samples-dev/listRemoteRenderingAccountKey.d.ts +2 -0
  42. package/dist-esm/samples-dev/listRemoteRenderingAccountKey.d.ts.map +1 -0
  43. package/dist-esm/samples-dev/listRemoteRenderingAccountKey.js +31 -0
  44. package/dist-esm/samples-dev/listRemoteRenderingAccountKey.js.map +1 -0
  45. package/dist-esm/samples-dev/listRemoteRenderingAccountsByResourceGroup.d.ts +2 -0
  46. package/dist-esm/samples-dev/listRemoteRenderingAccountsByResourceGroup.d.ts.map +1 -0
  47. package/dist-esm/samples-dev/listRemoteRenderingAccountsByResourceGroup.js +44 -0
  48. package/dist-esm/samples-dev/listRemoteRenderingAccountsByResourceGroup.js.map +1 -0
  49. package/dist-esm/samples-dev/listRemoteRenderingAccountsBySubscription.d.ts +2 -0
  50. package/dist-esm/samples-dev/listRemoteRenderingAccountsBySubscription.d.ts.map +1 -0
  51. package/dist-esm/samples-dev/listRemoteRenderingAccountsBySubscription.js +43 -0
  52. package/dist-esm/samples-dev/listRemoteRenderingAccountsBySubscription.js.map +1 -0
  53. package/dist-esm/samples-dev/listSpatialAnchorAccountKey.d.ts +2 -0
  54. package/dist-esm/samples-dev/listSpatialAnchorAccountKey.d.ts.map +1 -0
  55. package/dist-esm/samples-dev/listSpatialAnchorAccountKey.js +31 -0
  56. package/dist-esm/samples-dev/listSpatialAnchorAccountKey.js.map +1 -0
  57. package/dist-esm/samples-dev/listSpatialAnchorAccountsByResourceGroup.d.ts +2 -0
  58. package/dist-esm/samples-dev/listSpatialAnchorAccountsByResourceGroup.d.ts.map +1 -0
  59. package/dist-esm/samples-dev/listSpatialAnchorAccountsByResourceGroup.js +44 -0
  60. package/dist-esm/samples-dev/listSpatialAnchorAccountsByResourceGroup.js.map +1 -0
  61. package/dist-esm/samples-dev/listSpatialAnchorsAccountsBySubscription.d.ts +2 -0
  62. package/dist-esm/samples-dev/listSpatialAnchorsAccountsBySubscription.d.ts.map +1 -0
  63. package/dist-esm/samples-dev/listSpatialAnchorsAccountsBySubscription.js +43 -0
  64. package/dist-esm/samples-dev/listSpatialAnchorsAccountsBySubscription.js.map +1 -0
  65. package/dist-esm/samples-dev/regenerateRemoteRenderingAccountKeys.d.ts +2 -0
  66. package/dist-esm/samples-dev/regenerateRemoteRenderingAccountKeys.d.ts.map +1 -0
  67. package/dist-esm/samples-dev/regenerateRemoteRenderingAccountKeys.js +32 -0
  68. package/dist-esm/samples-dev/regenerateRemoteRenderingAccountKeys.js.map +1 -0
  69. package/dist-esm/samples-dev/regenerateSpatialAnchorsAccountKeys.d.ts +2 -0
  70. package/dist-esm/samples-dev/regenerateSpatialAnchorsAccountKeys.d.ts.map +1 -0
  71. package/dist-esm/samples-dev/regenerateSpatialAnchorsAccountKeys.js +32 -0
  72. package/dist-esm/samples-dev/regenerateSpatialAnchorsAccountKeys.js.map +1 -0
  73. package/dist-esm/samples-dev/updateRemoteRenderingAccount.d.ts +2 -0
  74. package/dist-esm/samples-dev/updateRemoteRenderingAccount.d.ts.map +1 -0
  75. package/dist-esm/samples-dev/updateRemoteRenderingAccount.js +36 -0
  76. package/dist-esm/samples-dev/updateRemoteRenderingAccount.js.map +1 -0
  77. package/dist-esm/samples-dev/updateSpatialAnchorsAccount.d.ts +2 -0
  78. package/dist-esm/samples-dev/updateSpatialAnchorsAccount.d.ts.map +1 -0
  79. package/dist-esm/samples-dev/updateSpatialAnchorsAccount.js +35 -0
  80. package/dist-esm/samples-dev/updateSpatialAnchorsAccount.js.map +1 -0
  81. package/dist-esm/src/index.d.ts +5 -0
  82. package/dist-esm/src/index.d.ts.map +1 -0
  83. package/dist-esm/src/index.js +12 -0
  84. package/dist-esm/src/index.js.map +1 -0
  85. package/dist-esm/src/mixedRealityClient.d.ts +28 -0
  86. package/dist-esm/src/mixedRealityClient.d.ts.map +1 -0
  87. package/dist-esm/src/mixedRealityClient.js +89 -0
  88. package/dist-esm/src/mixedRealityClient.js.map +1 -0
  89. package/dist-esm/src/models/index.d.ts +444 -0
  90. package/dist-esm/src/models/index.d.ts.map +1 -0
  91. package/dist-esm/src/models/index.js +22 -0
  92. package/dist-esm/src/models/index.js.map +1 -0
  93. package/dist-esm/src/models/mappers.d.ts +25 -0
  94. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  95. package/{esm → dist-esm/src}/models/mappers.js +473 -288
  96. package/dist-esm/src/models/mappers.js.map +1 -0
  97. package/dist-esm/src/models/parameters.d.ts +15 -0
  98. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  99. package/dist-esm/src/models/parameters.js +135 -0
  100. package/dist-esm/src/models/parameters.js.map +1 -0
  101. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  102. package/dist-esm/src/operations/index.d.ts.map +1 -0
  103. package/{esm → dist-esm/src}/operations/index.js +3 -5
  104. package/dist-esm/src/operations/index.js.map +1 -0
  105. package/dist-esm/src/operations/operations.d.ts +32 -0
  106. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  107. package/dist-esm/src/operations/operations.js +120 -0
  108. package/dist-esm/src/operations/operations.js.map +1 -0
  109. package/dist-esm/src/operations/remoteRenderingAccounts.d.ts +98 -0
  110. package/dist-esm/src/operations/remoteRenderingAccounts.d.ts.map +1 -0
  111. package/dist-esm/src/operations/remoteRenderingAccounts.js +422 -0
  112. package/dist-esm/src/operations/remoteRenderingAccounts.js.map +1 -0
  113. package/dist-esm/src/operations/spatialAnchorsAccounts.d.ts +98 -0
  114. package/dist-esm/src/operations/spatialAnchorsAccounts.d.ts.map +1 -0
  115. package/dist-esm/src/operations/spatialAnchorsAccounts.js +422 -0
  116. package/dist-esm/src/operations/spatialAnchorsAccounts.js.map +1 -0
  117. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  118. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  119. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  120. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  121. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  122. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  123. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  124. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  125. package/dist-esm/src/operationsInterfaces/remoteRenderingAccounts.d.ts +62 -0
  126. package/dist-esm/src/operationsInterfaces/remoteRenderingAccounts.d.ts.map +1 -0
  127. package/dist-esm/src/operationsInterfaces/remoteRenderingAccounts.js +9 -0
  128. package/dist-esm/src/operationsInterfaces/remoteRenderingAccounts.js.map +1 -0
  129. package/dist-esm/src/operationsInterfaces/spatialAnchorsAccounts.d.ts +62 -0
  130. package/dist-esm/src/operationsInterfaces/spatialAnchorsAccounts.d.ts.map +1 -0
  131. package/dist-esm/src/operationsInterfaces/spatialAnchorsAccounts.js +9 -0
  132. package/dist-esm/src/operationsInterfaces/spatialAnchorsAccounts.js.map +1 -0
  133. package/dist-esm/test/sampleTest.d.ts +2 -0
  134. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  135. package/dist-esm/test/sampleTest.js +40 -0
  136. package/dist-esm/test/sampleTest.js.map +1 -0
  137. package/package.json +75 -32
  138. package/review/arm-mixedreality.api.md +436 -0
  139. package/rollup.config.js +181 -30
  140. package/src/index.ts +12 -0
  141. package/src/mixedRealityClient.ts +104 -77
  142. package/src/models/index.ts +405 -735
  143. package/src/models/mappers.ts +478 -295
  144. package/src/models/parameters.ts +93 -47
  145. package/src/operations/index.ts +3 -5
  146. package/src/operations/operations.ts +87 -73
  147. package/src/operations/remoteRenderingAccounts.ts +321 -389
  148. package/src/operations/spatialAnchorsAccounts.ts +321 -389
  149. package/src/operationsInterfaces/index.ts +11 -0
  150. package/src/operationsInterfaces/operations.ts +22 -0
  151. package/src/operationsInterfaces/remoteRenderingAccounts.ts +119 -0
  152. package/src/operationsInterfaces/spatialAnchorsAccounts.ts +119 -0
  153. package/tsconfig.json +5 -4
  154. package/types/arm-mixedreality.d.ts +674 -0
  155. package/types/tsdoc-metadata.json +11 -0
  156. package/dist/arm-mixedreality.js +0 -1756
  157. package/dist/arm-mixedreality.js.map +0 -1
  158. package/dist/arm-mixedreality.min.js +0 -1
  159. package/dist/arm-mixedreality.min.js.map +0 -1
  160. package/esm/mixedRealityClient.d.ts +0 -42
  161. package/esm/mixedRealityClient.d.ts.map +0 -1
  162. package/esm/mixedRealityClient.js +0 -73
  163. package/esm/mixedRealityClient.js.map +0 -1
  164. package/esm/mixedRealityClientContext.d.ts +0 -16
  165. package/esm/mixedRealityClientContext.d.ts.map +0 -1
  166. package/esm/mixedRealityClientContext.js +0 -56
  167. package/esm/mixedRealityClientContext.js.map +0 -1
  168. package/esm/models/index.d.ts +0 -778
  169. package/esm/models/index.d.ts.map +0 -1
  170. package/esm/models/index.js +0 -8
  171. package/esm/models/index.js.map +0 -1
  172. package/esm/models/mappers.d.ts +0 -27
  173. package/esm/models/mappers.d.ts.map +0 -1
  174. package/esm/models/mappers.js.map +0 -1
  175. package/esm/models/operationsMappers.d.ts +0 -2
  176. package/esm/models/operationsMappers.d.ts.map +0 -1
  177. package/esm/models/operationsMappers.js +0 -9
  178. package/esm/models/operationsMappers.js.map +0 -1
  179. package/esm/models/parameters.d.ts +0 -10
  180. package/esm/models/parameters.d.ts.map +0 -1
  181. package/esm/models/parameters.js +0 -110
  182. package/esm/models/parameters.js.map +0 -1
  183. package/esm/models/remoteRenderingAccountsMappers.d.ts +0 -2
  184. package/esm/models/remoteRenderingAccountsMappers.d.ts.map +0 -1
  185. package/esm/models/remoteRenderingAccountsMappers.js +0 -9
  186. package/esm/models/remoteRenderingAccountsMappers.js.map +0 -1
  187. package/esm/models/spatialAnchorsAccountsMappers.d.ts +0 -2
  188. package/esm/models/spatialAnchorsAccountsMappers.d.ts.map +0 -1
  189. package/esm/models/spatialAnchorsAccountsMappers.js +0 -9
  190. package/esm/models/spatialAnchorsAccountsMappers.js.map +0 -1
  191. package/esm/operations/index.d.ts.map +0 -1
  192. package/esm/operations/index.js.map +0 -1
  193. package/esm/operations/operations.d.ts +0 -46
  194. package/esm/operations/operations.d.ts.map +0 -1
  195. package/esm/operations/operations.js +0 -77
  196. package/esm/operations/operations.js.map +0 -1
  197. package/esm/operations/remoteRenderingAccounts.d.ts +0 -217
  198. package/esm/operations/remoteRenderingAccounts.d.ts.map +0 -1
  199. package/esm/operations/remoteRenderingAccounts.js +0 -339
  200. package/esm/operations/remoteRenderingAccounts.js.map +0 -1
  201. package/esm/operations/spatialAnchorsAccounts.d.ts +0 -217
  202. package/esm/operations/spatialAnchorsAccounts.d.ts.map +0 -1
  203. package/esm/operations/spatialAnchorsAccounts.js +0 -339
  204. package/esm/operations/spatialAnchorsAccounts.js.map +0 -1
  205. package/src/mixedRealityClientContext.ts +0 -61
  206. package/src/models/operationsMappers.ts +0 -14
  207. package/src/models/remoteRenderingAccountsMappers.ts +0 -29
  208. package/src/models/spatialAnchorsAccountsMappers.ts +0 -29
@@ -1,112 +1,158 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
9
+ import {
10
+ OperationParameter,
11
+ OperationURLParameter,
12
+ OperationQueryParameter
13
+ } from "@azure/core-client";
14
+ import {
15
+ CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper,
16
+ SpatialAnchorsAccount as SpatialAnchorsAccountMapper,
17
+ AccountKeyRegenerateRequest as AccountKeyRegenerateRequestMapper,
18
+ RemoteRenderingAccount as RemoteRenderingAccountMapper
19
+ } from "../models/mappers";
12
20
 
13
- export const acceptLanguage: msRest.OperationParameter = {
14
- parameterPath: "acceptLanguage",
21
+ export const accept: OperationParameter = {
22
+ parameterPath: "accept",
15
23
  mapper: {
16
- serializedName: "accept-language",
17
- defaultValue: 'en-US',
24
+ defaultValue: "application/json",
25
+ isConstant: true,
26
+ serializedName: "Accept",
18
27
  type: {
19
28
  name: "String"
20
29
  }
21
30
  }
22
31
  };
23
- export const accountName: msRest.OperationURLParameter = {
24
- parameterPath: "accountName",
32
+
33
+ export const $host: OperationURLParameter = {
34
+ parameterPath: "$host",
25
35
  mapper: {
36
+ serializedName: "$host",
26
37
  required: true,
27
- serializedName: "accountName",
28
- constraints: {
29
- MaxLength: 90,
30
- MinLength: 1,
31
- Pattern: /^[-\w\._\(\)]+$/
32
- },
33
38
  type: {
34
39
  name: "String"
35
40
  }
36
- }
41
+ },
42
+ skipEncoding: true
37
43
  };
38
- export const apiVersion0: msRest.OperationQueryParameter = {
44
+
45
+ export const apiVersion: OperationQueryParameter = {
39
46
  parameterPath: "apiVersion",
40
47
  mapper: {
41
- required: true,
48
+ defaultValue: "2021-01-01",
42
49
  isConstant: true,
43
50
  serializedName: "api-version",
44
- defaultValue: '2020-05-01',
45
51
  type: {
46
52
  name: "String"
47
53
  }
48
54
  }
49
55
  };
50
- export const apiVersion1: msRest.OperationQueryParameter = {
51
- parameterPath: "apiVersion",
56
+
57
+ export const nextLink: OperationURLParameter = {
58
+ parameterPath: "nextLink",
52
59
  mapper: {
60
+ serializedName: "nextLink",
53
61
  required: true,
62
+ type: {
63
+ name: "String"
64
+ }
65
+ },
66
+ skipEncoding: true
67
+ };
68
+
69
+ export const contentType: OperationParameter = {
70
+ parameterPath: ["options", "contentType"],
71
+ mapper: {
72
+ defaultValue: "application/json",
54
73
  isConstant: true,
55
- serializedName: "api-version",
56
- defaultValue: '2020-04-06-preview',
74
+ serializedName: "Content-Type",
57
75
  type: {
58
76
  name: "String"
59
77
  }
60
78
  }
61
79
  };
62
- export const location: msRest.OperationURLParameter = {
63
- parameterPath: "location",
80
+
81
+ export const checkNameAvailability: OperationParameter = {
82
+ parameterPath: "checkNameAvailability",
83
+ mapper: CheckNameAvailabilityRequestMapper
84
+ };
85
+
86
+ export const subscriptionId: OperationURLParameter = {
87
+ parameterPath: "subscriptionId",
64
88
  mapper: {
89
+ serializedName: "subscriptionId",
65
90
  required: true,
66
- serializedName: "location",
67
- constraints: {
68
- MaxLength: 90,
69
- MinLength: 1,
70
- Pattern: /^[-\w\._\(\)]+$/
71
- },
72
91
  type: {
73
92
  name: "String"
74
93
  }
75
94
  }
76
95
  };
77
- export const nextPageLink: msRest.OperationURLParameter = {
78
- parameterPath: "nextPageLink",
96
+
97
+ export const location: OperationURLParameter = {
98
+ parameterPath: "location",
79
99
  mapper: {
100
+ constraints: {
101
+ Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"),
102
+ MaxLength: 90,
103
+ MinLength: 1
104
+ },
105
+ serializedName: "location",
80
106
  required: true,
81
- serializedName: "nextLink",
82
107
  type: {
83
108
  name: "String"
84
109
  }
85
- },
86
- skipEncoding: true
110
+ }
87
111
  };
88
- export const resourceGroupName: msRest.OperationURLParameter = {
112
+
113
+ export const resourceGroupName: OperationURLParameter = {
89
114
  parameterPath: "resourceGroupName",
90
115
  mapper: {
91
- required: true,
92
- serializedName: "resourceGroupName",
93
116
  constraints: {
117
+ Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"),
94
118
  MaxLength: 90,
95
- MinLength: 1,
96
- Pattern: /^[-\w\._\(\)]+$/
119
+ MinLength: 1
97
120
  },
121
+ serializedName: "resourceGroupName",
122
+ required: true,
98
123
  type: {
99
124
  name: "String"
100
125
  }
101
126
  }
102
127
  };
103
- export const subscriptionId: msRest.OperationURLParameter = {
104
- parameterPath: "subscriptionId",
128
+
129
+ export const accountName: OperationURLParameter = {
130
+ parameterPath: "accountName",
105
131
  mapper: {
132
+ constraints: {
133
+ Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"),
134
+ MaxLength: 90,
135
+ MinLength: 1
136
+ },
137
+ serializedName: "accountName",
106
138
  required: true,
107
- serializedName: "subscriptionId",
108
139
  type: {
109
140
  name: "String"
110
141
  }
111
142
  }
112
143
  };
144
+
145
+ export const spatialAnchorsAccount: OperationParameter = {
146
+ parameterPath: "spatialAnchorsAccount",
147
+ mapper: SpatialAnchorsAccountMapper
148
+ };
149
+
150
+ export const regenerate: OperationParameter = {
151
+ parameterPath: "regenerate",
152
+ mapper: AccountKeyRegenerateRequestMapper
153
+ };
154
+
155
+ export const remoteRenderingAccount: OperationParameter = {
156
+ parameterPath: "remoteRenderingAccount",
157
+ mapper: RemoteRenderingAccountMapper
158
+ };
@@ -1,11 +1,9 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
9
  export * from "./operations";
@@ -1,95 +1,111 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/operationsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Operations } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { MixedRealityClientContext } from "../mixedRealityClientContext";
14
+ import { MixedRealityClient } from "../mixedRealityClient";
15
+ import {
16
+ Operation,
17
+ OperationsListNextOptionalParams,
18
+ OperationsListOptionalParams,
19
+ OperationsListResponse,
20
+ OperationsListNextResponse
21
+ } from "../models";
16
22
 
17
- /** Class representing a Operations. */
18
- export class Operations {
19
- private readonly client: MixedRealityClientContext;
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing Operations operations. */
25
+ export class OperationsImpl implements Operations {
26
+ private readonly client: MixedRealityClient;
20
27
 
21
28
  /**
22
- * Create a Operations.
23
- * @param {MixedRealityClientContext} client Reference to the service client.
29
+ * Initialize a new instance of the class Operations class.
30
+ * @param client Reference to the service client
24
31
  */
25
- constructor(client: MixedRealityClientContext) {
32
+ constructor(client: MixedRealityClient) {
26
33
  this.client = client;
27
34
  }
28
35
 
29
36
  /**
30
37
  * Exposing Available Operations
31
- * @param [options] The optional parameters
32
- * @returns Promise<Models.OperationsListResponse>
38
+ * @param options The options parameters.
33
39
  */
34
- list(options?: msRest.RequestOptionsBase): Promise<Models.OperationsListResponse>;
35
- /**
36
- * @param callback The callback
37
- */
38
- list(callback: msRest.ServiceCallback<Models.OperationPage>): void;
39
- /**
40
- * @param options The optional parameters
41
- * @param callback The callback
42
- */
43
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationPage>): void;
44
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationPage>, callback?: msRest.ServiceCallback<Models.OperationPage>): Promise<Models.OperationsListResponse> {
45
- return this.client.sendOperationRequest(
46
- {
47
- options
40
+ public list(
41
+ options?: OperationsListOptionalParams
42
+ ): PagedAsyncIterableIterator<Operation> {
43
+ const iter = this.listPagingAll(options);
44
+ return {
45
+ next() {
46
+ return iter.next();
47
+ },
48
+ [Symbol.asyncIterator]() {
49
+ return this;
48
50
  },
49
- listOperationSpec,
50
- callback) as Promise<Models.OperationsListResponse>;
51
+ byPage: () => {
52
+ return this.listPagingPage(options);
53
+ }
54
+ };
55
+ }
56
+
57
+ private async *listPagingPage(
58
+ options?: OperationsListOptionalParams
59
+ ): AsyncIterableIterator<Operation[]> {
60
+ let result = await this._list(options);
61
+ yield result.value || [];
62
+ let continuationToken = result.nextLink;
63
+ while (continuationToken) {
64
+ result = await this._listNext(continuationToken, options);
65
+ continuationToken = result.nextLink;
66
+ yield result.value || [];
67
+ }
68
+ }
69
+
70
+ private async *listPagingAll(
71
+ options?: OperationsListOptionalParams
72
+ ): AsyncIterableIterator<Operation> {
73
+ for await (const page of this.listPagingPage(options)) {
74
+ yield* page;
75
+ }
51
76
  }
52
77
 
53
78
  /**
54
79
  * Exposing Available Operations
55
- * @param nextPageLink The NextLink from the previous successful call to List operation.
56
- * @param [options] The optional parameters
57
- * @returns Promise<Models.OperationsListNextResponse>
58
- */
59
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.OperationsListNextResponse>;
60
- /**
61
- * @param nextPageLink The NextLink from the previous successful call to List operation.
62
- * @param callback The callback
80
+ * @param options The options parameters.
63
81
  */
64
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.OperationPage>): void;
82
+ private _list(
83
+ options?: OperationsListOptionalParams
84
+ ): Promise<OperationsListResponse> {
85
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
86
+ }
87
+
65
88
  /**
66
- * @param nextPageLink The NextLink from the previous successful call to List operation.
67
- * @param options The optional parameters
68
- * @param callback The callback
89
+ * ListNext
90
+ * @param nextLink The nextLink from the previous successful call to the List method.
91
+ * @param options The options parameters.
69
92
  */
70
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationPage>): void;
71
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationPage>, callback?: msRest.ServiceCallback<Models.OperationPage>): Promise<Models.OperationsListNextResponse> {
93
+ private _listNext(
94
+ nextLink: string,
95
+ options?: OperationsListNextOptionalParams
96
+ ): Promise<OperationsListNextResponse> {
72
97
  return this.client.sendOperationRequest(
73
- {
74
- nextPageLink,
75
- options
76
- },
77
- listNextOperationSpec,
78
- callback) as Promise<Models.OperationsListNextResponse>;
98
+ { nextLink, options },
99
+ listNextOperationSpec
100
+ );
79
101
  }
80
102
  }
81
-
82
103
  // Operation Specifications
83
- const serializer = new msRest.Serializer(Mappers);
84
- const listOperationSpec: msRest.OperationSpec = {
104
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
105
+
106
+ const listOperationSpec: coreClient.OperationSpec = {
107
+ path: "/providers/Microsoft.MixedReality/operations",
85
108
  httpMethod: "GET",
86
- path: "providers/Microsoft.MixedReality/operations",
87
- queryParameters: [
88
- Parameters.apiVersion0
89
- ],
90
- headerParameters: [
91
- Parameters.acceptLanguage
92
- ],
93
109
  responses: {
94
110
  200: {
95
111
  bodyMapper: Mappers.OperationPage
@@ -98,19 +114,14 @@ const listOperationSpec: msRest.OperationSpec = {
98
114
  bodyMapper: Mappers.CloudError
99
115
  }
100
116
  },
117
+ queryParameters: [Parameters.apiVersion],
118
+ urlParameters: [Parameters.$host],
119
+ headerParameters: [Parameters.accept],
101
120
  serializer
102
121
  };
103
-
104
- const listNextOperationSpec: msRest.OperationSpec = {
105
- httpMethod: "GET",
106
- baseUrl: "https://management.azure.com",
122
+ const listNextOperationSpec: coreClient.OperationSpec = {
107
123
  path: "{nextLink}",
108
- urlParameters: [
109
- Parameters.nextPageLink
110
- ],
111
- headerParameters: [
112
- Parameters.acceptLanguage
113
- ],
124
+ httpMethod: "GET",
114
125
  responses: {
115
126
  200: {
116
127
  bodyMapper: Mappers.OperationPage
@@ -119,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = {
119
130
  bodyMapper: Mappers.CloudError
120
131
  }
121
132
  },
133
+ queryParameters: [Parameters.apiVersion],
134
+ urlParameters: [Parameters.$host, Parameters.nextLink],
135
+ headerParameters: [Parameters.accept],
122
136
  serializer
123
137
  };