// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::describe_model_package::_describe_model_package_input::DescribeModelPackageInputBuilder;
pub use crate::operation::describe_model_package::_describe_model_package_output::DescribeModelPackageOutputBuilder;
impl crate::operation::describe_model_package::builders::DescribeModelPackageInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::describe_model_package::DescribeModelPackageOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_model_package::DescribeModelPackageError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.describe_model_package();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `DescribeModelPackage`.
///
/// <p>Returns a description of the specified model package, which is used to create SageMaker models or list them on Amazon Web Services Marketplace.</p><important>
/// <p>If you provided a KMS Key ID when you created your model package, you will see the <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html">KMS Decrypt</a> API call in your CloudTrail logs when you use this API. To call this operation without requiring <code>kms:Decrypt</code> permission on the customer-managed key, set <code>IncludedData</code> to <code>MetadataOnly</code>; the response is returned with the embedded <code>ModelCard.ModelCardContent</code> field sanitized.</p>
/// </important>
/// <p>To create models in SageMaker, buyers can subscribe to model packages listed on Amazon Web Services Marketplace.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DescribeModelPackageFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::describe_model_package::builders::DescribeModelPackageInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::describe_model_package::DescribeModelPackageOutput,
crate::operation::describe_model_package::DescribeModelPackageError,
> for DescribeModelPackageFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::describe_model_package::DescribeModelPackageOutput,
crate::operation::describe_model_package::DescribeModelPackageError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl DescribeModelPackageFluentBuilder {
/// Creates a new `DescribeModelPackageFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the DescribeModelPackage as a reference.
pub fn as_input(&self) -> &crate::operation::describe_model_package::builders::DescribeModelPackageInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::describe_model_package::DescribeModelPackageOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_model_package::DescribeModelPackageError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::describe_model_package::DescribeModelPackage::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::describe_model_package::DescribeModelPackage::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::describe_model_package::DescribeModelPackageOutput,
crate::operation::describe_model_package::DescribeModelPackageError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The name or Amazon Resource Name (ARN) of the model package to describe.</p>
/// <p>When you specify a name, the name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen).</p>
pub fn model_package_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.model_package_name(input.into());
self
}
/// <p>The name or Amazon Resource Name (ARN) of the model package to describe.</p>
/// <p>When you specify a name, the name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen).</p>
pub fn set_model_package_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_model_package_name(input);
self
}
/// <p>The name or Amazon Resource Name (ARN) of the model package to describe.</p>
/// <p>When you specify a name, the name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen).</p>
pub fn get_model_package_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_model_package_name()
}
/// <p>Specifies the level of model package data to include in the response. Use this parameter to call <code>DescribeModelPackage</code> on a model package that has an associated model card without requiring <code>kms:Decrypt</code> permission on the customer-managed KMS key associated with the embedded model card.</p>
/// <ul>
/// <li>
/// <p><code>AllData</code>: Returns the full model package response, including the unredacted <code>ModelCard.ModelCardContent</code>. This option requires <code>kms:Decrypt</code> permission on the customer-managed key, if one is associated with the embedded model card. This is the default.</p></li>
/// <li>
/// <p><code>MetadataOnly</code>: Returns the full model package response, but with the embedded <code>ModelCard.ModelCardContent</code> sanitized to include only a small set of unencrypted metadata fields. This option does not require <code>kms:Decrypt</code> permission. All other top-level response fields, including <code>InferenceSpecification</code>, <code>ModelMetrics</code>, <code>DriftCheckBaselines</code>, and <code>SecurityConfig</code>, are returned unchanged. For the list of fields preserved within <code>ModelCardContent</code>, see <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeModelPackage.html#sagemaker-DescribeModelPackage-response-ModelCard">ModelCard</a>.</p></li>
/// </ul>
/// <p>If you don't specify a value, SageMaker returns <code>AllData</code>.</p>
pub fn included_data(mut self, input: crate::types::IncludedData) -> Self {
self.inner = self.inner.included_data(input);
self
}
/// <p>Specifies the level of model package data to include in the response. Use this parameter to call <code>DescribeModelPackage</code> on a model package that has an associated model card without requiring <code>kms:Decrypt</code> permission on the customer-managed KMS key associated with the embedded model card.</p>
/// <ul>
/// <li>
/// <p><code>AllData</code>: Returns the full model package response, including the unredacted <code>ModelCard.ModelCardContent</code>. This option requires <code>kms:Decrypt</code> permission on the customer-managed key, if one is associated with the embedded model card. This is the default.</p></li>
/// <li>
/// <p><code>MetadataOnly</code>: Returns the full model package response, but with the embedded <code>ModelCard.ModelCardContent</code> sanitized to include only a small set of unencrypted metadata fields. This option does not require <code>kms:Decrypt</code> permission. All other top-level response fields, including <code>InferenceSpecification</code>, <code>ModelMetrics</code>, <code>DriftCheckBaselines</code>, and <code>SecurityConfig</code>, are returned unchanged. For the list of fields preserved within <code>ModelCardContent</code>, see <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeModelPackage.html#sagemaker-DescribeModelPackage-response-ModelCard">ModelCard</a>.</p></li>
/// </ul>
/// <p>If you don't specify a value, SageMaker returns <code>AllData</code>.</p>
pub fn set_included_data(mut self, input: ::std::option::Option<crate::types::IncludedData>) -> Self {
self.inner = self.inner.set_included_data(input);
self
}
/// <p>Specifies the level of model package data to include in the response. Use this parameter to call <code>DescribeModelPackage</code> on a model package that has an associated model card without requiring <code>kms:Decrypt</code> permission on the customer-managed KMS key associated with the embedded model card.</p>
/// <ul>
/// <li>
/// <p><code>AllData</code>: Returns the full model package response, including the unredacted <code>ModelCard.ModelCardContent</code>. This option requires <code>kms:Decrypt</code> permission on the customer-managed key, if one is associated with the embedded model card. This is the default.</p></li>
/// <li>
/// <p><code>MetadataOnly</code>: Returns the full model package response, but with the embedded <code>ModelCard.ModelCardContent</code> sanitized to include only a small set of unencrypted metadata fields. This option does not require <code>kms:Decrypt</code> permission. All other top-level response fields, including <code>InferenceSpecification</code>, <code>ModelMetrics</code>, <code>DriftCheckBaselines</code>, and <code>SecurityConfig</code>, are returned unchanged. For the list of fields preserved within <code>ModelCardContent</code>, see <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeModelPackage.html#sagemaker-DescribeModelPackage-response-ModelCard">ModelCard</a>.</p></li>
/// </ul>
/// <p>If you don't specify a value, SageMaker returns <code>AllData</code>.</p>
pub fn get_included_data(&self) -> &::std::option::Option<crate::types::IncludedData> {
self.inner.get_included_data()
}
}