aws-sdk-qapps 1.66.0

AWS SDK for QApps
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 UpdateLibraryItemInput {
    /// <p>The unique identifier of the Amazon Q Business application environment instance.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the library item to update.</p>
    pub library_item_id: ::std::option::Option<::std::string::String>,
    /// <p>The new status to set for the library item, such as "Published" or "Hidden".</p>
    pub status: ::std::option::Option<crate::types::LibraryItemStatus>,
    /// <p>The new categories to associate with the library item.</p>
    pub categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdateLibraryItemInput {
    /// <p>The unique identifier of the Amazon Q Business application environment instance.</p>
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>The unique identifier of the library item to update.</p>
    pub fn library_item_id(&self) -> ::std::option::Option<&str> {
        self.library_item_id.as_deref()
    }
    /// <p>The new status to set for the library item, such as "Published" or "Hidden".</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::LibraryItemStatus> {
        self.status.as_ref()
    }
    /// <p>The new categories to associate with the library item.</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 `.categories.is_none()`.
    pub fn categories(&self) -> &[::std::string::String] {
        self.categories.as_deref().unwrap_or_default()
    }
}
impl UpdateLibraryItemInput {
    /// Creates a new builder-style object to manufacture [`UpdateLibraryItemInput`](crate::operation::update_library_item::UpdateLibraryItemInput).
    pub fn builder() -> crate::operation::update_library_item::builders::UpdateLibraryItemInputBuilder {
        crate::operation::update_library_item::builders::UpdateLibraryItemInputBuilder::default()
    }
}

/// A builder for [`UpdateLibraryItemInput`](crate::operation::update_library_item::UpdateLibraryItemInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateLibraryItemInputBuilder {
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) library_item_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::LibraryItemStatus>,
    pub(crate) categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdateLibraryItemInputBuilder {
    /// <p>The unique identifier of the Amazon Q Business application environment instance.</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>The unique identifier of the Amazon Q Business application environment instance.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The unique identifier of the Amazon Q Business application environment instance.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// <p>The unique identifier of the library item to update.</p>
    /// This field is required.
    pub fn library_item_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.library_item_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the library item to update.</p>
    pub fn set_library_item_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.library_item_id = input;
        self
    }
    /// <p>The unique identifier of the library item to update.</p>
    pub fn get_library_item_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.library_item_id
    }
    /// <p>The new status to set for the library item, such as "Published" or "Hidden".</p>
    pub fn status(mut self, input: crate::types::LibraryItemStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The new status to set for the library item, such as "Published" or "Hidden".</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LibraryItemStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The new status to set for the library item, such as "Published" or "Hidden".</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::LibraryItemStatus> {
        &self.status
    }
    /// Appends an item to `categories`.
    ///
    /// To override the contents of this collection use [`set_categories`](Self::set_categories).
    ///
    /// <p>The new categories to associate with the library item.</p>
    pub fn categories(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.categories.unwrap_or_default();
        v.push(input.into());
        self.categories = ::std::option::Option::Some(v);
        self
    }
    /// <p>The new categories to associate with the library item.</p>
    pub fn set_categories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.categories = input;
        self
    }
    /// <p>The new categories to associate with the library item.</p>
    pub fn get_categories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.categories
    }
    /// Consumes the builder and constructs a [`UpdateLibraryItemInput`](crate::operation::update_library_item::UpdateLibraryItemInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_library_item::UpdateLibraryItemInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_library_item::UpdateLibraryItemInput {
            instance_id: self.instance_id,
            library_item_id: self.library_item_id,
            status: self.status,
            categories: self.categories,
        })
    }
}