@azure/arm-oep 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +12 -1
- package/dist/index.js +183 -28
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/energyServicesCreateSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesCreateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesCreateSample.js +31 -0
- package/dist-esm/samples-dev/energyServicesCreateSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesDeleteSample.js +31 -0
- package/dist-esm/samples-dev/energyServicesDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesGetSample.js +31 -0
- package/dist-esm/samples-dev/energyServicesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesListByResourceGroupSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesListByResourceGroupSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesListByResourceGroupSample.js +44 -0
- package/dist-esm/samples-dev/energyServicesListByResourceGroupSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesListBySubscriptionSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesListBySubscriptionSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesListBySubscriptionSample.js +43 -0
- package/dist-esm/samples-dev/energyServicesListBySubscriptionSample.js.map +1 -0
- package/dist-esm/samples-dev/energyServicesUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/energyServicesUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/energyServicesUpdateSample.js +31 -0
- package/dist-esm/samples-dev/energyServicesUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailabilitySample.d.ts +2 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailabilitySample.d.ts.map +1 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailabilitySample.js +33 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailabilitySample.js.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsListSample.js +29 -0
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +19 -2
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +17 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.d.ts +2 -0
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.d.ts.map +1 -1
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.js +54 -5
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.js.map +1 -1
- package/dist-esm/src/operations/energyServices.d.ts.map +1 -1
- package/dist-esm/src/operations/energyServices.js +43 -16
- package/dist-esm/src/operations/energyServices.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/test/sampleTest.js +11 -13
- package/dist-esm/test/sampleTest.js.map +1 -1
- package/package.json +38 -22
- package/review/arm-oep.api.md +7 -20
- package/rollup.config.js +6 -72
- package/src/index.ts +1 -0
- package/src/models/index.ts +19 -2
- package/src/openEnergyPlatformManagementServiceAPIs.ts +70 -5
- package/src/operations/energyServices.ts +51 -18
- package/src/pagingHelper.ts +39 -0
- package/tsconfig.json +18 -5
- package/types/arm-oep.d.ts +30 -2
- package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.3 (2022-12-01)
|
|
4
|
+
|
|
5
|
+
**Features**
|
|
6
|
+
|
|
7
|
+
- Added Interface EnergyService
|
|
8
|
+
|
|
9
|
+
## 1.0.0-beta.2 (2022-04-27)
|
|
10
|
+
|
|
11
|
+
**Features**
|
|
12
|
+
|
|
13
|
+
- Bug fix
|
|
14
|
+
|
|
3
15
|
## 1.0.0-beta.1 (2022-01-19)
|
|
4
16
|
|
|
5
17
|
The package of @azure/arm-oep is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
|
package/README.md
CHANGED
|
@@ -13,9 +13,11 @@ Open Energy Platform Management Service APIs
|
|
|
13
13
|
|
|
14
14
|
### Currently supported environments
|
|
15
15
|
|
|
16
|
-
- [LTS versions of Node.js](https://
|
|
16
|
+
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
|
17
17
|
- Latest versions of Safari, Chrome, Edge and Firefox.
|
|
18
18
|
|
|
19
|
+
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
|
20
|
+
|
|
19
21
|
### Prerequisites
|
|
20
22
|
|
|
21
23
|
- An [Azure subscription][azure_sub].
|
|
@@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
|
|
|
49
51
|
```javascript
|
|
50
52
|
const { OpenEnergyPlatformManagementServiceAPIs } = require("@azure/arm-oep");
|
|
51
53
|
const { DefaultAzureCredential } = require("@azure/identity");
|
|
54
|
+
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
|
|
55
|
+
|
|
52
56
|
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
53
57
|
const client = new OpenEnergyPlatformManagementServiceAPIs(new DefaultAzureCredential(), subscriptionId);
|
|
58
|
+
|
|
59
|
+
// For client-side applications running in the browser, use this code instead:
|
|
60
|
+
// const credential = new InteractiveBrowserCredential({
|
|
61
|
+
// tenantId: "<YOUR_TENANT_ID>",
|
|
62
|
+
// clientId: "<YOUR_CLIENT_ID>"
|
|
63
|
+
// });
|
|
64
|
+
// const client = new OpenEnergyPlatformManagementServiceAPIs(credential, subscriptionId);
|
|
54
65
|
```
|
|
55
66
|
|
|
56
67
|
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var coreClient = require('@azure/core-client');
|
|
6
5
|
var tslib = require('tslib');
|
|
6
|
+
var coreClient = require('@azure/core-client');
|
|
7
|
+
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
7
8
|
var coreLro = require('@azure/core-lro');
|
|
8
9
|
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n["default"] = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
|
29
|
+
var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* Copyright (c) Microsoft Corporation.
|
|
33
|
+
* Licensed under the MIT License.
|
|
34
|
+
*
|
|
35
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
36
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
37
|
+
*/
|
|
38
|
+
const pageMap = new WeakMap();
|
|
39
|
+
/**
|
|
40
|
+
* Given a result page from a pageable operation, returns a
|
|
41
|
+
* continuation token that can be used to begin paging from
|
|
42
|
+
* that point later.
|
|
43
|
+
* @param page A result object from calling .byPage() on a paged operation.
|
|
44
|
+
* @returns The continuation token that can be passed into byPage().
|
|
45
|
+
*/
|
|
46
|
+
function getContinuationToken(page) {
|
|
47
|
+
var _a;
|
|
48
|
+
if (typeof page !== "object" || page === null) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
|
|
52
|
+
}
|
|
53
|
+
function setContinuationToken(page, continuationToken) {
|
|
54
|
+
var _a;
|
|
55
|
+
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
|
|
59
|
+
pageInfo.continuationToken = continuationToken;
|
|
60
|
+
pageMap.set(page, pageInfo);
|
|
61
|
+
}
|
|
62
|
+
|
|
9
63
|
/*
|
|
10
64
|
* Copyright (c) Microsoft Corporation.
|
|
11
65
|
* Licensed under the MIT License.
|
|
@@ -13,31 +67,58 @@ var coreLro = require('@azure/core-lro');
|
|
|
13
67
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
14
68
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
15
69
|
*/
|
|
70
|
+
/** Known values of {@link CheckNameAvailabilityReason} that the service accepts. */
|
|
71
|
+
exports.KnownCheckNameAvailabilityReason = void 0;
|
|
16
72
|
(function (KnownCheckNameAvailabilityReason) {
|
|
73
|
+
/** Invalid */
|
|
17
74
|
KnownCheckNameAvailabilityReason["Invalid"] = "Invalid";
|
|
75
|
+
/** AlreadyExists */
|
|
18
76
|
KnownCheckNameAvailabilityReason["AlreadyExists"] = "AlreadyExists";
|
|
19
77
|
})(exports.KnownCheckNameAvailabilityReason || (exports.KnownCheckNameAvailabilityReason = {}));
|
|
78
|
+
/** Known values of {@link ProvisioningState} that the service accepts. */
|
|
79
|
+
exports.KnownProvisioningState = void 0;
|
|
20
80
|
(function (KnownProvisioningState) {
|
|
81
|
+
/** Unknown */
|
|
21
82
|
KnownProvisioningState["Unknown"] = "Unknown";
|
|
83
|
+
/** Succeeded */
|
|
22
84
|
KnownProvisioningState["Succeeded"] = "Succeeded";
|
|
85
|
+
/** Failed */
|
|
23
86
|
KnownProvisioningState["Failed"] = "Failed";
|
|
87
|
+
/** Canceled */
|
|
24
88
|
KnownProvisioningState["Canceled"] = "Canceled";
|
|
89
|
+
/** Creating */
|
|
25
90
|
KnownProvisioningState["Creating"] = "Creating";
|
|
91
|
+
/** Deleting */
|
|
26
92
|
KnownProvisioningState["Deleting"] = "Deleting";
|
|
93
|
+
/** Updating */
|
|
27
94
|
KnownProvisioningState["Updating"] = "Updating";
|
|
28
95
|
})(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
|
|
96
|
+
/** Known values of {@link CreatedByType} that the service accepts. */
|
|
97
|
+
exports.KnownCreatedByType = void 0;
|
|
29
98
|
(function (KnownCreatedByType) {
|
|
99
|
+
/** User */
|
|
30
100
|
KnownCreatedByType["User"] = "User";
|
|
101
|
+
/** Application */
|
|
31
102
|
KnownCreatedByType["Application"] = "Application";
|
|
103
|
+
/** ManagedIdentity */
|
|
32
104
|
KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
|
|
105
|
+
/** Key */
|
|
33
106
|
KnownCreatedByType["Key"] = "Key";
|
|
34
107
|
})(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
|
|
108
|
+
/** Known values of {@link Origin} that the service accepts. */
|
|
109
|
+
exports.KnownOrigin = void 0;
|
|
35
110
|
(function (KnownOrigin) {
|
|
111
|
+
/** User */
|
|
36
112
|
KnownOrigin["User"] = "user";
|
|
113
|
+
/** System */
|
|
37
114
|
KnownOrigin["System"] = "system";
|
|
115
|
+
/** UserSystem */
|
|
38
116
|
KnownOrigin["UserSystem"] = "user,system";
|
|
39
117
|
})(exports.KnownOrigin || (exports.KnownOrigin = {}));
|
|
118
|
+
/** Known values of {@link ActionType} that the service accepts. */
|
|
119
|
+
exports.KnownActionType = void 0;
|
|
40
120
|
(function (KnownActionType) {
|
|
121
|
+
/** Internal */
|
|
41
122
|
KnownActionType["Internal"] = "Internal";
|
|
42
123
|
})(exports.KnownActionType || (exports.KnownActionType = {}));
|
|
43
124
|
|
|
@@ -652,7 +733,7 @@ class LocationsImpl {
|
|
|
652
733
|
}
|
|
653
734
|
}
|
|
654
735
|
// Operation Specifications
|
|
655
|
-
const serializer =
|
|
736
|
+
const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
656
737
|
const checkNameAvailabilityOperationSpec = {
|
|
657
738
|
path: "/subscriptions/{subscriptionId}/providers/Microsoft.OpenEnergyPlatform/checkNameAvailability",
|
|
658
739
|
httpMethod: "POST",
|
|
@@ -668,7 +749,7 @@ const checkNameAvailabilityOperationSpec = {
|
|
|
668
749
|
urlParameters: [$host, subscriptionId],
|
|
669
750
|
headerParameters: [contentType, accept],
|
|
670
751
|
mediaType: "json",
|
|
671
|
-
serializer
|
|
752
|
+
serializer: serializer$2
|
|
672
753
|
};
|
|
673
754
|
|
|
674
755
|
/*
|
|
@@ -730,20 +811,31 @@ class EnergyServicesImpl {
|
|
|
730
811
|
[Symbol.asyncIterator]() {
|
|
731
812
|
return this;
|
|
732
813
|
},
|
|
733
|
-
byPage: () => {
|
|
734
|
-
|
|
814
|
+
byPage: (settings) => {
|
|
815
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
816
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
817
|
+
}
|
|
818
|
+
return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
|
|
735
819
|
}
|
|
736
820
|
};
|
|
737
821
|
}
|
|
738
|
-
listByResourceGroupPagingPage(resourceGroupName, options) {
|
|
822
|
+
listByResourceGroupPagingPage(resourceGroupName, options, settings) {
|
|
739
823
|
return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
|
|
740
|
-
let result
|
|
741
|
-
|
|
742
|
-
|
|
824
|
+
let result;
|
|
825
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
826
|
+
if (!continuationToken) {
|
|
827
|
+
result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
|
|
828
|
+
let page = result.value || [];
|
|
829
|
+
continuationToken = result.nextLink;
|
|
830
|
+
setContinuationToken(page, continuationToken);
|
|
831
|
+
yield yield tslib.__await(page);
|
|
832
|
+
}
|
|
743
833
|
while (continuationToken) {
|
|
744
834
|
result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
|
|
745
835
|
continuationToken = result.nextLink;
|
|
746
|
-
|
|
836
|
+
let page = result.value || [];
|
|
837
|
+
setContinuationToken(page, continuationToken);
|
|
838
|
+
yield yield tslib.__await(page);
|
|
747
839
|
}
|
|
748
840
|
});
|
|
749
841
|
}
|
|
@@ -778,20 +870,31 @@ class EnergyServicesImpl {
|
|
|
778
870
|
[Symbol.asyncIterator]() {
|
|
779
871
|
return this;
|
|
780
872
|
},
|
|
781
|
-
byPage: () => {
|
|
782
|
-
|
|
873
|
+
byPage: (settings) => {
|
|
874
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
875
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
876
|
+
}
|
|
877
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
|
783
878
|
}
|
|
784
879
|
};
|
|
785
880
|
}
|
|
786
|
-
listBySubscriptionPagingPage(options) {
|
|
881
|
+
listBySubscriptionPagingPage(options, settings) {
|
|
787
882
|
return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
|
|
788
|
-
let result
|
|
789
|
-
|
|
790
|
-
|
|
883
|
+
let result;
|
|
884
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
885
|
+
if (!continuationToken) {
|
|
886
|
+
result = yield tslib.__await(this._listBySubscription(options));
|
|
887
|
+
let page = result.value || [];
|
|
888
|
+
continuationToken = result.nextLink;
|
|
889
|
+
setContinuationToken(page, continuationToken);
|
|
890
|
+
yield yield tslib.__await(page);
|
|
891
|
+
}
|
|
791
892
|
while (continuationToken) {
|
|
792
893
|
result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
|
|
793
894
|
continuationToken = result.nextLink;
|
|
794
|
-
|
|
895
|
+
let page = result.value || [];
|
|
896
|
+
setContinuationToken(page, continuationToken);
|
|
897
|
+
yield yield tslib.__await(page);
|
|
795
898
|
}
|
|
796
899
|
});
|
|
797
900
|
}
|
|
@@ -868,11 +971,13 @@ class EnergyServicesImpl {
|
|
|
868
971
|
};
|
|
869
972
|
});
|
|
870
973
|
const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, options }, createOperationSpec);
|
|
871
|
-
|
|
974
|
+
const poller = new coreLro.LroEngine(lro, {
|
|
872
975
|
resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
|
|
873
976
|
intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
|
|
874
977
|
lroResourceLocationConfig: "azure-async-operation"
|
|
875
978
|
});
|
|
979
|
+
yield poller.poll();
|
|
980
|
+
return poller;
|
|
876
981
|
});
|
|
877
982
|
}
|
|
878
983
|
/**
|
|
@@ -926,10 +1031,12 @@ class EnergyServicesImpl {
|
|
|
926
1031
|
};
|
|
927
1032
|
});
|
|
928
1033
|
const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, options }, deleteOperationSpec);
|
|
929
|
-
|
|
1034
|
+
const poller = new coreLro.LroEngine(lro, {
|
|
930
1035
|
resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
|
|
931
1036
|
intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
|
|
932
1037
|
});
|
|
1038
|
+
yield poller.poll();
|
|
1039
|
+
return poller;
|
|
933
1040
|
});
|
|
934
1041
|
}
|
|
935
1042
|
/**
|
|
@@ -963,7 +1070,7 @@ class EnergyServicesImpl {
|
|
|
963
1070
|
}
|
|
964
1071
|
}
|
|
965
1072
|
// Operation Specifications
|
|
966
|
-
const serializer$1 =
|
|
1073
|
+
const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
967
1074
|
const listByResourceGroupOperationSpec = {
|
|
968
1075
|
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OpenEnergyPlatform/energyServices",
|
|
969
1076
|
httpMethod: "GET",
|
|
@@ -1143,7 +1250,7 @@ class OperationsImpl {
|
|
|
1143
1250
|
}
|
|
1144
1251
|
}
|
|
1145
1252
|
// Operation Specifications
|
|
1146
|
-
const serializer
|
|
1253
|
+
const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
1147
1254
|
const listOperationSpec = {
|
|
1148
1255
|
path: "/providers/Microsoft.OpenEnergyPlatform/operations",
|
|
1149
1256
|
httpMethod: "GET",
|
|
@@ -1158,7 +1265,7 @@ const listOperationSpec = {
|
|
|
1158
1265
|
queryParameters: [apiVersion],
|
|
1159
1266
|
urlParameters: [$host],
|
|
1160
1267
|
headerParameters: [accept],
|
|
1161
|
-
serializer
|
|
1268
|
+
serializer
|
|
1162
1269
|
};
|
|
1163
1270
|
|
|
1164
1271
|
/*
|
|
@@ -1168,7 +1275,7 @@ const listOperationSpec = {
|
|
|
1168
1275
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
1169
1276
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
1170
1277
|
*/
|
|
1171
|
-
class OpenEnergyPlatformManagementServiceAPIs extends
|
|
1278
|
+
class OpenEnergyPlatformManagementServiceAPIs extends coreClient__namespace.ServiceClient {
|
|
1172
1279
|
/**
|
|
1173
1280
|
* Initializes a new instance of the OpenEnergyPlatformManagementServiceAPIs class.
|
|
1174
1281
|
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
@@ -1176,6 +1283,7 @@ class OpenEnergyPlatformManagementServiceAPIs extends coreClient.ServiceClient {
|
|
|
1176
1283
|
* @param options The parameter options
|
|
1177
1284
|
*/
|
|
1178
1285
|
constructor(credentials, subscriptionId, options) {
|
|
1286
|
+
var _a, _b, _c;
|
|
1179
1287
|
if (credentials === undefined) {
|
|
1180
1288
|
throw new Error("'credentials' cannot be null");
|
|
1181
1289
|
}
|
|
@@ -1190,17 +1298,35 @@ class OpenEnergyPlatformManagementServiceAPIs extends coreClient.ServiceClient {
|
|
|
1190
1298
|
requestContentType: "application/json; charset=utf-8",
|
|
1191
1299
|
credential: credentials
|
|
1192
1300
|
};
|
|
1193
|
-
const packageDetails = `azsdk-js-arm-oep/1.0.0-beta.
|
|
1301
|
+
const packageDetails = `azsdk-js-arm-oep/1.0.0-beta.3`;
|
|
1194
1302
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
1195
1303
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
1196
1304
|
: `${packageDetails}`;
|
|
1197
|
-
if (!options.credentialScopes) {
|
|
1198
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
1199
|
-
}
|
|
1200
1305
|
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
1201
1306
|
userAgentPrefix
|
|
1202
|
-
},
|
|
1307
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
|
|
1203
1308
|
super(optionsWithDefaults);
|
|
1309
|
+
let bearerTokenAuthenticationPolicyFound = false;
|
|
1310
|
+
if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
|
|
1311
|
+
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
1312
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
1313
|
+
coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
|
|
1314
|
+
}
|
|
1315
|
+
if (!options ||
|
|
1316
|
+
!options.pipeline ||
|
|
1317
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
1318
|
+
!bearerTokenAuthenticationPolicyFound) {
|
|
1319
|
+
this.pipeline.removePolicy({
|
|
1320
|
+
name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
|
|
1321
|
+
});
|
|
1322
|
+
this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
|
|
1323
|
+
credential: credentials,
|
|
1324
|
+
scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
|
|
1325
|
+
challengeCallbacks: {
|
|
1326
|
+
authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
|
|
1327
|
+
}
|
|
1328
|
+
}));
|
|
1329
|
+
}
|
|
1204
1330
|
// Parameter assignments
|
|
1205
1331
|
this.subscriptionId = subscriptionId;
|
|
1206
1332
|
// Assigning values to Constant parameters
|
|
@@ -1209,8 +1335,37 @@ class OpenEnergyPlatformManagementServiceAPIs extends coreClient.ServiceClient {
|
|
|
1209
1335
|
this.locations = new LocationsImpl(this);
|
|
1210
1336
|
this.energyServices = new EnergyServicesImpl(this);
|
|
1211
1337
|
this.operations = new OperationsImpl(this);
|
|
1338
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
1339
|
+
}
|
|
1340
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
1341
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
1342
|
+
if (!apiVersion) {
|
|
1343
|
+
return;
|
|
1344
|
+
}
|
|
1345
|
+
const apiVersionPolicy = {
|
|
1346
|
+
name: "CustomApiVersionPolicy",
|
|
1347
|
+
sendRequest(request, next) {
|
|
1348
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1349
|
+
const param = request.url.split("?");
|
|
1350
|
+
if (param.length > 1) {
|
|
1351
|
+
const newParams = param[1].split("&").map((item) => {
|
|
1352
|
+
if (item.indexOf("api-version") > -1) {
|
|
1353
|
+
return "api-version=" + apiVersion;
|
|
1354
|
+
}
|
|
1355
|
+
else {
|
|
1356
|
+
return item;
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
1360
|
+
}
|
|
1361
|
+
return next(request);
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
};
|
|
1365
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
1212
1366
|
}
|
|
1213
1367
|
}
|
|
1214
1368
|
|
|
1215
1369
|
exports.OpenEnergyPlatformManagementServiceAPIs = OpenEnergyPlatformManagementServiceAPIs;
|
|
1370
|
+
exports.getContinuationToken = getContinuationToken;
|
|
1216
1371
|
//# sourceMappingURL=index.js.map
|