aws_sdk_translate/types/
_parallel_data_data_location.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The location of the most recent parallel data input file that was successfully imported into Amazon Translate.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ParallelDataDataLocation {
7    /// <p>Describes the repository that contains the parallel data input file.</p>
8    pub repository_type: ::std::string::String,
9    /// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30-minute expiration.</p><important>
10    /// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks.</p>
11    /// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
12    /// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
13    /// </important>
14    pub location: ::std::string::String,
15}
16impl ParallelDataDataLocation {
17    /// <p>Describes the repository that contains the parallel data input file.</p>
18    pub fn repository_type(&self) -> &str {
19        use std::ops::Deref;
20        self.repository_type.deref()
21    }
22    /// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30-minute expiration.</p><important>
23    /// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks.</p>
24    /// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
25    /// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
26    /// </important>
27    pub fn location(&self) -> &str {
28        use std::ops::Deref;
29        self.location.deref()
30    }
31}
32impl ParallelDataDataLocation {
33    /// Creates a new builder-style object to manufacture [`ParallelDataDataLocation`](crate::types::ParallelDataDataLocation).
34    pub fn builder() -> crate::types::builders::ParallelDataDataLocationBuilder {
35        crate::types::builders::ParallelDataDataLocationBuilder::default()
36    }
37}
38
39/// A builder for [`ParallelDataDataLocation`](crate::types::ParallelDataDataLocation).
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct ParallelDataDataLocationBuilder {
43    pub(crate) repository_type: ::std::option::Option<::std::string::String>,
44    pub(crate) location: ::std::option::Option<::std::string::String>,
45}
46impl ParallelDataDataLocationBuilder {
47    /// <p>Describes the repository that contains the parallel data input file.</p>
48    /// This field is required.
49    pub fn repository_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.repository_type = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>Describes the repository that contains the parallel data input file.</p>
54    pub fn set_repository_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.repository_type = input;
56        self
57    }
58    /// <p>Describes the repository that contains the parallel data input file.</p>
59    pub fn get_repository_type(&self) -> &::std::option::Option<::std::string::String> {
60        &self.repository_type
61    }
62    /// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30-minute expiration.</p><important>
63    /// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks.</p>
64    /// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
65    /// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
66    /// </important>
67    /// This field is required.
68    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.location = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30-minute expiration.</p><important>
73    /// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks.</p>
74    /// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
75    /// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
76    /// </important>
77    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.location = input;
79        self
80    }
81    /// <p>The Amazon S3 location of the parallel data input file. The location is returned as a presigned URL to that has a 30-minute expiration.</p><important>
82    /// <p>Amazon Translate doesn't scan all input files for the risk of CSV injection attacks.</p>
83    /// <p>CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.</p>
84    /// <p>Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.</p>
85    /// </important>
86    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
87        &self.location
88    }
89    /// Consumes the builder and constructs a [`ParallelDataDataLocation`](crate::types::ParallelDataDataLocation).
90    /// This method will fail if any of the following fields are not set:
91    /// - [`repository_type`](crate::types::builders::ParallelDataDataLocationBuilder::repository_type)
92    /// - [`location`](crate::types::builders::ParallelDataDataLocationBuilder::location)
93    pub fn build(self) -> ::std::result::Result<crate::types::ParallelDataDataLocation, ::aws_smithy_types::error::operation::BuildError> {
94        ::std::result::Result::Ok(crate::types::ParallelDataDataLocation {
95            repository_type: self.repository_type.ok_or_else(|| {
96                ::aws_smithy_types::error::operation::BuildError::missing_field(
97                    "repository_type",
98                    "repository_type was not specified but it is required when building ParallelDataDataLocation",
99                )
100            })?,
101            location: self.location.ok_or_else(|| {
102                ::aws_smithy_types::error::operation::BuildError::missing_field(
103                    "location",
104                    "location was not specified but it is required when building ParallelDataDataLocation",
105                )
106            })?,
107        })
108    }
109}