aws-sdk-devicefarm 1.99.0

AWS SDK for AWS Device Farm
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 UpdateDeviceInstanceInput {
    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the profile that you want to associate with the device instance.</p>
    pub profile_arn: ::std::option::Option<::std::string::String>,
    /// <p>An array of strings that you want to associate with the device instance.</p>
    pub labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdateDeviceInstanceInput {
    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The ARN of the profile that you want to associate with the device instance.</p>
    pub fn profile_arn(&self) -> ::std::option::Option<&str> {
        self.profile_arn.as_deref()
    }
    /// <p>An array of strings that you want to associate with the device instance.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.labels.is_none()`.
    pub fn labels(&self) -> &[::std::string::String] {
        self.labels.as_deref().unwrap_or_default()
    }
}
impl UpdateDeviceInstanceInput {
    /// Creates a new builder-style object to manufacture [`UpdateDeviceInstanceInput`](crate::operation::update_device_instance::UpdateDeviceInstanceInput).
    pub fn builder() -> crate::operation::update_device_instance::builders::UpdateDeviceInstanceInputBuilder {
        crate::operation::update_device_instance::builders::UpdateDeviceInstanceInputBuilder::default()
    }
}

/// A builder for [`UpdateDeviceInstanceInput`](crate::operation::update_device_instance::UpdateDeviceInstanceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateDeviceInstanceInputBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) profile_arn: ::std::option::Option<::std::string::String>,
    pub(crate) labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdateDeviceInstanceInputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The ARN of the profile that you want to associate with the device instance.</p>
    pub fn profile_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.profile_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the profile that you want to associate with the device instance.</p>
    pub fn set_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.profile_arn = input;
        self
    }
    /// <p>The ARN of the profile that you want to associate with the device instance.</p>
    pub fn get_profile_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.profile_arn
    }
    /// Appends an item to `labels`.
    ///
    /// To override the contents of this collection use [`set_labels`](Self::set_labels).
    ///
    /// <p>An array of strings that you want to associate with the device instance.</p>
    pub fn labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.labels.unwrap_or_default();
        v.push(input.into());
        self.labels = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of strings that you want to associate with the device instance.</p>
    pub fn set_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.labels = input;
        self
    }
    /// <p>An array of strings that you want to associate with the device instance.</p>
    pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.labels
    }
    /// Consumes the builder and constructs a [`UpdateDeviceInstanceInput`](crate::operation::update_device_instance::UpdateDeviceInstanceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_device_instance::UpdateDeviceInstanceInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_device_instance::UpdateDeviceInstanceInput {
            arn: self.arn,
            profile_arn: self.profile_arn,
            labels: self.labels,
        })
    }
}