|
template<typename P = Payload, typename R = Result, typename = typename std::enable_if<!std::is_same<P, void>::value>::type, typename = typename std::enable_if<std::is_copy_constructible<R>::value>::type> |
| ApiResponse (const ApiResponse< R, Error, void > &other) |
| Creates the ApiResponse instance from a similar response type without payload. The payload is default initialized. More...
|
|
template<typename P = Payload, typename R = Result, typename = typename std::enable_if<!std::is_same<P, void>::value>::type, typename = typename std::enable_if<std::is_move_constructible<R>::value>::type> |
| ApiResponse (ApiResponse< R, Error, void > &&other) |
| Creates the ApiResponse instance from a similar response type without payload. The payload is default initialized. More...
|
|
template<typename P = Payload, typename = typename std::enable_if< !std::is_same<P, void>::value>::type> |
| ApiResponse (const ApiResponse< Result, Error, void > &other, P payload) |
| Creates the ApiResponse instance from a similar response type without payload, and a separate payload. More...
|
|
template<typename U , typename P = Payload, typename R = Result, typename = typename std::enable_if<std::is_same<P, void>::value>::type, typename = typename std::enable_if<std::is_copy_constructible<R>::value>::type> |
| ApiResponse (const ApiResponse< R, Error, U > &other) |
| Creates the ApiResponse instance from a similar request with a payload. More...
|
|
template<typename U , typename P = Payload, typename R = Result, typename = typename std::enable_if<std::is_same<P, void>::value>::type, typename = typename std::enable_if<std::is_move_constructible<R>::value>::type> |
| ApiResponse (ApiResponse< R, Error, U > &&other) |
| Creates the ApiResponse instance from a similar request with a payload. More...
|
|
| ApiResponse (ResultType result) |
| Creates the ApiResponse instance. More...
|
|
template<typename P = Payload, typename = typename std::enable_if< !std::is_same<P, void>::value>::type> |
| ApiResponse (ResultType result, P payload) |
| Creates the ApiResponse instance with payload. More...
|
|
| ApiResponse (const ErrorType &error) |
| Creates the ApiResponse instance if the request is not successful. More...
|
|
template<typename P = Payload, typename = typename std::enable_if< !std::is_same<P, void>::value>::type> |
| ApiResponse (const ErrorType &error, P payload) |
| Creates the ApiResponse instance if the request is not successful. More...
|
|
bool | IsSuccessful () const |
| Checks the status of the request attempt. More...
|
|
const ResultType & | GetResult () const |
| Gets the result of the successfully executed request. More...
|
|
ResultType && | MoveResult () |
| Moves the result of the successfully executed request. More...
|
|
const ErrorType & | GetError () const |
| Gets the error of the unsuccessful request attempt. More...
|
|
| operator bool () const |
| Operator to check the status of the request attempt. More...
|
|
template<typename Result, typename Error, typename Payload = void>
class olp::client::ApiResponse< Result, Error, Payload >
Represents a request outcome.
Contains a successful result or failure error. Before you try to access the error result, check the request outcome.
- Template Parameters
-
Result | The result type. |
Error | The error type. |
template<typename Result , typename Error , typename Payload = void>
template<typename P = Payload, typename R = Result, typename = typename std::enable_if<!std::is_same<P, void>::value>::type, typename = typename std::enable_if<std::is_copy_constructible<R>::value>::type>
Creates the ApiResponse
instance from a similar response type without payload. The payload is default initialized.
- Note
- Enabled only for the use cases when the input response type has no payload.
Used for moving the successfully executed request.
- Parameters
-
template<typename Result , typename Error , typename Payload = void>
template<typename P = Payload, typename R = Result, typename = typename std::enable_if<!std::is_same<P, void>::value>::type, typename = typename std::enable_if<std::is_move_constructible<R>::value>::type>
Creates the ApiResponse
instance from a similar response type without payload. The payload is default initialized.
- Note
- Enabled only for the use cases when the input response type has no payload.
Used for moving the successfully executed request.
- Parameters
-
template<typename Result , typename Error , typename Payload = void>
template<typename P = Payload, typename = typename std::enable_if< !std::is_same<P, void>::value>::type>
Creates the ApiResponse
instance from a similar response type without payload, and a separate payload.
- Note
- Enabled only for the use cases when the input response type has no payload.
Used for moving the successfully executed request.
- Parameters
-
other | The ApiResponse instance. |
payload | The Payload value. |
template<typename Result , typename Error , typename Payload = void>
template<typename U , typename P = Payload, typename R = Result, typename = typename std::enable_if<std::is_same<P, void>::value>::type, typename = typename std::enable_if<std::is_copy_constructible<R>::value>::type>
Creates the ApiResponse
instance from a similar request with a payload.
- Note
- Enabled only for the use cases when the input with a payload is sliced to the response without payload.
Used for moving the successfully executed request.
- Parameters
-
template<typename Result , typename Error , typename Payload = void>
template<typename U , typename P = Payload, typename R = Result, typename = typename std::enable_if<std::is_same<P, void>::value>::type, typename = typename std::enable_if<std::is_move_constructible<R>::value>::type>
Creates the ApiResponse
instance from a similar request with a payload.
- Note
- Enabled only for the use cases when the input with a payload is sliced to the response without payload.
Used for moving the successfully executed request.
- Parameters
-
template<typename Result , typename Error , typename Payload = void>
template<typename P = Payload, typename = typename std::enable_if< !std::is_same<P, void>::value>::type>
Creates the ApiResponse
instance with payload.
Used for moving the successfully executed request.
- Parameters
-
result | The ResultType instance. |
payload | The payload. |