| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | #nullable enable |
| | 5 | |
|
| | 6 | | namespace Azure.Core |
| | 7 | | { |
| | 8 | | internal class ResponseWithHeaders<T, THeaders> : Response<T> |
| | 9 | | { |
| | 10 | | private readonly Response _rawResponse; |
| | 11 | |
|
| 8 | 12 | | public ResponseWithHeaders(T value, THeaders headers, Response rawResponse) |
| | 13 | | { |
| 8 | 14 | | _rawResponse = rawResponse; |
| 8 | 15 | | Value = value; |
| 8 | 16 | | Headers = headers; |
| 8 | 17 | | } |
| | 18 | |
|
| 0 | 19 | | public override Response GetRawResponse() => _rawResponse; |
| | 20 | |
|
| 8 | 21 | | public override T Value { get; } |
| | 22 | |
|
| 0 | 23 | | public THeaders Headers { get; } |
| | 24 | |
|
| 0 | 25 | | public static implicit operator Response(ResponseWithHeaders<T, THeaders> self) => self.GetRawResponse(); |
| | 26 | | } |
| | 27 | | } |