| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.Threading.Tasks; |
| | 6 | | using Azure.Core; |
| | 7 | | using Azure.Core.Pipeline; |
| | 8 | |
|
| | 9 | | namespace Azure.Data.AppConfiguration |
| | 10 | | { |
| | 11 | | internal class ApiVersionPolicy : HttpPipelineSynchronousPolicy |
| | 12 | | { |
| | 13 | | private readonly string _versionString; |
| | 14 | |
|
| 324 | 15 | | public ApiVersionPolicy(string versionString) |
| | 16 | | { |
| 324 | 17 | | _versionString = versionString; |
| 324 | 18 | | } |
| | 19 | |
|
| | 20 | | public override void OnSendingRequest(HttpMessage message) |
| | 21 | | { |
| 776 | 22 | | message.Request.Uri.AppendQuery("api-version", _versionString); |
| 776 | 23 | | } |
| | 24 | | } |
| | 25 | | } |