UNPKG

1.07 kBJavaScriptView Raw
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License. See License.txt in the project root for license information.
3import { __extends } from "tslib";
4import { BaseRequestPolicy, } from "./requestPolicy";
5export function agentPolicy(agentSettings) {
6 return {
7 create: function (nextPolicy, options) {
8 return new AgentPolicy(nextPolicy, options, agentSettings);
9 },
10 };
11}
12var AgentPolicy = /** @class */ (function (_super) {
13 __extends(AgentPolicy, _super);
14 function AgentPolicy(nextPolicy, options, agentSettings) {
15 var _this = _super.call(this, nextPolicy, options) || this;
16 _this.agentSettings = agentSettings;
17 return _this;
18 }
19 AgentPolicy.prototype.sendRequest = function (request) {
20 if (!request.agentSettings) {
21 request.agentSettings = this.agentSettings;
22 }
23 return this._nextPolicy.sendRequest(request);
24 };
25 return AgentPolicy;
26}(BaseRequestPolicy));
27export { AgentPolicy };
28//# sourceMappingURL=agentPolicy.js.map
\No newline at end of file