// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_inbound_x12_transaction_settings_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::CreateInboundX12TransactionSettingsOutput,
    crate::error::CreateInboundX12TransactionSettingsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::CreateInboundX12TransactionSettingsError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::CreateInboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::CreateInboundX12TransactionSettingsErrorKind::OperationConflictError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::operation_conflict_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ResourceConflictException" => crate::error::CreateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::ResourceConflictError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::resource_conflict_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_resource_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "AccessDeniedException" => crate::error::CreateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::CreateInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::BadRequestError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::bad_request_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "GatewayTimeoutException" => crate::error::CreateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::GatewayTimeoutError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::gateway_timeout_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "InternalFailureException" => crate::error::CreateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::InternalFailureError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::internal_failure_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "QuotaExceededException" => crate::error::CreateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::CreateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::ResourceNotFoundError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::resource_not_found_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ServiceUnavailableException" => crate::error::CreateInboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::CreateInboundX12TransactionSettingsErrorKind::ServiceUnavailableError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::service_unavailable_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ThrottlingException" => {
            crate::error::CreateInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::ThrottlingError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::throttling_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "UnauthorizedException" => {
            crate::error::CreateInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::CreateInboundX12TransactionSettingsErrorKind::UnauthorizedError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::unauthorized_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        _ => crate::error::CreateInboundX12TransactionSettingsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_inbound_x12_transaction_settings_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::CreateInboundX12TransactionSettingsOutput,
    crate::error::CreateInboundX12TransactionSettingsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::create_inbound_x12_transaction_settings_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_create_inbound_x12_transaction_settings(response.body().as_ref(), output).map_err(crate::error::CreateInboundX12TransactionSettingsError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_outbound_x12_transaction_settings_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::CreateOutboundX12TransactionSettingsOutput,
    crate::error::CreateOutboundX12TransactionSettingsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::CreateOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::CreateOutboundX12TransactionSettingsErrorKind::OperationConflictError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::operation_conflict_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ResourceConflictException" => crate::error::CreateOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::CreateOutboundX12TransactionSettingsErrorKind::ResourceConflictError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::resource_conflict_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_resource_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "AccessDeniedException" => crate::error::CreateOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateOutboundX12TransactionSettingsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::CreateOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::CreateOutboundX12TransactionSettingsErrorKind::BadRequestError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::bad_request_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "GatewayTimeoutException" => crate::error::CreateOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateOutboundX12TransactionSettingsErrorKind::GatewayTimeoutError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::gateway_timeout_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "InternalFailureException" => crate::error::CreateOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateOutboundX12TransactionSettingsErrorKind::InternalFailureError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::internal_failure_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "QuotaExceededException" => crate::error::CreateOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::CreateOutboundX12TransactionSettingsErrorKind::QuotaExceededError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::quota_exceeded_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ResourceNotFoundException" => crate::error::CreateOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::CreateOutboundX12TransactionSettingsErrorKind::ResourceNotFoundError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::resource_not_found_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ServiceUnavailableException" => crate::error::CreateOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::CreateOutboundX12TransactionSettingsErrorKind::ServiceUnavailableError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::service_unavailable_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ThrottlingException" => {
            crate::error::CreateOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::CreateOutboundX12TransactionSettingsErrorKind::ThrottlingError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::throttling_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "UnauthorizedException" => {
            crate::error::CreateOutboundX12TransactionSettingsError {
                meta: generic,
                kind:
                    crate::error::CreateOutboundX12TransactionSettingsErrorKind::UnauthorizedError(
                        {
                            #[allow(unused_mut)]
                            let mut tmp = {
                                #[allow(unused_mut)]
                                let mut output =
                                    crate::error::unauthorized_error::Builder::default();
                                let _ = response;
                                output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
                                output.build()
                            };
                            if tmp.message.is_none() {
                                tmp.message = _error_message;
                            }
                            tmp
                        },
                    ),
            }
        }
        _ => crate::error::CreateOutboundX12TransactionSettingsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_outbound_x12_transaction_settings_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::CreateOutboundX12TransactionSettingsOutput,
    crate::error::CreateOutboundX12TransactionSettingsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::create_outbound_x12_transaction_settings_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_create_outbound_x12_transaction_settings(response.body().as_ref(), output).map_err(crate::error::CreateOutboundX12TransactionSettingsError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_x12_bucket_connection_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::CreateX12BucketConnectionOutput,
    crate::error::CreateX12BucketConnectionError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::CreateX12BucketConnectionError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::CreateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::CreateX12BucketConnectionErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceConflictException" => crate::error::CreateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::CreateX12BucketConnectionErrorKind::ResourceConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::CreateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::CreateX12BucketConnectionErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::CreateX12BucketConnectionError {
                meta: generic,
                kind: crate::error::CreateX12BucketConnectionErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::CreateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::CreateX12BucketConnectionErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::CreateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::CreateX12BucketConnectionErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::CreateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::CreateX12BucketConnectionErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::CreateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::CreateX12BucketConnectionErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::CreateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::CreateX12BucketConnectionErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::CreateX12BucketConnectionError {
                meta: generic,
                kind: crate::error::CreateX12BucketConnectionErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::CreateX12BucketConnectionError {
                meta: generic,
                kind: crate::error::CreateX12BucketConnectionErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::CreateX12BucketConnectionError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_x12_bucket_connection_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::CreateX12BucketConnectionOutput,
    crate::error::CreateX12BucketConnectionError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::create_x12_bucket_connection_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_create_x12_bucket_connection(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::CreateX12BucketConnectionError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_x12_partnership_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::CreateX12PartnershipOutput,
    crate::error::CreateX12PartnershipError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::CreateX12PartnershipError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::CreateX12PartnershipError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::CreateX12PartnershipError {
            meta: generic,
            kind: crate::error::CreateX12PartnershipErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceConflictException" => crate::error::CreateX12PartnershipError {
            meta: generic,
            kind: crate::error::CreateX12PartnershipErrorKind::ResourceConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::CreateX12PartnershipError {
            meta: generic,
            kind: crate::error::CreateX12PartnershipErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::CreateX12PartnershipError {
                meta: generic,
                kind: crate::error::CreateX12PartnershipErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::CreateX12PartnershipError {
            meta: generic,
            kind: crate::error::CreateX12PartnershipErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::CreateX12PartnershipError {
            meta: generic,
            kind: crate::error::CreateX12PartnershipErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::CreateX12PartnershipError {
            meta: generic,
            kind: crate::error::CreateX12PartnershipErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::CreateX12PartnershipError {
            meta: generic,
            kind: crate::error::CreateX12PartnershipErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::CreateX12PartnershipError {
            meta: generic,
            kind: crate::error::CreateX12PartnershipErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::CreateX12PartnershipError {
                meta: generic,
                kind: crate::error::CreateX12PartnershipErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::CreateX12PartnershipError {
                meta: generic,
                kind: crate::error::CreateX12PartnershipErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::CreateX12PartnershipError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_x12_partnership_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::CreateX12PartnershipOutput,
    crate::error::CreateX12PartnershipError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::create_x12_partnership_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_create_x12_partnership(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::CreateX12PartnershipError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_x12_profile_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateX12ProfileOutput, crate::error::CreateX12ProfileError>
{
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::CreateX12ProfileError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::CreateX12ProfileError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::CreateX12ProfileError {
            meta: generic,
            kind: crate::error::CreateX12ProfileErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceConflictException" => crate::error::CreateX12ProfileError {
            meta: generic,
            kind: crate::error::CreateX12ProfileErrorKind::ResourceConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::CreateX12ProfileError {
            meta: generic,
            kind: crate::error::CreateX12ProfileErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::CreateX12ProfileError {
                meta: generic,
                kind: crate::error::CreateX12ProfileErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::CreateX12ProfileError {
            meta: generic,
            kind: crate::error::CreateX12ProfileErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::CreateX12ProfileError {
            meta: generic,
            kind: crate::error::CreateX12ProfileErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::CreateX12ProfileError {
            meta: generic,
            kind: crate::error::CreateX12ProfileErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::CreateX12ProfileError {
            meta: generic,
            kind: crate::error::CreateX12ProfileErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::CreateX12ProfileError {
            meta: generic,
            kind: crate::error::CreateX12ProfileErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::CreateX12ProfileError {
                meta: generic,
                kind: crate::error::CreateX12ProfileErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::CreateX12ProfileError {
                meta: generic,
                kind: crate::error::CreateX12ProfileErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::CreateX12ProfileError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_x12_profile_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateX12ProfileOutput, crate::error::CreateX12ProfileError>
{
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::create_x12_profile_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_create_x12_profile(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::CreateX12ProfileError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_inbound_x12_transaction_settings_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::DeleteInboundX12TransactionSettingsOutput,
    crate::error::DeleteInboundX12TransactionSettingsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::DeleteInboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::DeleteInboundX12TransactionSettingsErrorKind::OperationConflictError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::operation_conflict_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "AccessDeniedException" => crate::error::DeleteInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteInboundX12TransactionSettingsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::DeleteInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::DeleteInboundX12TransactionSettingsErrorKind::BadRequestError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::bad_request_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "GatewayTimeoutException" => crate::error::DeleteInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteInboundX12TransactionSettingsErrorKind::GatewayTimeoutError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::gateway_timeout_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "InternalFailureException" => crate::error::DeleteInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteInboundX12TransactionSettingsErrorKind::InternalFailureError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::internal_failure_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "QuotaExceededException" => crate::error::DeleteInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteInboundX12TransactionSettingsErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::DeleteInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteInboundX12TransactionSettingsErrorKind::ResourceNotFoundError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::resource_not_found_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ServiceUnavailableException" => crate::error::DeleteInboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::DeleteInboundX12TransactionSettingsErrorKind::ServiceUnavailableError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::service_unavailable_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ThrottlingException" => {
            crate::error::DeleteInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::DeleteInboundX12TransactionSettingsErrorKind::ThrottlingError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::throttling_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "UnauthorizedException" => {
            crate::error::DeleteInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::DeleteInboundX12TransactionSettingsErrorKind::UnauthorizedError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::unauthorized_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        _ => crate::error::DeleteInboundX12TransactionSettingsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_inbound_x12_transaction_settings_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::DeleteInboundX12TransactionSettingsOutput,
    crate::error::DeleteInboundX12TransactionSettingsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::delete_inbound_x12_transaction_settings_output::Builder::default();
        let _ = response;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_outbound_x12_transaction_settings_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::DeleteOutboundX12TransactionSettingsOutput,
    crate::error::DeleteOutboundX12TransactionSettingsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::DeleteOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::DeleteOutboundX12TransactionSettingsErrorKind::OperationConflictError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::operation_conflict_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "AccessDeniedException" => crate::error::DeleteOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteOutboundX12TransactionSettingsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::DeleteOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::DeleteOutboundX12TransactionSettingsErrorKind::BadRequestError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::bad_request_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "GatewayTimeoutException" => crate::error::DeleteOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteOutboundX12TransactionSettingsErrorKind::GatewayTimeoutError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::gateway_timeout_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "InternalFailureException" => crate::error::DeleteOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteOutboundX12TransactionSettingsErrorKind::InternalFailureError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::internal_failure_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "QuotaExceededException" => crate::error::DeleteOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::DeleteOutboundX12TransactionSettingsErrorKind::QuotaExceededError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::quota_exceeded_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ResourceNotFoundException" => crate::error::DeleteOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::DeleteOutboundX12TransactionSettingsErrorKind::ResourceNotFoundError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::resource_not_found_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ServiceUnavailableException" => crate::error::DeleteOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::DeleteOutboundX12TransactionSettingsErrorKind::ServiceUnavailableError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::service_unavailable_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ThrottlingException" => {
            crate::error::DeleteOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::DeleteOutboundX12TransactionSettingsErrorKind::ThrottlingError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::throttling_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "UnauthorizedException" => {
            crate::error::DeleteOutboundX12TransactionSettingsError {
                meta: generic,
                kind:
                    crate::error::DeleteOutboundX12TransactionSettingsErrorKind::UnauthorizedError(
                        {
                            #[allow(unused_mut)]
                            let mut tmp = {
                                #[allow(unused_mut)]
                                let mut output =
                                    crate::error::unauthorized_error::Builder::default();
                                let _ = response;
                                output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOutboundX12TransactionSettingsError::unhandled)?;
                                output.build()
                            };
                            if tmp.message.is_none() {
                                tmp.message = _error_message;
                            }
                            tmp
                        },
                    ),
            }
        }
        _ => crate::error::DeleteOutboundX12TransactionSettingsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_outbound_x12_transaction_settings_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::DeleteOutboundX12TransactionSettingsOutput,
    crate::error::DeleteOutboundX12TransactionSettingsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::delete_outbound_x12_transaction_settings_output::Builder::default();
        let _ = response;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_x12_bucket_connection_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::DeleteX12BucketConnectionOutput,
    crate::error::DeleteX12BucketConnectionError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::DeleteX12BucketConnectionError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::DeleteX12BucketConnectionError {
            meta: generic,
            kind: crate::error::DeleteX12BucketConnectionErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::DeleteX12BucketConnectionError {
            meta: generic,
            kind: crate::error::DeleteX12BucketConnectionErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::DeleteX12BucketConnectionError {
                meta: generic,
                kind: crate::error::DeleteX12BucketConnectionErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::DeleteX12BucketConnectionError {
            meta: generic,
            kind: crate::error::DeleteX12BucketConnectionErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::DeleteX12BucketConnectionError {
            meta: generic,
            kind: crate::error::DeleteX12BucketConnectionErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::DeleteX12BucketConnectionError {
            meta: generic,
            kind: crate::error::DeleteX12BucketConnectionErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::DeleteX12BucketConnectionError {
            meta: generic,
            kind: crate::error::DeleteX12BucketConnectionErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::DeleteX12BucketConnectionError {
            meta: generic,
            kind: crate::error::DeleteX12BucketConnectionErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::DeleteX12BucketConnectionError {
                meta: generic,
                kind: crate::error::DeleteX12BucketConnectionErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::DeleteX12BucketConnectionError {
                meta: generic,
                kind: crate::error::DeleteX12BucketConnectionErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::DeleteX12BucketConnectionError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_x12_bucket_connection_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::DeleteX12BucketConnectionOutput,
    crate::error::DeleteX12BucketConnectionError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::delete_x12_bucket_connection_output::Builder::default();
        let _ = response;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_x12_partnership_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::DeleteX12PartnershipOutput,
    crate::error::DeleteX12PartnershipError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::DeleteX12PartnershipError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::DeleteX12PartnershipError {
            meta: generic,
            kind: crate::error::DeleteX12PartnershipErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::DeleteX12PartnershipError {
            meta: generic,
            kind: crate::error::DeleteX12PartnershipErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::DeleteX12PartnershipError {
                meta: generic,
                kind: crate::error::DeleteX12PartnershipErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::DeleteX12PartnershipError {
            meta: generic,
            kind: crate::error::DeleteX12PartnershipErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::DeleteX12PartnershipError {
            meta: generic,
            kind: crate::error::DeleteX12PartnershipErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::DeleteX12PartnershipError {
            meta: generic,
            kind: crate::error::DeleteX12PartnershipErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::DeleteX12PartnershipError {
            meta: generic,
            kind: crate::error::DeleteX12PartnershipErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::DeleteX12PartnershipError {
            meta: generic,
            kind: crate::error::DeleteX12PartnershipErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::DeleteX12PartnershipError {
                meta: generic,
                kind: crate::error::DeleteX12PartnershipErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::DeleteX12PartnershipError {
                meta: generic,
                kind: crate::error::DeleteX12PartnershipErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::DeleteX12PartnershipError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_x12_partnership_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::DeleteX12PartnershipOutput,
    crate::error::DeleteX12PartnershipError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::delete_x12_partnership_output::Builder::default();
        let _ = response;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_x12_profile_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteX12ProfileOutput, crate::error::DeleteX12ProfileError>
{
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::DeleteX12ProfileError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::DeleteX12ProfileError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::DeleteX12ProfileError {
            meta: generic,
            kind: crate::error::DeleteX12ProfileErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::DeleteX12ProfileError {
            meta: generic,
            kind: crate::error::DeleteX12ProfileErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::DeleteX12ProfileError {
                meta: generic,
                kind: crate::error::DeleteX12ProfileErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::DeleteX12ProfileError {
            meta: generic,
            kind: crate::error::DeleteX12ProfileErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::DeleteX12ProfileError {
            meta: generic,
            kind: crate::error::DeleteX12ProfileErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::DeleteX12ProfileError {
            meta: generic,
            kind: crate::error::DeleteX12ProfileErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::DeleteX12ProfileError {
            meta: generic,
            kind: crate::error::DeleteX12ProfileErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::DeleteX12ProfileError {
            meta: generic,
            kind: crate::error::DeleteX12ProfileErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::DeleteX12ProfileError {
                meta: generic,
                kind: crate::error::DeleteX12ProfileErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::DeleteX12ProfileError {
                meta: generic,
                kind: crate::error::DeleteX12ProfileErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::DeleteX12ProfileError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_delete_x12_profile_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteX12ProfileOutput, crate::error::DeleteX12ProfileError>
{
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::delete_x12_profile_output::Builder::default();
        let _ = response;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_generate_edi_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GenerateEdiOutput, crate::error::GenerateEdiError> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GenerateEdiError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::GenerateEdiError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GenerateEdiError {
            meta: generic,
            kind: crate::error::GenerateEdiErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GenerateEdiError {
                meta: generic,
                kind: crate::error::GenerateEdiErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GenerateEdiError {
            meta: generic,
            kind: crate::error::GenerateEdiErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GenerateEdiError {
            meta: generic,
            kind: crate::error::GenerateEdiErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GenerateEdiError {
            meta: generic,
            kind: crate::error::GenerateEdiErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GenerateEdiError {
            meta: generic,
            kind: crate::error::GenerateEdiErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GenerateEdiError {
            meta: generic,
            kind: crate::error::GenerateEdiErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::GenerateEdiError {
                meta: generic,
                kind: crate::error::GenerateEdiErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GenerateEdiError {
                meta: generic,
                kind: crate::error::GenerateEdiErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateEdiError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GenerateEdiError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_generate_edi_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GenerateEdiOutput, crate::error::GenerateEdiError> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::generate_edi_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_generate_edi(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::GenerateEdiError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_inbound_x12_transaction_settings_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetInboundX12TransactionSettingsOutput,
    crate::error::GetInboundX12TransactionSettingsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::GetInboundX12TransactionSettingsError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetInboundX12TransactionSettingsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::GetInboundX12TransactionSettingsErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetInboundX12TransactionSettingsErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetInboundX12TransactionSettingsErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetInboundX12TransactionSettingsErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetInboundX12TransactionSettingsErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GetInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetInboundX12TransactionSettingsErrorKind::ServiceUnavailableError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output =
                            crate::error::service_unavailable_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ThrottlingException" => {
            crate::error::GetInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::GetInboundX12TransactionSettingsErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::GetInboundX12TransactionSettingsErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GetInboundX12TransactionSettingsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_inbound_x12_transaction_settings_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetInboundX12TransactionSettingsOutput,
    crate::error::GetInboundX12TransactionSettingsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::get_inbound_x12_transaction_settings_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_get_inbound_x12_transaction_settings(response.body().as_ref(), output).map_err(crate::error::GetInboundX12TransactionSettingsError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_outbound_x12_control_numbers_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetOutboundX12ControlNumbersOutput,
    crate::error::GetOutboundX12ControlNumbersError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::GetOutboundX12ControlNumbersError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetOutboundX12ControlNumbersError {
            meta: generic,
            kind: crate::error::GetOutboundX12ControlNumbersErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetOutboundX12ControlNumbersError {
                meta: generic,
                kind: crate::error::GetOutboundX12ControlNumbersErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetOutboundX12ControlNumbersError {
            meta: generic,
            kind: crate::error::GetOutboundX12ControlNumbersErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetOutboundX12ControlNumbersError {
            meta: generic,
            kind: crate::error::GetOutboundX12ControlNumbersErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetOutboundX12ControlNumbersError {
            meta: generic,
            kind: crate::error::GetOutboundX12ControlNumbersErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetOutboundX12ControlNumbersError {
            meta: generic,
            kind: crate::error::GetOutboundX12ControlNumbersErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GetOutboundX12ControlNumbersError {
            meta: generic,
            kind: crate::error::GetOutboundX12ControlNumbersErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::GetOutboundX12ControlNumbersError {
                meta: generic,
                kind: crate::error::GetOutboundX12ControlNumbersErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetOutboundX12ControlNumbersError {
                meta: generic,
                kind: crate::error::GetOutboundX12ControlNumbersErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GetOutboundX12ControlNumbersError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_outbound_x12_control_numbers_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetOutboundX12ControlNumbersOutput,
    crate::error::GetOutboundX12ControlNumbersError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::get_outbound_x12_control_numbers_output::Builder::default();
        let _ = response;
        output =
            crate::json_deser::deser_operation_crate_operation_get_outbound_x12_control_numbers(
                response.body().as_ref(),
                output,
            )
            .map_err(crate::error::GetOutboundX12ControlNumbersError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_outbound_x12_transaction_settings_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetOutboundX12TransactionSettingsOutput,
    crate::error::GetOutboundX12TransactionSettingsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::GetOutboundX12TransactionSettingsError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::ResourceNotFoundError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::resource_not_found_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ServiceUnavailableException" => crate::error::GetOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::ServiceUnavailableError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output =
                            crate::error::service_unavailable_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ThrottlingException" => {
            crate::error::GetOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::GetOutboundX12TransactionSettingsErrorKind::UnauthorizedError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::unauthorized_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        _ => crate::error::GetOutboundX12TransactionSettingsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_outbound_x12_transaction_settings_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetOutboundX12TransactionSettingsOutput,
    crate::error::GetOutboundX12TransactionSettingsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::get_outbound_x12_transaction_settings_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_get_outbound_x12_transaction_settings(response.body().as_ref(), output).map_err(crate::error::GetOutboundX12TransactionSettingsError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_bucket_connection_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetX12BucketConnectionOutput,
    crate::error::GetX12BucketConnectionError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::GetX12BucketConnectionError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetX12BucketConnectionError {
            meta: generic,
            kind: crate::error::GetX12BucketConnectionErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetX12BucketConnectionError {
                meta: generic,
                kind: crate::error::GetX12BucketConnectionErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetX12BucketConnectionError {
            meta: generic,
            kind: crate::error::GetX12BucketConnectionErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetX12BucketConnectionError {
            meta: generic,
            kind: crate::error::GetX12BucketConnectionErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetX12BucketConnectionError {
            meta: generic,
            kind: crate::error::GetX12BucketConnectionErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetX12BucketConnectionError {
            meta: generic,
            kind: crate::error::GetX12BucketConnectionErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GetX12BucketConnectionError {
            meta: generic,
            kind: crate::error::GetX12BucketConnectionErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::GetX12BucketConnectionError {
                meta: generic,
                kind: crate::error::GetX12BucketConnectionErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetX12BucketConnectionError {
                meta: generic,
                kind: crate::error::GetX12BucketConnectionErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GetX12BucketConnectionError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_bucket_connection_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetX12BucketConnectionOutput,
    crate::error::GetX12BucketConnectionError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::get_x12_bucket_connection_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_get_x12_bucket_connection(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::GetX12BucketConnectionError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_connections_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetX12ConnectionsOutput, crate::error::GetX12ConnectionsError>
{
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetX12ConnectionsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::GetX12ConnectionsError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetX12ConnectionsError {
            meta: generic,
            kind: crate::error::GetX12ConnectionsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetX12ConnectionsError {
                meta: generic,
                kind: crate::error::GetX12ConnectionsErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetX12ConnectionsError {
            meta: generic,
            kind: crate::error::GetX12ConnectionsErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetX12ConnectionsError {
            meta: generic,
            kind: crate::error::GetX12ConnectionsErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetX12ConnectionsError {
            meta: generic,
            kind: crate::error::GetX12ConnectionsErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetX12ConnectionsError {
            meta: generic,
            kind: crate::error::GetX12ConnectionsErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GetX12ConnectionsError {
            meta: generic,
            kind: crate::error::GetX12ConnectionsErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::GetX12ConnectionsError {
                meta: generic,
                kind: crate::error::GetX12ConnectionsErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetX12ConnectionsError {
                meta: generic,
                kind: crate::error::GetX12ConnectionsErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ConnectionsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GetX12ConnectionsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_connections_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetX12ConnectionsOutput, crate::error::GetX12ConnectionsError>
{
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::get_x12_connections_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_get_x12_connections(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::GetX12ConnectionsError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_partnership_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetX12PartnershipOutput, crate::error::GetX12PartnershipError>
{
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetX12PartnershipError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::GetX12PartnershipError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetX12PartnershipError {
            meta: generic,
            kind: crate::error::GetX12PartnershipErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetX12PartnershipError {
                meta: generic,
                kind: crate::error::GetX12PartnershipErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetX12PartnershipError {
            meta: generic,
            kind: crate::error::GetX12PartnershipErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetX12PartnershipError {
            meta: generic,
            kind: crate::error::GetX12PartnershipErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetX12PartnershipError {
            meta: generic,
            kind: crate::error::GetX12PartnershipErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetX12PartnershipError {
            meta: generic,
            kind: crate::error::GetX12PartnershipErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GetX12PartnershipError {
            meta: generic,
            kind: crate::error::GetX12PartnershipErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::GetX12PartnershipError {
                meta: generic,
                kind: crate::error::GetX12PartnershipErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetX12PartnershipError {
                meta: generic,
                kind: crate::error::GetX12PartnershipErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GetX12PartnershipError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_partnership_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetX12PartnershipOutput, crate::error::GetX12PartnershipError>
{
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::get_x12_partnership_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_get_x12_partnership(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::GetX12PartnershipError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_partnership_by_interchanges_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetX12PartnershipByInterchangesOutput,
    crate::error::GetX12PartnershipByInterchangesError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::GetX12PartnershipByInterchangesError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetX12PartnershipByInterchangesError {
            meta: generic,
            kind: crate::error::GetX12PartnershipByInterchangesErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetX12PartnershipByInterchangesError {
                meta: generic,
                kind: crate::error::GetX12PartnershipByInterchangesErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetX12PartnershipByInterchangesError {
            meta: generic,
            kind: crate::error::GetX12PartnershipByInterchangesErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetX12PartnershipByInterchangesError {
            meta: generic,
            kind: crate::error::GetX12PartnershipByInterchangesErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetX12PartnershipByInterchangesError {
            meta: generic,
            kind: crate::error::GetX12PartnershipByInterchangesErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetX12PartnershipByInterchangesError {
            meta: generic,
            kind: crate::error::GetX12PartnershipByInterchangesErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GetX12PartnershipByInterchangesError {
            meta: generic,
            kind: crate::error::GetX12PartnershipByInterchangesErrorKind::ServiceUnavailableError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output =
                            crate::error::service_unavailable_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ThrottlingException" => {
            crate::error::GetX12PartnershipByInterchangesError {
                meta: generic,
                kind: crate::error::GetX12PartnershipByInterchangesErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetX12PartnershipByInterchangesError {
                meta: generic,
                kind: crate::error::GetX12PartnershipByInterchangesErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GetX12PartnershipByInterchangesError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_partnership_by_interchanges_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetX12PartnershipByInterchangesOutput,
    crate::error::GetX12PartnershipByInterchangesError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::get_x12_partnership_by_interchanges_output::Builder::default();
        let _ = response;
        output =
            crate::json_deser::deser_operation_crate_operation_get_x12_partnership_by_interchanges(
                response.body().as_ref(),
                output,
            )
            .map_err(crate::error::GetX12PartnershipByInterchangesError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_profile_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetX12ProfileOutput, crate::error::GetX12ProfileError> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetX12ProfileError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::GetX12ProfileError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetX12ProfileError {
            meta: generic,
            kind: crate::error::GetX12ProfileErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetX12ProfileError {
                meta: generic,
                kind: crate::error::GetX12ProfileErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetX12ProfileError {
            meta: generic,
            kind: crate::error::GetX12ProfileErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetX12ProfileError {
            meta: generic,
            kind: crate::error::GetX12ProfileErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetX12ProfileError {
            meta: generic,
            kind: crate::error::GetX12ProfileErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetX12ProfileError {
            meta: generic,
            kind: crate::error::GetX12ProfileErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GetX12ProfileError {
            meta: generic,
            kind: crate::error::GetX12ProfileErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::GetX12ProfileError {
                meta: generic,
                kind: crate::error::GetX12ProfileErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetX12ProfileError {
                meta: generic,
                kind: crate::error::GetX12ProfileErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GetX12ProfileError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_profile_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetX12ProfileOutput, crate::error::GetX12ProfileError> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::get_x12_profile_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_get_x12_profile(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::GetX12ProfileError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_profile_by_interchange_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetX12ProfileByInterchangeOutput,
    crate::error::GetX12ProfileByInterchangeError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::GetX12ProfileByInterchangeError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::GetX12ProfileByInterchangeError {
            meta: generic,
            kind: crate::error::GetX12ProfileByInterchangeErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::GetX12ProfileByInterchangeError {
                meta: generic,
                kind: crate::error::GetX12ProfileByInterchangeErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::GetX12ProfileByInterchangeError {
            meta: generic,
            kind: crate::error::GetX12ProfileByInterchangeErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::GetX12ProfileByInterchangeError {
            meta: generic,
            kind: crate::error::GetX12ProfileByInterchangeErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::GetX12ProfileByInterchangeError {
            meta: generic,
            kind: crate::error::GetX12ProfileByInterchangeErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::GetX12ProfileByInterchangeError {
            meta: generic,
            kind: crate::error::GetX12ProfileByInterchangeErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::GetX12ProfileByInterchangeError {
            meta: generic,
            kind: crate::error::GetX12ProfileByInterchangeErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::GetX12ProfileByInterchangeError {
                meta: generic,
                kind: crate::error::GetX12ProfileByInterchangeErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::GetX12ProfileByInterchangeError {
                meta: generic,
                kind: crate::error::GetX12ProfileByInterchangeErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::GetX12ProfileByInterchangeError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_x12_profile_by_interchange_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::GetX12ProfileByInterchangeOutput,
    crate::error::GetX12ProfileByInterchangeError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::get_x12_profile_by_interchange_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_get_x12_profile_by_interchange(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::GetX12ProfileByInterchangeError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_increment_x12_control_number_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::IncrementX12ControlNumberOutput,
    crate::error::IncrementX12ControlNumberError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::IncrementX12ControlNumberError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::IncrementX12ControlNumberError {
            meta: generic,
            kind: crate::error::IncrementX12ControlNumberErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::IncrementX12ControlNumberError {
            meta: generic,
            kind: crate::error::IncrementX12ControlNumberErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::IncrementX12ControlNumberError {
                meta: generic,
                kind: crate::error::IncrementX12ControlNumberErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::IncrementX12ControlNumberError {
            meta: generic,
            kind: crate::error::IncrementX12ControlNumberErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::IncrementX12ControlNumberError {
            meta: generic,
            kind: crate::error::IncrementX12ControlNumberErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::IncrementX12ControlNumberError {
            meta: generic,
            kind: crate::error::IncrementX12ControlNumberErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::IncrementX12ControlNumberError {
            meta: generic,
            kind: crate::error::IncrementX12ControlNumberErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::IncrementX12ControlNumberError {
            meta: generic,
            kind: crate::error::IncrementX12ControlNumberErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::IncrementX12ControlNumberError {
                meta: generic,
                kind: crate::error::IncrementX12ControlNumberErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::IncrementX12ControlNumberError {
                meta: generic,
                kind: crate::error::IncrementX12ControlNumberErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::IncrementX12ControlNumberError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_increment_x12_control_number_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::IncrementX12ControlNumberOutput,
    crate::error::IncrementX12ControlNumberError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::increment_x12_control_number_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_increment_x12_control_number(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::IncrementX12ControlNumberError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_list_x12_partnerships_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::ListX12PartnershipsOutput,
    crate::error::ListX12PartnershipsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::ListX12PartnershipsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::ListX12PartnershipsError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::ListX12PartnershipsError {
            meta: generic,
            kind: crate::error::ListX12PartnershipsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::ListX12PartnershipsError {
                meta: generic,
                kind: crate::error::ListX12PartnershipsErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::ListX12PartnershipsError {
            meta: generic,
            kind: crate::error::ListX12PartnershipsErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::ListX12PartnershipsError {
            meta: generic,
            kind: crate::error::ListX12PartnershipsErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::ListX12PartnershipsError {
            meta: generic,
            kind: crate::error::ListX12PartnershipsErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::ListX12PartnershipsError {
            meta: generic,
            kind: crate::error::ListX12PartnershipsErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::ListX12PartnershipsError {
            meta: generic,
            kind: crate::error::ListX12PartnershipsErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::ListX12PartnershipsError {
                meta: generic,
                kind: crate::error::ListX12PartnershipsErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::ListX12PartnershipsError {
                meta: generic,
                kind: crate::error::ListX12PartnershipsErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12PartnershipsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::ListX12PartnershipsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_list_x12_partnerships_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::ListX12PartnershipsOutput,
    crate::error::ListX12PartnershipsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::list_x12_partnerships_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_list_x12_partnerships(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::ListX12PartnershipsError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_list_x12_profiles_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListX12ProfilesOutput, crate::error::ListX12ProfilesError> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::ListX12ProfilesError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::ListX12ProfilesError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDeniedException" => crate::error::ListX12ProfilesError {
            meta: generic,
            kind: crate::error::ListX12ProfilesErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::ListX12ProfilesError {
                meta: generic,
                kind: crate::error::ListX12ProfilesErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::ListX12ProfilesError {
            meta: generic,
            kind: crate::error::ListX12ProfilesErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::ListX12ProfilesError {
            meta: generic,
            kind: crate::error::ListX12ProfilesErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::ListX12ProfilesError {
            meta: generic,
            kind: crate::error::ListX12ProfilesErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::ListX12ProfilesError {
            meta: generic,
            kind: crate::error::ListX12ProfilesErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::ListX12ProfilesError {
            meta: generic,
            kind: crate::error::ListX12ProfilesErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::ListX12ProfilesError {
                meta: generic,
                kind: crate::error::ListX12ProfilesErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::ListX12ProfilesError {
                meta: generic,
                kind: crate::error::ListX12ProfilesErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::ListX12ProfilesError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::ListX12ProfilesError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_list_x12_profiles_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListX12ProfilesOutput, crate::error::ListX12ProfilesError> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::list_x12_profiles_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_list_x12_profiles(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::ListX12ProfilesError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_set_outbound_x12_control_number_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::SetOutboundX12ControlNumberOutput,
    crate::error::SetOutboundX12ControlNumberError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::SetOutboundX12ControlNumberError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::SetOutboundX12ControlNumberError {
            meta: generic,
            kind: crate::error::SetOutboundX12ControlNumberErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::SetOutboundX12ControlNumberError {
            meta: generic,
            kind: crate::error::SetOutboundX12ControlNumberErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::SetOutboundX12ControlNumberError {
                meta: generic,
                kind: crate::error::SetOutboundX12ControlNumberErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::SetOutboundX12ControlNumberError {
            meta: generic,
            kind: crate::error::SetOutboundX12ControlNumberErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::SetOutboundX12ControlNumberError {
            meta: generic,
            kind: crate::error::SetOutboundX12ControlNumberErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::SetOutboundX12ControlNumberError {
            meta: generic,
            kind: crate::error::SetOutboundX12ControlNumberErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::SetOutboundX12ControlNumberError {
            meta: generic,
            kind: crate::error::SetOutboundX12ControlNumberErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::SetOutboundX12ControlNumberError {
            meta: generic,
            kind: crate::error::SetOutboundX12ControlNumberErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::SetOutboundX12ControlNumberError {
                meta: generic,
                kind: crate::error::SetOutboundX12ControlNumberErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::SetOutboundX12ControlNumberError {
                meta: generic,
                kind: crate::error::SetOutboundX12ControlNumberErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::SetOutboundX12ControlNumberError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_set_outbound_x12_control_number_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::SetOutboundX12ControlNumberOutput,
    crate::error::SetOutboundX12ControlNumberError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::set_outbound_x12_control_number_output::Builder::default();
        let _ = response;
        output =
            crate::json_deser::deser_operation_crate_operation_set_outbound_x12_control_number(
                response.body().as_ref(),
                output,
            )
            .map_err(crate::error::SetOutboundX12ControlNumberError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_inbound_x12_transaction_settings_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateInboundX12TransactionSettingsOutput,
    crate::error::UpdateInboundX12TransactionSettingsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::UpdateInboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::UpdateInboundX12TransactionSettingsErrorKind::OperationConflictError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::operation_conflict_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "AccessDeniedException" => crate::error::UpdateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateInboundX12TransactionSettingsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::UpdateInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::UpdateInboundX12TransactionSettingsErrorKind::BadRequestError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::bad_request_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "GatewayTimeoutException" => crate::error::UpdateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateInboundX12TransactionSettingsErrorKind::GatewayTimeoutError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::gateway_timeout_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "InternalFailureException" => crate::error::UpdateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateInboundX12TransactionSettingsErrorKind::InternalFailureError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::internal_failure_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "QuotaExceededException" => crate::error::UpdateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateInboundX12TransactionSettingsErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::UpdateInboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateInboundX12TransactionSettingsErrorKind::ResourceNotFoundError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::resource_not_found_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ServiceUnavailableException" => crate::error::UpdateInboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::UpdateInboundX12TransactionSettingsErrorKind::ServiceUnavailableError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::service_unavailable_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ThrottlingException" => {
            crate::error::UpdateInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::UpdateInboundX12TransactionSettingsErrorKind::ThrottlingError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::throttling_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "UnauthorizedException" => {
            crate::error::UpdateInboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::UpdateInboundX12TransactionSettingsErrorKind::UnauthorizedError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::unauthorized_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        _ => crate::error::UpdateInboundX12TransactionSettingsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_inbound_x12_transaction_settings_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateInboundX12TransactionSettingsOutput,
    crate::error::UpdateInboundX12TransactionSettingsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::update_inbound_x12_transaction_settings_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_update_inbound_x12_transaction_settings(response.body().as_ref(), output).map_err(crate::error::UpdateInboundX12TransactionSettingsError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_outbound_x12_transaction_settings_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateOutboundX12TransactionSettingsOutput,
    crate::error::UpdateOutboundX12TransactionSettingsError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::UpdateOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::UpdateOutboundX12TransactionSettingsErrorKind::OperationConflictError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::operation_conflict_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "AccessDeniedException" => crate::error::UpdateOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateOutboundX12TransactionSettingsErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::UpdateOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::UpdateOutboundX12TransactionSettingsErrorKind::BadRequestError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::bad_request_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "GatewayTimeoutException" => crate::error::UpdateOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateOutboundX12TransactionSettingsErrorKind::GatewayTimeoutError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::gateway_timeout_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "InternalFailureException" => crate::error::UpdateOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateOutboundX12TransactionSettingsErrorKind::InternalFailureError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::internal_failure_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "QuotaExceededException" => crate::error::UpdateOutboundX12TransactionSettingsError {
            meta: generic,
            kind: crate::error::UpdateOutboundX12TransactionSettingsErrorKind::QuotaExceededError(
                {
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::quota_exceeded_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                },
            ),
        },
        "ResourceNotFoundException" => crate::error::UpdateOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::UpdateOutboundX12TransactionSettingsErrorKind::ResourceNotFoundError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::resource_not_found_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ServiceUnavailableException" => crate::error::UpdateOutboundX12TransactionSettingsError {
            meta: generic,
            kind:
                crate::error::UpdateOutboundX12TransactionSettingsErrorKind::ServiceUnavailableError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output =
                                crate::error::service_unavailable_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "ThrottlingException" => {
            crate::error::UpdateOutboundX12TransactionSettingsError {
                meta: generic,
                kind: crate::error::UpdateOutboundX12TransactionSettingsErrorKind::ThrottlingError(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]
                            let mut output = crate::error::throttling_error::Builder::default();
                            let _ = response;
                            output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
            }
        }
        "UnauthorizedException" => {
            crate::error::UpdateOutboundX12TransactionSettingsError {
                meta: generic,
                kind:
                    crate::error::UpdateOutboundX12TransactionSettingsErrorKind::UnauthorizedError(
                        {
                            #[allow(unused_mut)]
                            let mut tmp = {
                                #[allow(unused_mut)]
                                let mut output =
                                    crate::error::unauthorized_error::Builder::default();
                                let _ = response;
                                output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
                                output.build()
                            };
                            if tmp.message.is_none() {
                                tmp.message = _error_message;
                            }
                            tmp
                        },
                    ),
            }
        }
        _ => crate::error::UpdateOutboundX12TransactionSettingsError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_outbound_x12_transaction_settings_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateOutboundX12TransactionSettingsOutput,
    crate::error::UpdateOutboundX12TransactionSettingsError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::update_outbound_x12_transaction_settings_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_update_outbound_x12_transaction_settings(response.body().as_ref(), output).map_err(crate::error::UpdateOutboundX12TransactionSettingsError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_x12_bucket_connection_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateX12BucketConnectionOutput,
    crate::error::UpdateX12BucketConnectionError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::UpdateX12BucketConnectionError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::UpdateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::UpdateX12BucketConnectionErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::UpdateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::UpdateX12BucketConnectionErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::UpdateX12BucketConnectionError {
                meta: generic,
                kind: crate::error::UpdateX12BucketConnectionErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::UpdateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::UpdateX12BucketConnectionErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::UpdateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::UpdateX12BucketConnectionErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::UpdateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::UpdateX12BucketConnectionErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::UpdateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::UpdateX12BucketConnectionErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::UpdateX12BucketConnectionError {
            meta: generic,
            kind: crate::error::UpdateX12BucketConnectionErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::UpdateX12BucketConnectionError {
                meta: generic,
                kind: crate::error::UpdateX12BucketConnectionErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::UpdateX12BucketConnectionError {
                meta: generic,
                kind: crate::error::UpdateX12BucketConnectionErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::UpdateX12BucketConnectionError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_x12_bucket_connection_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateX12BucketConnectionOutput,
    crate::error::UpdateX12BucketConnectionError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::update_x12_bucket_connection_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_update_x12_bucket_connection(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::UpdateX12BucketConnectionError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_x12_partnership_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateX12PartnershipOutput,
    crate::error::UpdateX12PartnershipError,
> {
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::UpdateX12PartnershipError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::UpdateX12PartnershipError {
            meta: generic,
            kind: crate::error::UpdateX12PartnershipErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::UpdateX12PartnershipError {
            meta: generic,
            kind: crate::error::UpdateX12PartnershipErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::UpdateX12PartnershipError {
                meta: generic,
                kind: crate::error::UpdateX12PartnershipErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::UpdateX12PartnershipError {
            meta: generic,
            kind: crate::error::UpdateX12PartnershipErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::UpdateX12PartnershipError {
            meta: generic,
            kind: crate::error::UpdateX12PartnershipErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::UpdateX12PartnershipError {
            meta: generic,
            kind: crate::error::UpdateX12PartnershipErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::UpdateX12PartnershipError {
            meta: generic,
            kind: crate::error::UpdateX12PartnershipErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::UpdateX12PartnershipError {
            meta: generic,
            kind: crate::error::UpdateX12PartnershipErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::UpdateX12PartnershipError {
                meta: generic,
                kind: crate::error::UpdateX12PartnershipErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::UpdateX12PartnershipError {
                meta: generic,
                kind: crate::error::UpdateX12PartnershipErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::UpdateX12PartnershipError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_x12_partnership_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateX12PartnershipOutput,
    crate::error::UpdateX12PartnershipError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::update_x12_partnership_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_update_x12_partnership(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::UpdateX12PartnershipError::unhandled)?;
        output.build()
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_x12_profile_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateX12ProfileOutput, crate::error::UpdateX12ProfileError>
{
    let generic = crate::json_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateX12ProfileError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => return Err(crate::error::UpdateX12ProfileError::unhandled(generic)),
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "OperationConflictException" => crate::error::UpdateX12ProfileError {
            meta: generic,
            kind: crate::error::UpdateX12ProfileErrorKind::OperationConflictError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::operation_conflict_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_operation_conflict_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "AccessDeniedException" => crate::error::UpdateX12ProfileError {
            meta: generic,
            kind: crate::error::UpdateX12ProfileErrorKind::AccessDeniedError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::access_denied_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_access_denied_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "BadRequestException" => {
            crate::error::UpdateX12ProfileError {
                meta: generic,
                kind: crate::error::UpdateX12ProfileErrorKind::BadRequestError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::bad_request_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_bad_request_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "GatewayTimeoutException" => crate::error::UpdateX12ProfileError {
            meta: generic,
            kind: crate::error::UpdateX12ProfileErrorKind::GatewayTimeoutError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::gateway_timeout_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_gateway_timeout_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InternalFailureException" => crate::error::UpdateX12ProfileError {
            meta: generic,
            kind: crate::error::UpdateX12ProfileErrorKind::InternalFailureError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::internal_failure_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_internal_failure_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "QuotaExceededException" => crate::error::UpdateX12ProfileError {
            meta: generic,
            kind: crate::error::UpdateX12ProfileErrorKind::QuotaExceededError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::quota_exceeded_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_quota_exceeded_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ResourceNotFoundException" => crate::error::UpdateX12ProfileError {
            meta: generic,
            kind: crate::error::UpdateX12ProfileErrorKind::ResourceNotFoundError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::resource_not_found_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_resource_not_found_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ServiceUnavailableException" => crate::error::UpdateX12ProfileError {
            meta: generic,
            kind: crate::error::UpdateX12ProfileErrorKind::ServiceUnavailableError({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output = crate::error::service_unavailable_error::Builder::default();
                    let _ = response;
                    output = crate::json_deser::deser_structure_crate_error_service_unavailable_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "ThrottlingException" => {
            crate::error::UpdateX12ProfileError {
                meta: generic,
                kind: crate::error::UpdateX12ProfileErrorKind::ThrottlingError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::throttling_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_throttling_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        "UnauthorizedException" => {
            crate::error::UpdateX12ProfileError {
                meta: generic,
                kind: crate::error::UpdateX12ProfileErrorKind::UnauthorizedError({
                    #[allow(unused_mut)]
                    let mut tmp = {
                        #[allow(unused_mut)]
                        let mut output = crate::error::unauthorized_error::Builder::default();
                        let _ = response;
                        output = crate::json_deser::deser_structure_crate_error_unauthorized_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateX12ProfileError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::UpdateX12ProfileError::generic(generic),
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_x12_profile_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateX12ProfileOutput, crate::error::UpdateX12ProfileError>
{
    Ok({
        #[allow(unused_mut)]
        let mut output = crate::output::update_x12_profile_output::Builder::default();
        let _ = response;
        output = crate::json_deser::deser_operation_crate_operation_update_x12_profile(
            response.body().as_ref(),
            output,
        )
        .map_err(crate::error::UpdateX12ProfileError::unhandled)?;
        output.build()
    })
}
