#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};



#[link(name = "interface_protocol__rosidl_typesupport_c")]
extern "C" {
    fn rosidl_typesupport_c__get_message_type_support_handle__interface_protocol__srv__EnableMotor_Request() -> *const std::ffi::c_void;
}

#[link(name = "interface_protocol__rosidl_generator_c")]
extern "C" {
    fn interface_protocol__srv__EnableMotor_Request__init(msg: *mut EnableMotor_Request) -> bool;
    fn interface_protocol__srv__EnableMotor_Request__Sequence__init(seq: *mut rosidl_runtime_rs::Sequence<EnableMotor_Request>, size: usize) -> bool;
    fn interface_protocol__srv__EnableMotor_Request__Sequence__fini(seq: *mut rosidl_runtime_rs::Sequence<EnableMotor_Request>);
    fn interface_protocol__srv__EnableMotor_Request__Sequence__copy(in_seq: &rosidl_runtime_rs::Sequence<EnableMotor_Request>, out_seq: *mut rosidl_runtime_rs::Sequence<EnableMotor_Request>) -> bool;
}

// Corresponds to interface_protocol__srv__EnableMotor_Request
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]


// This struct is not documented.
#[allow(missing_docs)]

#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct EnableMotor_Request {

    // This member is not documented.
    #[allow(missing_docs)]
    pub enable: bool,

}



impl Default for EnableMotor_Request {
  fn default() -> Self {
    unsafe {
      let mut msg = std::mem::zeroed();
      if !interface_protocol__srv__EnableMotor_Request__init(&mut msg as *mut _) {
        panic!("Call to interface_protocol__srv__EnableMotor_Request__init() failed");
      }
      msg
    }
  }
}

impl rosidl_runtime_rs::SequenceAlloc for EnableMotor_Request {
  fn sequence_init(seq: &mut rosidl_runtime_rs::Sequence<Self>, size: usize) -> bool {
    // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
    unsafe { interface_protocol__srv__EnableMotor_Request__Sequence__init(seq as *mut _, size) }
  }
  fn sequence_fini(seq: &mut rosidl_runtime_rs::Sequence<Self>) {
    // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
    unsafe { interface_protocol__srv__EnableMotor_Request__Sequence__fini(seq as *mut _) }
  }
  fn sequence_copy(in_seq: &rosidl_runtime_rs::Sequence<Self>, out_seq: &mut rosidl_runtime_rs::Sequence<Self>) -> bool {
    // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
    unsafe { interface_protocol__srv__EnableMotor_Request__Sequence__copy(in_seq, out_seq as *mut _) }
  }
}

impl rosidl_runtime_rs::Message for EnableMotor_Request {
  type RmwMsg = Self;
  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> { msg_cow }
  fn from_rmw_message(msg: Self::RmwMsg) -> Self { msg }
}

impl rosidl_runtime_rs::RmwMessage for EnableMotor_Request where Self: Sized {
  const TYPE_NAME: &'static str = "interface_protocol/srv/EnableMotor_Request";
  fn get_type_support() -> *const std::ffi::c_void {
    // SAFETY: No preconditions for this function.
    unsafe { rosidl_typesupport_c__get_message_type_support_handle__interface_protocol__srv__EnableMotor_Request() }
  }
}


#[link(name = "interface_protocol__rosidl_typesupport_c")]
extern "C" {
    fn rosidl_typesupport_c__get_message_type_support_handle__interface_protocol__srv__EnableMotor_Response() -> *const std::ffi::c_void;
}

#[link(name = "interface_protocol__rosidl_generator_c")]
extern "C" {
    fn interface_protocol__srv__EnableMotor_Response__init(msg: *mut EnableMotor_Response) -> bool;
    fn interface_protocol__srv__EnableMotor_Response__Sequence__init(seq: *mut rosidl_runtime_rs::Sequence<EnableMotor_Response>, size: usize) -> bool;
    fn interface_protocol__srv__EnableMotor_Response__Sequence__fini(seq: *mut rosidl_runtime_rs::Sequence<EnableMotor_Response>);
    fn interface_protocol__srv__EnableMotor_Response__Sequence__copy(in_seq: &rosidl_runtime_rs::Sequence<EnableMotor_Response>, out_seq: *mut rosidl_runtime_rs::Sequence<EnableMotor_Response>) -> bool;
}

// Corresponds to interface_protocol__srv__EnableMotor_Response
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]


// This struct is not documented.
#[allow(missing_docs)]

#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct EnableMotor_Response {

    // This member is not documented.
    #[allow(missing_docs)]
    pub success: bool,


    // This member is not documented.
    #[allow(missing_docs)]
    pub message: rosidl_runtime_rs::String,

}



impl Default for EnableMotor_Response {
  fn default() -> Self {
    unsafe {
      let mut msg = std::mem::zeroed();
      if !interface_protocol__srv__EnableMotor_Response__init(&mut msg as *mut _) {
        panic!("Call to interface_protocol__srv__EnableMotor_Response__init() failed");
      }
      msg
    }
  }
}

impl rosidl_runtime_rs::SequenceAlloc for EnableMotor_Response {
  fn sequence_init(seq: &mut rosidl_runtime_rs::Sequence<Self>, size: usize) -> bool {
    // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
    unsafe { interface_protocol__srv__EnableMotor_Response__Sequence__init(seq as *mut _, size) }
  }
  fn sequence_fini(seq: &mut rosidl_runtime_rs::Sequence<Self>) {
    // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
    unsafe { interface_protocol__srv__EnableMotor_Response__Sequence__fini(seq as *mut _) }
  }
  fn sequence_copy(in_seq: &rosidl_runtime_rs::Sequence<Self>, out_seq: &mut rosidl_runtime_rs::Sequence<Self>) -> bool {
    // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
    unsafe { interface_protocol__srv__EnableMotor_Response__Sequence__copy(in_seq, out_seq as *mut _) }
  }
}

impl rosidl_runtime_rs::Message for EnableMotor_Response {
  type RmwMsg = Self;
  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> { msg_cow }
  fn from_rmw_message(msg: Self::RmwMsg) -> Self { msg }
}

impl rosidl_runtime_rs::RmwMessage for EnableMotor_Response where Self: Sized {
  const TYPE_NAME: &'static str = "interface_protocol/srv/EnableMotor_Response";
  fn get_type_support() -> *const std::ffi::c_void {
    // SAFETY: No preconditions for this function.
    unsafe { rosidl_typesupport_c__get_message_type_support_handle__interface_protocol__srv__EnableMotor_Response() }
  }
}






#[link(name = "interface_protocol__rosidl_typesupport_c")]
extern "C" {
    fn rosidl_typesupport_c__get_service_type_support_handle__interface_protocol__srv__EnableMotor() -> *const std::ffi::c_void;
}

// Corresponds to interface_protocol__srv__EnableMotor
#[allow(missing_docs, non_camel_case_types)]
pub struct EnableMotor;

impl rosidl_runtime_rs::Service for EnableMotor {
    type Request = EnableMotor_Request;
    type Response = EnableMotor_Response;

    fn get_type_support() -> *const std::ffi::c_void {
        // SAFETY: No preconditions for this function.
        unsafe { rosidl_typesupport_c__get_service_type_support_handle__interface_protocol__srv__EnableMotor() }
    }
}


