aws_sdk_kms/operation/import_key_material/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::import_key_material::_import_key_material_output::ImportKeyMaterialOutputBuilder;
3
4pub use crate::operation::import_key_material::_import_key_material_input::ImportKeyMaterialInputBuilder;
5
6impl crate::operation::import_key_material::builders::ImportKeyMaterialInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::import_key_material::ImportKeyMaterialOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::import_key_material::ImportKeyMaterialError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.import_key_material();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ImportKeyMaterial`.
24///
25/// <p>Imports or reimports key material into an existing KMS key that was created without key material. You can also use this operation to set or update the expiration model and expiration date of the imported key material.</p>
26/// <p>By default, KMS creates KMS keys with key material that it generates. You can also generate and import your own key material. For more information about importing key material, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">Importing key material</a>.</p>
27/// <p>For asymmetric, HMAC and multi-Region keys, you cannot change the key material after the initial import. You can import multiple key materials into single-Region, symmetric encryption keys and rotate the key material on demand using <code>RotateKeyOnDemand</code>.</p>
28/// <p>After you import key material, you can <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#reimport-key-material">reimport the same key material</a> into that KMS key or, if the key supports on-demand rotation, import new key material. You can use the <code>ImportType</code> parameter to indicate whether you are importing new key material or re-importing previously imported key material. You might reimport key material to replace key material that expired or key material that you deleted. You might also reimport key material to change the expiration model or expiration date of the key material.</p>
29/// <p>Each time you import key material into KMS, you can determine whether (<code>ExpirationModel</code>) and when (<code>ValidTo</code>) the key material expires. To change the expiration of your key material, you must import it again, either by calling <code>ImportKeyMaterial</code> or using the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-import-key-material-console">import features</a> of the KMS console.</p>
30/// <p>Before you call <code>ImportKeyMaterial</code>, complete these steps:</p>
31/// <ul>
32/// <li>
33/// <p>Create or identify a KMS key with <code>EXTERNAL</code> origin, which indicates that the KMS key is designed for imported key material.</p>
34/// <p>To create a new KMS key for imported key material, call the <code>CreateKey</code> operation with an <code>Origin</code> value of <code>EXTERNAL</code>. You can create a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, asymmetric key agreement key, or asymmetric signing KMS key. You can also import key material into a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">multi-Region key</a> of any supported type. However, you can't import key material into a KMS key in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-store-overview.html">custom key store</a>.</p></li>
35/// <li>
36/// <p>Call the <code>GetParametersForImport</code> operation to get a public key and import token set for importing key material.</p></li>
37/// <li>
38/// <p>Use the public key in the <code>GetParametersForImport</code> response to encrypt your key material.</p></li>
39/// </ul>
40/// <p>Then, in an <code>ImportKeyMaterial</code> request, you submit your encrypted key material and import token. When calling this operation, you must specify the following values:</p>
41/// <ul>
42/// <li>
43/// <p>The key ID or key ARN of the KMS key to associate with the imported key material. Its <code>Origin</code> must be <code>EXTERNAL</code> and its <code>KeyState</code> must be <code>PendingImport</code>. You cannot perform this operation on a KMS key in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-store-overview.html">custom key store</a>, or on a KMS key in a different Amazon Web Services account. To get the <code>Origin</code> and <code>KeyState</code> of a KMS key, call <code>DescribeKey</code>.</p></li>
44/// <li>
45/// <p>The encrypted key material.</p></li>
46/// <li>
47/// <p>The import token that <code>GetParametersForImport</code> returned. You must use a public key and token from the same <code>GetParametersForImport</code> response.</p></li>
48/// <li>
49/// <p>Whether the key material expires (<code>ExpirationModel</code>) and, if so, when (<code>ValidTo</code>). For help with this choice, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-expiration">Setting an expiration time</a> in the <i>Key Management Service Developer Guide</i>.</p>
50/// <p>If you set an expiration date, KMS deletes the key material from the KMS key on the specified date, making the KMS key unusable. To use the KMS key in cryptographic operations again, you must reimport the same key material. However, you can delete and reimport the key material at any time, including before the key material expires. Each time you reimport, you can eliminate or reset the expiration time.</p></li>
51/// </ul>
52/// <p>When this operation is successful, the key state of the KMS key changes from <code>PendingImport</code> to <code>Enabled</code>, and you can use the KMS key in cryptographic operations. For single-Region, symmetric encryption keys, you will need to import all of the key materials associated with the KMS key to change its state to <code>Enabled</code>. Use the <code>ListKeyRotations</code> operation to list the ID and import state of each key material associated with a KMS key.</p>
53/// <p>If this operation fails, use the exception to help determine the problem. If the error is related to the key material, the import token, or wrapping key, use <code>GetParametersForImport</code> to get a new public key and import token for the KMS key and repeat the import procedure. For help, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-conceptual.html">Create a KMS key with imported key material</a> in the <i>Key Management Service Developer Guide</i>.</p>
54/// <p>The KMS key that you use for this operation must be in a compatible key state. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
55/// <p><b>Cross-account use</b>: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.</p>
56/// <p><b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ImportKeyMaterial</a> (key policy)</p>
57/// <p><b>Related operations:</b></p>
58/// <ul>
59/// <li>
60/// <p><code>DeleteImportedKeyMaterial</code></p></li>
61/// <li>
62/// <p><code>GetParametersForImport</code></p></li>
63/// <li>
64/// <p><code>ListKeyRotations</code></p></li>
65/// <li>
66/// <p><code>RotateKeyOnDemand</code></p></li>
67/// </ul>
68/// <p><b>Eventual consistency</b>: The KMS API follows an eventual consistency model. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/accessing-kms.html#programming-eventual-consistency">KMS eventual consistency</a>.</p>
69#[derive(::std::clone::Clone, ::std::fmt::Debug)]
70pub struct ImportKeyMaterialFluentBuilder {
71    handle: ::std::sync::Arc<crate::client::Handle>,
72    inner: crate::operation::import_key_material::builders::ImportKeyMaterialInputBuilder,
73    config_override: ::std::option::Option<crate::config::Builder>,
74}
75impl
76    crate::client::customize::internal::CustomizableSend<
77        crate::operation::import_key_material::ImportKeyMaterialOutput,
78        crate::operation::import_key_material::ImportKeyMaterialError,
79    > for ImportKeyMaterialFluentBuilder
80{
81    fn send(
82        self,
83        config_override: crate::config::Builder,
84    ) -> crate::client::customize::internal::BoxFuture<
85        crate::client::customize::internal::SendResult<
86            crate::operation::import_key_material::ImportKeyMaterialOutput,
87            crate::operation::import_key_material::ImportKeyMaterialError,
88        >,
89    > {
90        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
91    }
92}
93impl ImportKeyMaterialFluentBuilder {
94    /// Creates a new `ImportKeyMaterialFluentBuilder`.
95    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
96        Self {
97            handle,
98            inner: ::std::default::Default::default(),
99            config_override: ::std::option::Option::None,
100        }
101    }
102    /// Access the ImportKeyMaterial as a reference.
103    pub fn as_input(&self) -> &crate::operation::import_key_material::builders::ImportKeyMaterialInputBuilder {
104        &self.inner
105    }
106    /// Sends the request and returns the response.
107    ///
108    /// If an error occurs, an `SdkError` will be returned with additional details that
109    /// can be matched against.
110    ///
111    /// By default, any retryable failures will be retried twice. Retry behavior
112    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
113    /// set when configuring the client.
114    pub async fn send(
115        self,
116    ) -> ::std::result::Result<
117        crate::operation::import_key_material::ImportKeyMaterialOutput,
118        ::aws_smithy_runtime_api::client::result::SdkError<
119            crate::operation::import_key_material::ImportKeyMaterialError,
120            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
121        >,
122    > {
123        let input = self
124            .inner
125            .build()
126            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
127        let runtime_plugins = crate::operation::import_key_material::ImportKeyMaterial::operation_runtime_plugins(
128            self.handle.runtime_plugins.clone(),
129            &self.handle.conf,
130            self.config_override,
131        );
132        crate::operation::import_key_material::ImportKeyMaterial::orchestrate(&runtime_plugins, input).await
133    }
134
135    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
136    pub fn customize(
137        self,
138    ) -> crate::client::customize::CustomizableOperation<
139        crate::operation::import_key_material::ImportKeyMaterialOutput,
140        crate::operation::import_key_material::ImportKeyMaterialError,
141        Self,
142    > {
143        crate::client::customize::CustomizableOperation::new(self)
144    }
145    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
146        self.set_config_override(::std::option::Option::Some(config_override.into()));
147        self
148    }
149
150    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
151        self.config_override = config_override;
152        self
153    }
154    /// <p>The identifier of the KMS key that will be associated with the imported key material. This must be the same KMS key specified in the <code>KeyID</code> parameter of the corresponding <code>GetParametersForImport</code> request. The <code>Origin</code> of the KMS key must be <code>EXTERNAL</code> and its <code>KeyState</code> must be <code>PendingImport</code>.</p>
155    /// <p>The KMS key can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, or asymmetric signing KMS key, including a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">multi-Region key</a> of any supported type. You cannot perform this operation on a KMS key in a custom key store, or on a KMS key in a different Amazon Web Services account.</p>
156    /// <p>Specify the key ID or key ARN of the KMS key.</p>
157    /// <p>For example:</p>
158    /// <ul>
159    /// <li>
160    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
161    /// <li>
162    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
163    /// </ul>
164    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
165    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.inner = self.inner.key_id(input.into());
167        self
168    }
169    /// <p>The identifier of the KMS key that will be associated with the imported key material. This must be the same KMS key specified in the <code>KeyID</code> parameter of the corresponding <code>GetParametersForImport</code> request. The <code>Origin</code> of the KMS key must be <code>EXTERNAL</code> and its <code>KeyState</code> must be <code>PendingImport</code>.</p>
170    /// <p>The KMS key can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, or asymmetric signing KMS key, including a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">multi-Region key</a> of any supported type. You cannot perform this operation on a KMS key in a custom key store, or on a KMS key in a different Amazon Web Services account.</p>
171    /// <p>Specify the key ID or key ARN of the KMS key.</p>
172    /// <p>For example:</p>
173    /// <ul>
174    /// <li>
175    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
176    /// <li>
177    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
178    /// </ul>
179    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
180    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_key_id(input);
182        self
183    }
184    /// <p>The identifier of the KMS key that will be associated with the imported key material. This must be the same KMS key specified in the <code>KeyID</code> parameter of the corresponding <code>GetParametersForImport</code> request. The <code>Origin</code> of the KMS key must be <code>EXTERNAL</code> and its <code>KeyState</code> must be <code>PendingImport</code>.</p>
185    /// <p>The KMS key can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, or asymmetric signing KMS key, including a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">multi-Region key</a> of any supported type. You cannot perform this operation on a KMS key in a custom key store, or on a KMS key in a different Amazon Web Services account.</p>
186    /// <p>Specify the key ID or key ARN of the KMS key.</p>
187    /// <p>For example:</p>
188    /// <ul>
189    /// <li>
190    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
191    /// <li>
192    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
193    /// </ul>
194    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
195    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_key_id()
197    }
198    /// <p>The import token that you received in the response to a previous <code>GetParametersForImport</code> request. It must be from the same response that contained the public key that you used to encrypt the key material.</p>
199    pub fn import_token(mut self, input: ::aws_smithy_types::Blob) -> Self {
200        self.inner = self.inner.import_token(input);
201        self
202    }
203    /// <p>The import token that you received in the response to a previous <code>GetParametersForImport</code> request. It must be from the same response that contained the public key that you used to encrypt the key material.</p>
204    pub fn set_import_token(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
205        self.inner = self.inner.set_import_token(input);
206        self
207    }
208    /// <p>The import token that you received in the response to a previous <code>GetParametersForImport</code> request. It must be from the same response that contained the public key that you used to encrypt the key material.</p>
209    pub fn get_import_token(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
210        self.inner.get_import_token()
211    }
212    /// <p>The encrypted key material to import. The key material must be encrypted under the public wrapping key that <code>GetParametersForImport</code> returned, using the wrapping algorithm that you specified in the same <code>GetParametersForImport</code> request.</p>
213    pub fn encrypted_key_material(mut self, input: ::aws_smithy_types::Blob) -> Self {
214        self.inner = self.inner.encrypted_key_material(input);
215        self
216    }
217    /// <p>The encrypted key material to import. The key material must be encrypted under the public wrapping key that <code>GetParametersForImport</code> returned, using the wrapping algorithm that you specified in the same <code>GetParametersForImport</code> request.</p>
218    pub fn set_encrypted_key_material(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
219        self.inner = self.inner.set_encrypted_key_material(input);
220        self
221    }
222    /// <p>The encrypted key material to import. The key material must be encrypted under the public wrapping key that <code>GetParametersForImport</code> returned, using the wrapping algorithm that you specified in the same <code>GetParametersForImport</code> request.</p>
223    pub fn get_encrypted_key_material(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
224        self.inner.get_encrypted_key_material()
225    }
226    /// <p>The date and time when the imported key material expires. This parameter is required when the value of the <code>ExpirationModel</code> parameter is <code>KEY_MATERIAL_EXPIRES</code>. Otherwise it is not valid.</p>
227    /// <p>The value of this parameter must be a future date and time. The maximum value is 365 days from the request date.</p>
228    /// <p>When the key material expires, KMS deletes the key material from the KMS key. Without its key material, the KMS key is unusable. To use the KMS key in cryptographic operations, you must reimport the same key material.</p>
229    /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must delete (<code>DeleteImportedKeyMaterial</code>) and reimport the key material.</p>
230    pub fn valid_to(mut self, input: ::aws_smithy_types::DateTime) -> Self {
231        self.inner = self.inner.valid_to(input);
232        self
233    }
234    /// <p>The date and time when the imported key material expires. This parameter is required when the value of the <code>ExpirationModel</code> parameter is <code>KEY_MATERIAL_EXPIRES</code>. Otherwise it is not valid.</p>
235    /// <p>The value of this parameter must be a future date and time. The maximum value is 365 days from the request date.</p>
236    /// <p>When the key material expires, KMS deletes the key material from the KMS key. Without its key material, the KMS key is unusable. To use the KMS key in cryptographic operations, you must reimport the same key material.</p>
237    /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must delete (<code>DeleteImportedKeyMaterial</code>) and reimport the key material.</p>
238    pub fn set_valid_to(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
239        self.inner = self.inner.set_valid_to(input);
240        self
241    }
242    /// <p>The date and time when the imported key material expires. This parameter is required when the value of the <code>ExpirationModel</code> parameter is <code>KEY_MATERIAL_EXPIRES</code>. Otherwise it is not valid.</p>
243    /// <p>The value of this parameter must be a future date and time. The maximum value is 365 days from the request date.</p>
244    /// <p>When the key material expires, KMS deletes the key material from the KMS key. Without its key material, the KMS key is unusable. To use the KMS key in cryptographic operations, you must reimport the same key material.</p>
245    /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must delete (<code>DeleteImportedKeyMaterial</code>) and reimport the key material.</p>
246    pub fn get_valid_to(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
247        self.inner.get_valid_to()
248    }
249    /// <p>Specifies whether the key material expires. The default is <code>KEY_MATERIAL_EXPIRES</code>. For help with this choice, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-expiration">Setting an expiration time</a> in the <i>Key Management Service Developer Guide</i>.</p>
250    /// <p>When the value of <code>ExpirationModel</code> is <code>KEY_MATERIAL_EXPIRES</code>, you must specify a value for the <code>ValidTo</code> parameter. When value is <code>KEY_MATERIAL_DOES_NOT_EXPIRE</code>, you must omit the <code>ValidTo</code> parameter.</p>
251    /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must reimport the key material.</p>
252    pub fn expiration_model(mut self, input: crate::types::ExpirationModelType) -> Self {
253        self.inner = self.inner.expiration_model(input);
254        self
255    }
256    /// <p>Specifies whether the key material expires. The default is <code>KEY_MATERIAL_EXPIRES</code>. For help with this choice, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-expiration">Setting an expiration time</a> in the <i>Key Management Service Developer Guide</i>.</p>
257    /// <p>When the value of <code>ExpirationModel</code> is <code>KEY_MATERIAL_EXPIRES</code>, you must specify a value for the <code>ValidTo</code> parameter. When value is <code>KEY_MATERIAL_DOES_NOT_EXPIRE</code>, you must omit the <code>ValidTo</code> parameter.</p>
258    /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must reimport the key material.</p>
259    pub fn set_expiration_model(mut self, input: ::std::option::Option<crate::types::ExpirationModelType>) -> Self {
260        self.inner = self.inner.set_expiration_model(input);
261        self
262    }
263    /// <p>Specifies whether the key material expires. The default is <code>KEY_MATERIAL_EXPIRES</code>. For help with this choice, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-expiration">Setting an expiration time</a> in the <i>Key Management Service Developer Guide</i>.</p>
264    /// <p>When the value of <code>ExpirationModel</code> is <code>KEY_MATERIAL_EXPIRES</code>, you must specify a value for the <code>ValidTo</code> parameter. When value is <code>KEY_MATERIAL_DOES_NOT_EXPIRE</code>, you must omit the <code>ValidTo</code> parameter.</p>
265    /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must reimport the key material.</p>
266    pub fn get_expiration_model(&self) -> &::std::option::Option<crate::types::ExpirationModelType> {
267        self.inner.get_expiration_model()
268    }
269    /// <p>Indicates whether the key material being imported is previously associated with this KMS key or not. This parameter is optional and only usable with symmetric encryption keys. If no key material has ever been imported into the KMS key, and this parameter is omitted, the parameter defaults to <code>NEW_KEY_MATERIAL</code>. After the first key material is imported, if this parameter is omitted then the parameter defaults to <code>EXISTING_KEY_MATERIAL</code>.</p>
270    pub fn import_type(mut self, input: crate::types::ImportType) -> Self {
271        self.inner = self.inner.import_type(input);
272        self
273    }
274    /// <p>Indicates whether the key material being imported is previously associated with this KMS key or not. This parameter is optional and only usable with symmetric encryption keys. If no key material has ever been imported into the KMS key, and this parameter is omitted, the parameter defaults to <code>NEW_KEY_MATERIAL</code>. After the first key material is imported, if this parameter is omitted then the parameter defaults to <code>EXISTING_KEY_MATERIAL</code>.</p>
275    pub fn set_import_type(mut self, input: ::std::option::Option<crate::types::ImportType>) -> Self {
276        self.inner = self.inner.set_import_type(input);
277        self
278    }
279    /// <p>Indicates whether the key material being imported is previously associated with this KMS key or not. This parameter is optional and only usable with symmetric encryption keys. If no key material has ever been imported into the KMS key, and this parameter is omitted, the parameter defaults to <code>NEW_KEY_MATERIAL</code>. After the first key material is imported, if this parameter is omitted then the parameter defaults to <code>EXISTING_KEY_MATERIAL</code>.</p>
280    pub fn get_import_type(&self) -> &::std::option::Option<crate::types::ImportType> {
281        self.inner.get_import_type()
282    }
283    /// <p>Description for the key material being imported. This parameter is optional and only usable with symmetric encryption keys. If you do not specify a key material description, KMS retains the value you specified when you last imported the same key material into this KMS key.</p>
284    pub fn key_material_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285        self.inner = self.inner.key_material_description(input.into());
286        self
287    }
288    /// <p>Description for the key material being imported. This parameter is optional and only usable with symmetric encryption keys. If you do not specify a key material description, KMS retains the value you specified when you last imported the same key material into this KMS key.</p>
289    pub fn set_key_material_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
290        self.inner = self.inner.set_key_material_description(input);
291        self
292    }
293    /// <p>Description for the key material being imported. This parameter is optional and only usable with symmetric encryption keys. If you do not specify a key material description, KMS retains the value you specified when you last imported the same key material into this KMS key.</p>
294    pub fn get_key_material_description(&self) -> &::std::option::Option<::std::string::String> {
295        self.inner.get_key_material_description()
296    }
297    /// <p>Identifies the key material being imported. This parameter is optional and only usable with symmetric encryption keys. You cannot specify a key material ID with <code>ImportType</code> set to <code>NEW_KEY_MATERIAL</code>. Whenever you import key material into a symmetric encryption key, KMS assigns a unique identifier to the key material based on the KMS key ID and the imported key material. When you re-import key material with a specified key material ID, KMS:</p>
298    /// <ul>
299    /// <li>
300    /// <p>Computes the identifier for the key material</p></li>
301    /// <li>
302    /// <p>Matches the computed identifier against the specified key material ID</p></li>
303    /// <li>
304    /// <p>Verifies that the key material ID is already associated with the KMS key</p></li>
305    /// </ul>
306    /// <p>To get the list of key material IDs associated with a KMS key, use <code>ListKeyRotations</code>.</p>
307    pub fn key_material_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
308        self.inner = self.inner.key_material_id(input.into());
309        self
310    }
311    /// <p>Identifies the key material being imported. This parameter is optional and only usable with symmetric encryption keys. You cannot specify a key material ID with <code>ImportType</code> set to <code>NEW_KEY_MATERIAL</code>. Whenever you import key material into a symmetric encryption key, KMS assigns a unique identifier to the key material based on the KMS key ID and the imported key material. When you re-import key material with a specified key material ID, KMS:</p>
312    /// <ul>
313    /// <li>
314    /// <p>Computes the identifier for the key material</p></li>
315    /// <li>
316    /// <p>Matches the computed identifier against the specified key material ID</p></li>
317    /// <li>
318    /// <p>Verifies that the key material ID is already associated with the KMS key</p></li>
319    /// </ul>
320    /// <p>To get the list of key material IDs associated with a KMS key, use <code>ListKeyRotations</code>.</p>
321    pub fn set_key_material_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
322        self.inner = self.inner.set_key_material_id(input);
323        self
324    }
325    /// <p>Identifies the key material being imported. This parameter is optional and only usable with symmetric encryption keys. You cannot specify a key material ID with <code>ImportType</code> set to <code>NEW_KEY_MATERIAL</code>. Whenever you import key material into a symmetric encryption key, KMS assigns a unique identifier to the key material based on the KMS key ID and the imported key material. When you re-import key material with a specified key material ID, KMS:</p>
326    /// <ul>
327    /// <li>
328    /// <p>Computes the identifier for the key material</p></li>
329    /// <li>
330    /// <p>Matches the computed identifier against the specified key material ID</p></li>
331    /// <li>
332    /// <p>Verifies that the key material ID is already associated with the KMS key</p></li>
333    /// </ul>
334    /// <p>To get the list of key material IDs associated with a KMS key, use <code>ListKeyRotations</code>.</p>
335    pub fn get_key_material_id(&self) -> &::std::option::Option<::std::string::String> {
336        self.inner.get_key_material_id()
337    }
338}