@azure/arm-operations 4.0.0-beta.2 → 4.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 (106) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/LICENSE +1 -1
  3. package/README.md +13 -2
  4. package/dist/index.js +190 -71
  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/managementAssociationsCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/managementAssociationsCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/managementAssociationsCreateOrUpdateSample.js +40 -0
  11. package/dist-esm/samples-dev/managementAssociationsCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/managementAssociationsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/managementAssociationsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/managementAssociationsDeleteSample.js +34 -0
  15. package/dist-esm/samples-dev/managementAssociationsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/managementAssociationsGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/managementAssociationsGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/managementAssociationsGetSample.js +34 -0
  19. package/dist-esm/samples-dev/managementAssociationsGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/managementAssociationsListBySubscriptionSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/managementAssociationsListBySubscriptionSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/managementAssociationsListBySubscriptionSample.js +29 -0
  23. package/dist-esm/samples-dev/managementAssociationsListBySubscriptionSample.js.map +1 -0
  24. package/dist-esm/samples-dev/managementConfigurationsCreateOrUpdateSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/managementConfigurationsCreateOrUpdateSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/managementConfigurationsCreateOrUpdateSample.js +32 -0
  27. package/dist-esm/samples-dev/managementConfigurationsCreateOrUpdateSample.js.map +1 -0
  28. package/dist-esm/samples-dev/managementConfigurationsDeleteSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/managementConfigurationsDeleteSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/managementConfigurationsDeleteSample.js +31 -0
  31. package/dist-esm/samples-dev/managementConfigurationsDeleteSample.js.map +1 -0
  32. package/dist-esm/samples-dev/managementConfigurationsGetSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/managementConfigurationsGetSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/managementConfigurationsGetSample.js +31 -0
  35. package/dist-esm/samples-dev/managementConfigurationsGetSample.js.map +1 -0
  36. package/dist-esm/samples-dev/managementConfigurationsListBySubscriptionSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/managementConfigurationsListBySubscriptionSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/managementConfigurationsListBySubscriptionSample.js +29 -0
  39. package/dist-esm/samples-dev/managementConfigurationsListBySubscriptionSample.js.map +1 -0
  40. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/operationsListSample.js +43 -0
  43. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  44. package/dist-esm/samples-dev/solutionsCreateOrUpdateSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/solutionsCreateOrUpdateSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/solutionsCreateOrUpdateSample.js +51 -0
  47. package/dist-esm/samples-dev/solutionsCreateOrUpdateSample.js.map +1 -0
  48. package/dist-esm/samples-dev/solutionsDeleteSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/solutionsDeleteSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/solutionsDeleteSample.js +31 -0
  51. package/dist-esm/samples-dev/solutionsDeleteSample.js.map +1 -0
  52. package/dist-esm/samples-dev/solutionsGetSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/solutionsGetSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/solutionsGetSample.js +31 -0
  55. package/dist-esm/samples-dev/solutionsGetSample.js.map +1 -0
  56. package/dist-esm/samples-dev/solutionsListByResourceGroupSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/solutionsListByResourceGroupSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/solutionsListByResourceGroupSample.js +30 -0
  59. package/dist-esm/samples-dev/solutionsListByResourceGroupSample.js.map +1 -0
  60. package/dist-esm/samples-dev/solutionsListBySubscriptionSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/solutionsListBySubscriptionSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/solutionsListBySubscriptionSample.js +29 -0
  63. package/dist-esm/samples-dev/solutionsListBySubscriptionSample.js.map +1 -0
  64. package/dist-esm/samples-dev/solutionsUpdateSample.d.ts +2 -0
  65. package/dist-esm/samples-dev/solutionsUpdateSample.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/solutionsUpdateSample.js +34 -0
  67. package/dist-esm/samples-dev/solutionsUpdateSample.js.map +1 -0
  68. package/dist-esm/src/index.d.ts +1 -0
  69. package/dist-esm/src/index.d.ts.map +1 -1
  70. package/dist-esm/src/index.js +1 -0
  71. package/dist-esm/src/index.js.map +1 -1
  72. package/dist-esm/src/operations/managementAssociations.d.ts +12 -3
  73. package/dist-esm/src/operations/managementAssociations.d.ts.map +1 -1
  74. package/dist-esm/src/operations/managementAssociations.js +37 -6
  75. package/dist-esm/src/operations/managementAssociations.js.map +1 -1
  76. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  77. package/dist-esm/src/operations/operations.js +8 -4
  78. package/dist-esm/src/operations/operations.js.map +1 -1
  79. package/dist-esm/src/operations/solutions.d.ts.map +1 -1
  80. package/dist-esm/src/operations/solutions.js +9 -3
  81. package/dist-esm/src/operations/solutions.js.map +1 -1
  82. package/dist-esm/src/operationsInterfaces/managementAssociations.d.ts +12 -3
  83. package/dist-esm/src/operationsInterfaces/managementAssociations.d.ts.map +1 -1
  84. package/dist-esm/src/operationsManagementClient.d.ts +3 -7
  85. package/dist-esm/src/operationsManagementClient.d.ts.map +1 -1
  86. package/dist-esm/src/operationsManagementClient.js +55 -21
  87. package/dist-esm/src/operationsManagementClient.js.map +1 -1
  88. package/dist-esm/src/pagingHelper.d.ts +13 -0
  89. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  90. package/dist-esm/src/pagingHelper.js +32 -0
  91. package/dist-esm/src/pagingHelper.js.map +1 -0
  92. package/dist-esm/test/sampleTest.js +11 -13
  93. package/dist-esm/test/sampleTest.js.map +1 -1
  94. package/package.json +51 -21
  95. package/review/arm-operations.api.md +7 -10
  96. package/rollup.config.js +6 -72
  97. package/src/index.ts +1 -0
  98. package/src/operations/managementAssociations.ts +43 -3
  99. package/src/operations/operations.ts +10 -5
  100. package/src/operations/solutions.ts +9 -3
  101. package/src/operationsInterfaces/managementAssociations.ts +18 -0
  102. package/src/operationsManagementClient.ts +70 -26
  103. package/src/pagingHelper.ts +39 -0
  104. package/tsconfig.json +19 -5
  105. package/types/arm-operations.d.ts +24 -10
  106. package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Release History
2
2
 
3
- ## 4.0.0-beta.2 (2021-12-21)
3
+ ## 4.0.0-beta.4 (2022-12-02)
4
4
 
5
- The package of @azure/arm-operations is using our next generation design principles since version 4.0.0-beta.2, which contains breaking changes.
5
+ The package of @azure/arm-operations is using our next generation design principles since version 4.0.0-beta.4, which contains breaking changes.
6
6
 
7
7
  To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
8
8
 
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
@@ -6,16 +6,18 @@ Operations Management Client
6
6
 
7
7
  [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/operationsmanagement/arm-operations) |
8
8
  [Package (NPM)](https://www.npmjs.com/package/@azure/arm-operations) |
9
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-operations) |
9
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-operations?view=azure-node-preview) |
10
10
  [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11
11
 
12
12
  ## Getting started
13
13
 
14
14
  ### Currently supported environments
15
15
 
16
- - [LTS versions of Node.js](https://nodejs.org/about/releases/)
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 { OperationsManagementClient } = require("@azure/arm-operations");
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 OperationsManagementClient(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 OperationsManagementClient(credential, subscriptionId);
54
65
  ```
55
66
 
56
67
 
package/dist/index.js CHANGED
@@ -2,10 +2,55 @@
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
+
9
54
  /*
10
55
  * Copyright (c) Microsoft Corporation.
11
56
  * Licensed under the MIT License.
@@ -740,11 +785,13 @@ class SolutionsImpl {
740
785
  }
741
786
  };
742
787
  });
743
- const lro = new LroImpl(sendOperation, { resourceGroupName, solutionName, parameters, options }, createOrUpdateOperationSpec);
744
- return new coreLro.LroEngine(lro, {
788
+ const lro = new LroImpl(sendOperation, { resourceGroupName, solutionName, parameters, options }, createOrUpdateOperationSpec$2);
789
+ const poller = new coreLro.LroEngine(lro, {
745
790
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
746
791
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
747
792
  });
793
+ yield poller.poll();
794
+ return poller;
748
795
  });
749
796
  }
750
797
  /**
@@ -792,10 +839,12 @@ class SolutionsImpl {
792
839
  };
793
840
  });
794
841
  const lro = new LroImpl(sendOperation, { resourceGroupName, solutionName, parameters, options }, updateOperationSpec);
795
- return new coreLro.LroEngine(lro, {
842
+ const poller = new coreLro.LroEngine(lro, {
796
843
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
797
844
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
798
845
  });
846
+ yield poller.poll();
847
+ return poller;
799
848
  });
800
849
  }
801
850
  /**
@@ -841,11 +890,13 @@ class SolutionsImpl {
841
890
  }
842
891
  };
843
892
  });
844
- const lro = new LroImpl(sendOperation, { resourceGroupName, solutionName, options }, deleteOperationSpec);
845
- return new coreLro.LroEngine(lro, {
893
+ const lro = new LroImpl(sendOperation, { resourceGroupName, solutionName, options }, deleteOperationSpec$2);
894
+ const poller = new coreLro.LroEngine(lro, {
846
895
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
847
896
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
848
897
  });
898
+ yield poller.poll();
899
+ return poller;
849
900
  });
850
901
  }
851
902
  /**
@@ -867,7 +918,7 @@ class SolutionsImpl {
867
918
  * @param options The options parameters.
868
919
  */
869
920
  get(resourceGroupName, solutionName, options) {
870
- return this.client.sendOperationRequest({ resourceGroupName, solutionName, options }, getOperationSpec);
921
+ return this.client.sendOperationRequest({ resourceGroupName, solutionName, options }, getOperationSpec$2);
871
922
  }
872
923
  /**
873
924
  * Retrieves the solution list. It will retrieve both first party and third party solutions
@@ -882,12 +933,12 @@ class SolutionsImpl {
882
933
  * @param options The options parameters.
883
934
  */
884
935
  listBySubscription(options) {
885
- return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec);
936
+ return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec$2);
886
937
  }
887
938
  }
888
939
  // Operation Specifications
889
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
890
- const createOrUpdateOperationSpec = {
940
+ const serializer$3 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
941
+ const createOrUpdateOperationSpec$2 = {
891
942
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}",
892
943
  httpMethod: "PUT",
893
944
  responses: {
@@ -917,7 +968,7 @@ const createOrUpdateOperationSpec = {
917
968
  ],
918
969
  headerParameters: [contentType, accept],
919
970
  mediaType: "json",
920
- serializer
971
+ serializer: serializer$3
921
972
  };
922
973
  const updateOperationSpec = {
923
974
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}",
@@ -949,9 +1000,9 @@ const updateOperationSpec = {
949
1000
  ],
950
1001
  headerParameters: [contentType, accept],
951
1002
  mediaType: "json",
952
- serializer
1003
+ serializer: serializer$3
953
1004
  };
954
- const deleteOperationSpec = {
1005
+ const deleteOperationSpec$2 = {
955
1006
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}",
956
1007
  httpMethod: "DELETE",
957
1008
  responses: {
@@ -971,9 +1022,9 @@ const deleteOperationSpec = {
971
1022
  solutionName
972
1023
  ],
973
1024
  headerParameters: [accept],
974
- serializer
1025
+ serializer: serializer$3
975
1026
  };
976
- const getOperationSpec = {
1027
+ const getOperationSpec$2 = {
977
1028
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}",
978
1029
  httpMethod: "GET",
979
1030
  responses: {
@@ -992,7 +1043,7 @@ const getOperationSpec = {
992
1043
  solutionName
993
1044
  ],
994
1045
  headerParameters: [accept],
995
- serializer
1046
+ serializer: serializer$3
996
1047
  };
997
1048
  const listByResourceGroupOperationSpec = {
998
1049
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions",
@@ -1012,9 +1063,9 @@ const listByResourceGroupOperationSpec = {
1012
1063
  resourceGroupName
1013
1064
  ],
1014
1065
  headerParameters: [accept],
1015
- serializer
1066
+ serializer: serializer$3
1016
1067
  };
1017
- const listBySubscriptionOperationSpec = {
1068
+ const listBySubscriptionOperationSpec$2 = {
1018
1069
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/solutions",
1019
1070
  httpMethod: "GET",
1020
1071
  responses: {
@@ -1028,7 +1079,7 @@ const listBySubscriptionOperationSpec = {
1028
1079
  queryParameters: [apiVersion],
1029
1080
  urlParameters: [$host, subscriptionId],
1030
1081
  headerParameters: [accept],
1031
- serializer
1082
+ serializer: serializer$3
1032
1083
  };
1033
1084
 
1034
1085
  /*
@@ -1057,34 +1108,65 @@ class ManagementAssociationsImpl {
1057
1108
  /**
1058
1109
  * Creates or updates the ManagementAssociation.
1059
1110
  * @param resourceGroupName The name of the resource group to get. The name is case insensitive.
1111
+ * @param providerName Provider name for the parent resource.
1112
+ * @param resourceType Resource type for the parent resource
1113
+ * @param resourceName Parent resource name.
1060
1114
  * @param managementAssociationName User ManagementAssociation Name.
1061
1115
  * @param parameters The parameters required to create ManagementAssociation extension.
1062
1116
  * @param options The options parameters.
1063
1117
  */
1064
- createOrUpdate(resourceGroupName, managementAssociationName, parameters, options) {
1065
- return this.client.sendOperationRequest({ resourceGroupName, managementAssociationName, parameters, options }, createOrUpdateOperationSpec$1);
1118
+ createOrUpdate(resourceGroupName, providerName, resourceType, resourceName, managementAssociationName, parameters, options) {
1119
+ return this.client.sendOperationRequest({
1120
+ resourceGroupName,
1121
+ providerName,
1122
+ resourceType,
1123
+ resourceName,
1124
+ managementAssociationName,
1125
+ parameters,
1126
+ options
1127
+ }, createOrUpdateOperationSpec$1);
1066
1128
  }
1067
1129
  /**
1068
1130
  * Deletes the ManagementAssociation in the subscription.
1069
1131
  * @param resourceGroupName The name of the resource group to get. The name is case insensitive.
1132
+ * @param providerName Provider name for the parent resource.
1133
+ * @param resourceType Resource type for the parent resource
1134
+ * @param resourceName Parent resource name.
1070
1135
  * @param managementAssociationName User ManagementAssociation Name.
1071
1136
  * @param options The options parameters.
1072
1137
  */
1073
- delete(resourceGroupName, managementAssociationName, options) {
1074
- return this.client.sendOperationRequest({ resourceGroupName, managementAssociationName, options }, deleteOperationSpec$1);
1138
+ delete(resourceGroupName, providerName, resourceType, resourceName, managementAssociationName, options) {
1139
+ return this.client.sendOperationRequest({
1140
+ resourceGroupName,
1141
+ providerName,
1142
+ resourceType,
1143
+ resourceName,
1144
+ managementAssociationName,
1145
+ options
1146
+ }, deleteOperationSpec$1);
1075
1147
  }
1076
1148
  /**
1077
1149
  * Retrieves the user ManagementAssociation.
1078
1150
  * @param resourceGroupName The name of the resource group to get. The name is case insensitive.
1151
+ * @param providerName Provider name for the parent resource.
1152
+ * @param resourceType Resource type for the parent resource
1153
+ * @param resourceName Parent resource name.
1079
1154
  * @param managementAssociationName User ManagementAssociation Name.
1080
1155
  * @param options The options parameters.
1081
1156
  */
1082
- get(resourceGroupName, managementAssociationName, options) {
1083
- return this.client.sendOperationRequest({ resourceGroupName, managementAssociationName, options }, getOperationSpec$1);
1157
+ get(resourceGroupName, providerName, resourceType, resourceName, managementAssociationName, options) {
1158
+ return this.client.sendOperationRequest({
1159
+ resourceGroupName,
1160
+ providerName,
1161
+ resourceType,
1162
+ resourceName,
1163
+ managementAssociationName,
1164
+ options
1165
+ }, getOperationSpec$1);
1084
1166
  }
1085
1167
  }
1086
1168
  // Operation Specifications
1087
- const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
1169
+ const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1088
1170
  const listBySubscriptionOperationSpec$1 = {
1089
1171
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementAssociations",
1090
1172
  httpMethod: "GET",
@@ -1099,7 +1181,7 @@ const listBySubscriptionOperationSpec$1 = {
1099
1181
  queryParameters: [apiVersion],
1100
1182
  urlParameters: [$host, subscriptionId],
1101
1183
  headerParameters: [accept],
1102
- serializer: serializer$1
1184
+ serializer: serializer$2
1103
1185
  };
1104
1186
  const createOrUpdateOperationSpec$1 = {
1105
1187
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}",
@@ -1125,7 +1207,7 @@ const createOrUpdateOperationSpec$1 = {
1125
1207
  ],
1126
1208
  headerParameters: [contentType, accept],
1127
1209
  mediaType: "json",
1128
- serializer: serializer$1
1210
+ serializer: serializer$2
1129
1211
  };
1130
1212
  const deleteOperationSpec$1 = {
1131
1213
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}",
@@ -1147,7 +1229,7 @@ const deleteOperationSpec$1 = {
1147
1229
  managementAssociationName
1148
1230
  ],
1149
1231
  headerParameters: [accept],
1150
- serializer: serializer$1
1232
+ serializer: serializer$2
1151
1233
  };
1152
1234
  const getOperationSpec$1 = {
1153
1235
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}",
@@ -1171,7 +1253,7 @@ const getOperationSpec$1 = {
1171
1253
  managementAssociationName
1172
1254
  ],
1173
1255
  headerParameters: [accept],
1174
- serializer: serializer$1
1256
+ serializer: serializer$2
1175
1257
  };
1176
1258
 
1177
1259
  /*
@@ -1195,7 +1277,7 @@ class ManagementConfigurationsImpl {
1195
1277
  * @param options The options parameters.
1196
1278
  */
1197
1279
  listBySubscription(options) {
1198
- return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec$2);
1280
+ return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec);
1199
1281
  }
1200
1282
  /**
1201
1283
  * Creates or updates the ManagementConfiguration.
@@ -1205,7 +1287,7 @@ class ManagementConfigurationsImpl {
1205
1287
  * @param options The options parameters.
1206
1288
  */
1207
1289
  createOrUpdate(resourceGroupName, managementConfigurationName, parameters, options) {
1208
- return this.client.sendOperationRequest({ resourceGroupName, managementConfigurationName, parameters, options }, createOrUpdateOperationSpec$2);
1290
+ return this.client.sendOperationRequest({ resourceGroupName, managementConfigurationName, parameters, options }, createOrUpdateOperationSpec);
1209
1291
  }
1210
1292
  /**
1211
1293
  * Deletes the ManagementConfiguration in the subscription.
@@ -1214,7 +1296,7 @@ class ManagementConfigurationsImpl {
1214
1296
  * @param options The options parameters.
1215
1297
  */
1216
1298
  delete(resourceGroupName, managementConfigurationName, options) {
1217
- return this.client.sendOperationRequest({ resourceGroupName, managementConfigurationName, options }, deleteOperationSpec$2);
1299
+ return this.client.sendOperationRequest({ resourceGroupName, managementConfigurationName, options }, deleteOperationSpec);
1218
1300
  }
1219
1301
  /**
1220
1302
  * Retrieves the user ManagementConfiguration.
@@ -1223,12 +1305,12 @@ class ManagementConfigurationsImpl {
1223
1305
  * @param options The options parameters.
1224
1306
  */
1225
1307
  get(resourceGroupName, managementConfigurationName, options) {
1226
- return this.client.sendOperationRequest({ resourceGroupName, managementConfigurationName, options }, getOperationSpec$2);
1308
+ return this.client.sendOperationRequest({ resourceGroupName, managementConfigurationName, options }, getOperationSpec);
1227
1309
  }
1228
1310
  }
1229
1311
  // Operation Specifications
1230
- const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
1231
- const listBySubscriptionOperationSpec$2 = {
1312
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1313
+ const listBySubscriptionOperationSpec = {
1232
1314
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementConfigurations",
1233
1315
  httpMethod: "GET",
1234
1316
  responses: {
@@ -1242,9 +1324,9 @@ const listBySubscriptionOperationSpec$2 = {
1242
1324
  queryParameters: [apiVersion],
1243
1325
  urlParameters: [$host, subscriptionId],
1244
1326
  headerParameters: [accept],
1245
- serializer: serializer$2
1327
+ serializer: serializer$1
1246
1328
  };
1247
- const createOrUpdateOperationSpec$2 = {
1329
+ const createOrUpdateOperationSpec = {
1248
1330
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/ManagementConfigurations/{managementConfigurationName}",
1249
1331
  httpMethod: "PUT",
1250
1332
  responses: {
@@ -1265,9 +1347,9 @@ const createOrUpdateOperationSpec$2 = {
1265
1347
  ],
1266
1348
  headerParameters: [contentType, accept],
1267
1349
  mediaType: "json",
1268
- serializer: serializer$2
1350
+ serializer: serializer$1
1269
1351
  };
1270
- const deleteOperationSpec$2 = {
1352
+ const deleteOperationSpec = {
1271
1353
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/ManagementConfigurations/{managementConfigurationName}",
1272
1354
  httpMethod: "DELETE",
1273
1355
  responses: {
@@ -1284,9 +1366,9 @@ const deleteOperationSpec$2 = {
1284
1366
  managementConfigurationName
1285
1367
  ],
1286
1368
  headerParameters: [accept],
1287
- serializer: serializer$2
1369
+ serializer: serializer$1
1288
1370
  };
1289
- const getOperationSpec$2 = {
1371
+ const getOperationSpec = {
1290
1372
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/ManagementConfigurations/{managementConfigurationName}",
1291
1373
  httpMethod: "GET",
1292
1374
  responses: {
@@ -1305,7 +1387,7 @@ const getOperationSpec$2 = {
1305
1387
  managementConfigurationName
1306
1388
  ],
1307
1389
  headerParameters: [accept],
1308
- serializer: serializer$2
1390
+ serializer: serializer$1
1309
1391
  };
1310
1392
 
1311
1393
  /*
@@ -1338,14 +1420,18 @@ class OperationsImpl {
1338
1420
  [Symbol.asyncIterator]() {
1339
1421
  return this;
1340
1422
  },
1341
- byPage: () => {
1342
- return this.listPagingPage(options);
1423
+ byPage: (settings) => {
1424
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1425
+ throw new Error("maxPageSize is not supported by this operation.");
1426
+ }
1427
+ return this.listPagingPage(options, settings);
1343
1428
  }
1344
1429
  };
1345
1430
  }
1346
- listPagingPage(options) {
1431
+ listPagingPage(options, _settings) {
1347
1432
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1348
- let result = yield tslib.__await(this._list(options));
1433
+ let result;
1434
+ result = yield tslib.__await(this._list(options));
1349
1435
  yield yield tslib.__await(result.value || []);
1350
1436
  });
1351
1437
  }
@@ -1376,7 +1462,7 @@ class OperationsImpl {
1376
1462
  }
1377
1463
  }
1378
1464
  // Operation Specifications
1379
- const serializer$3 = coreClient.createSerializer(Mappers, /* isXml */ false);
1465
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1380
1466
  const listOperationSpec = {
1381
1467
  path: "/providers/Microsoft.OperationsManagement/operations",
1382
1468
  httpMethod: "GET",
@@ -1388,7 +1474,7 @@ const listOperationSpec = {
1388
1474
  queryParameters: [apiVersion],
1389
1475
  urlParameters: [$host],
1390
1476
  headerParameters: [accept],
1391
- serializer: serializer$3
1477
+ serializer
1392
1478
  };
1393
1479
 
1394
1480
  /*
@@ -1398,33 +1484,22 @@ const listOperationSpec = {
1398
1484
  * Code generated by Microsoft (R) AutoRest Code Generator.
1399
1485
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1400
1486
  */
1401
- class OperationsManagementClient extends coreClient.ServiceClient {
1487
+ class OperationsManagementClient extends coreClient__namespace.ServiceClient {
1402
1488
  /**
1403
1489
  * Initializes a new instance of the OperationsManagementClient class.
1404
1490
  * @param credentials Subscription credentials which uniquely identify client subscription.
1405
1491
  * @param subscriptionId Gets subscription credentials which uniquely identify Microsoft Azure
1406
1492
  * subscription. The subscription ID forms part of the URI for every service call.
1407
- * @param providerName Provider name for the parent resource.
1408
- * @param resourceType Resource type for the parent resource
1409
- * @param resourceName Parent resource name.
1410
1493
  * @param options The parameter options
1411
1494
  */
1412
- constructor(credentials, subscriptionId, providerName, resourceType, resourceName, options) {
1495
+ constructor(credentials, subscriptionId, options) {
1496
+ var _a, _b, _c;
1413
1497
  if (credentials === undefined) {
1414
1498
  throw new Error("'credentials' cannot be null");
1415
1499
  }
1416
1500
  if (subscriptionId === undefined) {
1417
1501
  throw new Error("'subscriptionId' cannot be null");
1418
1502
  }
1419
- if (providerName === undefined) {
1420
- throw new Error("'providerName' cannot be null");
1421
- }
1422
- if (resourceType === undefined) {
1423
- throw new Error("'resourceType' cannot be null");
1424
- }
1425
- if (resourceName === undefined) {
1426
- throw new Error("'resourceName' cannot be null");
1427
- }
1428
1503
  // Initializing default values for options
1429
1504
  if (!options) {
1430
1505
  options = {};
@@ -1433,22 +1508,37 @@ class OperationsManagementClient extends coreClient.ServiceClient {
1433
1508
  requestContentType: "application/json; charset=utf-8",
1434
1509
  credential: credentials
1435
1510
  };
1436
- const packageDetails = `azsdk-js-arm-operations/4.0.0-beta.2`;
1511
+ const packageDetails = `azsdk-js-arm-operations/4.0.0-beta.4`;
1437
1512
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1438
1513
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1439
1514
  : `${packageDetails}`;
1440
- if (!options.credentialScopes) {
1441
- options.credentialScopes = ["https://management.azure.com/.default"];
1442
- }
1443
1515
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1444
1516
  userAgentPrefix
1445
- }, baseUri: options.endpoint || "https://management.azure.com" });
1517
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1446
1518
  super(optionsWithDefaults);
1519
+ let bearerTokenAuthenticationPolicyFound = false;
1520
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1521
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1522
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1523
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1524
+ }
1525
+ if (!options ||
1526
+ !options.pipeline ||
1527
+ options.pipeline.getOrderedPolicies().length == 0 ||
1528
+ !bearerTokenAuthenticationPolicyFound) {
1529
+ this.pipeline.removePolicy({
1530
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1531
+ });
1532
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1533
+ credential: credentials,
1534
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
1535
+ challengeCallbacks: {
1536
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1537
+ }
1538
+ }));
1539
+ }
1447
1540
  // Parameter assignments
1448
1541
  this.subscriptionId = subscriptionId;
1449
- this.providerName = providerName;
1450
- this.resourceType = resourceType;
1451
- this.resourceName = resourceName;
1452
1542
  // Assigning values to Constant parameters
1453
1543
  this.$host = options.$host || "https://management.azure.com";
1454
1544
  this.apiVersion = options.apiVersion || "2015-11-01-preview";
@@ -1456,8 +1546,37 @@ class OperationsManagementClient extends coreClient.ServiceClient {
1456
1546
  this.managementAssociations = new ManagementAssociationsImpl(this);
1457
1547
  this.managementConfigurations = new ManagementConfigurationsImpl(this);
1458
1548
  this.operations = new OperationsImpl(this);
1549
+ this.addCustomApiVersionPolicy(options.apiVersion);
1550
+ }
1551
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1552
+ addCustomApiVersionPolicy(apiVersion) {
1553
+ if (!apiVersion) {
1554
+ return;
1555
+ }
1556
+ const apiVersionPolicy = {
1557
+ name: "CustomApiVersionPolicy",
1558
+ sendRequest(request, next) {
1559
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1560
+ const param = request.url.split("?");
1561
+ if (param.length > 1) {
1562
+ const newParams = param[1].split("&").map((item) => {
1563
+ if (item.indexOf("api-version") > -1) {
1564
+ return "api-version=" + apiVersion;
1565
+ }
1566
+ else {
1567
+ return item;
1568
+ }
1569
+ });
1570
+ request.url = param[0] + "?" + newParams.join("&");
1571
+ }
1572
+ return next(request);
1573
+ });
1574
+ }
1575
+ };
1576
+ this.pipeline.addPolicy(apiVersionPolicy);
1459
1577
  }
1460
1578
  }
1461
1579
 
1462
1580
  exports.OperationsManagementClient = OperationsManagementClient;
1581
+ exports.getContinuationToken = getContinuationToken;
1463
1582
  //# sourceMappingURL=index.js.map