1 |
|
2 |
|
3 | import { __extends } from "tslib";
|
4 | import { BaseRequestPolicy, } from "./requestPolicy";
|
5 | export function agentPolicy(agentSettings) {
|
6 | return {
|
7 | create: function (nextPolicy, options) {
|
8 | return new AgentPolicy(nextPolicy, options, agentSettings);
|
9 | },
|
10 | };
|
11 | }
|
12 | var AgentPolicy = (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));
|
27 | export { AgentPolicy };
|
28 |
|
\ | No newline at end of file |