@azure/arm-appcontainers 1.0.0 → 1.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Release History
2
2
 
3
+ ## 1.1.0 (2022-08-02)
4
+
5
+ **Features**
6
+
7
+ - Added Interface AuthConfig
8
+ - Added Interface Certificate
9
+ - Added Interface ContainerApp
10
+ - Added Interface CustomHostnameAnalysisResult
11
+ - Added Interface DaprComponent
12
+ - Added Interface ManagedEnvironment
13
+ - Added Interface ManagedEnvironmentStorage
14
+ - Added Interface ProxyResource
15
+ - Added Interface Replica
16
+ - Added Interface Revision
17
+ - Added Interface SourceControl
18
+ - Added Interface TrackedResource
19
+
20
+
3
21
  ## 1.0.0 (2022-05-20)
4
22
 
5
23
  The package of @azure/arm-appcontainers is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var coreClient = require('@azure/core-client');
6
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var tslib = require('tslib');
8
8
  var coreLro = require('@azure/core-lro');
9
9
 
10
10
  function _interopNamespace(e) {
@@ -38,128 +38,187 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
38
38
  /** Known values of {@link CreatedByType} that the service accepts. */
39
39
  exports.KnownCreatedByType = void 0;
40
40
  (function (KnownCreatedByType) {
41
+ /** User */
41
42
  KnownCreatedByType["User"] = "User";
43
+ /** Application */
42
44
  KnownCreatedByType["Application"] = "Application";
45
+ /** ManagedIdentity */
43
46
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
47
+ /** Key */
44
48
  KnownCreatedByType["Key"] = "Key";
45
49
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
46
50
  /** Known values of {@link ManagedServiceIdentityType} that the service accepts. */
47
51
  exports.KnownManagedServiceIdentityType = void 0;
48
52
  (function (KnownManagedServiceIdentityType) {
53
+ /** None */
49
54
  KnownManagedServiceIdentityType["None"] = "None";
55
+ /** SystemAssigned */
50
56
  KnownManagedServiceIdentityType["SystemAssigned"] = "SystemAssigned";
57
+ /** UserAssigned */
51
58
  KnownManagedServiceIdentityType["UserAssigned"] = "UserAssigned";
59
+ /** SystemAssignedUserAssigned */
52
60
  KnownManagedServiceIdentityType["SystemAssignedUserAssigned"] = "SystemAssigned,UserAssigned";
53
61
  })(exports.KnownManagedServiceIdentityType || (exports.KnownManagedServiceIdentityType = {}));
54
62
  /** Known values of {@link ContainerAppProvisioningState} that the service accepts. */
55
63
  exports.KnownContainerAppProvisioningState = void 0;
56
64
  (function (KnownContainerAppProvisioningState) {
65
+ /** InProgress */
57
66
  KnownContainerAppProvisioningState["InProgress"] = "InProgress";
67
+ /** Succeeded */
58
68
  KnownContainerAppProvisioningState["Succeeded"] = "Succeeded";
69
+ /** Failed */
59
70
  KnownContainerAppProvisioningState["Failed"] = "Failed";
71
+ /** Canceled */
60
72
  KnownContainerAppProvisioningState["Canceled"] = "Canceled";
61
73
  })(exports.KnownContainerAppProvisioningState || (exports.KnownContainerAppProvisioningState = {}));
62
74
  /** Known values of {@link ActiveRevisionsMode} that the service accepts. */
63
75
  exports.KnownActiveRevisionsMode = void 0;
64
76
  (function (KnownActiveRevisionsMode) {
77
+ /** Multiple */
65
78
  KnownActiveRevisionsMode["Multiple"] = "Multiple";
79
+ /** Single */
66
80
  KnownActiveRevisionsMode["Single"] = "Single";
67
81
  })(exports.KnownActiveRevisionsMode || (exports.KnownActiveRevisionsMode = {}));
68
82
  /** Known values of {@link IngressTransportMethod} that the service accepts. */
69
83
  exports.KnownIngressTransportMethod = void 0;
70
84
  (function (KnownIngressTransportMethod) {
85
+ /** Auto */
71
86
  KnownIngressTransportMethod["Auto"] = "auto";
87
+ /** Http */
72
88
  KnownIngressTransportMethod["Http"] = "http";
89
+ /** Http2 */
73
90
  KnownIngressTransportMethod["Http2"] = "http2";
74
91
  })(exports.KnownIngressTransportMethod || (exports.KnownIngressTransportMethod = {}));
75
92
  /** Known values of {@link BindingType} that the service accepts. */
76
93
  exports.KnownBindingType = void 0;
77
94
  (function (KnownBindingType) {
95
+ /** Disabled */
78
96
  KnownBindingType["Disabled"] = "Disabled";
97
+ /** SniEnabled */
79
98
  KnownBindingType["SniEnabled"] = "SniEnabled";
80
99
  })(exports.KnownBindingType || (exports.KnownBindingType = {}));
81
100
  /** Known values of {@link AppProtocol} that the service accepts. */
82
101
  exports.KnownAppProtocol = void 0;
83
102
  (function (KnownAppProtocol) {
103
+ /** Http */
84
104
  KnownAppProtocol["Http"] = "http";
105
+ /** Grpc */
85
106
  KnownAppProtocol["Grpc"] = "grpc";
86
107
  })(exports.KnownAppProtocol || (exports.KnownAppProtocol = {}));
87
108
  /** Known values of {@link Scheme} that the service accepts. */
88
109
  exports.KnownScheme = void 0;
89
110
  (function (KnownScheme) {
111
+ /** Http */
90
112
  KnownScheme["Http"] = "HTTP";
113
+ /** Https */
91
114
  KnownScheme["Https"] = "HTTPS";
92
115
  })(exports.KnownScheme || (exports.KnownScheme = {}));
93
116
  /** Known values of {@link Type} that the service accepts. */
94
117
  exports.KnownType = void 0;
95
118
  (function (KnownType) {
119
+ /** Liveness */
96
120
  KnownType["Liveness"] = "Liveness";
121
+ /** Readiness */
97
122
  KnownType["Readiness"] = "Readiness";
123
+ /** Startup */
98
124
  KnownType["Startup"] = "Startup";
99
125
  })(exports.KnownType || (exports.KnownType = {}));
100
126
  /** Known values of {@link StorageType} that the service accepts. */
101
127
  exports.KnownStorageType = void 0;
102
128
  (function (KnownStorageType) {
129
+ /** AzureFile */
103
130
  KnownStorageType["AzureFile"] = "AzureFile";
131
+ /** EmptyDir */
104
132
  KnownStorageType["EmptyDir"] = "EmptyDir";
105
133
  })(exports.KnownStorageType || (exports.KnownStorageType = {}));
106
134
  /** Known values of {@link RevisionHealthState} that the service accepts. */
107
135
  exports.KnownRevisionHealthState = void 0;
108
136
  (function (KnownRevisionHealthState) {
137
+ /** Healthy */
109
138
  KnownRevisionHealthState["Healthy"] = "Healthy";
139
+ /** Unhealthy */
110
140
  KnownRevisionHealthState["Unhealthy"] = "Unhealthy";
141
+ /** None */
111
142
  KnownRevisionHealthState["None"] = "None";
112
143
  })(exports.KnownRevisionHealthState || (exports.KnownRevisionHealthState = {}));
113
144
  /** Known values of {@link RevisionProvisioningState} that the service accepts. */
114
145
  exports.KnownRevisionProvisioningState = void 0;
115
146
  (function (KnownRevisionProvisioningState) {
147
+ /** Provisioning */
116
148
  KnownRevisionProvisioningState["Provisioning"] = "Provisioning";
149
+ /** Provisioned */
117
150
  KnownRevisionProvisioningState["Provisioned"] = "Provisioned";
151
+ /** Failed */
118
152
  KnownRevisionProvisioningState["Failed"] = "Failed";
153
+ /** Deprovisioning */
119
154
  KnownRevisionProvisioningState["Deprovisioning"] = "Deprovisioning";
155
+ /** Deprovisioned */
120
156
  KnownRevisionProvisioningState["Deprovisioned"] = "Deprovisioned";
121
157
  })(exports.KnownRevisionProvisioningState || (exports.KnownRevisionProvisioningState = {}));
122
158
  /** Known values of {@link EnvironmentProvisioningState} that the service accepts. */
123
159
  exports.KnownEnvironmentProvisioningState = void 0;
124
160
  (function (KnownEnvironmentProvisioningState) {
161
+ /** Succeeded */
125
162
  KnownEnvironmentProvisioningState["Succeeded"] = "Succeeded";
163
+ /** Failed */
126
164
  KnownEnvironmentProvisioningState["Failed"] = "Failed";
165
+ /** Canceled */
127
166
  KnownEnvironmentProvisioningState["Canceled"] = "Canceled";
167
+ /** Waiting */
128
168
  KnownEnvironmentProvisioningState["Waiting"] = "Waiting";
169
+ /** InitializationInProgress */
129
170
  KnownEnvironmentProvisioningState["InitializationInProgress"] = "InitializationInProgress";
171
+ /** InfrastructureSetupInProgress */
130
172
  KnownEnvironmentProvisioningState["InfrastructureSetupInProgress"] = "InfrastructureSetupInProgress";
173
+ /** InfrastructureSetupComplete */
131
174
  KnownEnvironmentProvisioningState["InfrastructureSetupComplete"] = "InfrastructureSetupComplete";
175
+ /** ScheduledForDelete */
132
176
  KnownEnvironmentProvisioningState["ScheduledForDelete"] = "ScheduledForDelete";
177
+ /** UpgradeRequested */
133
178
  KnownEnvironmentProvisioningState["UpgradeRequested"] = "UpgradeRequested";
179
+ /** UpgradeFailed */
134
180
  KnownEnvironmentProvisioningState["UpgradeFailed"] = "UpgradeFailed";
135
181
  })(exports.KnownEnvironmentProvisioningState || (exports.KnownEnvironmentProvisioningState = {}));
136
182
  /** Known values of {@link CertificateProvisioningState} that the service accepts. */
137
183
  exports.KnownCertificateProvisioningState = void 0;
138
184
  (function (KnownCertificateProvisioningState) {
185
+ /** Succeeded */
139
186
  KnownCertificateProvisioningState["Succeeded"] = "Succeeded";
187
+ /** Failed */
140
188
  KnownCertificateProvisioningState["Failed"] = "Failed";
189
+ /** Canceled */
141
190
  KnownCertificateProvisioningState["Canceled"] = "Canceled";
191
+ /** DeleteFailed */
142
192
  KnownCertificateProvisioningState["DeleteFailed"] = "DeleteFailed";
193
+ /** Pending */
143
194
  KnownCertificateProvisioningState["Pending"] = "Pending";
144
195
  })(exports.KnownCertificateProvisioningState || (exports.KnownCertificateProvisioningState = {}));
145
196
  /** Known values of {@link CheckNameAvailabilityReason} that the service accepts. */
146
197
  exports.KnownCheckNameAvailabilityReason = void 0;
147
198
  (function (KnownCheckNameAvailabilityReason) {
199
+ /** Invalid */
148
200
  KnownCheckNameAvailabilityReason["Invalid"] = "Invalid";
201
+ /** AlreadyExists */
149
202
  KnownCheckNameAvailabilityReason["AlreadyExists"] = "AlreadyExists";
150
203
  })(exports.KnownCheckNameAvailabilityReason || (exports.KnownCheckNameAvailabilityReason = {}));
151
204
  /** Known values of {@link AccessMode} that the service accepts. */
152
205
  exports.KnownAccessMode = void 0;
153
206
  (function (KnownAccessMode) {
207
+ /** ReadOnly */
154
208
  KnownAccessMode["ReadOnly"] = "ReadOnly";
209
+ /** ReadWrite */
155
210
  KnownAccessMode["ReadWrite"] = "ReadWrite";
156
211
  })(exports.KnownAccessMode || (exports.KnownAccessMode = {}));
157
212
  /** Known values of {@link SourceControlOperationState} that the service accepts. */
158
213
  exports.KnownSourceControlOperationState = void 0;
159
214
  (function (KnownSourceControlOperationState) {
215
+ /** InProgress */
160
216
  KnownSourceControlOperationState["InProgress"] = "InProgress";
217
+ /** Succeeded */
161
218
  KnownSourceControlOperationState["Succeeded"] = "Succeeded";
219
+ /** Failed */
162
220
  KnownSourceControlOperationState["Failed"] = "Failed";
221
+ /** Canceled */
163
222
  KnownSourceControlOperationState["Canceled"] = "Canceled";
164
223
  })(exports.KnownSourceControlOperationState || (exports.KnownSourceControlOperationState = {}));
165
224
 
@@ -2244,6 +2303,112 @@ const Volume = {
2244
2303
  }
2245
2304
  }
2246
2305
  };
2306
+ const CustomHostnameAnalysisResult = {
2307
+ type: {
2308
+ name: "Composite",
2309
+ className: "CustomHostnameAnalysisResult",
2310
+ modelProperties: {
2311
+ hostName: {
2312
+ serializedName: "hostName",
2313
+ readOnly: true,
2314
+ type: {
2315
+ name: "String"
2316
+ }
2317
+ },
2318
+ isHostnameAlreadyVerified: {
2319
+ serializedName: "isHostnameAlreadyVerified",
2320
+ readOnly: true,
2321
+ type: {
2322
+ name: "Boolean"
2323
+ }
2324
+ },
2325
+ customDomainVerificationTest: {
2326
+ serializedName: "customDomainVerificationTest",
2327
+ readOnly: true,
2328
+ type: {
2329
+ name: "Enum",
2330
+ allowedValues: ["Passed", "Failed", "Skipped"]
2331
+ }
2332
+ },
2333
+ customDomainVerificationFailureInfo: {
2334
+ serializedName: "customDomainVerificationFailureInfo",
2335
+ type: {
2336
+ name: "Composite",
2337
+ className: "DefaultErrorResponse"
2338
+ }
2339
+ },
2340
+ hasConflictOnManagedEnvironment: {
2341
+ serializedName: "hasConflictOnManagedEnvironment",
2342
+ readOnly: true,
2343
+ type: {
2344
+ name: "Boolean"
2345
+ }
2346
+ },
2347
+ conflictingContainerAppResourceId: {
2348
+ serializedName: "conflictingContainerAppResourceId",
2349
+ readOnly: true,
2350
+ type: {
2351
+ name: "String"
2352
+ }
2353
+ },
2354
+ cNameRecords: {
2355
+ serializedName: "cNameRecords",
2356
+ type: {
2357
+ name: "Sequence",
2358
+ element: {
2359
+ type: {
2360
+ name: "String"
2361
+ }
2362
+ }
2363
+ }
2364
+ },
2365
+ txtRecords: {
2366
+ serializedName: "txtRecords",
2367
+ type: {
2368
+ name: "Sequence",
2369
+ element: {
2370
+ type: {
2371
+ name: "String"
2372
+ }
2373
+ }
2374
+ }
2375
+ },
2376
+ aRecords: {
2377
+ serializedName: "aRecords",
2378
+ type: {
2379
+ name: "Sequence",
2380
+ element: {
2381
+ type: {
2382
+ name: "String"
2383
+ }
2384
+ }
2385
+ }
2386
+ },
2387
+ alternateCNameRecords: {
2388
+ serializedName: "alternateCNameRecords",
2389
+ type: {
2390
+ name: "Sequence",
2391
+ element: {
2392
+ type: {
2393
+ name: "String"
2394
+ }
2395
+ }
2396
+ }
2397
+ },
2398
+ alternateTxtRecords: {
2399
+ serializedName: "alternateTxtRecords",
2400
+ type: {
2401
+ name: "Sequence",
2402
+ element: {
2403
+ type: {
2404
+ name: "String"
2405
+ }
2406
+ }
2407
+ }
2408
+ }
2409
+ }
2410
+ }
2411
+ };
2247
2412
  const SecretsCollection = {
2248
2413
  type: {
2249
2414
  name: "Composite",
@@ -3093,100 +3258,6 @@ const AuthConfig = {
3093
3258
  } })
3094
3259
  }
3095
3260
  };
3096
- const CustomHostnameAnalysisResult = {
3097
- type: {
3098
- name: "Composite",
3099
- className: "CustomHostnameAnalysisResult",
3100
- modelProperties: Object.assign(Object.assign({}, ProxyResource.type.modelProperties), { hostName: {
3101
- serializedName: "properties.hostName",
3102
- readOnly: true,
3103
- type: {
3104
- name: "String"
3105
- }
3106
- }, isHostnameAlreadyVerified: {
3107
- serializedName: "properties.isHostnameAlreadyVerified",
3108
- readOnly: true,
3109
- type: {
3110
- name: "Boolean"
3111
- }
3112
- }, customDomainVerificationTest: {
3113
- serializedName: "properties.customDomainVerificationTest",
3114
- readOnly: true,
3115
- type: {
3116
- name: "Enum",
3117
- allowedValues: ["Passed", "Failed", "Skipped"]
3118
- }
3119
- }, customDomainVerificationFailureInfo: {
3120
- serializedName: "properties.customDomainVerificationFailureInfo",
3121
- type: {
3122
- name: "Composite",
3123
- className: "DefaultErrorResponse"
3124
- }
3125
- }, hasConflictOnManagedEnvironment: {
3126
- serializedName: "properties.hasConflictOnManagedEnvironment",
3127
- readOnly: true,
3128
- type: {
3129
- name: "Boolean"
3130
- }
3131
- }, conflictingContainerAppResourceId: {
3132
- serializedName: "properties.conflictingContainerAppResourceId",
3133
- readOnly: true,
3134
- type: {
3135
- name: "String"
3136
- }
3137
- }, cNameRecords: {
3138
- serializedName: "properties.cNameRecords",
3139
- type: {
3140
- name: "Sequence",
3141
- element: {
3142
- type: {
3143
- name: "String"
3144
- }
3145
- }
3146
- }
3147
- }, txtRecords: {
3148
- serializedName: "properties.txtRecords",
3149
- type: {
3150
- name: "Sequence",
3151
- element: {
3152
- type: {
3153
- name: "String"
3154
- }
3155
- }
3156
- }
3157
- }, aRecords: {
3158
- serializedName: "properties.aRecords",
3159
- type: {
3160
- name: "Sequence",
3161
- element: {
3162
- type: {
3163
- name: "String"
3164
- }
3165
- }
3166
- }
3167
- }, alternateCNameRecords: {
3168
- serializedName: "properties.alternateCNameRecords",
3169
- type: {
3170
- name: "Sequence",
3171
- element: {
3172
- type: {
3173
- name: "String"
3174
- }
3175
- }
3176
- }
3177
- }, alternateTxtRecords: {
3178
- serializedName: "properties.alternateTxtRecords",
3179
- type: {
3180
- name: "Sequence",
3181
- element: {
3182
- type: {
3183
- name: "String"
3184
- }
3185
- }
3186
- }
3187
- } })
3188
- }
3189
- };
3190
3261
  const Revision = {
3191
3262
  type: {
3192
3263
  name: "Composite",
@@ -3424,7 +3495,7 @@ const ContainerApp = {
3424
3495
  name: "Composite",
3425
3496
  className: "Template"
3426
3497
  }
3427
- }, outboundIPAddresses: {
3498
+ }, outboundIpAddresses: {
3428
3499
  serializedName: "properties.outboundIPAddresses",
3429
3500
  readOnly: true,
3430
3501
  type: {
@@ -3579,6 +3650,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
3579
3650
  CustomScaleRule: CustomScaleRule,
3580
3651
  HttpScaleRule: HttpScaleRule,
3581
3652
  Volume: Volume,
3653
+ CustomHostnameAnalysisResult: CustomHostnameAnalysisResult,
3582
3654
  SecretsCollection: SecretsCollection,
3583
3655
  ContainerAppSecret: ContainerAppSecret,
3584
3656
  RevisionCollection: RevisionCollection,
@@ -3609,7 +3681,6 @@ var Mappers = /*#__PURE__*/Object.freeze({
3609
3681
  ProxyResource: ProxyResource,
3610
3682
  TrackedResource: TrackedResource,
3611
3683
  AuthConfig: AuthConfig,
3612
- CustomHostnameAnalysisResult: CustomHostnameAnalysisResult,
3613
3684
  Revision: Revision,
3614
3685
  Replica: Replica,
3615
3686
  DaprComponent: DaprComponent,
@@ -6746,7 +6817,7 @@ class ContainerAppsAPIClient extends coreClient__namespace.ServiceClient {
6746
6817
  requestContentType: "application/json; charset=utf-8",
6747
6818
  credential: credentials
6748
6819
  };
6749
- const packageDetails = `azsdk-js-arm-appcontainers/1.0.0`;
6820
+ const packageDetails = `azsdk-js-arm-appcontainers/1.1.0`;
6750
6821
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
6751
6822
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
6752
6823
  : `${packageDetails}`;
@@ -6757,21 +6828,26 @@ class ContainerAppsAPIClient extends coreClient__namespace.ServiceClient {
6757
6828
  userAgentPrefix
6758
6829
  }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
6759
6830
  super(optionsWithDefaults);
6831
+ let bearerTokenAuthenticationPolicyFound = false;
6760
6832
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
6761
6833
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
6762
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
6834
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
6763
6835
  coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
6764
- if (!bearerTokenAuthenticationPolicyFound) {
6765
- this.pipeline.removePolicy({
6766
- name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
6767
- });
6768
- this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
6769
- scopes: `${optionsWithDefaults.baseUri}/.default`,
6770
- challengeCallbacks: {
6771
- authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
6772
- }
6773
- }));
6774
- }
6836
+ }
6837
+ if (!options ||
6838
+ !options.pipeline ||
6839
+ options.pipeline.getOrderedPolicies().length == 0 ||
6840
+ !bearerTokenAuthenticationPolicyFound) {
6841
+ this.pipeline.removePolicy({
6842
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
6843
+ });
6844
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
6845
+ credential: credentials,
6846
+ scopes: `${optionsWithDefaults.credentialScopes}`,
6847
+ challengeCallbacks: {
6848
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
6849
+ }
6850
+ }));
6775
6851
  }
6776
6852
  // Parameter assignments
6777
6853
  this.subscriptionId = subscriptionId;
@@ -6789,6 +6865,34 @@ class ContainerAppsAPIClient extends coreClient__namespace.ServiceClient {
6789
6865
  this.namespaces = new NamespacesImpl(this);
6790
6866
  this.managedEnvironmentsStorages = new ManagedEnvironmentsStoragesImpl(this);
6791
6867
  this.containerAppsSourceControls = new ContainerAppsSourceControlsImpl(this);
6868
+ this.addCustomApiVersionPolicy(options.apiVersion);
6869
+ }
6870
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
6871
+ addCustomApiVersionPolicy(apiVersion) {
6872
+ if (!apiVersion) {
6873
+ return;
6874
+ }
6875
+ const apiVersionPolicy = {
6876
+ name: "CustomApiVersionPolicy",
6877
+ sendRequest(request, next) {
6878
+ return tslib.__awaiter(this, void 0, void 0, function* () {
6879
+ const param = request.url.split("?");
6880
+ if (param.length > 1) {
6881
+ const newParams = param[1].split("&").map((item) => {
6882
+ if (item.indexOf("api-version") > -1) {
6883
+ return "api-version=" + apiVersion;
6884
+ }
6885
+ else {
6886
+ return item;
6887
+ }
6888
+ });
6889
+ request.url = param[0] + "?" + newParams.join("&");
6890
+ }
6891
+ return next(request);
6892
+ });
6893
+ }
6894
+ };
6895
+ this.pipeline.addPolicy(apiVersionPolicy);
6792
6896
  }
6793
6897
  }
6794
6898