Samuel Kahn 343d7eb712
[cpp-ue4] Improved retry system to use Unreal's FHttpRetrySystem (#9382)
* Revert "[cpp-ue4] Added the possibility to retry requests easily with AsyncRetry method on the response and SetAutoRetryCount on the request"

* [cpp-ue4] Improved retry system to use Unreal's FHttpRetrySystem

* [cpp-ue4] Updated style guide link

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-05-06 11:26:07 +08:00

48 lines
1.5 KiB
C++

/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* https://github.com/OpenAPITools/openapi-generator
* Do not edit the class manually.
*/
#include "OpenAPIBaseModel.h"
namespace OpenAPI
{
bool HttpRetryManager::Tick(float DeltaTime)
{
FManager::Update();
return true;
}
HttpRetryParams::HttpRetryParams(const FRetryLimitCountSetting& InRetryLimitCountOverride /*= FRetryLimitCountSetting()*/,
const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride /*= FRetryTimeoutRelativeSecondsSetting()*/,
const FRetryResponseCodes& InRetryResponseCodes /*= FRetryResponseCodes()*/,
const FRetryVerbs& InRetryVerbs /*= FRetryVerbs()*/,
const FRetryDomainsPtr& InRetryDomains /*= FRetryDomainsPtr() */)
: RetryLimitCountOverride(InRetryLimitCountOverride)
, RetryTimeoutRelativeSecondsOverride(InRetryTimeoutRelativeSecondsOverride)
, RetryResponseCodes(InRetryResponseCodes)
, RetryVerbs(InRetryVerbs)
, RetryDomains(InRetryDomains)
{
}
void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode)
{
ResponseCode = InHttpResponseCode;
SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode));
if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout)
{
SetResponseString(TEXT("Request Timeout"));
}
}
}