/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#pragma once
#include <aws/appmesh/AppMesh_EXPORTS.h>
#include <aws/appmesh/model/TcpRouteAction.h>
#include <aws/appmesh/model/TcpRouteMatch.h>
#include <aws/appmesh/model/TcpTimeout.h>

#include <utility>

namespace Aws {
namespace Utils {
namespace Json {
class JsonValue;
class JsonView;
}  // namespace Json
}  // namespace Utils
namespace AppMesh {
namespace Model {

/**
 * <p>An object that represents a TCP route type.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/appmesh-2019-01-25/TcpRoute">AWS
 * API Reference</a></p>
 */
class TcpRoute {
 public:
  AWS_APPMESH_API TcpRoute() = default;
  AWS_APPMESH_API TcpRoute(Aws::Utils::Json::JsonView jsonValue);
  AWS_APPMESH_API TcpRoute& operator=(Aws::Utils::Json::JsonView jsonValue);
  AWS_APPMESH_API Aws::Utils::Json::JsonValue Jsonize() const;

  ///@{
  /**
   * <p>The action to take if a match is determined.</p>
   */
  inline const TcpRouteAction& GetAction() const { return m_action; }
  inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; }
  template <typename ActionT = TcpRouteAction>
  void SetAction(ActionT&& value) {
    m_actionHasBeenSet = true;
    m_action = std::forward<ActionT>(value);
  }
  template <typename ActionT = TcpRouteAction>
  TcpRoute& WithAction(ActionT&& value) {
    SetAction(std::forward<ActionT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>An object that represents the criteria for determining a request match.</p>
   */
  inline const TcpRouteMatch& GetMatch() const { return m_match; }
  inline bool MatchHasBeenSet() const { return m_matchHasBeenSet; }
  template <typename MatchT = TcpRouteMatch>
  void SetMatch(MatchT&& value) {
    m_matchHasBeenSet = true;
    m_match = std::forward<MatchT>(value);
  }
  template <typename MatchT = TcpRouteMatch>
  TcpRoute& WithMatch(MatchT&& value) {
    SetMatch(std::forward<MatchT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>An object that represents types of timeouts. </p>
   */
  inline const TcpTimeout& GetTimeout() const { return m_timeout; }
  inline bool TimeoutHasBeenSet() const { return m_timeoutHasBeenSet; }
  template <typename TimeoutT = TcpTimeout>
  void SetTimeout(TimeoutT&& value) {
    m_timeoutHasBeenSet = true;
    m_timeout = std::forward<TimeoutT>(value);
  }
  template <typename TimeoutT = TcpTimeout>
  TcpRoute& WithTimeout(TimeoutT&& value) {
    SetTimeout(std::forward<TimeoutT>(value));
    return *this;
  }
  ///@}
 private:
  TcpRouteAction m_action;

  TcpRouteMatch m_match;

  TcpTimeout m_timeout;
  bool m_actionHasBeenSet = false;
  bool m_matchHasBeenSet = false;
  bool m_timeoutHasBeenSet = false;
};

}  // namespace Model
}  // namespace AppMesh
}  // namespace Aws
