/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace AppMesh { namespace Model { /** *

An object that represents a retry policy. Specify at least one value for at * least one of the types of RetryEvents, a value for * maxRetries, and a value for perRetryTimeout. Both * server-error and gateway-error under * httpRetryEvents include the Envoy reset policy. For * more information on the reset policy, see the Envoy * documentation.

See Also:

AWS * API Reference

*/ class HttpRetryPolicy { public: AWS_APPMESH_API HttpRetryPolicy(); AWS_APPMESH_API HttpRetryPolicy(Aws::Utils::Json::JsonView jsonValue); AWS_APPMESH_API HttpRetryPolicy& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_APPMESH_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline const Aws::Vector& GetHttpRetryEvents() const{ return m_httpRetryEvents; } /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline bool HttpRetryEventsHasBeenSet() const { return m_httpRetryEventsHasBeenSet; } /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline void SetHttpRetryEvents(const Aws::Vector& value) { m_httpRetryEventsHasBeenSet = true; m_httpRetryEvents = value; } /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline void SetHttpRetryEvents(Aws::Vector&& value) { m_httpRetryEventsHasBeenSet = true; m_httpRetryEvents = std::move(value); } /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline HttpRetryPolicy& WithHttpRetryEvents(const Aws::Vector& value) { SetHttpRetryEvents(value); return *this;} /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline HttpRetryPolicy& WithHttpRetryEvents(Aws::Vector&& value) { SetHttpRetryEvents(std::move(value)); return *this;} /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline HttpRetryPolicy& AddHttpRetryEvents(const Aws::String& value) { m_httpRetryEventsHasBeenSet = true; m_httpRetryEvents.push_back(value); return *this; } /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline HttpRetryPolicy& AddHttpRetryEvents(Aws::String&& value) { m_httpRetryEventsHasBeenSet = true; m_httpRetryEvents.push_back(std::move(value)); return *this; } /** *

Specify at least one of the following values.

  • * server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, * 508, 510, and 511

  • gateway-error – HTTP status codes * 502, 503, and 504

  • client-error – HTTP status code * 409

  • stream-error – Retry on refused stream

  • *
*/ inline HttpRetryPolicy& AddHttpRetryEvents(const char* value) { m_httpRetryEventsHasBeenSet = true; m_httpRetryEvents.push_back(value); return *this; } /** *

The maximum number of retry attempts.

*/ inline long long GetMaxRetries() const{ return m_maxRetries; } /** *

The maximum number of retry attempts.

*/ inline bool MaxRetriesHasBeenSet() const { return m_maxRetriesHasBeenSet; } /** *

The maximum number of retry attempts.

*/ inline void SetMaxRetries(long long value) { m_maxRetriesHasBeenSet = true; m_maxRetries = value; } /** *

The maximum number of retry attempts.

*/ inline HttpRetryPolicy& WithMaxRetries(long long value) { SetMaxRetries(value); return *this;} /** *

The timeout for each retry attempt.

*/ inline const Duration& GetPerRetryTimeout() const{ return m_perRetryTimeout; } /** *

The timeout for each retry attempt.

*/ inline bool PerRetryTimeoutHasBeenSet() const { return m_perRetryTimeoutHasBeenSet; } /** *

The timeout for each retry attempt.

*/ inline void SetPerRetryTimeout(const Duration& value) { m_perRetryTimeoutHasBeenSet = true; m_perRetryTimeout = value; } /** *

The timeout for each retry attempt.

*/ inline void SetPerRetryTimeout(Duration&& value) { m_perRetryTimeoutHasBeenSet = true; m_perRetryTimeout = std::move(value); } /** *

The timeout for each retry attempt.

*/ inline HttpRetryPolicy& WithPerRetryTimeout(const Duration& value) { SetPerRetryTimeout(value); return *this;} /** *

The timeout for each retry attempt.

*/ inline HttpRetryPolicy& WithPerRetryTimeout(Duration&& value) { SetPerRetryTimeout(std::move(value)); return *this;} /** *

Specify a valid value. The event occurs before any processing of a request * has started and is encountered when the upstream is temporarily or permanently * unavailable.

*/ inline const Aws::Vector& GetTcpRetryEvents() const{ return m_tcpRetryEvents; } /** *

Specify a valid value. The event occurs before any processing of a request * has started and is encountered when the upstream is temporarily or permanently * unavailable.

*/ inline bool TcpRetryEventsHasBeenSet() const { return m_tcpRetryEventsHasBeenSet; } /** *

Specify a valid value. The event occurs before any processing of a request * has started and is encountered when the upstream is temporarily or permanently * unavailable.

*/ inline void SetTcpRetryEvents(const Aws::Vector& value) { m_tcpRetryEventsHasBeenSet = true; m_tcpRetryEvents = value; } /** *

Specify a valid value. The event occurs before any processing of a request * has started and is encountered when the upstream is temporarily or permanently * unavailable.

*/ inline void SetTcpRetryEvents(Aws::Vector&& value) { m_tcpRetryEventsHasBeenSet = true; m_tcpRetryEvents = std::move(value); } /** *

Specify a valid value. The event occurs before any processing of a request * has started and is encountered when the upstream is temporarily or permanently * unavailable.

*/ inline HttpRetryPolicy& WithTcpRetryEvents(const Aws::Vector& value) { SetTcpRetryEvents(value); return *this;} /** *

Specify a valid value. The event occurs before any processing of a request * has started and is encountered when the upstream is temporarily or permanently * unavailable.

*/ inline HttpRetryPolicy& WithTcpRetryEvents(Aws::Vector&& value) { SetTcpRetryEvents(std::move(value)); return *this;} /** *

Specify a valid value. The event occurs before any processing of a request * has started and is encountered when the upstream is temporarily or permanently * unavailable.

*/ inline HttpRetryPolicy& AddTcpRetryEvents(const TcpRetryPolicyEvent& value) { m_tcpRetryEventsHasBeenSet = true; m_tcpRetryEvents.push_back(value); return *this; } /** *

Specify a valid value. The event occurs before any processing of a request * has started and is encountered when the upstream is temporarily or permanently * unavailable.

*/ inline HttpRetryPolicy& AddTcpRetryEvents(TcpRetryPolicyEvent&& value) { m_tcpRetryEventsHasBeenSet = true; m_tcpRetryEvents.push_back(std::move(value)); return *this; } private: Aws::Vector m_httpRetryEvents; bool m_httpRetryEventsHasBeenSet = false; long long m_maxRetries; bool m_maxRetriesHasBeenSet = false; Duration m_perRetryTimeout; bool m_perRetryTimeoutHasBeenSet = false; Aws::Vector m_tcpRetryEvents; bool m_tcpRetryEventsHasBeenSet = false; }; } // namespace Model } // namespace AppMesh } // namespace Aws