aws_sdk_sagemaker/operation/update_trial/
_update_trial_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateTrialInput {
6    /// <p>The name of the trial to update.</p>
7    pub trial_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
9    pub display_name: ::std::option::Option<::std::string::String>,
10}
11impl UpdateTrialInput {
12    /// <p>The name of the trial to update.</p>
13    pub fn trial_name(&self) -> ::std::option::Option<&str> {
14        self.trial_name.as_deref()
15    }
16    /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
17    pub fn display_name(&self) -> ::std::option::Option<&str> {
18        self.display_name.as_deref()
19    }
20}
21impl UpdateTrialInput {
22    /// Creates a new builder-style object to manufacture [`UpdateTrialInput`](crate::operation::update_trial::UpdateTrialInput).
23    pub fn builder() -> crate::operation::update_trial::builders::UpdateTrialInputBuilder {
24        crate::operation::update_trial::builders::UpdateTrialInputBuilder::default()
25    }
26}
27
28/// A builder for [`UpdateTrialInput`](crate::operation::update_trial::UpdateTrialInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct UpdateTrialInputBuilder {
32    pub(crate) trial_name: ::std::option::Option<::std::string::String>,
33    pub(crate) display_name: ::std::option::Option<::std::string::String>,
34}
35impl UpdateTrialInputBuilder {
36    /// <p>The name of the trial to update.</p>
37    /// This field is required.
38    pub fn trial_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.trial_name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The name of the trial to update.</p>
43    pub fn set_trial_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.trial_name = input;
45        self
46    }
47    /// <p>The name of the trial to update.</p>
48    pub fn get_trial_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.trial_name
50    }
51    /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
52    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.display_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
57    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.display_name = input;
59        self
60    }
61    /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
62    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.display_name
64    }
65    /// Consumes the builder and constructs a [`UpdateTrialInput`](crate::operation::update_trial::UpdateTrialInput).
66    pub fn build(self) -> ::std::result::Result<crate::operation::update_trial::UpdateTrialInput, ::aws_smithy_types::error::operation::BuildError> {
67        ::std::result::Result::Ok(crate::operation::update_trial::UpdateTrialInput {
68            trial_name: self.trial_name,
69            display_name: self.display_name,
70        })
71    }
72}