aws-sdk-sagemakerjobruntime 1.0.0

AWS SDK for Sagemaker Job Runtime Service
Documentation
// 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)]
pub struct SampleOutput {
    /// MIME type of the inference result.
    pub content_type: ::std::option::Option<::std::string::String>,
    /// The raw inference response body from the model.
    pub body: ::aws_smithy_types::Blob,
    _request_id: Option<String>,
}
impl SampleOutput {
    /// MIME type of the inference result.
    pub fn content_type(&self) -> ::std::option::Option<&str> {
        self.content_type.as_deref()
    }
    /// The raw inference response body from the model.
    pub fn body(&self) -> &::aws_smithy_types::Blob {
        &self.body
    }
}
impl ::std::fmt::Debug for SampleOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SampleOutput");
        formatter.field("content_type", &self.content_type);
        formatter.field("body", &"*** Sensitive Data Redacted ***");
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for SampleOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl SampleOutput {
    /// Creates a new builder-style object to manufacture [`SampleOutput`](crate::operation::sample::SampleOutput).
    pub fn builder() -> crate::operation::sample::builders::SampleOutputBuilder {
        crate::operation::sample::builders::SampleOutputBuilder::default()
    }
}

/// A builder for [`SampleOutput`](crate::operation::sample::SampleOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct SampleOutputBuilder {
    pub(crate) content_type: ::std::option::Option<::std::string::String>,
    pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
    _request_id: Option<String>,
}
impl SampleOutputBuilder {
    /// MIME type of the inference result.
    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.content_type = ::std::option::Option::Some(input.into());
        self
    }
    /// MIME type of the inference result.
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.content_type = input;
        self
    }
    /// MIME type of the inference result.
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.content_type
    }
    /// The raw inference response body from the model.
    /// This field is required.
    pub fn body(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.body = ::std::option::Option::Some(input);
        self
    }
    /// The raw inference response body from the model.
    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.body = input;
        self
    }
    /// The raw inference response body from the model.
    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.body
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`SampleOutput`](crate::operation::sample::SampleOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`body`](crate::operation::sample::builders::SampleOutputBuilder::body)
    pub fn build(self) -> ::std::result::Result<crate::operation::sample::SampleOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::sample::SampleOutput {
            content_type: self.content_type,
            body: self.body.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "body",
                    "body was not specified but it is required when building SampleOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for SampleOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SampleOutputBuilder");
        formatter.field("content_type", &self.content_type);
        formatter.field("body", &"*** Sensitive Data Redacted ***");
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}