aws-sdk-translate 1.19.0

AWS SDK for Amazon Translate
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The term being translated by the custom terminology.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Term {
    /// <p>The source text of the term being translated by the custom terminology.</p>
    pub source_text: ::std::option::Option<::std::string::String>,
    /// <p>The target text of the term being translated by the custom terminology.</p>
    pub target_text: ::std::option::Option<::std::string::String>,
}
impl Term {
    /// <p>The source text of the term being translated by the custom terminology.</p>
    pub fn source_text(&self) -> ::std::option::Option<&str> {
        self.source_text.as_deref()
    }
    /// <p>The target text of the term being translated by the custom terminology.</p>
    pub fn target_text(&self) -> ::std::option::Option<&str> {
        self.target_text.as_deref()
    }
}
impl Term {
    /// Creates a new builder-style object to manufacture [`Term`](crate::types::Term).
    pub fn builder() -> crate::types::builders::TermBuilder {
        crate::types::builders::TermBuilder::default()
    }
}

/// A builder for [`Term`](crate::types::Term).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct TermBuilder {
    pub(crate) source_text: ::std::option::Option<::std::string::String>,
    pub(crate) target_text: ::std::option::Option<::std::string::String>,
}
impl TermBuilder {
    /// <p>The source text of the term being translated by the custom terminology.</p>
    pub fn source_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_text = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The source text of the term being translated by the custom terminology.</p>
    pub fn set_source_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_text = input;
        self
    }
    /// <p>The source text of the term being translated by the custom terminology.</p>
    pub fn get_source_text(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_text
    }
    /// <p>The target text of the term being translated by the custom terminology.</p>
    pub fn target_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.target_text = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The target text of the term being translated by the custom terminology.</p>
    pub fn set_target_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.target_text = input;
        self
    }
    /// <p>The target text of the term being translated by the custom terminology.</p>
    pub fn get_target_text(&self) -> &::std::option::Option<::std::string::String> {
        &self.target_text
    }
    /// Consumes the builder and constructs a [`Term`](crate::types::Term).
    pub fn build(self) -> crate::types::Term {
        crate::types::Term {
            source_text: self.source_text,
            target_text: self.target_text,
        }
    }
}