aws-sdk-glue 1.147.0

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

/// <p>An entity supported by a given <code>ConnectionType</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Entity {
    /// <p>The name of the entity.</p>
    pub entity_name: ::std::option::Option<::std::string::String>,
    /// <p>Label used for the entity.</p>
    pub label: ::std::option::Option<::std::string::String>,
    /// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
    pub is_parent_entity: ::std::option::Option<bool>,
    /// <p>A description of the entity.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
    pub category: ::std::option::Option<::std::string::String>,
    /// <p>An optional map of keys which may be returned for an entity by a connector.</p>
    pub custom_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Entity {
    /// <p>The name of the entity.</p>
    pub fn entity_name(&self) -> ::std::option::Option<&str> {
        self.entity_name.as_deref()
    }
    /// <p>Label used for the entity.</p>
    pub fn label(&self) -> ::std::option::Option<&str> {
        self.label.as_deref()
    }
    /// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
    pub fn is_parent_entity(&self) -> ::std::option::Option<bool> {
        self.is_parent_entity
    }
    /// <p>A description of the entity.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
    pub fn category(&self) -> ::std::option::Option<&str> {
        self.category.as_deref()
    }
    /// <p>An optional map of keys which may be returned for an entity by a connector.</p>
    pub fn custom_properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.custom_properties.as_ref()
    }
}
impl Entity {
    /// Creates a new builder-style object to manufacture [`Entity`](crate::types::Entity).
    pub fn builder() -> crate::types::builders::EntityBuilder {
        crate::types::builders::EntityBuilder::default()
    }
}

/// A builder for [`Entity`](crate::types::Entity).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EntityBuilder {
    pub(crate) entity_name: ::std::option::Option<::std::string::String>,
    pub(crate) label: ::std::option::Option<::std::string::String>,
    pub(crate) is_parent_entity: ::std::option::Option<bool>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) category: ::std::option::Option<::std::string::String>,
    pub(crate) custom_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl EntityBuilder {
    /// <p>The name of the entity.</p>
    pub fn entity_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.entity_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the entity.</p>
    pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.entity_name = input;
        self
    }
    /// <p>The name of the entity.</p>
    pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.entity_name
    }
    /// <p>Label used for the entity.</p>
    pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.label = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Label used for the entity.</p>
    pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.label = input;
        self
    }
    /// <p>Label used for the entity.</p>
    pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
        &self.label
    }
    /// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
    pub fn is_parent_entity(mut self, input: bool) -> Self {
        self.is_parent_entity = ::std::option::Option::Some(input);
        self
    }
    /// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
    pub fn set_is_parent_entity(mut self, input: ::std::option::Option<bool>) -> Self {
        self.is_parent_entity = input;
        self
    }
    /// <p>A Boolean value which helps to determine whether there are sub objects that can be listed.</p>
    pub fn get_is_parent_entity(&self) -> &::std::option::Option<bool> {
        &self.is_parent_entity
    }
    /// <p>A description of the entity.</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 description of the entity.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the entity.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
    pub fn category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.category = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
    pub fn set_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.category = input;
        self
    }
    /// <p>The type of entities that are present in the response. This value depends on the source connection. For example this is <code>SObjects</code> for Salesforce and <code>databases</code> or <code>schemas</code> or <code>tables</code> for sources like Amazon Redshift.</p>
    pub fn get_category(&self) -> &::std::option::Option<::std::string::String> {
        &self.category
    }
    /// Adds a key-value pair to `custom_properties`.
    ///
    /// To override the contents of this collection use [`set_custom_properties`](Self::set_custom_properties).
    ///
    /// <p>An optional map of keys which may be returned for an entity by a connector.</p>
    pub fn custom_properties(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.custom_properties.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.custom_properties = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>An optional map of keys which may be returned for an entity by a connector.</p>
    pub fn set_custom_properties(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.custom_properties = input;
        self
    }
    /// <p>An optional map of keys which may be returned for an entity by a connector.</p>
    pub fn get_custom_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.custom_properties
    }
    /// Consumes the builder and constructs a [`Entity`](crate::types::Entity).
    pub fn build(self) -> crate::types::Entity {
        crate::types::Entity {
            entity_name: self.entity_name,
            label: self.label,
            is_parent_entity: self.is_parent_entity,
            description: self.description,
            category: self.category,
            custom_properties: self.custom_properties,
        }
    }
}