1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The content and content type of a document.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Document {
/// <p>The <code>Content</code>field type is Binary large object (blob). This object contains the document content converted into base64-encoded binary data. If you use one of the AWS SDKs, the SDK performs the Base64-encoding on this field before sending the request.</p>
pub content: ::aws_smithy_types::Blob,
/// <p>Describes the format of the document. You can specify one of the following:</p>
/// <ul>
/// <li>
/// <p><code>text/html</code> - The input data consists of HTML content. Amazon Translate translates only the text in the HTML element.</p></li>
/// <li>
/// <p><code>text/plain</code> - The input data consists of unformatted text. Amazon Translate translates every character in the content.</p></li>
/// <li>
/// <p><code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code> - The input data consists of a Word document (.docx).</p></li>
/// </ul>
pub content_type: ::std::string::String,
}
impl Document {
/// <p>The <code>Content</code>field type is Binary large object (blob). This object contains the document content converted into base64-encoded binary data. If you use one of the AWS SDKs, the SDK performs the Base64-encoding on this field before sending the request.</p>
pub fn content(&self) -> &::aws_smithy_types::Blob {
&self.content
}
/// <p>Describes the format of the document. You can specify one of the following:</p>
/// <ul>
/// <li>
/// <p><code>text/html</code> - The input data consists of HTML content. Amazon Translate translates only the text in the HTML element.</p></li>
/// <li>
/// <p><code>text/plain</code> - The input data consists of unformatted text. Amazon Translate translates every character in the content.</p></li>
/// <li>
/// <p><code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code> - The input data consists of a Word document (.docx).</p></li>
/// </ul>
pub fn content_type(&self) -> &str {
use std::ops::Deref;
self.content_type.deref()
}
}
impl ::std::fmt::Debug for Document {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Document");
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("content_type", &self.content_type);
formatter.finish()
}
}
impl Document {
/// Creates a new builder-style object to manufacture [`Document`](crate::types::Document).
pub fn builder() -> crate::types::builders::DocumentBuilder {
crate::types::builders::DocumentBuilder::default()
}
}
/// A builder for [`Document`](crate::types::Document).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct DocumentBuilder {
pub(crate) content: ::std::option::Option<::aws_smithy_types::Blob>,
pub(crate) content_type: ::std::option::Option<::std::string::String>,
}
impl DocumentBuilder {
/// <p>The <code>Content</code>field type is Binary large object (blob). This object contains the document content converted into base64-encoded binary data. If you use one of the AWS SDKs, the SDK performs the Base64-encoding on this field before sending the request.</p>
/// This field is required.
pub fn content(mut self, input: ::aws_smithy_types::Blob) -> Self {
self.content = ::std::option::Option::Some(input);
self
}
/// <p>The <code>Content</code>field type is Binary large object (blob). This object contains the document content converted into base64-encoded binary data. If you use one of the AWS SDKs, the SDK performs the Base64-encoding on this field before sending the request.</p>
pub fn set_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
self.content = input;
self
}
/// <p>The <code>Content</code>field type is Binary large object (blob). This object contains the document content converted into base64-encoded binary data. If you use one of the AWS SDKs, the SDK performs the Base64-encoding on this field before sending the request.</p>
pub fn get_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
&self.content
}
/// <p>Describes the format of the document. You can specify one of the following:</p>
/// <ul>
/// <li>
/// <p><code>text/html</code> - The input data consists of HTML content. Amazon Translate translates only the text in the HTML element.</p></li>
/// <li>
/// <p><code>text/plain</code> - The input data consists of unformatted text. Amazon Translate translates every character in the content.</p></li>
/// <li>
/// <p><code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code> - The input data consists of a Word document (.docx).</p></li>
/// </ul>
/// This field is required.
pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.content_type = ::std::option::Option::Some(input.into());
self
}
/// <p>Describes the format of the document. You can specify one of the following:</p>
/// <ul>
/// <li>
/// <p><code>text/html</code> - The input data consists of HTML content. Amazon Translate translates only the text in the HTML element.</p></li>
/// <li>
/// <p><code>text/plain</code> - The input data consists of unformatted text. Amazon Translate translates every character in the content.</p></li>
/// <li>
/// <p><code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code> - The input data consists of a Word document (.docx).</p></li>
/// </ul>
pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.content_type = input;
self
}
/// <p>Describes the format of the document. You can specify one of the following:</p>
/// <ul>
/// <li>
/// <p><code>text/html</code> - The input data consists of HTML content. Amazon Translate translates only the text in the HTML element.</p></li>
/// <li>
/// <p><code>text/plain</code> - The input data consists of unformatted text. Amazon Translate translates every character in the content.</p></li>
/// <li>
/// <p><code>application/vnd.openxmlformats-officedocument.wordprocessingml.document</code> - The input data consists of a Word document (.docx).</p></li>
/// </ul>
pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
&self.content_type
}
/// Consumes the builder and constructs a [`Document`](crate::types::Document).
/// This method will fail if any of the following fields are not set:
/// - [`content`](crate::types::builders::DocumentBuilder::content)
/// - [`content_type`](crate::types::builders::DocumentBuilder::content_type)
pub fn build(self) -> ::std::result::Result<crate::types::Document, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Document {
content: self.content.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"content",
"content was not specified but it is required when building Document",
)
})?,
content_type: self.content_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"content_type",
"content_type was not specified but it is required when building Document",
)
})?,
})
}
}
impl ::std::fmt::Debug for DocumentBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DocumentBuilder");
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("content_type", &self.content_type);
formatter.finish()
}
}