@azure/arm-postgresql-flexible 6.0.1-alpha.20221214.1 → 6.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.
- package/CHANGELOG.md +13 -10
- package/dist/index.js +238 -67
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/checkNameAvailabilityExecuteSample.js +10 -2
- package/dist-esm/samples-dev/checkNameAvailabilityExecuteSample.js.map +1 -1
- package/dist-esm/samples-dev/configurationsGetSample.js +11 -3
- package/dist-esm/samples-dev/configurationsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/configurationsListByServerSample.js +11 -3
- package/dist-esm/samples-dev/configurationsListByServerSample.js.map +1 -1
- package/dist-esm/samples-dev/configurationsPutSample.js +11 -3
- package/dist-esm/samples-dev/configurationsPutSample.js.map +1 -1
- package/dist-esm/samples-dev/configurationsUpdateSample.js +11 -3
- package/dist-esm/samples-dev/configurationsUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/databasesCreateSample.js +11 -3
- package/dist-esm/samples-dev/databasesCreateSample.js.map +1 -1
- package/dist-esm/samples-dev/databasesDeleteSample.js +11 -3
- package/dist-esm/samples-dev/databasesDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/databasesGetSample.js +11 -3
- package/dist-esm/samples-dev/databasesGetSample.js.map +1 -1
- package/dist-esm/samples-dev/databasesListByServerSample.js +11 -3
- package/dist-esm/samples-dev/databasesListByServerSample.js.map +1 -1
- package/dist-esm/samples-dev/firewallRulesCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/firewallRulesCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/firewallRulesDeleteSample.js +11 -3
- package/dist-esm/samples-dev/firewallRulesDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/firewallRulesGetSample.js +11 -3
- package/dist-esm/samples-dev/firewallRulesGetSample.js.map +1 -1
- package/dist-esm/samples-dev/firewallRulesListByServerSample.js +11 -3
- package/dist-esm/samples-dev/firewallRulesListByServerSample.js.map +1 -1
- package/dist-esm/samples-dev/getPrivateDnsZoneSuffixExecuteSample.js +10 -2
- package/dist-esm/samples-dev/getPrivateDnsZoneSuffixExecuteSample.js.map +1 -1
- package/dist-esm/samples-dev/locationBasedCapabilitiesExecuteSample.js +10 -2
- package/dist-esm/samples-dev/locationBasedCapabilitiesExecuteSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +10 -2
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/serversCreateSample.js +15 -6
- package/dist-esm/samples-dev/serversCreateSample.js.map +1 -1
- package/dist-esm/samples-dev/serversDeleteSample.js +11 -3
- package/dist-esm/samples-dev/serversDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/serversGetSample.js +15 -6
- package/dist-esm/samples-dev/serversGetSample.js.map +1 -1
- package/dist-esm/samples-dev/serversListByResourceGroupSample.js +11 -3
- package/dist-esm/samples-dev/serversListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/serversListSample.js +10 -2
- package/dist-esm/samples-dev/serversListSample.js.map +1 -1
- package/dist-esm/samples-dev/serversRestartSample.js +15 -6
- package/dist-esm/samples-dev/serversRestartSample.js.map +1 -1
- package/dist-esm/samples-dev/serversStartSample.js +11 -3
- package/dist-esm/samples-dev/serversStartSample.js.map +1 -1
- package/dist-esm/samples-dev/serversStopSample.js +11 -3
- package/dist-esm/samples-dev/serversStopSample.js.map +1 -1
- package/dist-esm/samples-dev/serversUpdateSample.js +15 -6
- package/dist-esm/samples-dev/serversUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/virtualNetworkSubnetUsageExecuteSample.js +10 -2
- package/dist-esm/samples-dev/virtualNetworkSubnetUsageExecuteSample.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +60 -11
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +48 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/operations/configurations.d.ts.map +1 -1
- package/dist-esm/src/operations/configurations.js +19 -8
- package/dist-esm/src/operations/configurations.js.map +1 -1
- package/dist-esm/src/operations/databases.d.ts.map +1 -1
- package/dist-esm/src/operations/databases.js +19 -8
- package/dist-esm/src/operations/databases.js.map +1 -1
- package/dist-esm/src/operations/firewallRules.d.ts.map +1 -1
- package/dist-esm/src/operations/firewallRules.js +19 -8
- package/dist-esm/src/operations/firewallRules.js.map +1 -1
- package/dist-esm/src/operations/locationBasedCapabilities.d.ts.map +1 -1
- package/dist-esm/src/operations/locationBasedCapabilities.js +19 -8
- package/dist-esm/src/operations/locationBasedCapabilities.js.map +1 -1
- package/dist-esm/src/operations/servers.d.ts.map +1 -1
- package/dist-esm/src/operations/servers.js +37 -16
- package/dist-esm/src/operations/servers.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/src/postgreSQLManagementFlexibleServerClient.d.ts +2 -0
- package/dist-esm/src/postgreSQLManagementFlexibleServerClient.d.ts.map +1 -1
- package/dist-esm/src/postgreSQLManagementFlexibleServerClient.js +49 -18
- package/dist-esm/src/postgreSQLManagementFlexibleServerClient.js.map +1 -1
- package/dist-esm/test/sampleTest.js +11 -13
- package/dist-esm/test/sampleTest.js.map +1 -1
- package/package.json +15 -10
- package/review/arm-postgresql-flexible.api.md +38 -82
- package/src/index.ts +1 -0
- package/src/models/index.ts +59 -11
- package/src/operations/configurations.ts +22 -13
- package/src/operations/databases.ts +23 -14
- package/src/operations/firewallRules.ts +23 -14
- package/src/operations/locationBasedCapabilities.ts +21 -9
- package/src/operations/servers.ts +46 -19
- package/src/pagingHelper.ts +39 -0
- package/src/postgreSQLManagementFlexibleServerClient.ts +60 -20
- package/types/arm-postgresql-flexible.d.ts +71 -11
- package/types/tsdoc-metadata.json +1 -1
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { FirewallRules } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -18,12 +19,12 @@ import {
|
|
|
18
19
|
FirewallRule,
|
|
19
20
|
FirewallRulesListByServerNextOptionalParams,
|
|
20
21
|
FirewallRulesListByServerOptionalParams,
|
|
22
|
+
FirewallRulesListByServerResponse,
|
|
21
23
|
FirewallRulesCreateOrUpdateOptionalParams,
|
|
22
24
|
FirewallRulesCreateOrUpdateResponse,
|
|
23
25
|
FirewallRulesDeleteOptionalParams,
|
|
24
26
|
FirewallRulesGetOptionalParams,
|
|
25
27
|
FirewallRulesGetResponse,
|
|
26
|
-
FirewallRulesListByServerResponse,
|
|
27
28
|
FirewallRulesListByServerNextResponse
|
|
28
29
|
} from "../models";
|
|
29
30
|
|
|
@@ -63,11 +64,15 @@ export class FirewallRulesImpl implements FirewallRules {
|
|
|
63
64
|
[Symbol.asyncIterator]() {
|
|
64
65
|
return this;
|
|
65
66
|
},
|
|
66
|
-
byPage: () => {
|
|
67
|
+
byPage: (settings?: PageSettings) => {
|
|
68
|
+
if (settings?.maxPageSize) {
|
|
69
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
70
|
+
}
|
|
67
71
|
return this.listByServerPagingPage(
|
|
68
72
|
resourceGroupName,
|
|
69
73
|
serverName,
|
|
70
|
-
options
|
|
74
|
+
options,
|
|
75
|
+
settings
|
|
71
76
|
);
|
|
72
77
|
}
|
|
73
78
|
};
|
|
@@ -76,15 +81,18 @@ export class FirewallRulesImpl implements FirewallRules {
|
|
|
76
81
|
private async *listByServerPagingPage(
|
|
77
82
|
resourceGroupName: string,
|
|
78
83
|
serverName: string,
|
|
79
|
-
options?: FirewallRulesListByServerOptionalParams
|
|
84
|
+
options?: FirewallRulesListByServerOptionalParams,
|
|
85
|
+
settings?: PageSettings
|
|
80
86
|
): AsyncIterableIterator<FirewallRule[]> {
|
|
81
|
-
let result
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
options
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
let result: FirewallRulesListByServerResponse;
|
|
88
|
+
let continuationToken = settings?.continuationToken;
|
|
89
|
+
if (!continuationToken) {
|
|
90
|
+
result = await this._listByServer(resourceGroupName, serverName, options);
|
|
91
|
+
let page = result.value || [];
|
|
92
|
+
continuationToken = result.nextLink;
|
|
93
|
+
setContinuationToken(page, continuationToken);
|
|
94
|
+
yield page;
|
|
95
|
+
}
|
|
88
96
|
while (continuationToken) {
|
|
89
97
|
result = await this._listByServerNext(
|
|
90
98
|
resourceGroupName,
|
|
@@ -93,7 +101,9 @@ export class FirewallRulesImpl implements FirewallRules {
|
|
|
93
101
|
options
|
|
94
102
|
);
|
|
95
103
|
continuationToken = result.nextLink;
|
|
96
|
-
|
|
104
|
+
let page = result.value || [];
|
|
105
|
+
setContinuationToken(page, continuationToken);
|
|
106
|
+
yield page;
|
|
97
107
|
}
|
|
98
108
|
}
|
|
99
109
|
|
|
@@ -467,7 +477,6 @@ const listByServerNextOperationSpec: coreClient.OperationSpec = {
|
|
|
467
477
|
bodyMapper: Mappers.CloudError
|
|
468
478
|
}
|
|
469
479
|
},
|
|
470
|
-
queryParameters: [Parameters.apiVersion],
|
|
471
480
|
urlParameters: [
|
|
472
481
|
Parameters.$host,
|
|
473
482
|
Parameters.subscriptionId,
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { LocationBasedCapabilities } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -51,19 +52,29 @@ export class LocationBasedCapabilitiesImpl
|
|
|
51
52
|
[Symbol.asyncIterator]() {
|
|
52
53
|
return this;
|
|
53
54
|
},
|
|
54
|
-
byPage: () => {
|
|
55
|
-
|
|
55
|
+
byPage: (settings?: PageSettings) => {
|
|
56
|
+
if (settings?.maxPageSize) {
|
|
57
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
58
|
+
}
|
|
59
|
+
return this.executePagingPage(locationName, options, settings);
|
|
56
60
|
}
|
|
57
61
|
};
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
private async *executePagingPage(
|
|
61
65
|
locationName: string,
|
|
62
|
-
options?: LocationBasedCapabilitiesExecuteOptionalParams
|
|
66
|
+
options?: LocationBasedCapabilitiesExecuteOptionalParams,
|
|
67
|
+
settings?: PageSettings
|
|
63
68
|
): AsyncIterableIterator<CapabilityProperties[]> {
|
|
64
|
-
let result
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
let result: LocationBasedCapabilitiesExecuteResponse;
|
|
70
|
+
let continuationToken = settings?.continuationToken;
|
|
71
|
+
if (!continuationToken) {
|
|
72
|
+
result = await this._execute(locationName, options);
|
|
73
|
+
let page = result.value || [];
|
|
74
|
+
continuationToken = result.nextLink;
|
|
75
|
+
setContinuationToken(page, continuationToken);
|
|
76
|
+
yield page;
|
|
77
|
+
}
|
|
67
78
|
while (continuationToken) {
|
|
68
79
|
result = await this._executeNext(
|
|
69
80
|
locationName,
|
|
@@ -71,7 +82,9 @@ export class LocationBasedCapabilitiesImpl
|
|
|
71
82
|
options
|
|
72
83
|
);
|
|
73
84
|
continuationToken = result.nextLink;
|
|
74
|
-
|
|
85
|
+
let page = result.value || [];
|
|
86
|
+
setContinuationToken(page, continuationToken);
|
|
87
|
+
yield page;
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
90
|
|
|
@@ -151,7 +164,6 @@ const executeNextOperationSpec: coreClient.OperationSpec = {
|
|
|
151
164
|
bodyMapper: Mappers.CloudError
|
|
152
165
|
}
|
|
153
166
|
},
|
|
154
|
-
queryParameters: [Parameters.apiVersion],
|
|
155
167
|
urlParameters: [
|
|
156
168
|
Parameters.$host,
|
|
157
169
|
Parameters.subscriptionId,
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { Servers } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -18,8 +19,10 @@ import {
|
|
|
18
19
|
Server,
|
|
19
20
|
ServersListByResourceGroupNextOptionalParams,
|
|
20
21
|
ServersListByResourceGroupOptionalParams,
|
|
22
|
+
ServersListByResourceGroupResponse,
|
|
21
23
|
ServersListNextOptionalParams,
|
|
22
24
|
ServersListOptionalParams,
|
|
25
|
+
ServersListResponse,
|
|
23
26
|
ServersCreateOptionalParams,
|
|
24
27
|
ServersCreateResponse,
|
|
25
28
|
ServerForUpdate,
|
|
@@ -28,8 +31,6 @@ import {
|
|
|
28
31
|
ServersDeleteOptionalParams,
|
|
29
32
|
ServersGetOptionalParams,
|
|
30
33
|
ServersGetResponse,
|
|
31
|
-
ServersListByResourceGroupResponse,
|
|
32
|
-
ServersListResponse,
|
|
33
34
|
ServersRestartOptionalParams,
|
|
34
35
|
ServersStartOptionalParams,
|
|
35
36
|
ServersStopOptionalParams,
|
|
@@ -67,19 +68,33 @@ export class ServersImpl implements Servers {
|
|
|
67
68
|
[Symbol.asyncIterator]() {
|
|
68
69
|
return this;
|
|
69
70
|
},
|
|
70
|
-
byPage: () => {
|
|
71
|
-
|
|
71
|
+
byPage: (settings?: PageSettings) => {
|
|
72
|
+
if (settings?.maxPageSize) {
|
|
73
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
74
|
+
}
|
|
75
|
+
return this.listByResourceGroupPagingPage(
|
|
76
|
+
resourceGroupName,
|
|
77
|
+
options,
|
|
78
|
+
settings
|
|
79
|
+
);
|
|
72
80
|
}
|
|
73
81
|
};
|
|
74
82
|
}
|
|
75
83
|
|
|
76
84
|
private async *listByResourceGroupPagingPage(
|
|
77
85
|
resourceGroupName: string,
|
|
78
|
-
options?: ServersListByResourceGroupOptionalParams
|
|
86
|
+
options?: ServersListByResourceGroupOptionalParams,
|
|
87
|
+
settings?: PageSettings
|
|
79
88
|
): AsyncIterableIterator<Server[]> {
|
|
80
|
-
let result
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
let result: ServersListByResourceGroupResponse;
|
|
90
|
+
let continuationToken = settings?.continuationToken;
|
|
91
|
+
if (!continuationToken) {
|
|
92
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
|
93
|
+
let page = result.value || [];
|
|
94
|
+
continuationToken = result.nextLink;
|
|
95
|
+
setContinuationToken(page, continuationToken);
|
|
96
|
+
yield page;
|
|
97
|
+
}
|
|
83
98
|
while (continuationToken) {
|
|
84
99
|
result = await this._listByResourceGroupNext(
|
|
85
100
|
resourceGroupName,
|
|
@@ -87,7 +102,9 @@ export class ServersImpl implements Servers {
|
|
|
87
102
|
options
|
|
88
103
|
);
|
|
89
104
|
continuationToken = result.nextLink;
|
|
90
|
-
|
|
105
|
+
let page = result.value || [];
|
|
106
|
+
setContinuationToken(page, continuationToken);
|
|
107
|
+
yield page;
|
|
91
108
|
}
|
|
92
109
|
}
|
|
93
110
|
|
|
@@ -118,22 +135,34 @@ export class ServersImpl implements Servers {
|
|
|
118
135
|
[Symbol.asyncIterator]() {
|
|
119
136
|
return this;
|
|
120
137
|
},
|
|
121
|
-
byPage: () => {
|
|
122
|
-
|
|
138
|
+
byPage: (settings?: PageSettings) => {
|
|
139
|
+
if (settings?.maxPageSize) {
|
|
140
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
141
|
+
}
|
|
142
|
+
return this.listPagingPage(options, settings);
|
|
123
143
|
}
|
|
124
144
|
};
|
|
125
145
|
}
|
|
126
146
|
|
|
127
147
|
private async *listPagingPage(
|
|
128
|
-
options?: ServersListOptionalParams
|
|
148
|
+
options?: ServersListOptionalParams,
|
|
149
|
+
settings?: PageSettings
|
|
129
150
|
): AsyncIterableIterator<Server[]> {
|
|
130
|
-
let result
|
|
131
|
-
|
|
132
|
-
|
|
151
|
+
let result: ServersListResponse;
|
|
152
|
+
let continuationToken = settings?.continuationToken;
|
|
153
|
+
if (!continuationToken) {
|
|
154
|
+
result = await this._list(options);
|
|
155
|
+
let page = result.value || [];
|
|
156
|
+
continuationToken = result.nextLink;
|
|
157
|
+
setContinuationToken(page, continuationToken);
|
|
158
|
+
yield page;
|
|
159
|
+
}
|
|
133
160
|
while (continuationToken) {
|
|
134
161
|
result = await this._listNext(continuationToken, options);
|
|
135
162
|
continuationToken = result.nextLink;
|
|
136
|
-
|
|
163
|
+
let page = result.value || [];
|
|
164
|
+
setContinuationToken(page, continuationToken);
|
|
165
|
+
yield page;
|
|
137
166
|
}
|
|
138
167
|
}
|
|
139
168
|
|
|
@@ -957,7 +986,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
957
986
|
bodyMapper: Mappers.CloudError
|
|
958
987
|
}
|
|
959
988
|
},
|
|
960
|
-
queryParameters: [Parameters.apiVersion],
|
|
961
989
|
urlParameters: [
|
|
962
990
|
Parameters.$host,
|
|
963
991
|
Parameters.subscriptionId,
|
|
@@ -978,7 +1006,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
978
1006
|
bodyMapper: Mappers.CloudError
|
|
979
1007
|
}
|
|
980
1008
|
},
|
|
981
|
-
queryParameters: [Parameters.apiVersion],
|
|
982
1009
|
urlParameters: [
|
|
983
1010
|
Parameters.$host,
|
|
984
1011
|
Parameters.subscriptionId,
|
|
@@ -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
|
+
}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
import * as coreClient from "@azure/core-client";
|
|
10
10
|
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
11
|
+
import {
|
|
12
|
+
PipelineRequest,
|
|
13
|
+
PipelineResponse,
|
|
14
|
+
SendRequest
|
|
15
|
+
} from "@azure/core-rest-pipeline";
|
|
11
16
|
import * as coreAuth from "@azure/core-auth";
|
|
12
17
|
import {
|
|
13
18
|
ServersImpl,
|
|
@@ -65,47 +70,53 @@ export class PostgreSQLManagementFlexibleServerClient extends coreClient.Service
|
|
|
65
70
|
credential: credentials
|
|
66
71
|
};
|
|
67
72
|
|
|
68
|
-
const packageDetails = `azsdk-js-arm-postgresql-flexible/6.0
|
|
73
|
+
const packageDetails = `azsdk-js-arm-postgresql-flexible/6.1.0`;
|
|
69
74
|
const userAgentPrefix =
|
|
70
75
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
71
76
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
72
77
|
: `${packageDetails}`;
|
|
73
78
|
|
|
74
|
-
if (!options.credentialScopes) {
|
|
75
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
76
|
-
}
|
|
77
79
|
const optionsWithDefaults = {
|
|
78
80
|
...defaults,
|
|
79
81
|
...options,
|
|
80
82
|
userAgentOptions: {
|
|
81
83
|
userAgentPrefix
|
|
82
84
|
},
|
|
83
|
-
|
|
85
|
+
endpoint:
|
|
84
86
|
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
85
87
|
};
|
|
86
88
|
super(optionsWithDefaults);
|
|
87
89
|
|
|
90
|
+
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
|
88
91
|
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
89
92
|
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
90
|
-
|
|
93
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
91
94
|
(pipelinePolicy) =>
|
|
92
95
|
pipelinePolicy.name ===
|
|
93
96
|
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
94
97
|
);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
}
|
|
99
|
+
if (
|
|
100
|
+
!options ||
|
|
101
|
+
!options.pipeline ||
|
|
102
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
103
|
+
!bearerTokenAuthenticationPolicyFound
|
|
104
|
+
) {
|
|
105
|
+
this.pipeline.removePolicy({
|
|
106
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
107
|
+
});
|
|
108
|
+
this.pipeline.addPolicy(
|
|
109
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
110
|
+
credential: credentials,
|
|
111
|
+
scopes:
|
|
112
|
+
optionsWithDefaults.credentialScopes ??
|
|
113
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
|
114
|
+
challengeCallbacks: {
|
|
115
|
+
authorizeRequestOnChallenge:
|
|
116
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
);
|
|
109
120
|
}
|
|
110
121
|
// Parameter assignments
|
|
111
122
|
this.subscriptionId = subscriptionId;
|
|
@@ -122,6 +133,35 @@ export class PostgreSQLManagementFlexibleServerClient extends coreClient.Service
|
|
|
122
133
|
this.operations = new OperationsImpl(this);
|
|
123
134
|
this.databases = new DatabasesImpl(this);
|
|
124
135
|
this.getPrivateDnsZoneSuffix = new GetPrivateDnsZoneSuffixImpl(this);
|
|
136
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
140
|
+
private addCustomApiVersionPolicy(apiVersion?: string) {
|
|
141
|
+
if (!apiVersion) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const apiVersionPolicy = {
|
|
145
|
+
name: "CustomApiVersionPolicy",
|
|
146
|
+
async sendRequest(
|
|
147
|
+
request: PipelineRequest,
|
|
148
|
+
next: SendRequest
|
|
149
|
+
): Promise<PipelineResponse> {
|
|
150
|
+
const param = request.url.split("?");
|
|
151
|
+
if (param.length > 1) {
|
|
152
|
+
const newParams = param[1].split("&").map((item) => {
|
|
153
|
+
if (item.indexOf("api-version") > -1) {
|
|
154
|
+
return "api-version=" + apiVersion;
|
|
155
|
+
} else {
|
|
156
|
+
return item;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
160
|
+
}
|
|
161
|
+
return next(request);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
125
165
|
}
|
|
126
166
|
|
|
127
167
|
servers: Servers;
|