aws-sdk-comprehendmedical 0.24.0

AWS SDK for AWS Comprehend Medical
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_describe_entities_detection_v2_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeEntitiesDetectionV2JobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_1) = &input.job_id {
        object.key("JobId").string(var_1.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_icd10_cm_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeIcd10CmInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_2) = &input.job_id {
        object.key("JobId").string(var_2.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_phi_detection_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribePhiDetectionJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_3) = &input.job_id {
        object.key("JobId").string(var_3.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_rx_norm_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeRxNormInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_4) = &input.job_id {
        object.key("JobId").string(var_4.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_snomedct_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeSnomedctInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_5) = &input.job_id {
        object.key("JobId").string(var_5.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_detect_entities_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DetectEntitiesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_6) = &input.text {
        object.key("Text").string(var_6.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_detect_entities_v2_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DetectEntitiesV2Input,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_7) = &input.text {
        object.key("Text").string(var_7.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_detect_phi_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DetectPhiInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_8) = &input.text {
        object.key("Text").string(var_8.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_infer_icd10_cm_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::InferIcd10CmInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_9) = &input.text {
        object.key("Text").string(var_9.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_infer_rx_norm_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::InferRxNormInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_10) = &input.text {
        object.key("Text").string(var_10.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_infer_snomedct_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::InferSnomedctInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_11) = &input.text {
        object.key("Text").string(var_11.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_entities_detection_v2_jobs_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListEntitiesDetectionV2JobsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_12) = &input.filter {
        #[allow(unused_mut)]
        let mut object_13 = object.key("Filter").start_object();
        crate::json_ser::serialize_structure_crate_model_comprehend_medical_async_job_filter(
            &mut object_13,
            var_12,
        )?;
        object_13.finish();
    }
    if let Some(var_14) = &input.next_token {
        object.key("NextToken").string(var_14.as_str());
    }
    if let Some(var_15) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_15).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_icd10_cm_inference_jobs_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListIcd10CmInferenceJobsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_16) = &input.filter {
        #[allow(unused_mut)]
        let mut object_17 = object.key("Filter").start_object();
        crate::json_ser::serialize_structure_crate_model_comprehend_medical_async_job_filter(
            &mut object_17,
            var_16,
        )?;
        object_17.finish();
    }
    if let Some(var_18) = &input.next_token {
        object.key("NextToken").string(var_18.as_str());
    }
    if let Some(var_19) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_19).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_phi_detection_jobs_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListPhiDetectionJobsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_20) = &input.filter {
        #[allow(unused_mut)]
        let mut object_21 = object.key("Filter").start_object();
        crate::json_ser::serialize_structure_crate_model_comprehend_medical_async_job_filter(
            &mut object_21,
            var_20,
        )?;
        object_21.finish();
    }
    if let Some(var_22) = &input.next_token {
        object.key("NextToken").string(var_22.as_str());
    }
    if let Some(var_23) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_23).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_rx_norm_inference_jobs_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListRxNormInferenceJobsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_24) = &input.filter {
        #[allow(unused_mut)]
        let mut object_25 = object.key("Filter").start_object();
        crate::json_ser::serialize_structure_crate_model_comprehend_medical_async_job_filter(
            &mut object_25,
            var_24,
        )?;
        object_25.finish();
    }
    if let Some(var_26) = &input.next_token {
        object.key("NextToken").string(var_26.as_str());
    }
    if let Some(var_27) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_27).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_snomedct_inference_jobs_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListSnomedctInferenceJobsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_28) = &input.filter {
        #[allow(unused_mut)]
        let mut object_29 = object.key("Filter").start_object();
        crate::json_ser::serialize_structure_crate_model_comprehend_medical_async_job_filter(
            &mut object_29,
            var_28,
        )?;
        object_29.finish();
    }
    if let Some(var_30) = &input.next_token {
        object.key("NextToken").string(var_30.as_str());
    }
    if let Some(var_31) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_31).into()),
        );
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_entities_detection_v2_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartEntitiesDetectionV2JobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_32) = &input.input_data_config {
        #[allow(unused_mut)]
        let mut object_33 = object.key("InputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_input_data_config(&mut object_33, var_32)?;
        object_33.finish();
    }
    if let Some(var_34) = &input.output_data_config {
        #[allow(unused_mut)]
        let mut object_35 = object.key("OutputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_output_data_config(
            &mut object_35,
            var_34,
        )?;
        object_35.finish();
    }
    if let Some(var_36) = &input.data_access_role_arn {
        object.key("DataAccessRoleArn").string(var_36.as_str());
    }
    if let Some(var_37) = &input.job_name {
        object.key("JobName").string(var_37.as_str());
    }
    if let Some(var_38) = &input.client_request_token {
        object.key("ClientRequestToken").string(var_38.as_str());
    }
    if let Some(var_39) = &input.kms_key {
        object.key("KMSKey").string(var_39.as_str());
    }
    if let Some(var_40) = &input.language_code {
        object.key("LanguageCode").string(var_40.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_icd10_cm_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartIcd10CmInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_41) = &input.input_data_config {
        #[allow(unused_mut)]
        let mut object_42 = object.key("InputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_input_data_config(&mut object_42, var_41)?;
        object_42.finish();
    }
    if let Some(var_43) = &input.output_data_config {
        #[allow(unused_mut)]
        let mut object_44 = object.key("OutputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_output_data_config(
            &mut object_44,
            var_43,
        )?;
        object_44.finish();
    }
    if let Some(var_45) = &input.data_access_role_arn {
        object.key("DataAccessRoleArn").string(var_45.as_str());
    }
    if let Some(var_46) = &input.job_name {
        object.key("JobName").string(var_46.as_str());
    }
    if let Some(var_47) = &input.client_request_token {
        object.key("ClientRequestToken").string(var_47.as_str());
    }
    if let Some(var_48) = &input.kms_key {
        object.key("KMSKey").string(var_48.as_str());
    }
    if let Some(var_49) = &input.language_code {
        object.key("LanguageCode").string(var_49.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_phi_detection_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartPhiDetectionJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_50) = &input.input_data_config {
        #[allow(unused_mut)]
        let mut object_51 = object.key("InputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_input_data_config(&mut object_51, var_50)?;
        object_51.finish();
    }
    if let Some(var_52) = &input.output_data_config {
        #[allow(unused_mut)]
        let mut object_53 = object.key("OutputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_output_data_config(
            &mut object_53,
            var_52,
        )?;
        object_53.finish();
    }
    if let Some(var_54) = &input.data_access_role_arn {
        object.key("DataAccessRoleArn").string(var_54.as_str());
    }
    if let Some(var_55) = &input.job_name {
        object.key("JobName").string(var_55.as_str());
    }
    if let Some(var_56) = &input.client_request_token {
        object.key("ClientRequestToken").string(var_56.as_str());
    }
    if let Some(var_57) = &input.kms_key {
        object.key("KMSKey").string(var_57.as_str());
    }
    if let Some(var_58) = &input.language_code {
        object.key("LanguageCode").string(var_58.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_rx_norm_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartRxNormInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_59) = &input.input_data_config {
        #[allow(unused_mut)]
        let mut object_60 = object.key("InputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_input_data_config(&mut object_60, var_59)?;
        object_60.finish();
    }
    if let Some(var_61) = &input.output_data_config {
        #[allow(unused_mut)]
        let mut object_62 = object.key("OutputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_output_data_config(
            &mut object_62,
            var_61,
        )?;
        object_62.finish();
    }
    if let Some(var_63) = &input.data_access_role_arn {
        object.key("DataAccessRoleArn").string(var_63.as_str());
    }
    if let Some(var_64) = &input.job_name {
        object.key("JobName").string(var_64.as_str());
    }
    if let Some(var_65) = &input.client_request_token {
        object.key("ClientRequestToken").string(var_65.as_str());
    }
    if let Some(var_66) = &input.kms_key {
        object.key("KMSKey").string(var_66.as_str());
    }
    if let Some(var_67) = &input.language_code {
        object.key("LanguageCode").string(var_67.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_start_snomedct_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StartSnomedctInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_68) = &input.input_data_config {
        #[allow(unused_mut)]
        let mut object_69 = object.key("InputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_input_data_config(&mut object_69, var_68)?;
        object_69.finish();
    }
    if let Some(var_70) = &input.output_data_config {
        #[allow(unused_mut)]
        let mut object_71 = object.key("OutputDataConfig").start_object();
        crate::json_ser::serialize_structure_crate_model_output_data_config(
            &mut object_71,
            var_70,
        )?;
        object_71.finish();
    }
    if let Some(var_72) = &input.data_access_role_arn {
        object.key("DataAccessRoleArn").string(var_72.as_str());
    }
    if let Some(var_73) = &input.job_name {
        object.key("JobName").string(var_73.as_str());
    }
    if let Some(var_74) = &input.client_request_token {
        object.key("ClientRequestToken").string(var_74.as_str());
    }
    if let Some(var_75) = &input.kms_key {
        object.key("KMSKey").string(var_75.as_str());
    }
    if let Some(var_76) = &input.language_code {
        object.key("LanguageCode").string(var_76.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_entities_detection_v2_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopEntitiesDetectionV2JobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_77) = &input.job_id {
        object.key("JobId").string(var_77.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_icd10_cm_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopIcd10CmInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_78) = &input.job_id {
        object.key("JobId").string(var_78.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_phi_detection_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopPhiDetectionJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_79) = &input.job_id {
        object.key("JobId").string(var_79.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_rx_norm_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopRxNormInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_80) = &input.job_id {
        object.key("JobId").string(var_80.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_stop_snomedct_inference_job_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::StopSnomedctInferenceJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_81) = &input.job_id {
        object.key("JobId").string(var_81.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_comprehend_medical_async_job_filter(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ComprehendMedicalAsyncJobFilter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_82) = &input.job_name {
        object.key("JobName").string(var_82.as_str());
    }
    if let Some(var_83) = &input.job_status {
        object.key("JobStatus").string(var_83.as_str());
    }
    if let Some(var_84) = &input.submit_time_before {
        object
            .key("SubmitTimeBefore")
            .date_time(var_84, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_85) = &input.submit_time_after {
        object
            .key("SubmitTimeAfter")
            .date_time(var_85, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    Ok(())
}

pub fn serialize_structure_crate_model_input_data_config(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::InputDataConfig,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_86) = &input.s3_bucket {
        object.key("S3Bucket").string(var_86.as_str());
    }
    if let Some(var_87) = &input.s3_key {
        object.key("S3Key").string(var_87.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_output_data_config(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::OutputDataConfig,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_88) = &input.s3_bucket {
        object.key("S3Bucket").string(var_88.as_str());
    }
    if let Some(var_89) = &input.s3_key {
        object.key("S3Key").string(var_89.as_str());
    }
    Ok(())
}