| | 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 | |
|
| 4 | 12 | | public ResponseWithHeaders(T value, THeaders headers, Response rawResponse) |
| | 13 | | { |
| 4 | 14 | | _rawResponse = rawResponse; |
| 4 | 15 | | Value = value; |
| 4 | 16 | | Headers = headers; |
| 4 | 17 | | } |
| | 18 | |
|
| 4 | 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 | | } |