@azure/arm-mixedreality 3.1.0 → 4.0.1-alpha.20220131.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -0
  3. package/README.md +69 -80
  4. package/dist/index.js +2016 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/samples-dev/checkLocalNameAvailability.d.ts +2 -0
  9. package/dist-esm/samples-dev/checkLocalNameAvailability.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/checkLocalNameAvailability.js +34 -0
  11. package/dist-esm/samples-dev/checkLocalNameAvailability.js.map +1 -0
  12. package/dist-esm/samples-dev/createRemoteRenderingAccount.d.ts +2 -0
  13. package/dist-esm/samples-dev/createRemoteRenderingAccount.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/createRemoteRenderingAccount.js +35 -0
  15. package/dist-esm/samples-dev/createRemoteRenderingAccount.js.map +1 -0
  16. package/dist-esm/samples-dev/createSpatialAnchorAccount.d.ts +2 -0
  17. package/dist-esm/samples-dev/createSpatialAnchorAccount.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/createSpatialAnchorAccount.js +34 -0
  19. package/dist-esm/samples-dev/createSpatialAnchorAccount.js.map +1 -0
  20. package/dist-esm/samples-dev/deleteRemoteRenderingAccount.d.ts +2 -0
  21. package/dist-esm/samples-dev/deleteRemoteRenderingAccount.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/deleteRemoteRenderingAccount.js +31 -0
  23. package/dist-esm/samples-dev/deleteRemoteRenderingAccount.js.map +1 -0
  24. package/dist-esm/samples-dev/deleteSpatialAnchorsAccount.d.ts +2 -0
  25. package/dist-esm/samples-dev/deleteSpatialAnchorsAccount.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/deleteSpatialAnchorsAccount.js +31 -0
  27. package/dist-esm/samples-dev/deleteSpatialAnchorsAccount.js.map +1 -0
  28. package/dist-esm/samples-dev/getRemoteRenderingAccount.d.ts +2 -0
  29. package/dist-esm/samples-dev/getRemoteRenderingAccount.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/getRemoteRenderingAccount.js +31 -0
  31. package/dist-esm/samples-dev/getRemoteRenderingAccount.js.map +1 -0
  32. package/dist-esm/samples-dev/getSpatialAnchorsAccount.d.ts +2 -0
  33. package/dist-esm/samples-dev/getSpatialAnchorsAccount.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/getSpatialAnchorsAccount.js +31 -0
  35. package/dist-esm/samples-dev/getSpatialAnchorsAccount.js.map +1 -0
  36. package/dist-esm/samples-dev/listAvailableOperations.d.ts +2 -0
  37. package/dist-esm/samples-dev/listAvailableOperations.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/listAvailableOperations.js +43 -0
  39. package/dist-esm/samples-dev/listAvailableOperations.js.map +1 -0
  40. package/dist-esm/samples-dev/listRemoteRenderingAccountKey.d.ts +2 -0
  41. package/dist-esm/samples-dev/listRemoteRenderingAccountKey.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/listRemoteRenderingAccountKey.js +31 -0
  43. package/dist-esm/samples-dev/listRemoteRenderingAccountKey.js.map +1 -0
  44. package/dist-esm/samples-dev/listRemoteRenderingAccountsByResourceGroup.d.ts +2 -0
  45. package/dist-esm/samples-dev/listRemoteRenderingAccountsByResourceGroup.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/listRemoteRenderingAccountsByResourceGroup.js +44 -0
  47. package/dist-esm/samples-dev/listRemoteRenderingAccountsByResourceGroup.js.map +1 -0
  48. package/dist-esm/samples-dev/listRemoteRenderingAccountsBySubscription.d.ts +2 -0
  49. package/dist-esm/samples-dev/listRemoteRenderingAccountsBySubscription.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/listRemoteRenderingAccountsBySubscription.js +43 -0
  51. package/dist-esm/samples-dev/listRemoteRenderingAccountsBySubscription.js.map +1 -0
  52. package/dist-esm/samples-dev/listSpatialAnchorAccountKey.d.ts +2 -0
  53. package/dist-esm/samples-dev/listSpatialAnchorAccountKey.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/listSpatialAnchorAccountKey.js +31 -0
  55. package/dist-esm/samples-dev/listSpatialAnchorAccountKey.js.map +1 -0
  56. package/dist-esm/samples-dev/listSpatialAnchorAccountsByResourceGroup.d.ts +2 -0
  57. package/dist-esm/samples-dev/listSpatialAnchorAccountsByResourceGroup.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/listSpatialAnchorAccountsByResourceGroup.js +44 -0
  59. package/dist-esm/samples-dev/listSpatialAnchorAccountsByResourceGroup.js.map +1 -0
  60. package/dist-esm/samples-dev/listSpatialAnchorsAccountsBySubscription.d.ts +2 -0
  61. package/dist-esm/samples-dev/listSpatialAnchorsAccountsBySubscription.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/listSpatialAnchorsAccountsBySubscription.js +43 -0
  63. package/dist-esm/samples-dev/listSpatialAnchorsAccountsBySubscription.js.map +1 -0
  64. package/dist-esm/samples-dev/regenerateRemoteRenderingAccountKeys.d.ts +2 -0
  65. package/dist-esm/samples-dev/regenerateRemoteRenderingAccountKeys.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/regenerateRemoteRenderingAccountKeys.js +32 -0
  67. package/dist-esm/samples-dev/regenerateRemoteRenderingAccountKeys.js.map +1 -0
  68. package/dist-esm/samples-dev/regenerateSpatialAnchorsAccountKeys.d.ts +2 -0
  69. package/dist-esm/samples-dev/regenerateSpatialAnchorsAccountKeys.d.ts.map +1 -0
  70. package/dist-esm/samples-dev/regenerateSpatialAnchorsAccountKeys.js +32 -0
  71. package/dist-esm/samples-dev/regenerateSpatialAnchorsAccountKeys.js.map +1 -0
  72. package/dist-esm/samples-dev/updateRemoteRenderingAccount.d.ts +2 -0
  73. package/dist-esm/samples-dev/updateRemoteRenderingAccount.d.ts.map +1 -0
  74. package/dist-esm/samples-dev/updateRemoteRenderingAccount.js +36 -0
  75. package/dist-esm/samples-dev/updateRemoteRenderingAccount.js.map +1 -0
  76. package/dist-esm/samples-dev/updateSpatialAnchorsAccount.d.ts +2 -0
  77. package/dist-esm/samples-dev/updateSpatialAnchorsAccount.d.ts.map +1 -0
  78. package/dist-esm/samples-dev/updateSpatialAnchorsAccount.js +35 -0
  79. package/dist-esm/samples-dev/updateSpatialAnchorsAccount.js.map +1 -0
  80. package/dist-esm/src/index.d.ts +5 -0
  81. package/dist-esm/src/index.d.ts.map +1 -0
  82. package/dist-esm/src/index.js +12 -0
  83. package/dist-esm/src/index.js.map +1 -0
  84. package/dist-esm/src/mixedRealityClient.d.ts +28 -0
  85. package/dist-esm/src/mixedRealityClient.d.ts.map +1 -0
  86. package/dist-esm/src/mixedRealityClient.js +89 -0
  87. package/dist-esm/src/mixedRealityClient.js.map +1 -0
  88. package/dist-esm/src/models/index.d.ts +444 -0
  89. package/dist-esm/src/models/index.d.ts.map +1 -0
  90. package/dist-esm/src/models/index.js +22 -0
  91. package/dist-esm/src/models/index.js.map +1 -0
  92. package/dist-esm/src/models/mappers.d.ts +25 -0
  93. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  94. package/{esm → dist-esm/src}/models/mappers.js +362 -457
  95. package/dist-esm/src/models/mappers.js.map +1 -0
  96. package/dist-esm/src/models/parameters.d.ts +15 -0
  97. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  98. package/dist-esm/src/models/parameters.js +135 -0
  99. package/dist-esm/src/models/parameters.js.map +1 -0
  100. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  101. package/dist-esm/src/operations/index.d.ts.map +1 -0
  102. package/{esm → dist-esm/src}/operations/index.js +1 -2
  103. package/dist-esm/src/operations/index.js.map +1 -0
  104. package/dist-esm/src/operations/operations.d.ts +32 -0
  105. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  106. package/dist-esm/src/operations/operations.js +120 -0
  107. package/dist-esm/src/operations/operations.js.map +1 -0
  108. package/dist-esm/src/operations/remoteRenderingAccounts.d.ts +98 -0
  109. package/dist-esm/src/operations/remoteRenderingAccounts.d.ts.map +1 -0
  110. package/dist-esm/src/operations/remoteRenderingAccounts.js +422 -0
  111. package/dist-esm/src/operations/remoteRenderingAccounts.js.map +1 -0
  112. package/dist-esm/src/operations/spatialAnchorsAccounts.d.ts +98 -0
  113. package/dist-esm/src/operations/spatialAnchorsAccounts.d.ts.map +1 -0
  114. package/dist-esm/src/operations/spatialAnchorsAccounts.js +422 -0
  115. package/dist-esm/src/operations/spatialAnchorsAccounts.js.map +1 -0
  116. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  117. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  118. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  119. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  120. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  121. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  122. package/{esm/models/index.js → dist-esm/src/operationsInterfaces/operations.js} +2 -1
  123. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  124. package/dist-esm/src/operationsInterfaces/remoteRenderingAccounts.d.ts +62 -0
  125. package/dist-esm/src/operationsInterfaces/remoteRenderingAccounts.d.ts.map +1 -0
  126. package/dist-esm/src/operationsInterfaces/remoteRenderingAccounts.js +9 -0
  127. package/dist-esm/src/operationsInterfaces/remoteRenderingAccounts.js.map +1 -0
  128. package/dist-esm/src/operationsInterfaces/spatialAnchorsAccounts.d.ts +62 -0
  129. package/dist-esm/src/operationsInterfaces/spatialAnchorsAccounts.d.ts.map +1 -0
  130. package/dist-esm/src/operationsInterfaces/spatialAnchorsAccounts.js +9 -0
  131. package/dist-esm/src/operationsInterfaces/spatialAnchorsAccounts.js.map +1 -0
  132. package/dist-esm/test/sampleTest.d.ts +2 -0
  133. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  134. package/dist-esm/test/sampleTest.js +40 -0
  135. package/dist-esm/test/sampleTest.js.map +1 -0
  136. package/package.json +79 -22
  137. package/review/arm-mixedreality.api.md +436 -0
  138. package/rollup.config.js +181 -30
  139. package/src/{models/operationsMappers.ts → index.ts} +4 -11
  140. package/src/mixedRealityClient.ts +102 -80
  141. package/src/models/index.ts +370 -884
  142. package/src/models/mappers.ts +367 -478
  143. package/src/models/parameters.ts +100 -39
  144. package/src/operations/index.ts +1 -2
  145. package/src/operations/operations.ts +85 -73
  146. package/src/operations/remoteRenderingAccounts.ts +319 -392
  147. package/src/operations/spatialAnchorsAccounts.ts +319 -392
  148. package/src/operationsInterfaces/index.ts +11 -0
  149. package/src/operationsInterfaces/operations.ts +22 -0
  150. package/src/operationsInterfaces/remoteRenderingAccounts.ts +119 -0
  151. package/src/operationsInterfaces/spatialAnchorsAccounts.ts +119 -0
  152. package/tsconfig.json +5 -4
  153. package/types/arm-mixedreality.d.ts +674 -0
  154. package/types/tsdoc-metadata.json +11 -0
  155. package/dist/arm-mixedreality.js +0 -2052
  156. package/dist/arm-mixedreality.js.map +0 -1
  157. package/dist/arm-mixedreality.min.js +0 -1
  158. package/dist/arm-mixedreality.min.js.map +0 -1
  159. package/esm/mixedRealityClient.d.ts +0 -48
  160. package/esm/mixedRealityClient.d.ts.map +0 -1
  161. package/esm/mixedRealityClient.js +0 -77
  162. package/esm/mixedRealityClient.js.map +0 -1
  163. package/esm/mixedRealityClientContext.d.ts +0 -23
  164. package/esm/mixedRealityClientContext.d.ts.map +0 -1
  165. package/esm/mixedRealityClientContext.js +0 -61
  166. package/esm/mixedRealityClientContext.js.map +0 -1
  167. package/esm/models/index.d.ts +0 -957
  168. package/esm/models/index.d.ts.map +0 -1
  169. package/esm/models/index.js.map +0 -1
  170. package/esm/models/mappers.d.ts +0 -32
  171. package/esm/models/mappers.d.ts.map +0 -1
  172. package/esm/models/mappers.js.map +0 -1
  173. package/esm/models/operationsMappers.d.ts +0 -2
  174. package/esm/models/operationsMappers.d.ts.map +0 -1
  175. package/esm/models/operationsMappers.js +0 -9
  176. package/esm/models/operationsMappers.js.map +0 -1
  177. package/esm/models/parameters.d.ts +0 -9
  178. package/esm/models/parameters.d.ts.map +0 -1
  179. package/esm/models/parameters.js +0 -95
  180. package/esm/models/parameters.js.map +0 -1
  181. package/esm/models/remoteRenderingAccountsMappers.d.ts +0 -2
  182. package/esm/models/remoteRenderingAccountsMappers.d.ts.map +0 -1
  183. package/esm/models/remoteRenderingAccountsMappers.js +0 -9
  184. package/esm/models/remoteRenderingAccountsMappers.js.map +0 -1
  185. package/esm/models/spatialAnchorsAccountsMappers.d.ts +0 -2
  186. package/esm/models/spatialAnchorsAccountsMappers.d.ts.map +0 -1
  187. package/esm/models/spatialAnchorsAccountsMappers.js +0 -9
  188. package/esm/models/spatialAnchorsAccountsMappers.js.map +0 -1
  189. package/esm/operations/index.d.ts.map +0 -1
  190. package/esm/operations/index.js.map +0 -1
  191. package/esm/operations/operations.d.ts +0 -46
  192. package/esm/operations/operations.d.ts.map +0 -1
  193. package/esm/operations/operations.js +0 -79
  194. package/esm/operations/operations.js.map +0 -1
  195. package/esm/operations/remoteRenderingAccounts.d.ts +0 -217
  196. package/esm/operations/remoteRenderingAccounts.d.ts.map +0 -1
  197. package/esm/operations/remoteRenderingAccounts.js +0 -344
  198. package/esm/operations/remoteRenderingAccounts.js.map +0 -1
  199. package/esm/operations/spatialAnchorsAccounts.d.ts +0 -217
  200. package/esm/operations/spatialAnchorsAccounts.d.ts.map +0 -1
  201. package/esm/operations/spatialAnchorsAccounts.js +0 -344
  202. package/esm/operations/spatialAnchorsAccounts.js.map +0 -1
  203. package/src/mixedRealityClientContext.ts +0 -68
  204. package/src/models/remoteRenderingAccountsMappers.ts +0 -29
  205. package/src/models/spatialAnchorsAccountsMappers.ts +0 -29
package/rollup.config.js CHANGED
@@ -1,37 +1,188 @@
1
- import rollup from "rollup";
2
- import nodeResolve from "rollup-plugin-node-resolve";
3
- import sourcemaps from "rollup-plugin-sourcemaps";
4
-
5
- /**
6
- * @type {rollup.RollupFileOptions}
7
- */
8
- const config = {
9
- input: "./esm/mixedRealityClient.js",
10
- external: [
11
- "@azure/ms-rest-js",
12
- "@azure/ms-rest-azure-js"
13
- ],
14
- output: {
15
- file: "./dist/arm-mixedreality.js",
16
- format: "umd",
17
- name: "Azure.ArmMixedreality",
18
- sourcemap: true,
19
- globals: {
20
- "@azure/ms-rest-js": "msRest",
21
- "@azure/ms-rest-azure-js": "msRestAzure"
22
- },
23
- banner: `/*
1
+ /*
24
2
  * Copyright (c) Microsoft Corporation.
25
3
  * Licensed under the MIT License.
26
4
  *
27
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
28
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
29
- */`
30
- },
31
- plugins: [
32
- nodeResolve({ mainFields: ['module', 'main'] }),
33
- sourcemaps()
34
- ]
7
+ */
8
+
9
+ import nodeResolve from "@rollup/plugin-node-resolve";
10
+ import cjs from "@rollup/plugin-commonjs";
11
+ import sourcemaps from "rollup-plugin-sourcemaps";
12
+ import multiEntry from "@rollup/plugin-multi-entry";
13
+ import json from "@rollup/plugin-json";
14
+
15
+ import nodeBuiltins from "builtin-modules";
16
+
17
+ /**
18
+ * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
19
+ *
20
+ * NOTE: this manual configuration is only needed because OpenTelemetry uses an
21
+ * __exportStar downleveled helper function to declare its exports which confuses
22
+ * rollup's automatic discovery mechanism.
23
+ *
24
+ * @returns an object reference that can be `...`'d into your cjs() configuration.
25
+ */
26
+ export function openTelemetryCommonJs() {
27
+ const namedExports = {};
28
+
29
+ for (const key of [
30
+ "@opentelemetry/api",
31
+ "@azure/core-tracing/node_modules/@opentelemetry/api"
32
+ ]) {
33
+ namedExports[key] = [
34
+ "SpanKind",
35
+ "TraceFlags",
36
+ "getSpan",
37
+ "setSpan",
38
+ "SpanStatusCode",
39
+ "getSpanContext",
40
+ "setSpanContext"
41
+ ];
42
+ }
43
+
44
+ const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
45
+
46
+ for (const version of releasedOpenTelemetryVersions) {
47
+ namedExports[
48
+ // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
49
+ `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
50
+ ] = [
51
+ "SpanKind",
52
+ "TraceFlags",
53
+ "getSpan",
54
+ "setSpan",
55
+ "StatusCode",
56
+ "CanonicalCode",
57
+ "getSpanContext",
58
+ "setSpanContext"
59
+ ];
60
+ }
61
+
62
+ return namedExports;
63
+ }
64
+
65
+ // #region Warning Handler
66
+
67
+ /**
68
+ * A function that can determine whether a rollupwarning should be ignored. If
69
+ * the function returns `true`, then the warning will not be displayed.
70
+ */
71
+
72
+ function ignoreNiseSinonEvalWarnings(warning) {
73
+ return (
74
+ warning.code === "EVAL" &&
75
+ warning.id &&
76
+ (warning.id.includes("node_modules/nise") ||
77
+ warning.id.includes("node_modules/sinon")) === true
78
+ );
79
+ }
80
+
81
+ function ignoreChaiCircularDependencyWarnings(warning) {
82
+ return (
83
+ warning.code === "CIRCULAR_DEPENDENCY" &&
84
+ warning.importer && warning.importer.includes("node_modules/chai") === true
85
+ );
86
+ }
87
+
88
+ const warningInhibitors = [
89
+ ignoreChaiCircularDependencyWarnings,
90
+ ignoreNiseSinonEvalWarnings
91
+ ];
92
+
93
+ /**
94
+ * Construct a warning handler for the shared rollup configuration
95
+ * that ignores certain warnings that are not relevant to testing.
96
+ */
97
+ function makeOnWarnForTesting() {
98
+ return (warning, warn) => {
99
+ // If every inhibitor returns false (i.e. no inhibitors), then show the warning
100
+ if (warningInhibitors.every((inhib) => !inhib(warning))) {
101
+ warn(warning);
102
+ }
103
+ };
104
+ }
105
+
106
+ // #endregion
107
+
108
+ function makeBrowserTestConfig() {
109
+ const config = {
110
+ input: {
111
+ include: ["dist-esm/test/**/*.spec.js"],
112
+ exclude: ["dist-esm/test/**/node/**"]
113
+ },
114
+ output: {
115
+ file: `dist-test/index.browser.js`,
116
+ format: "umd",
117
+ sourcemap: true
118
+ },
119
+ preserveSymlinks: false,
120
+ plugins: [
121
+ multiEntry({ exports: false }),
122
+ nodeResolve({
123
+ mainFields: ["module", "browser"]
124
+ }),
125
+ cjs({
126
+ namedExports: {
127
+ // Chai's strange internal architecture makes it impossible to statically
128
+ // analyze its exports.
129
+ chai: [
130
+ "version",
131
+ "use",
132
+ "util",
133
+ "config",
134
+ "expect",
135
+ "should",
136
+ "assert"
137
+ ],
138
+ ...openTelemetryCommonJs()
139
+ }
140
+ }),
141
+ json(),
142
+ sourcemaps()
143
+ //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
144
+ ],
145
+ onwarn: makeOnWarnForTesting(),
146
+ // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
147
+ // rollup started respecting the "sideEffects" field in package.json. Since
148
+ // our package.json sets "sideEffects=false", this also applies to test
149
+ // code, which causes all tests to be removed by tree-shaking.
150
+ treeshake: false
151
+ };
152
+
153
+ return config;
154
+ }
155
+
156
+ const defaultConfigurationOptions = {
157
+ disableBrowserBundle: false
35
158
  };
36
159
 
37
- export default config;
160
+ export function makeConfig(pkg, options) {
161
+ options = {
162
+ ...defaultConfigurationOptions,
163
+ ...(options || {})
164
+ };
165
+
166
+ const baseConfig = {
167
+ // Use the package's module field if it has one
168
+ input: pkg["module"] || "dist-esm/src/index.js",
169
+ external: [
170
+ ...nodeBuiltins,
171
+ ...Object.keys(pkg.dependencies),
172
+ ...Object.keys(pkg.devDependencies)
173
+ ],
174
+ output: { file: "dist/index.js", format: "cjs", sourcemap: true },
175
+ preserveSymlinks: false,
176
+ plugins: [sourcemaps(), nodeResolve(), cjs()]
177
+ };
178
+
179
+ const config = [baseConfig];
180
+
181
+ if (!options.disableBrowserBundle) {
182
+ config.push(makeBrowserTestConfig());
183
+ }
184
+
185
+ return config;
186
+ }
187
+
188
+ export default makeConfig(require("./package.json"));
@@ -6,14 +6,7 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- export {
10
- CloudError,
11
- LogSpecification,
12
- MetricDimension,
13
- MetricSpecification,
14
- Operation,
15
- OperationDisplay,
16
- OperationPage,
17
- OperationProperties,
18
- ServiceSpecification
19
- } from "../models/mappers";
9
+ /// <reference lib="esnext.asynciterable" />
10
+ export * from "./models";
11
+ export { MixedRealityClient } from "./mixedRealityClient";
12
+ export * from "./operationsInterfaces";
@@ -3,99 +3,120 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import { TokenCredential } from "@azure/core-auth";
12
- import * as Models from "./models";
13
- import * as Mappers from "./models/mappers";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import {
12
+ OperationsImpl,
13
+ SpatialAnchorsAccountsImpl,
14
+ RemoteRenderingAccountsImpl
15
+ } from "./operations";
16
+ import {
17
+ Operations,
18
+ SpatialAnchorsAccounts,
19
+ RemoteRenderingAccounts
20
+ } from "./operationsInterfaces";
14
21
  import * as Parameters from "./models/parameters";
15
- import * as operations from "./operations";
16
- import { MixedRealityClientContext } from "./mixedRealityClientContext";
17
-
22
+ import * as Mappers from "./models/mappers";
23
+ import {
24
+ MixedRealityClientOptionalParams,
25
+ CheckNameAvailabilityRequest,
26
+ CheckNameAvailabilityLocalOptionalParams,
27
+ CheckNameAvailabilityLocalResponse
28
+ } from "./models";
18
29
 
19
- class MixedRealityClient extends MixedRealityClientContext {
20
- // Operation groups
21
- operations: operations.Operations;
22
- spatialAnchorsAccounts: operations.SpatialAnchorsAccounts;
23
- remoteRenderingAccounts: operations.RemoteRenderingAccounts;
30
+ export class MixedRealityClient extends coreClient.ServiceClient {
31
+ $host: string;
32
+ apiVersion: string;
33
+ subscriptionId: string;
24
34
 
25
35
  /**
26
36
  * Initializes a new instance of the MixedRealityClient class.
27
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
28
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
29
- * more information about these credentials, see
30
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
31
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
32
- * @azure/ms-rest-browserauth are also supported.
37
+ * @param credentials Subscription credentials which uniquely identify client subscription.
33
38
  * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g.
34
- * 00000000-0000-0000-0000-000000000000)
35
- * @param [options] The parameter options
39
+ * 00000000-0000-0000-0000-000000000000)
40
+ * @param options The parameter options
36
41
  */
37
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.MixedRealityClientOptions) {
38
- super(credentials, subscriptionId, options);
39
- this.operations = new operations.Operations(this);
40
- this.spatialAnchorsAccounts = new operations.SpatialAnchorsAccounts(this);
41
- this.remoteRenderingAccounts = new operations.RemoteRenderingAccounts(this);
42
+ constructor(
43
+ credentials: coreAuth.TokenCredential,
44
+ subscriptionId: string,
45
+ options?: MixedRealityClientOptionalParams
46
+ ) {
47
+ if (credentials === undefined) {
48
+ throw new Error("'credentials' cannot be null");
49
+ }
50
+ if (subscriptionId === undefined) {
51
+ throw new Error("'subscriptionId' cannot be null");
52
+ }
53
+
54
+ // Initializing default values for options
55
+ if (!options) {
56
+ options = {};
57
+ }
58
+ const defaults: MixedRealityClientOptionalParams = {
59
+ requestContentType: "application/json; charset=utf-8",
60
+ credential: credentials
61
+ };
62
+
63
+ const packageDetails = `azsdk-js-arm-mixedreality/4.0.1`;
64
+ const userAgentPrefix =
65
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
66
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
67
+ : `${packageDetails}`;
68
+
69
+ if (!options.credentialScopes) {
70
+ options.credentialScopes = ["https://management.azure.com/.default"];
71
+ }
72
+ const optionsWithDefaults = {
73
+ ...defaults,
74
+ ...options,
75
+ userAgentOptions: {
76
+ userAgentPrefix
77
+ },
78
+ baseUri: options.endpoint || "https://management.azure.com"
79
+ };
80
+ super(optionsWithDefaults);
81
+ // Parameter assignments
82
+ this.subscriptionId = subscriptionId;
83
+
84
+ // Assigning values to Constant parameters
85
+ this.$host = options.$host || "https://management.azure.com";
86
+ this.apiVersion = options.apiVersion || "2021-01-01";
87
+ this.operations = new OperationsImpl(this);
88
+ this.spatialAnchorsAccounts = new SpatialAnchorsAccountsImpl(this);
89
+ this.remoteRenderingAccounts = new RemoteRenderingAccountsImpl(this);
42
90
  }
43
91
 
44
92
  /**
45
93
  * Check Name Availability for local uniqueness
46
94
  * @param location The location in which uniqueness will be verified.
47
95
  * @param checkNameAvailability Check Name Availability Request.
48
- * @param [options] The optional parameters
49
- * @returns Promise<Models.CheckNameAvailabilityLocalResponse>
50
- */
51
- checkNameAvailabilityLocal(location: string, checkNameAvailability: Models.CheckNameAvailabilityRequest, options?: msRest.RequestOptionsBase): Promise<Models.CheckNameAvailabilityLocalResponse>;
52
- /**
53
- * @param location The location in which uniqueness will be verified.
54
- * @param checkNameAvailability Check Name Availability Request.
55
- * @param callback The callback
56
- */
57
- checkNameAvailabilityLocal(location: string, checkNameAvailability: Models.CheckNameAvailabilityRequest, callback: msRest.ServiceCallback<Models.CheckNameAvailabilityResponse>): void;
58
- /**
59
- * @param location The location in which uniqueness will be verified.
60
- * @param checkNameAvailability Check Name Availability Request.
61
- * @param options The optional parameters
62
- * @param callback The callback
96
+ * @param options The options parameters.
63
97
  */
64
- checkNameAvailabilityLocal(location: string, checkNameAvailability: Models.CheckNameAvailabilityRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CheckNameAvailabilityResponse>): void;
65
- checkNameAvailabilityLocal(location: string, checkNameAvailability: Models.CheckNameAvailabilityRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CheckNameAvailabilityResponse>, callback?: msRest.ServiceCallback<Models.CheckNameAvailabilityResponse>): Promise<Models.CheckNameAvailabilityLocalResponse> {
98
+ checkNameAvailabilityLocal(
99
+ location: string,
100
+ checkNameAvailability: CheckNameAvailabilityRequest,
101
+ options?: CheckNameAvailabilityLocalOptionalParams
102
+ ): Promise<CheckNameAvailabilityLocalResponse> {
66
103
  return this.sendOperationRequest(
67
- {
68
- location,
69
- checkNameAvailability,
70
- options
71
- },
72
- checkNameAvailabilityLocalOperationSpec,
73
- callback) as Promise<Models.CheckNameAvailabilityLocalResponse>;
104
+ { location, checkNameAvailability, options },
105
+ checkNameAvailabilityLocalOperationSpec
106
+ );
74
107
  }
75
- }
76
108
 
109
+ operations: Operations;
110
+ spatialAnchorsAccounts: SpatialAnchorsAccounts;
111
+ remoteRenderingAccounts: RemoteRenderingAccounts;
112
+ }
77
113
  // Operation Specifications
78
- const serializer = new msRest.Serializer(Mappers);
79
- const checkNameAvailabilityLocalOperationSpec: msRest.OperationSpec = {
114
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
115
+
116
+ const checkNameAvailabilityLocalOperationSpec: coreClient.OperationSpec = {
117
+ path:
118
+ "/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability",
80
119
  httpMethod: "POST",
81
- path: "subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/locations/{location}/checkNameAvailability",
82
- urlParameters: [
83
- Parameters.subscriptionId,
84
- Parameters.location
85
- ],
86
- queryParameters: [
87
- Parameters.apiVersion
88
- ],
89
- headerParameters: [
90
- Parameters.acceptLanguage
91
- ],
92
- requestBody: {
93
- parameterPath: "checkNameAvailability",
94
- mapper: {
95
- ...Mappers.CheckNameAvailabilityRequest,
96
- required: true
97
- }
98
- },
99
120
  responses: {
100
121
  200: {
101
122
  bodyMapper: Mappers.CheckNameAvailabilityResponse
@@ -104,13 +125,14 @@ const checkNameAvailabilityLocalOperationSpec: msRest.OperationSpec = {
104
125
  bodyMapper: Mappers.CloudError
105
126
  }
106
127
  },
128
+ requestBody: Parameters.checkNameAvailability,
129
+ queryParameters: [Parameters.apiVersion],
130
+ urlParameters: [
131
+ Parameters.$host,
132
+ Parameters.subscriptionId,
133
+ Parameters.location
134
+ ],
135
+ headerParameters: [Parameters.accept, Parameters.contentType],
136
+ mediaType: "json",
107
137
  serializer
108
138
  };
109
-
110
- export {
111
- MixedRealityClient,
112
- MixedRealityClientContext,
113
- Models as MixedRealityModels,
114
- Mappers as MixedRealityMappers
115
- };
116
- export * from "./operations";