aws-sdk-ssm 1.112.0

AWS SDK for Amazon Simple Systems Manager (SSM)
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 PutInventoryInput {
    /// <p>An managed node ID where you want to add or update inventory items.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The inventory items that you want to add or update on managed nodes.</p>
    pub items: ::std::option::Option<::std::vec::Vec<crate::types::InventoryItem>>,
}
impl PutInventoryInput {
    /// <p>An managed node ID where you want to add or update inventory items.</p>
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>The inventory items that you want to add or update on managed nodes.</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 `.items.is_none()`.
    pub fn items(&self) -> &[crate::types::InventoryItem] {
        self.items.as_deref().unwrap_or_default()
    }
}
impl PutInventoryInput {
    /// Creates a new builder-style object to manufacture [`PutInventoryInput`](crate::operation::put_inventory::PutInventoryInput).
    pub fn builder() -> crate::operation::put_inventory::builders::PutInventoryInputBuilder {
        crate::operation::put_inventory::builders::PutInventoryInputBuilder::default()
    }
}

/// A builder for [`PutInventoryInput`](crate::operation::put_inventory::PutInventoryInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutInventoryInputBuilder {
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) items: ::std::option::Option<::std::vec::Vec<crate::types::InventoryItem>>,
}
impl PutInventoryInputBuilder {
    /// <p>An managed node ID where you want to add or update inventory items.</p>
    /// This field is required.
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An managed node ID where you want to add or update inventory items.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>An managed node ID where you want to add or update inventory items.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// Appends an item to `items`.
    ///
    /// To override the contents of this collection use [`set_items`](Self::set_items).
    ///
    /// <p>The inventory items that you want to add or update on managed nodes.</p>
    pub fn items(mut self, input: crate::types::InventoryItem) -> Self {
        let mut v = self.items.unwrap_or_default();
        v.push(input);
        self.items = ::std::option::Option::Some(v);
        self
    }
    /// <p>The inventory items that you want to add or update on managed nodes.</p>
    pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InventoryItem>>) -> Self {
        self.items = input;
        self
    }
    /// <p>The inventory items that you want to add or update on managed nodes.</p>
    pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InventoryItem>> {
        &self.items
    }
    /// Consumes the builder and constructs a [`PutInventoryInput`](crate::operation::put_inventory::PutInventoryInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_inventory::PutInventoryInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_inventory::PutInventoryInput {
            instance_id: self.instance_id,
            items: self.items,
        })
    }
}