aws_sdk_lexmodelbuilding/operation/start_migration/
_start_migration_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 StartMigrationInput {
6    /// <p>The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.</p>
7    pub v1_bot_name: ::std::option::Option<::std::string::String>,
8    /// <p>The version of the bot to migrate to Amazon Lex V2. You can migrate the <code>$LATEST</code> version as well as any numbered version.</p>
9    pub v1_bot_version: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex V1 bot to.</p>
11    /// <ul>
12    /// <li>
13    /// <p>If the Amazon Lex V2 bot doesn't exist, you must use the <code>CREATE_NEW</code> migration strategy.</p></li>
14    /// <li>
15    /// <p>If the Amazon Lex V2 bot exists, you must use the <code>UPDATE_EXISTING</code> migration strategy to change the contents of the Amazon Lex V2 bot.</p></li>
16    /// </ul>
17    pub v2_bot_name: ::std::option::Option<::std::string::String>,
18    /// <p>The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.</p>
19    pub v2_bot_role: ::std::option::Option<::std::string::String>,
20    /// <p>The strategy used to conduct the migration.</p>
21    /// <ul>
22    /// <li>
23    /// <p><code>CREATE_NEW</code> - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1 bot to the new bot.</p></li>
24    /// <li>
25    /// <p><code>UPDATE_EXISTING</code> - Overwrites the existing Amazon Lex V2 bot metadata and the locale being migrated. It doesn't change any other locales in the Amazon Lex V2 bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2 bot.</p></li>
26    /// </ul>
27    pub migration_strategy: ::std::option::Option<crate::types::MigrationStrategy>,
28}
29impl StartMigrationInput {
30    /// <p>The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.</p>
31    pub fn v1_bot_name(&self) -> ::std::option::Option<&str> {
32        self.v1_bot_name.as_deref()
33    }
34    /// <p>The version of the bot to migrate to Amazon Lex V2. You can migrate the <code>$LATEST</code> version as well as any numbered version.</p>
35    pub fn v1_bot_version(&self) -> ::std::option::Option<&str> {
36        self.v1_bot_version.as_deref()
37    }
38    /// <p>The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex V1 bot to.</p>
39    /// <ul>
40    /// <li>
41    /// <p>If the Amazon Lex V2 bot doesn't exist, you must use the <code>CREATE_NEW</code> migration strategy.</p></li>
42    /// <li>
43    /// <p>If the Amazon Lex V2 bot exists, you must use the <code>UPDATE_EXISTING</code> migration strategy to change the contents of the Amazon Lex V2 bot.</p></li>
44    /// </ul>
45    pub fn v2_bot_name(&self) -> ::std::option::Option<&str> {
46        self.v2_bot_name.as_deref()
47    }
48    /// <p>The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.</p>
49    pub fn v2_bot_role(&self) -> ::std::option::Option<&str> {
50        self.v2_bot_role.as_deref()
51    }
52    /// <p>The strategy used to conduct the migration.</p>
53    /// <ul>
54    /// <li>
55    /// <p><code>CREATE_NEW</code> - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1 bot to the new bot.</p></li>
56    /// <li>
57    /// <p><code>UPDATE_EXISTING</code> - Overwrites the existing Amazon Lex V2 bot metadata and the locale being migrated. It doesn't change any other locales in the Amazon Lex V2 bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2 bot.</p></li>
58    /// </ul>
59    pub fn migration_strategy(&self) -> ::std::option::Option<&crate::types::MigrationStrategy> {
60        self.migration_strategy.as_ref()
61    }
62}
63impl StartMigrationInput {
64    /// Creates a new builder-style object to manufacture [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
65    pub fn builder() -> crate::operation::start_migration::builders::StartMigrationInputBuilder {
66        crate::operation::start_migration::builders::StartMigrationInputBuilder::default()
67    }
68}
69
70/// A builder for [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct StartMigrationInputBuilder {
74    pub(crate) v1_bot_name: ::std::option::Option<::std::string::String>,
75    pub(crate) v1_bot_version: ::std::option::Option<::std::string::String>,
76    pub(crate) v2_bot_name: ::std::option::Option<::std::string::String>,
77    pub(crate) v2_bot_role: ::std::option::Option<::std::string::String>,
78    pub(crate) migration_strategy: ::std::option::Option<crate::types::MigrationStrategy>,
79}
80impl StartMigrationInputBuilder {
81    /// <p>The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.</p>
82    /// This field is required.
83    pub fn v1_bot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.v1_bot_name = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.</p>
88    pub fn set_v1_bot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.v1_bot_name = input;
90        self
91    }
92    /// <p>The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.</p>
93    pub fn get_v1_bot_name(&self) -> &::std::option::Option<::std::string::String> {
94        &self.v1_bot_name
95    }
96    /// <p>The version of the bot to migrate to Amazon Lex V2. You can migrate the <code>$LATEST</code> version as well as any numbered version.</p>
97    /// This field is required.
98    pub fn v1_bot_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.v1_bot_version = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The version of the bot to migrate to Amazon Lex V2. You can migrate the <code>$LATEST</code> version as well as any numbered version.</p>
103    pub fn set_v1_bot_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.v1_bot_version = input;
105        self
106    }
107    /// <p>The version of the bot to migrate to Amazon Lex V2. You can migrate the <code>$LATEST</code> version as well as any numbered version.</p>
108    pub fn get_v1_bot_version(&self) -> &::std::option::Option<::std::string::String> {
109        &self.v1_bot_version
110    }
111    /// <p>The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex V1 bot to.</p>
112    /// <ul>
113    /// <li>
114    /// <p>If the Amazon Lex V2 bot doesn't exist, you must use the <code>CREATE_NEW</code> migration strategy.</p></li>
115    /// <li>
116    /// <p>If the Amazon Lex V2 bot exists, you must use the <code>UPDATE_EXISTING</code> migration strategy to change the contents of the Amazon Lex V2 bot.</p></li>
117    /// </ul>
118    /// This field is required.
119    pub fn v2_bot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.v2_bot_name = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex V1 bot to.</p>
124    /// <ul>
125    /// <li>
126    /// <p>If the Amazon Lex V2 bot doesn't exist, you must use the <code>CREATE_NEW</code> migration strategy.</p></li>
127    /// <li>
128    /// <p>If the Amazon Lex V2 bot exists, you must use the <code>UPDATE_EXISTING</code> migration strategy to change the contents of the Amazon Lex V2 bot.</p></li>
129    /// </ul>
130    pub fn set_v2_bot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.v2_bot_name = input;
132        self
133    }
134    /// <p>The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex V1 bot to.</p>
135    /// <ul>
136    /// <li>
137    /// <p>If the Amazon Lex V2 bot doesn't exist, you must use the <code>CREATE_NEW</code> migration strategy.</p></li>
138    /// <li>
139    /// <p>If the Amazon Lex V2 bot exists, you must use the <code>UPDATE_EXISTING</code> migration strategy to change the contents of the Amazon Lex V2 bot.</p></li>
140    /// </ul>
141    pub fn get_v2_bot_name(&self) -> &::std::option::Option<::std::string::String> {
142        &self.v2_bot_name
143    }
144    /// <p>The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.</p>
145    /// This field is required.
146    pub fn v2_bot_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.v2_bot_role = ::std::option::Option::Some(input.into());
148        self
149    }
150    /// <p>The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.</p>
151    pub fn set_v2_bot_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.v2_bot_role = input;
153        self
154    }
155    /// <p>The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.</p>
156    pub fn get_v2_bot_role(&self) -> &::std::option::Option<::std::string::String> {
157        &self.v2_bot_role
158    }
159    /// <p>The strategy used to conduct the migration.</p>
160    /// <ul>
161    /// <li>
162    /// <p><code>CREATE_NEW</code> - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1 bot to the new bot.</p></li>
163    /// <li>
164    /// <p><code>UPDATE_EXISTING</code> - Overwrites the existing Amazon Lex V2 bot metadata and the locale being migrated. It doesn't change any other locales in the Amazon Lex V2 bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2 bot.</p></li>
165    /// </ul>
166    /// This field is required.
167    pub fn migration_strategy(mut self, input: crate::types::MigrationStrategy) -> Self {
168        self.migration_strategy = ::std::option::Option::Some(input);
169        self
170    }
171    /// <p>The strategy used to conduct the migration.</p>
172    /// <ul>
173    /// <li>
174    /// <p><code>CREATE_NEW</code> - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1 bot to the new bot.</p></li>
175    /// <li>
176    /// <p><code>UPDATE_EXISTING</code> - Overwrites the existing Amazon Lex V2 bot metadata and the locale being migrated. It doesn't change any other locales in the Amazon Lex V2 bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2 bot.</p></li>
177    /// </ul>
178    pub fn set_migration_strategy(mut self, input: ::std::option::Option<crate::types::MigrationStrategy>) -> Self {
179        self.migration_strategy = input;
180        self
181    }
182    /// <p>The strategy used to conduct the migration.</p>
183    /// <ul>
184    /// <li>
185    /// <p><code>CREATE_NEW</code> - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1 bot to the new bot.</p></li>
186    /// <li>
187    /// <p><code>UPDATE_EXISTING</code> - Overwrites the existing Amazon Lex V2 bot metadata and the locale being migrated. It doesn't change any other locales in the Amazon Lex V2 bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2 bot.</p></li>
188    /// </ul>
189    pub fn get_migration_strategy(&self) -> &::std::option::Option<crate::types::MigrationStrategy> {
190        &self.migration_strategy
191    }
192    /// Consumes the builder and constructs a [`StartMigrationInput`](crate::operation::start_migration::StartMigrationInput).
193    pub fn build(
194        self,
195    ) -> ::std::result::Result<crate::operation::start_migration::StartMigrationInput, ::aws_smithy_types::error::operation::BuildError> {
196        ::std::result::Result::Ok(crate::operation::start_migration::StartMigrationInput {
197            v1_bot_name: self.v1_bot_name,
198            v1_bot_version: self.v1_bot_version,
199            v2_bot_name: self.v2_bot_name,
200            v2_bot_role: self.v2_bot_role,
201            migration_strategy: self.migration_strategy,
202        })
203    }
204}