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, ::std::fmt::Debug)]
pub struct UpdateRewardInput {
    /// The job ARN.
    pub job_arn: ::std::option::Option<::std::string::String>,
    /// The trajectory ID to update with reward values.
    pub trajectory_id: ::std::option::Option<::std::string::String>,
    /// The list of reward values to assign to this trajectory. Provide one reward value per turn in the trajectory.
    pub rewards: ::std::option::Option<::std::vec::Vec<f64>>,
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl UpdateRewardInput {
    /// The job ARN.
    pub fn job_arn(&self) -> ::std::option::Option<&str> {
        self.job_arn.as_deref()
    }
    /// The trajectory ID to update with reward values.
    pub fn trajectory_id(&self) -> ::std::option::Option<&str> {
        self.trajectory_id.as_deref()
    }
    /// The list of reward values to assign to this trajectory. Provide one reward value per turn in the trajectory.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.rewards.is_none()`.
    pub fn rewards(&self) -> &[f64] {
        self.rewards.as_deref().unwrap_or_default()
    }
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl UpdateRewardInput {
    /// Creates a new builder-style object to manufacture [`UpdateRewardInput`](crate::operation::update_reward::UpdateRewardInput).
    pub fn builder() -> crate::operation::update_reward::builders::UpdateRewardInputBuilder {
        crate::operation::update_reward::builders::UpdateRewardInputBuilder::default()
    }
}

/// A builder for [`UpdateRewardInput`](crate::operation::update_reward::UpdateRewardInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateRewardInputBuilder {
    pub(crate) job_arn: ::std::option::Option<::std::string::String>,
    pub(crate) trajectory_id: ::std::option::Option<::std::string::String>,
    pub(crate) rewards: ::std::option::Option<::std::vec::Vec<f64>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl UpdateRewardInputBuilder {
    /// The job ARN.
    /// 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.
    pub fn set_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_arn = input;
        self
    }
    /// The job ARN.
    pub fn get_job_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_arn
    }
    /// The trajectory ID to update with reward values.
    /// 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 to update with reward values.
    pub fn set_trajectory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.trajectory_id = input;
        self
    }
    /// The trajectory ID to update with reward values.
    pub fn get_trajectory_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.trajectory_id
    }
    /// Appends an item to `rewards`.
    ///
    /// To override the contents of this collection use [`set_rewards`](Self::set_rewards).
    ///
    /// The list of reward values to assign to this trajectory. Provide one reward value per turn in the trajectory.
    pub fn rewards(mut self, input: f64) -> Self {
        let mut v = self.rewards.unwrap_or_default();
        v.push(input);
        self.rewards = ::std::option::Option::Some(v);
        self
    }
    /// The list of reward values to assign to this trajectory. Provide one reward value per turn in the trajectory.
    pub fn set_rewards(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
        self.rewards = input;
        self
    }
    /// The list of reward values to assign to this trajectory. Provide one reward value per turn in the trajectory.
    pub fn get_rewards(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
        &self.rewards
    }
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`UpdateRewardInput`](crate::operation::update_reward::UpdateRewardInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_reward::UpdateRewardInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_reward::UpdateRewardInput {
            job_arn: self.job_arn,
            trajectory_id: self.trajectory_id,
            rewards: self.rewards,
            client_token: self.client_token,
        })
    }
}