@azure/arm-portal 1.0.0-beta.1 → 1.0.0-beta.4

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 (73) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/LICENSE +1 -1
  3. package/README.md +18 -7
  4. package/dist/index.js +111 -41
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/dashboardsCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/dashboardsCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/dashboardsCreateOrUpdateSample.js +46 -0
  11. package/dist-esm/samples-dev/dashboardsCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/dashboardsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/dashboardsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/dashboardsDeleteSample.js +31 -0
  15. package/dist-esm/samples-dev/dashboardsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/dashboardsGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/dashboardsGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/dashboardsGetSample.js +31 -0
  19. package/dist-esm/samples-dev/dashboardsGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/dashboardsListByResourceGroupSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/dashboardsListByResourceGroupSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/dashboardsListByResourceGroupSample.js +44 -0
  23. package/dist-esm/samples-dev/dashboardsListByResourceGroupSample.js.map +1 -0
  24. package/dist-esm/samples-dev/dashboardsListBySubscriptionSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/dashboardsListBySubscriptionSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/dashboardsListBySubscriptionSample.js +43 -0
  27. package/dist-esm/samples-dev/dashboardsListBySubscriptionSample.js.map +1 -0
  28. package/dist-esm/samples-dev/dashboardsUpdateSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/dashboardsUpdateSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/dashboardsUpdateSample.js +34 -0
  31. package/dist-esm/samples-dev/dashboardsUpdateSample.js.map +1 -0
  32. package/dist-esm/samples-dev/listTenantConfigurationViolationsListSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/listTenantConfigurationViolationsListSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/listTenantConfigurationViolationsListSample.js +43 -0
  35. package/dist-esm/samples-dev/listTenantConfigurationViolationsListSample.js.map +1 -0
  36. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/operationsListSample.js +43 -0
  39. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  40. package/dist-esm/samples-dev/tenantConfigurationsCreateSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/tenantConfigurationsCreateSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/tenantConfigurationsCreateSample.js +33 -0
  43. package/dist-esm/samples-dev/tenantConfigurationsCreateSample.js.map +1 -0
  44. package/dist-esm/samples-dev/tenantConfigurationsDeleteSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/tenantConfigurationsDeleteSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/tenantConfigurationsDeleteSample.js +30 -0
  47. package/dist-esm/samples-dev/tenantConfigurationsDeleteSample.js.map +1 -0
  48. package/dist-esm/samples-dev/tenantConfigurationsGetSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/tenantConfigurationsGetSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/tenantConfigurationsGetSample.js +30 -0
  51. package/dist-esm/samples-dev/tenantConfigurationsGetSample.js.map +1 -0
  52. package/dist-esm/samples-dev/tenantConfigurationsListSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/tenantConfigurationsListSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/tenantConfigurationsListSample.js +43 -0
  55. package/dist-esm/samples-dev/tenantConfigurationsListSample.js.map +1 -0
  56. package/dist-esm/src/models/index.d.ts +7 -5
  57. package/dist-esm/src/models/index.d.ts.map +1 -1
  58. package/dist-esm/src/models/index.js +1 -0
  59. package/dist-esm/src/models/index.js.map +1 -1
  60. package/dist-esm/src/portal.d.ts +2 -0
  61. package/dist-esm/src/portal.d.ts.map +1 -1
  62. package/dist-esm/src/portal.js +49 -2
  63. package/dist-esm/src/portal.js.map +1 -1
  64. package/dist-esm/test/sampleTest.js +11 -13
  65. package/dist-esm/test/sampleTest.js.map +1 -1
  66. package/package.json +49 -20
  67. package/review/arm-portal.api.md +7 -7
  68. package/rollup.config.js +6 -72
  69. package/src/models/index.ts +6 -5
  70. package/src/portal.ts +61 -2
  71. package/tsconfig.json +19 -5
  72. package/types/arm-portal.d.ts +9 -5
  73. package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
- ## 1.0.0-beta.1 (2021-11-30)
1
+ # Release History
2
+
3
+ ## 1.0.0-beta.4 (2022-07-08)
4
+
5
+ **Features**
2
6
 
3
- - Initial Release
7
+ - Added Interface Configuration
8
+ - Added Interface MarkdownPartMetadata
9
+ - Added Interface ProxyResource
10
+
11
+ ### 1.0.0-beta.3 (2022-04-28)
12
+
13
+ **Features**
14
+
15
+ - Bug fix
16
+
17
+ ### 1.0.0-beta.2 (2021-11-30)
18
+
19
+ The package of @azure/arm-portal is using our next generation design principles since version 1.0.0-beta.2, which contains breaking changes.
20
+
21
+ To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
22
+
23
+ To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).
24
+
25
+ To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Microsoft
3
+ Copyright (c) 2022 Microsoft
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Azure Service client library for JavaScript
1
+ # Azure Portal client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Portal client.
4
4
 
5
5
  Allows creation and deletion of Azure Shared Dashboards.
6
6
 
@@ -16,13 +16,15 @@ Allows creation and deletion of Azure Shared Dashboards.
16
16
  - [LTS versions of Node.js](https://nodejs.org/about/releases/)
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].
22
24
 
23
25
  ### Install the `@azure/arm-portal` package
24
26
 
25
- Install the Azure Service client library for JavaScript with `npm`:
27
+ Install the Azure Portal client library for JavaScript with `npm`:
26
28
 
27
29
  ```bash
28
30
  npm install @azure/arm-portal
@@ -30,8 +32,8 @@ npm install @azure/arm-portal
30
32
 
31
33
  ### Create and authenticate a `Portal`
32
34
 
33
- To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate.
34
- You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal].
35
+ To create a client object to access the Azure Portal API, you will need the `endpoint` of your Azure Portal resource and a `credential`. The Azure Portal client can use Azure Active Directory credentials to authenticate.
36
+ You can find the endpoint for your Azure Portal resource in the [Azure Portal][azure_portal].
35
37
 
36
38
  You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
37
39
 
@@ -41,7 +43,7 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below
41
43
  npm install @azure/identity
42
44
  ```
43
45
 
44
- You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
46
+ You will also need to **register a new AAD application and grant access to Azure Portal** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
45
47
  Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
46
48
 
47
49
  For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
@@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
49
51
  ```javascript
50
52
  const { Portal } = require("@azure/arm-portal");
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 Portal(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 Portal(credential, subscriptionId);
54
65
  ```
55
66
 
56
67
 
@@ -61,7 +72,7 @@ To use this client library in the browser, first you need to use a bundler. For
61
72
 
62
73
  ### Portal
63
74
 
64
- `Portal` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access.
75
+ `Portal` is the primary interface for developers using the Azure Portal client library. Explore the methods on this client object to understand the different features of the Azure Portal service that you can access.
65
76
 
66
77
  ## Troubleshooting
67
78
 
package/dist/index.js CHANGED
@@ -2,8 +2,30 @@
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');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
28
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
7
29
 
8
30
  /*
9
31
  * Copyright (c) Microsoft Corporation.
@@ -12,7 +34,10 @@ var tslib = require('tslib');
12
34
  * Code generated by Microsoft (R) AutoRest Code Generator.
13
35
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
14
36
  */
37
+ /** Known values of {@link ConfigurationName} that the service accepts. */
38
+ exports.KnownConfigurationName = void 0;
15
39
  (function (KnownConfigurationName) {
40
+ /** Default */
16
41
  KnownConfigurationName["Default"] = "default";
17
42
  })(exports.KnownConfigurationName || (exports.KnownConfigurationName = {}));
18
43
 
@@ -856,7 +881,7 @@ class OperationsImpl {
856
881
  * @param options The options parameters.
857
882
  */
858
883
  _list(options) {
859
- return this.client.sendOperationRequest({ options }, listOperationSpec);
884
+ return this.client.sendOperationRequest({ options }, listOperationSpec$2);
860
885
  }
861
886
  /**
862
887
  * ListNext
@@ -864,12 +889,12 @@ class OperationsImpl {
864
889
  * @param options The options parameters.
865
890
  */
866
891
  _listNext(nextLink, options) {
867
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
892
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$2);
868
893
  }
869
894
  }
870
895
  // Operation Specifications
871
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
872
- const listOperationSpec = {
896
+ const serializer$3 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
897
+ const listOperationSpec$2 = {
873
898
  path: "/providers/Microsoft.Portal/operations",
874
899
  httpMethod: "GET",
875
900
  responses: {
@@ -883,9 +908,9 @@ const listOperationSpec = {
883
908
  queryParameters: [apiVersion],
884
909
  urlParameters: [$host],
885
910
  headerParameters: [accept],
886
- serializer
911
+ serializer: serializer$3
887
912
  };
888
- const listNextOperationSpec = {
913
+ const listNextOperationSpec$2 = {
889
914
  path: "{nextLink}",
890
915
  httpMethod: "GET",
891
916
  responses: {
@@ -899,7 +924,7 @@ const listNextOperationSpec = {
899
924
  queryParameters: [apiVersion],
900
925
  urlParameters: [$host, nextLink],
901
926
  headerParameters: [accept],
902
- serializer
927
+ serializer: serializer$3
903
928
  };
904
929
 
905
930
  /*
@@ -1033,7 +1058,7 @@ class DashboardsImpl {
1033
1058
  * @param options The options parameters.
1034
1059
  */
1035
1060
  delete(resourceGroupName, dashboardName, options) {
1036
- return this.client.sendOperationRequest({ resourceGroupName, dashboardName, options }, deleteOperationSpec);
1061
+ return this.client.sendOperationRequest({ resourceGroupName, dashboardName, options }, deleteOperationSpec$1);
1037
1062
  }
1038
1063
  /**
1039
1064
  * Gets the Dashboard.
@@ -1042,7 +1067,7 @@ class DashboardsImpl {
1042
1067
  * @param options The options parameters.
1043
1068
  */
1044
1069
  get(resourceGroupName, dashboardName, options) {
1045
- return this.client.sendOperationRequest({ resourceGroupName, dashboardName, options }, getOperationSpec);
1070
+ return this.client.sendOperationRequest({ resourceGroupName, dashboardName, options }, getOperationSpec$1);
1046
1071
  }
1047
1072
  /**
1048
1073
  * Updates an existing Dashboard.
@@ -1088,7 +1113,7 @@ class DashboardsImpl {
1088
1113
  }
1089
1114
  }
1090
1115
  // Operation Specifications
1091
- const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
1116
+ const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1092
1117
  const createOrUpdateOperationSpec = {
1093
1118
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}",
1094
1119
  httpMethod: "PUT",
@@ -1113,9 +1138,9 @@ const createOrUpdateOperationSpec = {
1113
1138
  ],
1114
1139
  headerParameters: [accept, contentType],
1115
1140
  mediaType: "json",
1116
- serializer: serializer$1
1141
+ serializer: serializer$2
1117
1142
  };
1118
- const deleteOperationSpec = {
1143
+ const deleteOperationSpec$1 = {
1119
1144
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}",
1120
1145
  httpMethod: "DELETE",
1121
1146
  responses: {
@@ -1133,9 +1158,9 @@ const deleteOperationSpec = {
1133
1158
  dashboardName
1134
1159
  ],
1135
1160
  headerParameters: [accept],
1136
- serializer: serializer$1
1161
+ serializer: serializer$2
1137
1162
  };
1138
- const getOperationSpec = {
1163
+ const getOperationSpec$1 = {
1139
1164
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}",
1140
1165
  httpMethod: "GET",
1141
1166
  responses: {
@@ -1155,7 +1180,7 @@ const getOperationSpec = {
1155
1180
  dashboardName
1156
1181
  ],
1157
1182
  headerParameters: [accept],
1158
- serializer: serializer$1
1183
+ serializer: serializer$2
1159
1184
  };
1160
1185
  const updateOperationSpec = {
1161
1186
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}",
@@ -1179,7 +1204,7 @@ const updateOperationSpec = {
1179
1204
  ],
1180
1205
  headerParameters: [accept, contentType],
1181
1206
  mediaType: "json",
1182
- serializer: serializer$1
1207
+ serializer: serializer$2
1183
1208
  };
1184
1209
  const listByResourceGroupOperationSpec = {
1185
1210
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards",
@@ -1199,7 +1224,7 @@ const listByResourceGroupOperationSpec = {
1199
1224
  resourceGroupName
1200
1225
  ],
1201
1226
  headerParameters: [accept],
1202
- serializer: serializer$1
1227
+ serializer: serializer$2
1203
1228
  };
1204
1229
  const listBySubscriptionOperationSpec = {
1205
1230
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Portal/dashboards",
@@ -1215,7 +1240,7 @@ const listBySubscriptionOperationSpec = {
1215
1240
  queryParameters: [apiVersion],
1216
1241
  urlParameters: [$host, subscriptionId],
1217
1242
  headerParameters: [accept],
1218
- serializer: serializer$1
1243
+ serializer: serializer$2
1219
1244
  };
1220
1245
  const listByResourceGroupNextOperationSpec = {
1221
1246
  path: "{nextLink}",
@@ -1236,7 +1261,7 @@ const listByResourceGroupNextOperationSpec = {
1236
1261
  resourceGroupName
1237
1262
  ],
1238
1263
  headerParameters: [accept],
1239
- serializer: serializer$1
1264
+ serializer: serializer$2
1240
1265
  };
1241
1266
  const listBySubscriptionNextOperationSpec = {
1242
1267
  path: "{nextLink}",
@@ -1256,7 +1281,7 @@ const listBySubscriptionNextOperationSpec = {
1256
1281
  subscriptionId
1257
1282
  ],
1258
1283
  headerParameters: [accept],
1259
- serializer: serializer$1
1284
+ serializer: serializer$2
1260
1285
  };
1261
1286
 
1262
1287
  /*
@@ -1337,7 +1362,7 @@ class TenantConfigurationsImpl {
1337
1362
  * @param options The options parameters.
1338
1363
  */
1339
1364
  get(configurationName, options) {
1340
- return this.client.sendOperationRequest({ configurationName, options }, getOperationSpec$1);
1365
+ return this.client.sendOperationRequest({ configurationName, options }, getOperationSpec);
1341
1366
  }
1342
1367
  /**
1343
1368
  * Create the tenant configuration. If configuration already exists - update it. User has to be a
@@ -1355,7 +1380,7 @@ class TenantConfigurationsImpl {
1355
1380
  * @param options The options parameters.
1356
1381
  */
1357
1382
  delete(configurationName, options) {
1358
- return this.client.sendOperationRequest({ configurationName, options }, deleteOperationSpec$1);
1383
+ return this.client.sendOperationRequest({ configurationName, options }, deleteOperationSpec);
1359
1384
  }
1360
1385
  /**
1361
1386
  * ListNext
@@ -1367,7 +1392,7 @@ class TenantConfigurationsImpl {
1367
1392
  }
1368
1393
  }
1369
1394
  // Operation Specifications
1370
- const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
1395
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1371
1396
  const listOperationSpec$1 = {
1372
1397
  path: "/providers/Microsoft.Portal/tenantConfigurations",
1373
1398
  httpMethod: "GET",
@@ -1382,9 +1407,9 @@ const listOperationSpec$1 = {
1382
1407
  queryParameters: [apiVersion],
1383
1408
  urlParameters: [$host],
1384
1409
  headerParameters: [accept],
1385
- serializer: serializer$2
1410
+ serializer: serializer$1
1386
1411
  };
1387
- const getOperationSpec$1 = {
1412
+ const getOperationSpec = {
1388
1413
  path: "/providers/Microsoft.Portal/tenantConfigurations/{configurationName}",
1389
1414
  httpMethod: "GET",
1390
1415
  responses: {
@@ -1399,7 +1424,7 @@ const getOperationSpec$1 = {
1399
1424
  queryParameters: [apiVersion],
1400
1425
  urlParameters: [$host, configurationName],
1401
1426
  headerParameters: [accept],
1402
- serializer: serializer$2
1427
+ serializer: serializer$1
1403
1428
  };
1404
1429
  const createOperationSpec = {
1405
1430
  path: "/providers/Microsoft.Portal/tenantConfigurations/{configurationName}",
@@ -1420,9 +1445,9 @@ const createOperationSpec = {
1420
1445
  urlParameters: [$host, configurationName],
1421
1446
  headerParameters: [accept, contentType],
1422
1447
  mediaType: "json",
1423
- serializer: serializer$2
1448
+ serializer: serializer$1
1424
1449
  };
1425
- const deleteOperationSpec$1 = {
1450
+ const deleteOperationSpec = {
1426
1451
  path: "/providers/Microsoft.Portal/tenantConfigurations/{configurationName}",
1427
1452
  httpMethod: "DELETE",
1428
1453
  responses: {
@@ -1435,7 +1460,7 @@ const deleteOperationSpec$1 = {
1435
1460
  queryParameters: [apiVersion],
1436
1461
  urlParameters: [$host, configurationName],
1437
1462
  headerParameters: [accept],
1438
- serializer: serializer$2
1463
+ serializer: serializer$1
1439
1464
  };
1440
1465
  const listNextOperationSpec$1 = {
1441
1466
  path: "{nextLink}",
@@ -1451,7 +1476,7 @@ const listNextOperationSpec$1 = {
1451
1476
  queryParameters: [apiVersion],
1452
1477
  urlParameters: [$host, nextLink],
1453
1478
  headerParameters: [accept],
1454
- serializer: serializer$2
1479
+ serializer: serializer$1
1455
1480
  };
1456
1481
 
1457
1482
  /*
@@ -1524,7 +1549,7 @@ class ListTenantConfigurationViolationsImpl {
1524
1549
  * @param options The options parameters.
1525
1550
  */
1526
1551
  _list(options) {
1527
- return this.client.sendOperationRequest({ options }, listOperationSpec$2);
1552
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
1528
1553
  }
1529
1554
  /**
1530
1555
  * ListNext
@@ -1532,12 +1557,12 @@ class ListTenantConfigurationViolationsImpl {
1532
1557
  * @param options The options parameters.
1533
1558
  */
1534
1559
  _listNext(nextLink, options) {
1535
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$2);
1560
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1536
1561
  }
1537
1562
  }
1538
1563
  // Operation Specifications
1539
- const serializer$3 = coreClient.createSerializer(Mappers, /* isXml */ false);
1540
- const listOperationSpec$2 = {
1564
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1565
+ const listOperationSpec = {
1541
1566
  path: "/providers/Microsoft.Portal/listTenantConfigurationViolations",
1542
1567
  httpMethod: "POST",
1543
1568
  responses: {
@@ -1551,9 +1576,9 @@ const listOperationSpec$2 = {
1551
1576
  queryParameters: [apiVersion],
1552
1577
  urlParameters: [$host],
1553
1578
  headerParameters: [accept],
1554
- serializer: serializer$3
1579
+ serializer
1555
1580
  };
1556
- const listNextOperationSpec$2 = {
1581
+ const listNextOperationSpec = {
1557
1582
  path: "{nextLink}",
1558
1583
  httpMethod: "GET",
1559
1584
  responses: {
@@ -1567,7 +1592,7 @@ const listNextOperationSpec$2 = {
1567
1592
  queryParameters: [apiVersion],
1568
1593
  urlParameters: [$host, nextLink],
1569
1594
  headerParameters: [accept],
1570
- serializer: serializer$3
1595
+ serializer
1571
1596
  };
1572
1597
 
1573
1598
  /*
@@ -1577,7 +1602,7 @@ const listNextOperationSpec$2 = {
1577
1602
  * Code generated by Microsoft (R) AutoRest Code Generator.
1578
1603
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1579
1604
  */
1580
- class Portal extends coreClient.ServiceClient {
1605
+ class Portal extends coreClient__namespace.ServiceClient {
1581
1606
  /**
1582
1607
  * Initializes a new instance of the Portal class.
1583
1608
  * @param credentials Subscription credentials which uniquely identify client subscription.
@@ -1586,6 +1611,7 @@ class Portal extends coreClient.ServiceClient {
1586
1611
  * @param options The parameter options
1587
1612
  */
1588
1613
  constructor(credentials, subscriptionId, options) {
1614
+ var _a, _b;
1589
1615
  if (credentials === undefined) {
1590
1616
  throw new Error("'credentials' cannot be null");
1591
1617
  }
@@ -1600,7 +1626,7 @@ class Portal extends coreClient.ServiceClient {
1600
1626
  requestContentType: "application/json; charset=utf-8",
1601
1627
  credential: credentials
1602
1628
  };
1603
- const packageDetails = `azsdk-js-arm-portal/1.0.0-beta.1`;
1629
+ const packageDetails = `azsdk-js-arm-portal/1.0.0-beta.4`;
1604
1630
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1605
1631
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1606
1632
  : `${packageDetails}`;
@@ -1609,8 +1635,24 @@ class Portal extends coreClient.ServiceClient {
1609
1635
  }
1610
1636
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1611
1637
  userAgentPrefix
1612
- }, baseUri: options.endpoint || "https://management.azure.com" });
1638
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1613
1639
  super(optionsWithDefaults);
1640
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1641
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1642
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1643
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1644
+ if (!bearerTokenAuthenticationPolicyFound) {
1645
+ this.pipeline.removePolicy({
1646
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1647
+ });
1648
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1649
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
1650
+ challengeCallbacks: {
1651
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1652
+ }
1653
+ }));
1654
+ }
1655
+ }
1614
1656
  // Parameter assignments
1615
1657
  this.subscriptionId = subscriptionId;
1616
1658
  // Assigning values to Constant parameters
@@ -1620,6 +1662,34 @@ class Portal extends coreClient.ServiceClient {
1620
1662
  this.dashboards = new DashboardsImpl(this);
1621
1663
  this.tenantConfigurations = new TenantConfigurationsImpl(this);
1622
1664
  this.listTenantConfigurationViolations = new ListTenantConfigurationViolationsImpl(this);
1665
+ this.addCustomApiVersionPolicy(options.apiVersion);
1666
+ }
1667
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1668
+ addCustomApiVersionPolicy(apiVersion) {
1669
+ if (!apiVersion) {
1670
+ return;
1671
+ }
1672
+ const apiVersionPolicy = {
1673
+ name: "CustomApiVersionPolicy",
1674
+ sendRequest(request, next) {
1675
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1676
+ const param = request.url.split("?");
1677
+ if (param.length > 1) {
1678
+ const newParams = param[1].split("&").map((item) => {
1679
+ if (item.indexOf("api-version") > -1) {
1680
+ return "api-version=" + apiVersion;
1681
+ }
1682
+ else {
1683
+ return item;
1684
+ }
1685
+ });
1686
+ request.url = param[0] + "?" + newParams.join("&");
1687
+ }
1688
+ return next(request);
1689
+ });
1690
+ }
1691
+ };
1692
+ this.pipeline.addPolicy(apiVersionPolicy);
1623
1693
  }
1624
1694
  }
1625
1695