// generated from rosidl_generator_cpp/resource/idl__traits.hpp.em
// with input from interface_protocol:msg/JointMotionPlanRequest.idl
// generated code does not contain a copyright notice

#ifndef INTERFACE_PROTOCOL__MSG__DETAIL__JOINT_MOTION_PLAN_REQUEST__TRAITS_HPP_
#define INTERFACE_PROTOCOL__MSG__DETAIL__JOINT_MOTION_PLAN_REQUEST__TRAITS_HPP_

#include <stdint.h>

#include <sstream>
#include <string>
#include <type_traits>

#include "interface_protocol/msg/detail/joint_motion_plan_request__struct.hpp"
#include "rosidl_runtime_cpp/traits.hpp"

namespace interface_protocol
{

namespace msg
{

inline void to_flow_style_yaml(
  const JointMotionPlanRequest & msg,
  std::ostream & out)
{
  out << "{";
  // member: request_id
  {
    out << "request_id: ";
    rosidl_generator_traits::value_to_yaml(msg.request_id, out);
    out << ", ";
  }

  // member: request_type
  {
    out << "request_type: ";
    rosidl_generator_traits::value_to_yaml(msg.request_type, out);
    out << ", ";
  }

  // member: use_gravity_compensation
  {
    out << "use_gravity_compensation: ";
    rosidl_generator_traits::value_to_yaml(msg.use_gravity_compensation, out);
    out << ", ";
  }

  // member: joint_indices
  {
    if (msg.joint_indices.size() == 0) {
      out << "joint_indices: []";
    } else {
      out << "joint_indices: [";
      size_t pending_items = msg.joint_indices.size();
      for (auto item : msg.joint_indices) {
        rosidl_generator_traits::value_to_yaml(item, out);
        if (--pending_items > 0) {
          out << ", ";
        }
      }
      out << "]";
    }
    out << ", ";
  }

  // member: target_positions
  {
    if (msg.target_positions.size() == 0) {
      out << "target_positions: []";
    } else {
      out << "target_positions: [";
      size_t pending_items = msg.target_positions.size();
      for (auto item : msg.target_positions) {
        rosidl_generator_traits::value_to_yaml(item, out);
        if (--pending_items > 0) {
          out << ", ";
        }
      }
      out << "]";
    }
    out << ", ";
  }

  // member: target_velocities
  {
    if (msg.target_velocities.size() == 0) {
      out << "target_velocities: []";
    } else {
      out << "target_velocities: [";
      size_t pending_items = msg.target_velocities.size();
      for (auto item : msg.target_velocities) {
        rosidl_generator_traits::value_to_yaml(item, out);
        if (--pending_items > 0) {
          out << ", ";
        }
      }
      out << "]";
    }
    out << ", ";
  }

  // member: execution_time
  {
    out << "execution_time: ";
    rosidl_generator_traits::value_to_yaml(msg.execution_time, out);
    out << ", ";
  }

  // member: stiffness
  {
    if (msg.stiffness.size() == 0) {
      out << "stiffness: []";
    } else {
      out << "stiffness: [";
      size_t pending_items = msg.stiffness.size();
      for (auto item : msg.stiffness) {
        rosidl_generator_traits::value_to_yaml(item, out);
        if (--pending_items > 0) {
          out << ", ";
        }
      }
      out << "]";
    }
    out << ", ";
  }

  // member: damping
  {
    if (msg.damping.size() == 0) {
      out << "damping: []";
    } else {
      out << "damping: [";
      size_t pending_items = msg.damping.size();
      for (auto item : msg.damping) {
        rosidl_generator_traits::value_to_yaml(item, out);
        if (--pending_items > 0) {
          out << ", ";
        }
      }
      out << "]";
    }
  }
  out << "}";
}  // NOLINT(readability/fn_size)

inline void to_block_style_yaml(
  const JointMotionPlanRequest & msg,
  std::ostream & out, size_t indentation = 0)
{
  // member: request_id
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    out << "request_id: ";
    rosidl_generator_traits::value_to_yaml(msg.request_id, out);
    out << "\n";
  }

  // member: request_type
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    out << "request_type: ";
    rosidl_generator_traits::value_to_yaml(msg.request_type, out);
    out << "\n";
  }

  // member: use_gravity_compensation
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    out << "use_gravity_compensation: ";
    rosidl_generator_traits::value_to_yaml(msg.use_gravity_compensation, out);
    out << "\n";
  }

  // member: joint_indices
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    if (msg.joint_indices.size() == 0) {
      out << "joint_indices: []\n";
    } else {
      out << "joint_indices:\n";
      for (auto item : msg.joint_indices) {
        if (indentation > 0) {
          out << std::string(indentation, ' ');
        }
        out << "- ";
        rosidl_generator_traits::value_to_yaml(item, out);
        out << "\n";
      }
    }
  }

  // member: target_positions
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    if (msg.target_positions.size() == 0) {
      out << "target_positions: []\n";
    } else {
      out << "target_positions:\n";
      for (auto item : msg.target_positions) {
        if (indentation > 0) {
          out << std::string(indentation, ' ');
        }
        out << "- ";
        rosidl_generator_traits::value_to_yaml(item, out);
        out << "\n";
      }
    }
  }

  // member: target_velocities
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    if (msg.target_velocities.size() == 0) {
      out << "target_velocities: []\n";
    } else {
      out << "target_velocities:\n";
      for (auto item : msg.target_velocities) {
        if (indentation > 0) {
          out << std::string(indentation, ' ');
        }
        out << "- ";
        rosidl_generator_traits::value_to_yaml(item, out);
        out << "\n";
      }
    }
  }

  // member: execution_time
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    out << "execution_time: ";
    rosidl_generator_traits::value_to_yaml(msg.execution_time, out);
    out << "\n";
  }

  // member: stiffness
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    if (msg.stiffness.size() == 0) {
      out << "stiffness: []\n";
    } else {
      out << "stiffness:\n";
      for (auto item : msg.stiffness) {
        if (indentation > 0) {
          out << std::string(indentation, ' ');
        }
        out << "- ";
        rosidl_generator_traits::value_to_yaml(item, out);
        out << "\n";
      }
    }
  }

  // member: damping
  {
    if (indentation > 0) {
      out << std::string(indentation, ' ');
    }
    if (msg.damping.size() == 0) {
      out << "damping: []\n";
    } else {
      out << "damping:\n";
      for (auto item : msg.damping) {
        if (indentation > 0) {
          out << std::string(indentation, ' ');
        }
        out << "- ";
        rosidl_generator_traits::value_to_yaml(item, out);
        out << "\n";
      }
    }
  }
}  // NOLINT(readability/fn_size)

inline std::string to_yaml(const JointMotionPlanRequest & msg, bool use_flow_style = false)
{
  std::ostringstream out;
  if (use_flow_style) {
    to_flow_style_yaml(msg, out);
  } else {
    to_block_style_yaml(msg, out);
  }
  return out.str();
}

}  // namespace msg

}  // namespace interface_protocol

namespace rosidl_generator_traits
{

[[deprecated("use interface_protocol::msg::to_block_style_yaml() instead")]]
inline void to_yaml(
  const interface_protocol::msg::JointMotionPlanRequest & msg,
  std::ostream & out, size_t indentation = 0)
{
  interface_protocol::msg::to_block_style_yaml(msg, out, indentation);
}

[[deprecated("use interface_protocol::msg::to_yaml() instead")]]
inline std::string to_yaml(const interface_protocol::msg::JointMotionPlanRequest & msg)
{
  return interface_protocol::msg::to_yaml(msg);
}

template<>
inline const char * data_type<interface_protocol::msg::JointMotionPlanRequest>()
{
  return "interface_protocol::msg::JointMotionPlanRequest";
}

template<>
inline const char * name<interface_protocol::msg::JointMotionPlanRequest>()
{
  return "interface_protocol/msg/JointMotionPlanRequest";
}

template<>
struct has_fixed_size<interface_protocol::msg::JointMotionPlanRequest>
  : std::integral_constant<bool, false> {};

template<>
struct has_bounded_size<interface_protocol::msg::JointMotionPlanRequest>
  : std::integral_constant<bool, false> {};

template<>
struct is_message<interface_protocol::msg::JointMotionPlanRequest>
  : std::true_type {};

}  // namespace rosidl_generator_traits

#endif  // INTERFACE_PROTOCOL__MSG__DETAIL__JOINT_MOTION_PLAN_REQUEST__TRAITS_HPP_
