#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateEntityInput {
pub workspace_id: ::std::option::Option<::std::string::String>,
pub entity_id: ::std::option::Option<::std::string::String>,
pub entity_name: ::std::option::Option<::std::string::String>,
pub description: ::std::option::Option<::std::string::String>,
pub components: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>>,
pub parent_entity_id: ::std::option::Option<::std::string::String>,
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateEntityInput {
pub fn workspace_id(&self) -> ::std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn entity_id(&self) -> ::std::option::Option<&str> {
self.entity_id.as_deref()
}
pub fn entity_name(&self) -> ::std::option::Option<&str> {
self.entity_name.as_deref()
}
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
pub fn components(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>> {
self.components.as_ref()
}
pub fn parent_entity_id(&self) -> ::std::option::Option<&str> {
self.parent_entity_id.as_deref()
}
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
}
impl CreateEntityInput {
pub fn builder() -> crate::operation::create_entity::builders::CreateEntityInputBuilder {
crate::operation::create_entity::builders::CreateEntityInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateEntityInputBuilder {
pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
pub(crate) entity_id: ::std::option::Option<::std::string::String>,
pub(crate) entity_name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) components: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>>,
pub(crate) parent_entity_id: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateEntityInputBuilder {
pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.workspace_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
&self.workspace_id
}
pub fn entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.entity_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.entity_id = input;
self
}
pub fn get_entity_id(&self) -> &::std::option::Option<::std::string::String> {
&self.entity_id
}
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
}
pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.entity_name = input;
self
}
pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
&self.entity_name
}
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
pub fn components(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ComponentRequest) -> Self {
let mut hash_map = self.components.unwrap_or_default();
hash_map.insert(k.into(), v);
self.components = ::std::option::Option::Some(hash_map);
self
}
pub fn set_components(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>>,
) -> Self {
self.components = input;
self
}
pub fn get_components(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>> {
&self.components
}
pub fn parent_entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.parent_entity_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_parent_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.parent_entity_id = input;
self
}
pub fn get_parent_entity_id(&self) -> &::std::option::Option<::std::string::String> {
&self.parent_entity_id
}
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_entity::CreateEntityInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_entity::CreateEntityInput {
workspace_id: self.workspace_id,
entity_id: self.entity_id,
entity_name: self.entity_name,
description: self.description,
components: self.components,
parent_entity_id: self.parent_entity_id,
tags: self.tags,
})
}
}