@azure/arm-baremetalinfrastructure 1.0.0-beta.1

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 (97) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +1378 -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/azureBareMetalInstancesGetSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/azureBareMetalInstancesGetSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/azureBareMetalInstancesGetSample.js +39 -0
  11. package/dist-esm/samples-dev/azureBareMetalInstancesGetSample.js.map +1 -0
  12. package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.js +59 -0
  15. package/dist-esm/samples-dev/azureBareMetalInstancesListByResourceGroupSample.js.map +1 -0
  16. package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.js +58 -0
  19. package/dist-esm/samples-dev/azureBareMetalInstancesListBySubscriptionSample.js.map +1 -0
  20. package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.js +60 -0
  23. package/dist-esm/samples-dev/azureBareMetalInstancesUpdateSample.js.map +1 -0
  24. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/operationsListSample.js +58 -0
  27. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  28. package/dist-esm/src/bareMetalInfrastructureClient.d.ts +21 -0
  29. package/dist-esm/src/bareMetalInfrastructureClient.d.ts.map +1 -0
  30. package/dist-esm/src/bareMetalInfrastructureClient.js +101 -0
  31. package/dist-esm/src/bareMetalInfrastructureClient.js.map +1 -0
  32. package/dist-esm/src/index.d.ts +6 -0
  33. package/dist-esm/src/index.d.ts.map +1 -0
  34. package/dist-esm/src/index.js +13 -0
  35. package/dist-esm/src/index.js.map +1 -0
  36. package/dist-esm/src/models/index.d.ts +519 -0
  37. package/dist-esm/src/models/index.d.ts.map +1 -0
  38. package/dist-esm/src/models/index.js +152 -0
  39. package/dist-esm/src/models/index.js.map +1 -0
  40. package/dist-esm/src/models/mappers.d.ts +20 -0
  41. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  42. package/dist-esm/src/models/mappers.js +513 -0
  43. package/dist-esm/src/models/mappers.js.map +1 -0
  44. package/dist-esm/src/models/parameters.d.ts +11 -0
  45. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  46. package/dist-esm/src/models/parameters.js +105 -0
  47. package/dist-esm/src/models/parameters.js.map +1 -0
  48. package/dist-esm/src/operations/azureBareMetalInstances.d.ts +73 -0
  49. package/dist-esm/src/operations/azureBareMetalInstances.d.ts.map +1 -0
  50. package/dist-esm/src/operations/azureBareMetalInstances.js +334 -0
  51. package/dist-esm/src/operations/azureBareMetalInstances.js.map +1 -0
  52. package/dist-esm/src/operations/index.d.ts +3 -0
  53. package/dist-esm/src/operations/index.d.ts.map +1 -0
  54. package/dist-esm/src/operations/index.js +10 -0
  55. package/dist-esm/src/operations/index.js.map +1 -0
  56. package/dist-esm/src/operations/operations.d.ts +26 -0
  57. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  58. package/dist-esm/src/operations/operations.js +101 -0
  59. package/dist-esm/src/operations/operations.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.d.ts +35 -0
  61. package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/azureBareMetalInstances.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
  65. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/index.js +10 -0
  67. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  69. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  72. package/dist-esm/src/pagingHelper.d.ts +13 -0
  73. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  74. package/dist-esm/src/pagingHelper.js +32 -0
  75. package/dist-esm/src/pagingHelper.js.map +1 -0
  76. package/dist-esm/test/baremetalinfrastructure_operations_test.spec.d.ts +4 -0
  77. package/dist-esm/test/baremetalinfrastructure_operations_test.spec.d.ts.map +1 -0
  78. package/dist-esm/test/baremetalinfrastructure_operations_test.spec.js +78 -0
  79. package/dist-esm/test/baremetalinfrastructure_operations_test.spec.js.map +1 -0
  80. package/package.json +121 -0
  81. package/review/arm-baremetalinfrastructure.api.md +325 -0
  82. package/rollup.config.js +122 -0
  83. package/src/bareMetalInfrastructureClient.ts +142 -0
  84. package/src/index.ts +13 -0
  85. package/src/models/index.ts +566 -0
  86. package/src/models/mappers.ts +549 -0
  87. package/src/models/parameters.ts +119 -0
  88. package/src/operations/azureBareMetalInstances.ts +395 -0
  89. package/src/operations/index.ts +10 -0
  90. package/src/operations/operations.ts +103 -0
  91. package/src/operationsInterfaces/azureBareMetalInstances.ts +67 -0
  92. package/src/operationsInterfaces/index.ts +10 -0
  93. package/src/operationsInterfaces/operations.ts +22 -0
  94. package/src/pagingHelper.ts +39 -0
  95. package/tsconfig.json +33 -0
  96. package/types/arm-baremetalinfrastructure.d.ts +633 -0
  97. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,122 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
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
+ // #region Warning Handler
18
+
19
+ /**
20
+ * A function that can determine whether a rollup warning should be ignored. If
21
+ * the function returns `true`, then the warning will not be displayed.
22
+ */
23
+
24
+ function ignoreNiseSinonEval(warning) {
25
+ return (
26
+ warning.code === "EVAL" &&
27
+ warning.id &&
28
+ (warning.id.includes("node_modules/nise") ||
29
+ warning.id.includes("node_modules/sinon")) === true
30
+ );
31
+ }
32
+
33
+ function ignoreChaiCircularDependency(warning) {
34
+ return (
35
+ warning.code === "CIRCULAR_DEPENDENCY" &&
36
+ warning.importer && warning.importer.includes("node_modules/chai") === true
37
+ );
38
+ }
39
+
40
+ const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
41
+
42
+ /**
43
+ * Construct a warning handler for the shared rollup configuration
44
+ * that ignores certain warnings that are not relevant to testing.
45
+ */
46
+ function makeOnWarnForTesting() {
47
+ return (warning, warn) => {
48
+ // If every inhibitor returns false (i.e. no inhibitors), then show the warning
49
+ if (warningInhibitors.every((inhib) => !inhib(warning))) {
50
+ warn(warning);
51
+ }
52
+ };
53
+ }
54
+
55
+ // #endregion
56
+
57
+ function makeBrowserTestConfig() {
58
+ const config = {
59
+ input: {
60
+ include: ["dist-esm/test/**/*.spec.js"],
61
+ exclude: ["dist-esm/test/**/node/**"]
62
+ },
63
+ output: {
64
+ file: `dist-test/index.browser.js`,
65
+ format: "umd",
66
+ sourcemap: true
67
+ },
68
+ preserveSymlinks: false,
69
+ plugins: [
70
+ multiEntry({ exports: false }),
71
+ nodeResolve({
72
+ mainFields: ["module", "browser"]
73
+ }),
74
+ cjs(),
75
+ json(),
76
+ sourcemaps()
77
+ //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
78
+ ],
79
+ onwarn: makeOnWarnForTesting(),
80
+ // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
81
+ // rollup started respecting the "sideEffects" field in package.json. Since
82
+ // our package.json sets "sideEffects=false", this also applies to test
83
+ // code, which causes all tests to be removed by tree-shaking.
84
+ treeshake: false
85
+ };
86
+
87
+ return config;
88
+ }
89
+
90
+ const defaultConfigurationOptions = {
91
+ disableBrowserBundle: false
92
+ };
93
+
94
+ export function makeConfig(pkg, options) {
95
+ options = {
96
+ ...defaultConfigurationOptions,
97
+ ...(options || {})
98
+ };
99
+
100
+ const baseConfig = {
101
+ // Use the package's module field if it has one
102
+ input: pkg["module"] || "dist-esm/src/index.js",
103
+ external: [
104
+ ...nodeBuiltins,
105
+ ...Object.keys(pkg.dependencies),
106
+ ...Object.keys(pkg.devDependencies)
107
+ ],
108
+ output: { file: "dist/index.js", format: "cjs", sourcemap: true },
109
+ preserveSymlinks: false,
110
+ plugins: [sourcemaps(), nodeResolve()]
111
+ };
112
+
113
+ const config = [baseConfig];
114
+
115
+ if (!options.disableBrowserBundle) {
116
+ config.push(makeBrowserTestConfig());
117
+ }
118
+
119
+ return config;
120
+ }
121
+
122
+ export default makeConfig(require("./package.json"));
@@ -0,0 +1,142 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
+ import {
12
+ PipelineRequest,
13
+ PipelineResponse,
14
+ SendRequest
15
+ } from "@azure/core-rest-pipeline";
16
+ import * as coreAuth from "@azure/core-auth";
17
+ import { AzureBareMetalInstancesImpl, OperationsImpl } from "./operations";
18
+ import { AzureBareMetalInstances, Operations } from "./operationsInterfaces";
19
+ import { BareMetalInfrastructureClientOptionalParams } from "./models";
20
+
21
+ export class BareMetalInfrastructureClient extends coreClient.ServiceClient {
22
+ $host: string;
23
+ apiVersion: string;
24
+ subscriptionId: string;
25
+
26
+ /**
27
+ * Initializes a new instance of the BareMetalInfrastructureClient class.
28
+ * @param credentials Subscription credentials which uniquely identify client subscription.
29
+ * @param subscriptionId The ID of the target subscription.
30
+ * @param options The parameter options
31
+ */
32
+ constructor(
33
+ credentials: coreAuth.TokenCredential,
34
+ subscriptionId: string,
35
+ options?: BareMetalInfrastructureClientOptionalParams
36
+ ) {
37
+ if (credentials === undefined) {
38
+ throw new Error("'credentials' cannot be null");
39
+ }
40
+ if (subscriptionId === undefined) {
41
+ throw new Error("'subscriptionId' cannot be null");
42
+ }
43
+
44
+ // Initializing default values for options
45
+ if (!options) {
46
+ options = {};
47
+ }
48
+ const defaults: BareMetalInfrastructureClientOptionalParams = {
49
+ requestContentType: "application/json; charset=utf-8",
50
+ credential: credentials
51
+ };
52
+
53
+ const packageDetails = `azsdk-js-arm-baremetalinfrastructure/1.0.0-beta.1`;
54
+ const userAgentPrefix =
55
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
56
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
57
+ : `${packageDetails}`;
58
+
59
+ const optionsWithDefaults = {
60
+ ...defaults,
61
+ ...options,
62
+ userAgentOptions: {
63
+ userAgentPrefix
64
+ },
65
+ endpoint:
66
+ options.endpoint ?? options.baseUri ?? "https://management.azure.com"
67
+ };
68
+ super(optionsWithDefaults);
69
+
70
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
71
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
72
+ const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
73
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
74
+ (pipelinePolicy) =>
75
+ pipelinePolicy.name ===
76
+ coreRestPipeline.bearerTokenAuthenticationPolicyName
77
+ );
78
+ }
79
+ if (
80
+ !options ||
81
+ !options.pipeline ||
82
+ options.pipeline.getOrderedPolicies().length == 0 ||
83
+ !bearerTokenAuthenticationPolicyFound
84
+ ) {
85
+ this.pipeline.removePolicy({
86
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
87
+ });
88
+ this.pipeline.addPolicy(
89
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
90
+ credential: credentials,
91
+ scopes:
92
+ optionsWithDefaults.credentialScopes ??
93
+ `${optionsWithDefaults.endpoint}/.default`,
94
+ challengeCallbacks: {
95
+ authorizeRequestOnChallenge:
96
+ coreClient.authorizeRequestOnClaimChallenge
97
+ }
98
+ })
99
+ );
100
+ }
101
+ // Parameter assignments
102
+ this.subscriptionId = subscriptionId;
103
+
104
+ // Assigning values to Constant parameters
105
+ this.$host = options.$host || "https://management.azure.com";
106
+ this.apiVersion = options.apiVersion || "2021-08-09";
107
+ this.azureBareMetalInstances = new AzureBareMetalInstancesImpl(this);
108
+ this.operations = new OperationsImpl(this);
109
+ this.addCustomApiVersionPolicy(options.apiVersion);
110
+ }
111
+
112
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
113
+ private addCustomApiVersionPolicy(apiVersion?: string) {
114
+ if (!apiVersion) {
115
+ return;
116
+ }
117
+ const apiVersionPolicy = {
118
+ name: "CustomApiVersionPolicy",
119
+ async sendRequest(
120
+ request: PipelineRequest,
121
+ next: SendRequest
122
+ ): Promise<PipelineResponse> {
123
+ const param = request.url.split("?");
124
+ if (param.length > 1) {
125
+ const newParams = param[1].split("&").map((item) => {
126
+ if (item.indexOf("api-version") > -1) {
127
+ return "api-version=" + apiVersion;
128
+ } else {
129
+ return item;
130
+ }
131
+ });
132
+ request.url = param[0] + "?" + newParams.join("&");
133
+ }
134
+ return next(request);
135
+ }
136
+ };
137
+ this.pipeline.addPolicy(apiVersionPolicy);
138
+ }
139
+
140
+ azureBareMetalInstances: AzureBareMetalInstances;
141
+ operations: Operations;
142
+ }
package/src/index.ts ADDED
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ /// <reference lib="esnext.asynciterable" />
10
+ export { getContinuationToken } from "./pagingHelper";
11
+ export * from "./models";
12
+ export { BareMetalInfrastructureClient } from "./bareMetalInfrastructureClient";
13
+ export * from "./operationsInterfaces";