aws_sdk_qbusiness/operation/batch_put_document/
_batch_put_document_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 BatchPutDocumentInput {
6    /// <p>The identifier of the Amazon Q Business application.</p>
7    pub application_id: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the Amazon Q Business index to add the documents to.</p>
9    pub index_id: ::std::option::Option<::std::string::String>,
10    /// <p>One or more documents to add to the index.</p><important>
11    /// <p>Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant.</p>
12    /// </important>
13    pub documents: ::std::option::Option<::std::vec::Vec<crate::types::Document>>,
14    /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket.</p>
15    pub role_arn: ::std::option::Option<::std::string::String>,
16    /// <p>The identifier of the data source sync during which the documents were added.</p>
17    pub data_source_sync_id: ::std::option::Option<::std::string::String>,
18}
19impl BatchPutDocumentInput {
20    /// <p>The identifier of the Amazon Q Business application.</p>
21    pub fn application_id(&self) -> ::std::option::Option<&str> {
22        self.application_id.as_deref()
23    }
24    /// <p>The identifier of the Amazon Q Business index to add the documents to.</p>
25    pub fn index_id(&self) -> ::std::option::Option<&str> {
26        self.index_id.as_deref()
27    }
28    /// <p>One or more documents to add to the index.</p><important>
29    /// <p>Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant.</p>
30    /// </important>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.documents.is_none()`.
33    pub fn documents(&self) -> &[crate::types::Document] {
34        self.documents.as_deref().unwrap_or_default()
35    }
36    /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket.</p>
37    pub fn role_arn(&self) -> ::std::option::Option<&str> {
38        self.role_arn.as_deref()
39    }
40    /// <p>The identifier of the data source sync during which the documents were added.</p>
41    pub fn data_source_sync_id(&self) -> ::std::option::Option<&str> {
42        self.data_source_sync_id.as_deref()
43    }
44}
45impl BatchPutDocumentInput {
46    /// Creates a new builder-style object to manufacture [`BatchPutDocumentInput`](crate::operation::batch_put_document::BatchPutDocumentInput).
47    pub fn builder() -> crate::operation::batch_put_document::builders::BatchPutDocumentInputBuilder {
48        crate::operation::batch_put_document::builders::BatchPutDocumentInputBuilder::default()
49    }
50}
51
52/// A builder for [`BatchPutDocumentInput`](crate::operation::batch_put_document::BatchPutDocumentInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct BatchPutDocumentInputBuilder {
56    pub(crate) application_id: ::std::option::Option<::std::string::String>,
57    pub(crate) index_id: ::std::option::Option<::std::string::String>,
58    pub(crate) documents: ::std::option::Option<::std::vec::Vec<crate::types::Document>>,
59    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
60    pub(crate) data_source_sync_id: ::std::option::Option<::std::string::String>,
61}
62impl BatchPutDocumentInputBuilder {
63    /// <p>The identifier of the Amazon Q Business application.</p>
64    /// This field is required.
65    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.application_id = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The identifier of the Amazon Q Business application.</p>
70    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.application_id = input;
72        self
73    }
74    /// <p>The identifier of the Amazon Q Business application.</p>
75    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
76        &self.application_id
77    }
78    /// <p>The identifier of the Amazon Q Business index to add the documents to.</p>
79    /// This field is required.
80    pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.index_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The identifier of the Amazon Q Business index to add the documents to.</p>
85    pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.index_id = input;
87        self
88    }
89    /// <p>The identifier of the Amazon Q Business index to add the documents to.</p>
90    pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.index_id
92    }
93    /// Appends an item to `documents`.
94    ///
95    /// To override the contents of this collection use [`set_documents`](Self::set_documents).
96    ///
97    /// <p>One or more documents to add to the index.</p><important>
98    /// <p>Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant.</p>
99    /// </important>
100    pub fn documents(mut self, input: crate::types::Document) -> Self {
101        let mut v = self.documents.unwrap_or_default();
102        v.push(input);
103        self.documents = ::std::option::Option::Some(v);
104        self
105    }
106    /// <p>One or more documents to add to the index.</p><important>
107    /// <p>Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant.</p>
108    /// </important>
109    pub fn set_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Document>>) -> Self {
110        self.documents = input;
111        self
112    }
113    /// <p>One or more documents to add to the index.</p><important>
114    /// <p>Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant.</p>
115    /// </important>
116    pub fn get_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Document>> {
117        &self.documents
118    }
119    /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket.</p>
120    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.role_arn = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket.</p>
125    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.role_arn = input;
127        self
128    }
129    /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket.</p>
130    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
131        &self.role_arn
132    }
133    /// <p>The identifier of the data source sync during which the documents were added.</p>
134    pub fn data_source_sync_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.data_source_sync_id = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// <p>The identifier of the data source sync during which the documents were added.</p>
139    pub fn set_data_source_sync_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.data_source_sync_id = input;
141        self
142    }
143    /// <p>The identifier of the data source sync during which the documents were added.</p>
144    pub fn get_data_source_sync_id(&self) -> &::std::option::Option<::std::string::String> {
145        &self.data_source_sync_id
146    }
147    /// Consumes the builder and constructs a [`BatchPutDocumentInput`](crate::operation::batch_put_document::BatchPutDocumentInput).
148    pub fn build(
149        self,
150    ) -> ::std::result::Result<crate::operation::batch_put_document::BatchPutDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
151        ::std::result::Result::Ok(crate::operation::batch_put_document::BatchPutDocumentInput {
152            application_id: self.application_id,
153            index_id: self.index_id,
154            documents: self.documents,
155            role_arn: self.role_arn,
156            data_source_sync_id: self.data_source_sync_id,
157        })
158    }
159}