aws_sdk_translate/operation/get_terminology/
_get_terminology_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetTerminologyInput {
6    /// <p>The name of the custom terminology being retrieved.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The data format of the custom terminology being retrieved.</p>
9    /// <p>If you don't specify this parameter, Amazon Translate returns a file with the same format as the file that was imported to create the terminology.</p>
10    /// <p>If you specify this parameter when you retrieve a multi-directional terminology resource, you must specify the same format as the input file that was imported to create it. Otherwise, Amazon Translate throws an error.</p>
11    pub terminology_data_format: ::std::option::Option<crate::types::TerminologyDataFormat>,
12}
13impl GetTerminologyInput {
14    /// <p>The name of the custom terminology being retrieved.</p>
15    pub fn name(&self) -> ::std::option::Option<&str> {
16        self.name.as_deref()
17    }
18    /// <p>The data format of the custom terminology being retrieved.</p>
19    /// <p>If you don't specify this parameter, Amazon Translate returns a file with the same format as the file that was imported to create the terminology.</p>
20    /// <p>If you specify this parameter when you retrieve a multi-directional terminology resource, you must specify the same format as the input file that was imported to create it. Otherwise, Amazon Translate throws an error.</p>
21    pub fn terminology_data_format(&self) -> ::std::option::Option<&crate::types::TerminologyDataFormat> {
22        self.terminology_data_format.as_ref()
23    }
24}
25impl GetTerminologyInput {
26    /// Creates a new builder-style object to manufacture [`GetTerminologyInput`](crate::operation::get_terminology::GetTerminologyInput).
27    pub fn builder() -> crate::operation::get_terminology::builders::GetTerminologyInputBuilder {
28        crate::operation::get_terminology::builders::GetTerminologyInputBuilder::default()
29    }
30}
31
32/// A builder for [`GetTerminologyInput`](crate::operation::get_terminology::GetTerminologyInput).
33#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
34#[non_exhaustive]
35pub struct GetTerminologyInputBuilder {
36    pub(crate) name: ::std::option::Option<::std::string::String>,
37    pub(crate) terminology_data_format: ::std::option::Option<crate::types::TerminologyDataFormat>,
38}
39impl GetTerminologyInputBuilder {
40    /// <p>The name of the custom terminology being retrieved.</p>
41    /// This field is required.
42    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
43        self.name = ::std::option::Option::Some(input.into());
44        self
45    }
46    /// <p>The name of the custom terminology being retrieved.</p>
47    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
48        self.name = input;
49        self
50    }
51    /// <p>The name of the custom terminology being retrieved.</p>
52    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
53        &self.name
54    }
55    /// <p>The data format of the custom terminology being retrieved.</p>
56    /// <p>If you don't specify this parameter, Amazon Translate returns a file with the same format as the file that was imported to create the terminology.</p>
57    /// <p>If you specify this parameter when you retrieve a multi-directional terminology resource, you must specify the same format as the input file that was imported to create it. Otherwise, Amazon Translate throws an error.</p>
58    pub fn terminology_data_format(mut self, input: crate::types::TerminologyDataFormat) -> Self {
59        self.terminology_data_format = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>The data format of the custom terminology being retrieved.</p>
63    /// <p>If you don't specify this parameter, Amazon Translate returns a file with the same format as the file that was imported to create the terminology.</p>
64    /// <p>If you specify this parameter when you retrieve a multi-directional terminology resource, you must specify the same format as the input file that was imported to create it. Otherwise, Amazon Translate throws an error.</p>
65    pub fn set_terminology_data_format(mut self, input: ::std::option::Option<crate::types::TerminologyDataFormat>) -> Self {
66        self.terminology_data_format = input;
67        self
68    }
69    /// <p>The data format of the custom terminology being retrieved.</p>
70    /// <p>If you don't specify this parameter, Amazon Translate returns a file with the same format as the file that was imported to create the terminology.</p>
71    /// <p>If you specify this parameter when you retrieve a multi-directional terminology resource, you must specify the same format as the input file that was imported to create it. Otherwise, Amazon Translate throws an error.</p>
72    pub fn get_terminology_data_format(&self) -> &::std::option::Option<crate::types::TerminologyDataFormat> {
73        &self.terminology_data_format
74    }
75    /// Consumes the builder and constructs a [`GetTerminologyInput`](crate::operation::get_terminology::GetTerminologyInput).
76    pub fn build(
77        self,
78    ) -> ::std::result::Result<crate::operation::get_terminology::GetTerminologyInput, ::aws_smithy_types::error::operation::BuildError> {
79        ::std::result::Result::Ok(crate::operation::get_terminology::GetTerminologyInput {
80            name: self.name,
81            terminology_data_format: self.terminology_data_format,
82        })
83    }
84}