aws-sdk-opensearch 1.112.0

AWS SDK for Amazon OpenSearch Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Container for the parameters to the <code>UpdateDataSource</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateDataSourceInput {
    /// <p>The name of the domain.</p>
    pub domain_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the data source to modify.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The type of data source.</p>
    pub data_source_type: ::std::option::Option<crate::types::DataSourceType>,
    /// <p>A new description of the data source.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The status of the data source update.</p>
    pub status: ::std::option::Option<crate::types::DataSourceStatus>,
}
impl UpdateDataSourceInput {
    /// <p>The name of the domain.</p>
    pub fn domain_name(&self) -> ::std::option::Option<&str> {
        self.domain_name.as_deref()
    }
    /// <p>The name of the data source to modify.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The type of data source.</p>
    pub fn data_source_type(&self) -> ::std::option::Option<&crate::types::DataSourceType> {
        self.data_source_type.as_ref()
    }
    /// <p>A new description of the data source.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The status of the data source update.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::DataSourceStatus> {
        self.status.as_ref()
    }
}
impl UpdateDataSourceInput {
    /// Creates a new builder-style object to manufacture [`UpdateDataSourceInput`](crate::operation::update_data_source::UpdateDataSourceInput).
    pub fn builder() -> crate::operation::update_data_source::builders::UpdateDataSourceInputBuilder {
        crate::operation::update_data_source::builders::UpdateDataSourceInputBuilder::default()
    }
}

/// A builder for [`UpdateDataSourceInput`](crate::operation::update_data_source::UpdateDataSourceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateDataSourceInputBuilder {
    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) data_source_type: ::std::option::Option<crate::types::DataSourceType>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::DataSourceStatus>,
}
impl UpdateDataSourceInputBuilder {
    /// <p>The name of the domain.</p>
    /// This field is required.
    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the domain.</p>
    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_name = input;
        self
    }
    /// <p>The name of the domain.</p>
    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_name
    }
    /// <p>The name of the data source to modify.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the data source to modify.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the data source to modify.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The type of data source.</p>
    /// This field is required.
    pub fn data_source_type(mut self, input: crate::types::DataSourceType) -> Self {
        self.data_source_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of data source.</p>
    pub fn set_data_source_type(mut self, input: ::std::option::Option<crate::types::DataSourceType>) -> Self {
        self.data_source_type = input;
        self
    }
    /// <p>The type of data source.</p>
    pub fn get_data_source_type(&self) -> &::std::option::Option<crate::types::DataSourceType> {
        &self.data_source_type
    }
    /// <p>A new description of the data source.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A new description of the data source.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A new description of the data source.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The status of the data source update.</p>
    pub fn status(mut self, input: crate::types::DataSourceStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the data source update.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DataSourceStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the data source update.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::DataSourceStatus> {
        &self.status
    }
    /// Consumes the builder and constructs a [`UpdateDataSourceInput`](crate::operation::update_data_source::UpdateDataSourceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_data_source::UpdateDataSourceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_data_source::UpdateDataSourceInput {
            domain_name: self.domain_name,
            name: self.name,
            data_source_type: self.data_source_type,
            description: self.description,
            status: self.status,
        })
    }
}