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 SampleInput {
    /// The job ARN that identifies which model session to route the inference request to.
    pub job_arn: ::std::option::Option<::std::string::String>,
    /// The trajectory ID for grouping turns into a single rollout. Each turn (prompt and response) is captured for later use.
    pub trajectory_id: ::std::option::Option<::std::string::String>,
    /// The raw inference request body in OpenAI-compatible JSON format.
    pub body: ::std::option::Option<::aws_smithy_types::Blob>,
}
impl SampleInput {
    /// The job ARN that identifies which model session to route the inference request to.
    pub fn job_arn(&self) -> ::std::option::Option<&str> {
        self.job_arn.as_deref()
    }
    /// The trajectory ID for grouping turns into a single rollout. Each turn (prompt and response) is captured for later use.
    pub fn trajectory_id(&self) -> ::std::option::Option<&str> {
        self.trajectory_id.as_deref()
    }
    /// The raw inference request body in OpenAI-compatible JSON format.
    pub fn body(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
        self.body.as_ref()
    }
}
impl ::std::fmt::Debug for SampleInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SampleInput");
        formatter.field("job_arn", &self.job_arn);
        formatter.field("trajectory_id", &self.trajectory_id);
        formatter.field("body", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl SampleInput {
    /// Creates a new builder-style object to manufacture [`SampleInput`](crate::operation::sample::SampleInput).
    pub fn builder() -> crate::operation::sample::builders::SampleInputBuilder {
        crate::operation::sample::builders::SampleInputBuilder::default()
    }
}

/// A builder for [`SampleInput`](crate::operation::sample::SampleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct SampleInputBuilder {
    pub(crate) job_arn: ::std::option::Option<::std::string::String>,
    pub(crate) trajectory_id: ::std::option::Option<::std::string::String>,
    pub(crate) body: ::std::option::Option<::aws_smithy_types::Blob>,
}
impl SampleInputBuilder {
    /// The job ARN that identifies which model session to route the inference request to.
    /// This field is required.
    pub fn job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The job ARN that identifies which model session to route the inference request to.
    pub fn set_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_arn = input;
        self
    }
    /// The job ARN that identifies which model session to route the inference request to.
    pub fn get_job_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_arn
    }
    /// The trajectory ID for grouping turns into a single rollout. Each turn (prompt and response) is captured for later use.
    /// This field is required.
    pub fn trajectory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.trajectory_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The trajectory ID for grouping turns into a single rollout. Each turn (prompt and response) is captured for later use.
    pub fn set_trajectory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.trajectory_id = input;
        self
    }
    /// The trajectory ID for grouping turns into a single rollout. Each turn (prompt and response) is captured for later use.
    pub fn get_trajectory_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.trajectory_id
    }
    /// The raw inference request body in OpenAI-compatible JSON format.
    /// 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 request body in OpenAI-compatible JSON format.
    pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.body = input;
        self
    }
    /// The raw inference request body in OpenAI-compatible JSON format.
    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.body
    }
    /// Consumes the builder and constructs a [`SampleInput`](crate::operation::sample::SampleInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::sample::SampleInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::sample::SampleInput {
            job_arn: self.job_arn,
            trajectory_id: self.trajectory_id,
            body: self.body,
        })
    }
}
impl ::std::fmt::Debug for SampleInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SampleInputBuilder");
        formatter.field("job_arn", &self.job_arn);
        formatter.field("trajectory_id", &self.trajectory_id);
        formatter.field("body", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}