@azure/arm-sqlvirtualmachine 5.0.0-beta.5 → 5.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/index.js +397 -144
  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/availabilityGroupListenersCreateOrUpdateSample.js +53 -5
  9. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.js.map +1 -1
  10. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.js +12 -4
  11. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.js.map +1 -1
  12. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.js +12 -4
  13. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.js.map +1 -1
  14. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js +12 -4
  15. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js.map +1 -1
  16. package/dist-esm/samples-dev/operationsListSample.js +11 -3
  17. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  18. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.js +13 -4
  19. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.js.map +1 -1
  20. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.js +12 -4
  21. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.js.map +1 -1
  22. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.js +12 -4
  23. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.js.map +1 -1
  24. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js +12 -4
  25. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js.map +1 -1
  26. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js +11 -3
  27. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js.map +1 -1
  28. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.js +12 -4
  29. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.js.map +1 -1
  30. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js +43 -25
  31. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js.map +1 -1
  32. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.js +12 -4
  33. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.js.map +1 -1
  34. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.js +12 -4
  35. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.js.map +1 -1
  36. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js +12 -4
  37. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js.map +1 -1
  38. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js +12 -4
  39. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js.map +1 -1
  40. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js +11 -3
  41. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js.map +1 -1
  42. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.js +12 -4
  43. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.js.map +1 -1
  44. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js +12 -4
  45. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js.map +1 -1
  46. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.js +12 -4
  47. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.js.map +1 -1
  48. package/dist-esm/src/index.d.ts +1 -0
  49. package/dist-esm/src/index.d.ts.map +1 -1
  50. package/dist-esm/src/index.js +1 -0
  51. package/dist-esm/src/index.js.map +1 -1
  52. package/dist-esm/src/models/index.d.ts +136 -26
  53. package/dist-esm/src/models/index.d.ts.map +1 -1
  54. package/dist-esm/src/models/index.js +70 -0
  55. package/dist-esm/src/models/index.js.map +1 -1
  56. package/dist-esm/src/models/mappers.d.ts +1 -0
  57. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  58. package/dist-esm/src/models/mappers.js +78 -1
  59. package/dist-esm/src/models/mappers.js.map +1 -1
  60. package/dist-esm/src/models/parameters.js +1 -1
  61. package/dist-esm/src/operations/availabilityGroupListeners.d.ts.map +1 -1
  62. package/dist-esm/src/operations/availabilityGroupListeners.js +19 -8
  63. package/dist-esm/src/operations/availabilityGroupListeners.js.map +1 -1
  64. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  65. package/dist-esm/src/operations/operations.js +19 -8
  66. package/dist-esm/src/operations/operations.js.map +1 -1
  67. package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts.map +1 -1
  68. package/dist-esm/src/operations/sqlVirtualMachineGroups.js +37 -16
  69. package/dist-esm/src/operations/sqlVirtualMachineGroups.js.map +1 -1
  70. package/dist-esm/src/operations/sqlVirtualMachines.d.ts +17 -17
  71. package/dist-esm/src/operations/sqlVirtualMachines.d.ts.map +1 -1
  72. package/dist-esm/src/operations/sqlVirtualMachines.js +121 -90
  73. package/dist-esm/src/operations/sqlVirtualMachines.js.map +1 -1
  74. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts +17 -17
  75. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts.map +1 -1
  76. package/dist-esm/src/pagingHelper.d.ts +13 -0
  77. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  78. package/dist-esm/src/pagingHelper.js +32 -0
  79. package/dist-esm/src/pagingHelper.js.map +1 -0
  80. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts.map +1 -1
  81. package/dist-esm/src/sqlVirtualMachineManagementClient.js +22 -20
  82. package/dist-esm/src/sqlVirtualMachineManagementClient.js.map +1 -1
  83. package/package.json +9 -8
  84. package/review/arm-sqlvirtualmachine.api.md +66 -86
  85. package/src/index.ts +1 -0
  86. package/src/models/index.ts +142 -28
  87. package/src/models/mappers.ts +83 -1
  88. package/src/models/parameters.ts +1 -1
  89. package/src/operations/availabilityGroupListeners.ts +27 -14
  90. package/src/operations/operations.ts +21 -9
  91. package/src/operations/sqlVirtualMachineGroups.ts +46 -19
  92. package/src/operations/sqlVirtualMachines.ts +170 -131
  93. package/src/operationsInterfaces/sqlVirtualMachines.ts +26 -26
  94. package/src/pagingHelper.ts +39 -0
  95. package/src/sqlVirtualMachineManagementClient.ts +28 -22
  96. package/types/arm-sqlvirtualmachine.d.ts +159 -35
  97. package/types/tsdoc-metadata.json +1 -1
@@ -13,6 +13,7 @@ import {
13
13
  SqlVirtualMachinesListBySqlVmGroupOptionalParams,
14
14
  SqlVirtualMachinesListOptionalParams,
15
15
  SqlVirtualMachinesListByResourceGroupOptionalParams,
16
+ SqlVirtualMachinesStartAssessmentOptionalParams,
16
17
  SqlVirtualMachinesRedeployOptionalParams,
17
18
  SqlVirtualMachinesGetOptionalParams,
18
19
  SqlVirtualMachinesGetResponse,
@@ -21,8 +22,7 @@ import {
21
22
  SqlVirtualMachinesDeleteOptionalParams,
22
23
  SqlVirtualMachineUpdate,
23
24
  SqlVirtualMachinesUpdateOptionalParams,
24
- SqlVirtualMachinesUpdateResponse,
25
- SqlVirtualMachinesStartAssessmentOptionalParams
25
+ SqlVirtualMachinesUpdateResponse
26
26
  } from "../models";
27
27
 
28
28
  /// <reference lib="esnext.asynciterable" />
@@ -57,6 +57,30 @@ export interface SqlVirtualMachines {
57
57
  resourceGroupName: string,
58
58
  options?: SqlVirtualMachinesListByResourceGroupOptionalParams
59
59
  ): PagedAsyncIterableIterator<SqlVirtualMachine>;
60
+ /**
61
+ * Starts Assessment on SQL virtual machine.
62
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
63
+ * value from the Azure Resource Manager API or the portal.
64
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
65
+ * @param options The options parameters.
66
+ */
67
+ beginStartAssessment(
68
+ resourceGroupName: string,
69
+ sqlVirtualMachineName: string,
70
+ options?: SqlVirtualMachinesStartAssessmentOptionalParams
71
+ ): Promise<PollerLike<PollOperationState<void>, void>>;
72
+ /**
73
+ * Starts Assessment on SQL virtual machine.
74
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
75
+ * value from the Azure Resource Manager API or the portal.
76
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
77
+ * @param options The options parameters.
78
+ */
79
+ beginStartAssessmentAndWait(
80
+ resourceGroupName: string,
81
+ sqlVirtualMachineName: string,
82
+ options?: SqlVirtualMachinesStartAssessmentOptionalParams
83
+ ): Promise<void>;
60
84
  /**
61
85
  * Uninstalls and reinstalls the SQL Iaas Extension.
62
86
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
@@ -183,28 +207,4 @@ export interface SqlVirtualMachines {
183
207
  parameters: SqlVirtualMachineUpdate,
184
208
  options?: SqlVirtualMachinesUpdateOptionalParams
185
209
  ): Promise<SqlVirtualMachinesUpdateResponse>;
186
- /**
187
- * Starts Assessment on SQL virtual machine.
188
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
189
- * value from the Azure Resource Manager API or the portal.
190
- * @param sqlVirtualMachineName Name of the SQL virtual machine.
191
- * @param options The options parameters.
192
- */
193
- beginStartAssessment(
194
- resourceGroupName: string,
195
- sqlVirtualMachineName: string,
196
- options?: SqlVirtualMachinesStartAssessmentOptionalParams
197
- ): Promise<PollerLike<PollOperationState<void>, void>>;
198
- /**
199
- * Starts Assessment on SQL virtual machine.
200
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
201
- * value from the Azure Resource Manager API or the portal.
202
- * @param sqlVirtualMachineName Name of the SQL virtual machine.
203
- * @param options The options parameters.
204
- */
205
- beginStartAssessmentAndWait(
206
- resourceGroupName: string,
207
- sqlVirtualMachineName: string,
208
- options?: SqlVirtualMachinesStartAssessmentOptionalParams
209
- ): Promise<void>;
210
210
  }
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export interface PageInfo {
10
+ continuationToken?: string;
11
+ }
12
+
13
+ const pageMap = new WeakMap<object, PageInfo>();
14
+
15
+ /**
16
+ * Given the last `.value` produced by the `byPage` iterator,
17
+ * returns a continuation token that can be used to begin paging from
18
+ * that point later.
19
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
20
+ * @returns The continuation token that can be passed into byPage() during future calls.
21
+ */
22
+ export function getContinuationToken(page: unknown): string | undefined {
23
+ if (typeof page !== "object" || page === null) {
24
+ return undefined;
25
+ }
26
+ return pageMap.get(page)?.continuationToken;
27
+ }
28
+
29
+ export function setContinuationToken(
30
+ page: unknown,
31
+ continuationToken: string | undefined
32
+ ): void {
33
+ if (typeof page !== "object" || page === null || !continuationToken) {
34
+ return;
35
+ }
36
+ const pageInfo = pageMap.get(page) ?? {};
37
+ pageInfo.continuationToken = continuationToken;
38
+ pageMap.set(page, pageInfo);
39
+ }
@@ -60,54 +60,60 @@ export class SqlVirtualMachineManagementClient extends coreClient.ServiceClient
60
60
  credential: credentials
61
61
  };
62
62
 
63
- const packageDetails = `azsdk-js-arm-sqlvirtualmachine/5.0.0-beta.5`;
63
+ const packageDetails = `azsdk-js-arm-sqlvirtualmachine/5.0.0-beta.7`;
64
64
  const userAgentPrefix =
65
65
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
66
66
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
67
67
  : `${packageDetails}`;
68
68
 
69
- if (!options.credentialScopes) {
70
- options.credentialScopes = ["https://management.azure.com/.default"];
71
- }
72
69
  const optionsWithDefaults = {
73
70
  ...defaults,
74
71
  ...options,
75
72
  userAgentOptions: {
76
73
  userAgentPrefix
77
74
  },
78
- baseUri:
75
+ endpoint:
79
76
  options.endpoint ?? options.baseUri ?? "https://management.azure.com"
80
77
  };
81
78
  super(optionsWithDefaults);
82
79
 
80
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
83
81
  if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
84
82
  const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
85
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
83
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
86
84
  (pipelinePolicy) =>
87
85
  pipelinePolicy.name ===
88
86
  coreRestPipeline.bearerTokenAuthenticationPolicyName
89
87
  );
90
- if (!bearerTokenAuthenticationPolicyFound) {
91
- this.pipeline.removePolicy({
92
- name: coreRestPipeline.bearerTokenAuthenticationPolicyName
93
- });
94
- this.pipeline.addPolicy(
95
- coreRestPipeline.bearerTokenAuthenticationPolicy({
96
- scopes: `${optionsWithDefaults.baseUri}/.default`,
97
- challengeCallbacks: {
98
- authorizeRequestOnChallenge:
99
- coreClient.authorizeRequestOnClaimChallenge
100
- }
101
- })
102
- );
103
- }
88
+ }
89
+ if (
90
+ !options ||
91
+ !options.pipeline ||
92
+ options.pipeline.getOrderedPolicies().length == 0 ||
93
+ !bearerTokenAuthenticationPolicyFound
94
+ ) {
95
+ this.pipeline.removePolicy({
96
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
97
+ });
98
+ this.pipeline.addPolicy(
99
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
100
+ credential: credentials,
101
+ scopes:
102
+ optionsWithDefaults.credentialScopes ??
103
+ `${optionsWithDefaults.endpoint}/.default`,
104
+ challengeCallbacks: {
105
+ authorizeRequestOnChallenge:
106
+ coreClient.authorizeRequestOnClaimChallenge
107
+ }
108
+ })
109
+ );
104
110
  }
105
111
  // Parameter assignments
106
112
  this.subscriptionId = subscriptionId;
107
113
 
108
114
  // Assigning values to Constant parameters
109
115
  this.$host = options.$host || "https://management.azure.com";
110
- this.apiVersion = options.apiVersion || "2021-11-01-preview";
116
+ this.apiVersion = options.apiVersion || "2022-07-01-preview";
111
117
  this.availabilityGroupListeners = new AvailabilityGroupListenersImpl(this);
112
118
  this.operations = new OperationsImpl(this);
113
119
  this.sqlVirtualMachineGroups = new SqlVirtualMachineGroupsImpl(this);
@@ -130,7 +136,7 @@ export class SqlVirtualMachineManagementClient extends coreClient.ServiceClient
130
136
  if (param.length > 1) {
131
137
  const newParams = param[1].split("&").map((item) => {
132
138
  if (item.indexOf("api-version") > -1) {
133
- return item.replace(/(?<==).*$/, apiVersion);
139
+ return "api-version=" + apiVersion;
134
140
  } else {
135
141
  return item;
136
142
  }