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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateLibraryItemInput {
/// <p>The unique identifier of the Amazon Q Business application environment instance.</p>
pub instance_id: ::std::option::Option<::std::string::String>,
/// <p>The unique identifier of the Amazon Q App to publish to the library.</p>
pub app_id: ::std::option::Option<::std::string::String>,
/// <p>The version of the Amazon Q App to publish to the library.</p>
pub app_version: ::std::option::Option<i32>,
/// <p>The categories to associate with the library item for easier discovery.</p>
pub categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateLibraryItemInput {
/// <p>The unique identifier of the Amazon Q Business application environment instance.</p>
pub fn instance_id(&self) -> ::std::option::Option<&str> {
self.instance_id.as_deref()
}
/// <p>The unique identifier of the Amazon Q App to publish to the library.</p>
pub fn app_id(&self) -> ::std::option::Option<&str> {
self.app_id.as_deref()
}
/// <p>The version of the Amazon Q App to publish to the library.</p>
pub fn app_version(&self) -> ::std::option::Option<i32> {
self.app_version
}
/// <p>The categories to associate with the library item for easier discovery.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.categories.is_none()`.
pub fn categories(&self) -> &[::std::string::String] {
self.categories.as_deref().unwrap_or_default()
}
}
impl CreateLibraryItemInput {
/// Creates a new builder-style object to manufacture [`CreateLibraryItemInput`](crate::operation::create_library_item::CreateLibraryItemInput).
pub fn builder() -> crate::operation::create_library_item::builders::CreateLibraryItemInputBuilder {
crate::operation::create_library_item::builders::CreateLibraryItemInputBuilder::default()
}
}
/// A builder for [`CreateLibraryItemInput`](crate::operation::create_library_item::CreateLibraryItemInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateLibraryItemInputBuilder {
pub(crate) instance_id: ::std::option::Option<::std::string::String>,
pub(crate) app_id: ::std::option::Option<::std::string::String>,
pub(crate) app_version: ::std::option::Option<i32>,
pub(crate) categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateLibraryItemInputBuilder {
/// <p>The unique identifier of the Amazon Q Business application environment instance.</p>
/// This field is required.
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the Amazon Q Business application environment instance.</p>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_id = input;
self
}
/// <p>The unique identifier of the Amazon Q Business application environment instance.</p>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_id
}
/// <p>The unique identifier of the Amazon Q App to publish to the library.</p>
/// This field is required.
pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.app_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the Amazon Q App to publish to the library.</p>
pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.app_id = input;
self
}
/// <p>The unique identifier of the Amazon Q App to publish to the library.</p>
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
&self.app_id
}
/// <p>The version of the Amazon Q App to publish to the library.</p>
/// This field is required.
pub fn app_version(mut self, input: i32) -> Self {
self.app_version = ::std::option::Option::Some(input);
self
}
/// <p>The version of the Amazon Q App to publish to the library.</p>
pub fn set_app_version(mut self, input: ::std::option::Option<i32>) -> Self {
self.app_version = input;
self
}
/// <p>The version of the Amazon Q App to publish to the library.</p>
pub fn get_app_version(&self) -> &::std::option::Option<i32> {
&self.app_version
}
/// Appends an item to `categories`.
///
/// To override the contents of this collection use [`set_categories`](Self::set_categories).
///
/// <p>The categories to associate with the library item for easier discovery.</p>
pub fn categories(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.categories.unwrap_or_default();
v.push(input.into());
self.categories = ::std::option::Option::Some(v);
self
}
/// <p>The categories to associate with the library item for easier discovery.</p>
pub fn set_categories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.categories = input;
self
}
/// <p>The categories to associate with the library item for easier discovery.</p>
pub fn get_categories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.categories
}
/// Consumes the builder and constructs a [`CreateLibraryItemInput`](crate::operation::create_library_item::CreateLibraryItemInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_library_item::CreateLibraryItemInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_library_item::CreateLibraryItemInput {
instance_id: self.instance_id,
app_id: self.app_id,
app_version: self.app_version,
categories: self.categories,
})
}
}