use crate::frame::enums::{Parameters, Response};
use crate::frame::parameters::configuration;
impl TryFrom<Parameters> for configuration::add_endpoint::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(
configuration::Response::AddEndpoint(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::get_configuration_value::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(
configuration::Response::GetConfigurationValue(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::get_extended_value::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(
configuration::Response::GetExtendedValue(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::get_policy::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(configuration::Response::GetPolicy(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::get_value::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(configuration::Response::GetValue(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::read_attribute::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(
configuration::Response::ReadAttribute(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::send_pan_id_update::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(
configuration::Response::SendPanIdUpdate(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::set_configuration_value::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(
configuration::Response::SetConfigurationValue(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::set_passive_ack_config::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(
configuration::Response::SetPassiveAckConfig(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::set_policy::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(configuration::Response::SetPolicy(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::set_value::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(configuration::Response::SetValue(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::version::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(configuration::Response::Version(
response,
))) => Ok(response),
_ => Err(parameters),
}
}
}
impl TryFrom<Parameters> for configuration::write_attribute::Response {
type Error = Parameters;
fn try_from(parameters: Parameters) -> Result<Self, Self::Error> {
match parameters {
Parameters::Response(Response::Configuration(
configuration::Response::WriteAttribute(response),
)) => Ok(response),
_ => Err(parameters),
}
}
}