@azure/arm-devspaces 2.0.1-alpha.20221101.1 → 2.1.0

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 (77) hide show
  1. package/CHANGELOG.md +10 -11
  2. package/README.md +11 -0
  3. package/dist/index.js +206 -51
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/containerHostMappingsGetContainerHostMappingSample.d.ts +2 -0
  8. package/dist-esm/samples-dev/containerHostMappingsGetContainerHostMappingSample.d.ts.map +1 -0
  9. package/dist-esm/samples-dev/containerHostMappingsGetContainerHostMappingSample.js +34 -0
  10. package/dist-esm/samples-dev/containerHostMappingsGetContainerHostMappingSample.js.map +1 -0
  11. package/dist-esm/samples-dev/controllersCreateSample.d.ts +2 -0
  12. package/dist-esm/samples-dev/controllersCreateSample.d.ts.map +1 -0
  13. package/dist-esm/samples-dev/controllersCreateSample.js +38 -0
  14. package/dist-esm/samples-dev/controllersCreateSample.js.map +1 -0
  15. package/dist-esm/samples-dev/controllersDeleteSample.d.ts +2 -0
  16. package/dist-esm/samples-dev/controllersDeleteSample.d.ts.map +1 -0
  17. package/dist-esm/samples-dev/controllersDeleteSample.js +31 -0
  18. package/dist-esm/samples-dev/controllersDeleteSample.js.map +1 -0
  19. package/dist-esm/samples-dev/controllersGetSample.d.ts +2 -0
  20. package/dist-esm/samples-dev/controllersGetSample.d.ts.map +1 -0
  21. package/dist-esm/samples-dev/controllersGetSample.js +31 -0
  22. package/dist-esm/samples-dev/controllersGetSample.js.map +1 -0
  23. package/dist-esm/samples-dev/controllersListByResourceGroupSample.d.ts +2 -0
  24. package/dist-esm/samples-dev/controllersListByResourceGroupSample.d.ts.map +1 -0
  25. package/dist-esm/samples-dev/controllersListByResourceGroupSample.js +44 -0
  26. package/dist-esm/samples-dev/controllersListByResourceGroupSample.js.map +1 -0
  27. package/dist-esm/samples-dev/controllersListConnectionDetailsSample.d.ts +2 -0
  28. package/dist-esm/samples-dev/controllersListConnectionDetailsSample.d.ts.map +1 -0
  29. package/dist-esm/samples-dev/controllersListConnectionDetailsSample.js +34 -0
  30. package/dist-esm/samples-dev/controllersListConnectionDetailsSample.js.map +1 -0
  31. package/dist-esm/samples-dev/controllersListSample.d.ts +2 -0
  32. package/dist-esm/samples-dev/controllersListSample.d.ts.map +1 -0
  33. package/dist-esm/samples-dev/controllersListSample.js +43 -0
  34. package/dist-esm/samples-dev/controllersListSample.js.map +1 -0
  35. package/dist-esm/samples-dev/controllersUpdateSample.d.ts +2 -0
  36. package/dist-esm/samples-dev/controllersUpdateSample.d.ts.map +1 -0
  37. package/dist-esm/samples-dev/controllersUpdateSample.js +35 -0
  38. package/dist-esm/samples-dev/controllersUpdateSample.js.map +1 -0
  39. package/dist-esm/src/devSpacesManagementClient.d.ts +2 -0
  40. package/dist-esm/src/devSpacesManagementClient.d.ts.map +1 -1
  41. package/dist-esm/src/devSpacesManagementClient.js +54 -5
  42. package/dist-esm/src/devSpacesManagementClient.js.map +1 -1
  43. package/dist-esm/src/index.d.ts +1 -0
  44. package/dist-esm/src/index.d.ts.map +1 -1
  45. package/dist-esm/src/index.js +1 -0
  46. package/dist-esm/src/index.js.map +1 -1
  47. package/dist-esm/src/models/index.d.ts +15 -6
  48. package/dist-esm/src/models/index.d.ts.map +1 -1
  49. package/dist-esm/src/models/index.js +9 -0
  50. package/dist-esm/src/models/index.js.map +1 -1
  51. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  52. package/dist-esm/src/models/mappers.js +1 -0
  53. package/dist-esm/src/models/mappers.js.map +1 -1
  54. package/dist-esm/src/operations/controllers.d.ts.map +1 -1
  55. package/dist-esm/src/operations/controllers.js +43 -16
  56. package/dist-esm/src/operations/controllers.js.map +1 -1
  57. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  58. package/dist-esm/src/operations/operations.js +19 -7
  59. package/dist-esm/src/operations/operations.js.map +1 -1
  60. package/dist-esm/src/pagingHelper.d.ts +13 -0
  61. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  62. package/dist-esm/src/pagingHelper.js +32 -0
  63. package/dist-esm/src/pagingHelper.js.map +1 -0
  64. package/dist-esm/test/sampleTest.js +11 -13
  65. package/dist-esm/test/sampleTest.js.map +1 -1
  66. package/package.json +37 -17
  67. package/review/arm-devspaces.api.md +14 -20
  68. package/rollup.config.js +6 -72
  69. package/src/devSpacesManagementClient.ts +70 -5
  70. package/src/index.ts +1 -0
  71. package/src/models/index.ts +16 -6
  72. package/src/models/mappers.ts +1 -0
  73. package/src/operations/controllers.ts +52 -19
  74. package/src/operations/operations.ts +21 -8
  75. package/src/pagingHelper.ts +39 -0
  76. package/tsconfig.json +19 -5
  77. package/types/arm-devspaces.d.ts +26 -6
package/CHANGELOG.md CHANGED
@@ -1,15 +1,14 @@
1
1
  # Release History
2
-
3
- ## 2.0.1 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
2
+
3
+ ## 2.1.0 (2022-11-22)
4
+
5
+ **Features**
6
+
7
+ - Added Interface Controller
8
+ - Added Interface KubernetesConnectionDetails
9
+ - Added Interface TrackedResource
10
+
11
+
13
12
  ## 2.0.0 (2022-01-13)
14
13
 
15
14
  The package of @azure/arm-devspaces is using our next generation design principles since version 2.0.0, which contains breaking changes.
package/README.md CHANGED
@@ -16,6 +16,8 @@ Dev Spaces Client
16
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 { DevSpacesManagementClient } = require("@azure/arm-devspaces");
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 DevSpacesManagementClient(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 DevSpacesManagementClient(credential, subscriptionId);
54
65
  ```
55
66
 
56
67
 
package/dist/index.js CHANGED
@@ -2,10 +2,32 @@
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
+
9
31
  /*
10
32
  * Copyright (c) Microsoft Corporation.
11
33
  * Licensed under the MIT License.
@@ -13,19 +35,66 @@ var coreLro = require('@azure/core-lro');
13
35
  * Code generated by Microsoft (R) AutoRest Code Generator.
14
36
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
15
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
+
63
+ /*
64
+ * Copyright (c) Microsoft Corporation.
65
+ * Licensed under the MIT License.
66
+ *
67
+ * Code generated by Microsoft (R) AutoRest Code Generator.
68
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
69
+ */
70
+ /** Known values of {@link ProvisioningState} that the service accepts. */
71
+ exports.KnownProvisioningState = void 0;
16
72
  (function (KnownProvisioningState) {
73
+ /** Succeeded */
17
74
  KnownProvisioningState["Succeeded"] = "Succeeded";
75
+ /** Failed */
18
76
  KnownProvisioningState["Failed"] = "Failed";
77
+ /** Canceled */
19
78
  KnownProvisioningState["Canceled"] = "Canceled";
79
+ /** Updating */
20
80
  KnownProvisioningState["Updating"] = "Updating";
81
+ /** Creating */
21
82
  KnownProvisioningState["Creating"] = "Creating";
83
+ /** Deleting */
22
84
  KnownProvisioningState["Deleting"] = "Deleting";
85
+ /** Deleted */
23
86
  KnownProvisioningState["Deleted"] = "Deleted";
24
87
  })(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
88
+ /** Known values of {@link SkuName} that the service accepts. */
89
+ exports.KnownSkuName = void 0;
25
90
  (function (KnownSkuName) {
91
+ /** S1 */
26
92
  KnownSkuName["S1"] = "S1";
27
93
  })(exports.KnownSkuName || (exports.KnownSkuName = {}));
94
+ /** Known values of {@link SkuTier} that the service accepts. */
95
+ exports.KnownSkuTier = void 0;
28
96
  (function (KnownSkuTier) {
97
+ /** Standard */
29
98
  KnownSkuTier["Standard"] = "Standard";
30
99
  })(exports.KnownSkuTier || (exports.KnownSkuTier = {}));
31
100
 
@@ -341,6 +410,7 @@ const OrchestratorSpecificConnectionDetails = {
341
410
  modelProperties: {
342
411
  instanceType: {
343
412
  serializedName: "instanceType",
413
+ required: true,
344
414
  readOnly: true,
345
415
  type: {
346
416
  name: "String"
@@ -616,7 +686,7 @@ class ContainerHostMappingsImpl {
616
686
  }
617
687
  }
618
688
  // Operation Specifications
619
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
689
+ const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
620
690
  const getContainerHostMappingOperationSpec = {
621
691
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping",
622
692
  httpMethod: "POST",
@@ -639,7 +709,7 @@ const getContainerHostMappingOperationSpec = {
639
709
  ],
640
710
  headerParameters: [contentType, accept],
641
711
  mediaType: "json",
642
- serializer
712
+ serializer: serializer$2
643
713
  };
644
714
 
645
715
  /*
@@ -673,20 +743,31 @@ class OperationsImpl {
673
743
  [Symbol.asyncIterator]() {
674
744
  return this;
675
745
  },
676
- byPage: () => {
677
- return this.listPagingPage(options);
746
+ byPage: (settings) => {
747
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
748
+ throw new Error("maxPageSize is not supported by this operation.");
749
+ }
750
+ return this.listPagingPage(options, settings);
678
751
  }
679
752
  };
680
753
  }
681
- listPagingPage(options) {
754
+ listPagingPage(options, settings) {
682
755
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
683
- let result = yield tslib.__await(this._list(options));
684
- yield yield tslib.__await(result.value || []);
685
- let continuationToken = result.nextLink;
756
+ let result;
757
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
758
+ if (!continuationToken) {
759
+ result = yield tslib.__await(this._list(options));
760
+ let page = result.value || [];
761
+ continuationToken = result.nextLink;
762
+ setContinuationToken(page, continuationToken);
763
+ yield yield tslib.__await(page);
764
+ }
686
765
  while (continuationToken) {
687
766
  result = yield tslib.__await(this._listNext(continuationToken, options));
688
767
  continuationToken = result.nextLink;
689
- yield yield tslib.__await(result.value || []);
768
+ let page = result.value || [];
769
+ setContinuationToken(page, continuationToken);
770
+ yield yield tslib.__await(page);
690
771
  }
691
772
  });
692
773
  }
@@ -714,7 +795,7 @@ class OperationsImpl {
714
795
  * @param options The options parameters.
715
796
  */
716
797
  _list(options) {
717
- return this.client.sendOperationRequest({ options }, listOperationSpec);
798
+ return this.client.sendOperationRequest({ options }, listOperationSpec$1);
718
799
  }
719
800
  /**
720
801
  * ListNext
@@ -722,12 +803,12 @@ class OperationsImpl {
722
803
  * @param options The options parameters.
723
804
  */
724
805
  _listNext(nextLink, options) {
725
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
806
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$1);
726
807
  }
727
808
  }
728
809
  // Operation Specifications
729
- const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
730
- const listOperationSpec = {
810
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
811
+ const listOperationSpec$1 = {
731
812
  path: "/providers/Microsoft.DevSpaces/operations",
732
813
  httpMethod: "GET",
733
814
  responses: {
@@ -740,7 +821,7 @@ const listOperationSpec = {
740
821
  headerParameters: [accept],
741
822
  serializer: serializer$1
742
823
  };
743
- const listNextOperationSpec = {
824
+ const listNextOperationSpec$1 = {
744
825
  path: "{nextLink}",
745
826
  httpMethod: "GET",
746
827
  responses: {
@@ -814,20 +895,31 @@ class ControllersImpl {
814
895
  [Symbol.asyncIterator]() {
815
896
  return this;
816
897
  },
817
- byPage: () => {
818
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
898
+ byPage: (settings) => {
899
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
900
+ throw new Error("maxPageSize is not supported by this operation.");
901
+ }
902
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
819
903
  }
820
904
  };
821
905
  }
822
- listByResourceGroupPagingPage(resourceGroupName, options) {
906
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
823
907
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
824
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
825
- yield yield tslib.__await(result.value || []);
826
- let continuationToken = result.nextLink;
908
+ let result;
909
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
910
+ if (!continuationToken) {
911
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
912
+ let page = result.value || [];
913
+ continuationToken = result.nextLink;
914
+ setContinuationToken(page, continuationToken);
915
+ yield yield tslib.__await(page);
916
+ }
827
917
  while (continuationToken) {
828
918
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
829
919
  continuationToken = result.nextLink;
830
- yield yield tslib.__await(result.value || []);
920
+ let page = result.value || [];
921
+ setContinuationToken(page, continuationToken);
922
+ yield yield tslib.__await(page);
831
923
  }
832
924
  });
833
925
  }
@@ -862,20 +954,31 @@ class ControllersImpl {
862
954
  [Symbol.asyncIterator]() {
863
955
  return this;
864
956
  },
865
- byPage: () => {
866
- return this.listPagingPage(options);
957
+ byPage: (settings) => {
958
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
959
+ throw new Error("maxPageSize is not supported by this operation.");
960
+ }
961
+ return this.listPagingPage(options, settings);
867
962
  }
868
963
  };
869
964
  }
870
- listPagingPage(options) {
965
+ listPagingPage(options, settings) {
871
966
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
872
- let result = yield tslib.__await(this._list(options));
873
- yield yield tslib.__await(result.value || []);
874
- let continuationToken = result.nextLink;
967
+ let result;
968
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
969
+ if (!continuationToken) {
970
+ result = yield tslib.__await(this._list(options));
971
+ let page = result.value || [];
972
+ continuationToken = result.nextLink;
973
+ setContinuationToken(page, continuationToken);
974
+ yield yield tslib.__await(page);
975
+ }
875
976
  while (continuationToken) {
876
977
  result = yield tslib.__await(this._listNext(continuationToken, options));
877
978
  continuationToken = result.nextLink;
878
- yield yield tslib.__await(result.value || []);
979
+ let page = result.value || [];
980
+ setContinuationToken(page, continuationToken);
981
+ yield yield tslib.__await(page);
879
982
  }
880
983
  });
881
984
  }
@@ -938,10 +1041,12 @@ class ControllersImpl {
938
1041
  };
939
1042
  });
940
1043
  const lro = new LroImpl(sendOperation, { resourceGroupName, name, controller, options }, createOperationSpec);
941
- return new coreLro.LroEngine(lro, {
1044
+ const poller = new coreLro.LroEngine(lro, {
942
1045
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
943
1046
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
944
1047
  });
1048
+ yield poller.poll();
1049
+ return poller;
945
1050
  });
946
1051
  }
947
1052
  /**
@@ -988,10 +1093,12 @@ class ControllersImpl {
988
1093
  };
989
1094
  });
990
1095
  const lro = new LroImpl(sendOperation, { resourceGroupName, name, options }, deleteOperationSpec);
991
- return new coreLro.LroEngine(lro, {
1096
+ const poller = new coreLro.LroEngine(lro, {
992
1097
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
993
1098
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
994
1099
  });
1100
+ yield poller.poll();
1101
+ return poller;
995
1102
  });
996
1103
  }
997
1104
  /**
@@ -1031,7 +1138,7 @@ class ControllersImpl {
1031
1138
  * @param options The options parameters.
1032
1139
  */
1033
1140
  _list(options) {
1034
- return this.client.sendOperationRequest({ options }, listOperationSpec$1);
1141
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
1035
1142
  }
1036
1143
  /**
1037
1144
  * Lists connection details for the underlying container resources of an Azure Dev Spaces Controller.
@@ -1059,11 +1166,11 @@ class ControllersImpl {
1059
1166
  * @param options The options parameters.
1060
1167
  */
1061
1168
  _listNext(nextLink, options) {
1062
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$1);
1169
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1063
1170
  }
1064
1171
  }
1065
1172
  // Operation Specifications
1066
- const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
1173
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1067
1174
  const getOperationSpec = {
1068
1175
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}",
1069
1176
  httpMethod: "GET",
@@ -1083,7 +1190,7 @@ const getOperationSpec = {
1083
1190
  name
1084
1191
  ],
1085
1192
  headerParameters: [accept],
1086
- serializer: serializer$2
1193
+ serializer
1087
1194
  };
1088
1195
  const createOperationSpec = {
1089
1196
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}",
@@ -1115,7 +1222,7 @@ const createOperationSpec = {
1115
1222
  ],
1116
1223
  headerParameters: [contentType, accept],
1117
1224
  mediaType: "json",
1118
- serializer: serializer$2
1225
+ serializer
1119
1226
  };
1120
1227
  const deleteOperationSpec = {
1121
1228
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}",
@@ -1137,7 +1244,7 @@ const deleteOperationSpec = {
1137
1244
  name
1138
1245
  ],
1139
1246
  headerParameters: [accept],
1140
- serializer: serializer$2
1247
+ serializer
1141
1248
  };
1142
1249
  const updateOperationSpec = {
1143
1250
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}",
@@ -1163,7 +1270,7 @@ const updateOperationSpec = {
1163
1270
  ],
1164
1271
  headerParameters: [contentType, accept],
1165
1272
  mediaType: "json",
1166
- serializer: serializer$2
1273
+ serializer
1167
1274
  };
1168
1275
  const listByResourceGroupOperationSpec = {
1169
1276
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers",
@@ -1183,9 +1290,9 @@ const listByResourceGroupOperationSpec = {
1183
1290
  resourceGroupName
1184
1291
  ],
1185
1292
  headerParameters: [accept],
1186
- serializer: serializer$2
1293
+ serializer
1187
1294
  };
1188
- const listOperationSpec$1 = {
1295
+ const listOperationSpec = {
1189
1296
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers",
1190
1297
  httpMethod: "GET",
1191
1298
  responses: {
@@ -1199,7 +1306,7 @@ const listOperationSpec$1 = {
1199
1306
  queryParameters: [apiVersion],
1200
1307
  urlParameters: [$host, subscriptionId],
1201
1308
  headerParameters: [accept],
1202
- serializer: serializer$2
1309
+ serializer
1203
1310
  };
1204
1311
  const listConnectionDetailsOperationSpec = {
1205
1312
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails",
@@ -1222,7 +1329,7 @@ const listConnectionDetailsOperationSpec = {
1222
1329
  ],
1223
1330
  headerParameters: [contentType, accept],
1224
1331
  mediaType: "json",
1225
- serializer: serializer$2
1332
+ serializer
1226
1333
  };
1227
1334
  const listByResourceGroupNextOperationSpec = {
1228
1335
  path: "{nextLink}",
@@ -1243,9 +1350,9 @@ const listByResourceGroupNextOperationSpec = {
1243
1350
  nextLink
1244
1351
  ],
1245
1352
  headerParameters: [accept],
1246
- serializer: serializer$2
1353
+ serializer
1247
1354
  };
1248
- const listNextOperationSpec$1 = {
1355
+ const listNextOperationSpec = {
1249
1356
  path: "{nextLink}",
1250
1357
  httpMethod: "GET",
1251
1358
  responses: {
@@ -1263,7 +1370,7 @@ const listNextOperationSpec$1 = {
1263
1370
  nextLink
1264
1371
  ],
1265
1372
  headerParameters: [accept],
1266
- serializer: serializer$2
1373
+ serializer
1267
1374
  };
1268
1375
 
1269
1376
  /*
@@ -1273,7 +1380,7 @@ const listNextOperationSpec$1 = {
1273
1380
  * Code generated by Microsoft (R) AutoRest Code Generator.
1274
1381
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1275
1382
  */
1276
- class DevSpacesManagementClient extends coreClient.ServiceClient {
1383
+ class DevSpacesManagementClient extends coreClient__namespace.ServiceClient {
1277
1384
  /**
1278
1385
  * Initializes a new instance of the DevSpacesManagementClient class.
1279
1386
  * @param credentials Subscription credentials which uniquely identify client subscription.
@@ -1281,6 +1388,7 @@ class DevSpacesManagementClient extends coreClient.ServiceClient {
1281
1388
  * @param options The parameter options
1282
1389
  */
1283
1390
  constructor(credentials, subscriptionId, options) {
1391
+ var _a, _b, _c;
1284
1392
  if (credentials === undefined) {
1285
1393
  throw new Error("'credentials' cannot be null");
1286
1394
  }
@@ -1295,17 +1403,35 @@ class DevSpacesManagementClient extends coreClient.ServiceClient {
1295
1403
  requestContentType: "application/json; charset=utf-8",
1296
1404
  credential: credentials
1297
1405
  };
1298
- const packageDetails = `azsdk-js-arm-devspaces/2.0.0`;
1406
+ const packageDetails = `azsdk-js-arm-devspaces/2.1.0`;
1299
1407
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1300
1408
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1301
1409
  : `${packageDetails}`;
1302
- if (!options.credentialScopes) {
1303
- options.credentialScopes = ["https://management.azure.com/.default"];
1304
- }
1305
1410
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1306
1411
  userAgentPrefix
1307
- }, baseUri: options.endpoint || "https://management.azure.com" });
1412
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1308
1413
  super(optionsWithDefaults);
1414
+ let bearerTokenAuthenticationPolicyFound = false;
1415
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1416
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1417
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1418
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1419
+ }
1420
+ if (!options ||
1421
+ !options.pipeline ||
1422
+ options.pipeline.getOrderedPolicies().length == 0 ||
1423
+ !bearerTokenAuthenticationPolicyFound) {
1424
+ this.pipeline.removePolicy({
1425
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1426
+ });
1427
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1428
+ credential: credentials,
1429
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
1430
+ challengeCallbacks: {
1431
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1432
+ }
1433
+ }));
1434
+ }
1309
1435
  // Parameter assignments
1310
1436
  this.subscriptionId = subscriptionId;
1311
1437
  // Assigning values to Constant parameters
@@ -1314,8 +1440,37 @@ class DevSpacesManagementClient extends coreClient.ServiceClient {
1314
1440
  this.containerHostMappings = new ContainerHostMappingsImpl(this);
1315
1441
  this.operations = new OperationsImpl(this);
1316
1442
  this.controllers = new ControllersImpl(this);
1443
+ this.addCustomApiVersionPolicy(options.apiVersion);
1444
+ }
1445
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1446
+ addCustomApiVersionPolicy(apiVersion) {
1447
+ if (!apiVersion) {
1448
+ return;
1449
+ }
1450
+ const apiVersionPolicy = {
1451
+ name: "CustomApiVersionPolicy",
1452
+ sendRequest(request, next) {
1453
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1454
+ const param = request.url.split("?");
1455
+ if (param.length > 1) {
1456
+ const newParams = param[1].split("&").map((item) => {
1457
+ if (item.indexOf("api-version") > -1) {
1458
+ return "api-version=" + apiVersion;
1459
+ }
1460
+ else {
1461
+ return item;
1462
+ }
1463
+ });
1464
+ request.url = param[0] + "?" + newParams.join("&");
1465
+ }
1466
+ return next(request);
1467
+ });
1468
+ }
1469
+ };
1470
+ this.pipeline.addPolicy(apiVersionPolicy);
1317
1471
  }
1318
1472
  }
1319
1473
 
1320
1474
  exports.DevSpacesManagementClient = DevSpacesManagementClient;
1475
+ exports.getContinuationToken = getContinuationToken;
1321
1476
  //# sourceMappingURL=index.js.map