text: /*
   * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *    http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  #include <tencentcloud/redis/v20180412/model/SecurityGroupsInboundAndOutbound.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Redis::V20180412::Model;
  using namespace rapidjson;
  using namespace std;
  
  SecurityGroupsInboundAndOutbound::SecurityGroupsInboundAndOutbound() :
      m_actionHasBeenSet(false),
      m_ipHasBeenSet(false),
      m_portHasBeenSet(false),
      m_protoHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome SecurityGroupsInboundAndOutbound::Deserialize(const Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("Action") && !value["Action"].IsNull())
      {
          if (!value["Action"].IsString())
          {
              return CoreInternalOutcome(Error("response `SecurityGroupsInboundAndOutbound.Action` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_action = string(value["Action"].GetString());
          m_actionHasBeenSet = true;
      }
  
      if (value.HasMember("Ip") && !value["Ip"].IsNull())
      {
          if (!value["Ip"].IsString())
          {
              return CoreInternalOutcome(Error("response `SecurityGroupsInboundAndOutbound.Ip` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_ip = string(value["Ip"].GetString());
          m_ipHasBeenSet = true;
      }
  
      if (value.HasMember("Port") && !value["Port"].IsNull())
      {
          if (!value["Port"].IsString())
          {
              return CoreInternalOutcome(Error("response `SecurityGroupsInboundAndOutbound.Port` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_port = string(value["Port"].GetString());
          m_portHasBeenSet = true;
      }
  
      if (value.HasMember("Proto") && !value["Proto"].IsNull())
      {
          if (!value["Proto"].IsString())
          {
              return CoreInternalOutcome(Error("response `SecurityGroupsInboundAndOutbound.Proto` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_proto = string(value["Proto"].GetString());
          m_protoHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void SecurityGroupsInboundAndOutbound::ToJsonObject(Value &value, Document::AllocatorType& allocator) const
  {
  
      if (m_actionHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "Action";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, Value(m_action.c_str(), allocator).Move(), allocator);
      }
  
      if (m_ipHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "Ip";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, Value(m_ip.c_str(), allocator).Move(), allocator);
      }
  
      if (m_portHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "Port";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, Value(m_port.c_str(), allocator).Move(), allocator);
      }
  
      if (m_protoHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "Proto";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, Value(m_proto.c_str(), allocator).Move(), allocator);
      }
  
  }
  
  
  string SecurityGroupsInboundAndOutbound::GetAction() const
  {
      return m_action;
  }
  
  void SecurityGroupsInboundAndOutbound::SetAction(const string& _action)
  {
      m_action = _action;
      m_actionHasBeenSet = true;
  }
  
  bool SecurityGroupsInboundAndOutbound::ActionHasBeenSet() const
  {
      return m_actionHasBeenSet;
  }
  
  string SecurityGroupsInboundAndOutbound::GetIp() const
  {
      return m_ip;
  }
  
  void SecurityGroupsInboundAndOutbound::SetIp(const string& _ip)
  {
      m_ip = _ip;
      m_ipHasBeenSet = true;
  }
  
  bool SecurityGroupsInboundAndOutbound::IpHasBeenSet() const
  {
      return m_ipHasBeenSet;
  }
  
  string SecurityGroupsInboundAndOutbound::GetPort() const
  {
      return m_port;
  }
  
  void SecurityGroupsInboundAndOutbound::SetPort(const string& _port)
  {
      m_port = _port;
      m_portHasBeenSet = true;
  }
  
  bool SecurityGroupsInboundAndOutbound::PortHasBeenSet() const
  {
      return m_portHasBeenSet;
  }
  
  string SecurityGroupsInboundAndOutbound::GetProto() const
  {
      return m_proto;
  }
  
  void SecurityGroupsInboundAndOutbound::SetProto(const string& _proto)
  {
      m_proto = _proto;
      m_protoHasBeenSet = true;
  }
  
  bool SecurityGroupsInboundAndOutbound::ProtoHasBeenSet() const
  {
      return m_protoHasBeenSet;
  }
  
  