#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateContentAssociationInput {
pub client_token: ::std::option::Option<::std::string::String>,
pub knowledge_base_id: ::std::option::Option<::std::string::String>,
pub content_id: ::std::option::Option<::std::string::String>,
pub association_type: ::std::option::Option<crate::types::ContentAssociationType>,
pub association: ::std::option::Option<crate::types::ContentAssociationContents>,
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateContentAssociationInput {
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
pub fn knowledge_base_id(&self) -> ::std::option::Option<&str> {
self.knowledge_base_id.as_deref()
}
pub fn content_id(&self) -> ::std::option::Option<&str> {
self.content_id.as_deref()
}
pub fn association_type(&self) -> ::std::option::Option<&crate::types::ContentAssociationType> {
self.association_type.as_ref()
}
pub fn association(&self) -> ::std::option::Option<&crate::types::ContentAssociationContents> {
self.association.as_ref()
}
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
}
impl CreateContentAssociationInput {
pub fn builder() -> crate::operation::create_content_association::builders::CreateContentAssociationInputBuilder {
crate::operation::create_content_association::builders::CreateContentAssociationInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateContentAssociationInputBuilder {
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) knowledge_base_id: ::std::option::Option<::std::string::String>,
pub(crate) content_id: ::std::option::Option<::std::string::String>,
pub(crate) association_type: ::std::option::Option<crate::types::ContentAssociationType>,
pub(crate) association: ::std::option::Option<crate::types::ContentAssociationContents>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateContentAssociationInputBuilder {
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
pub fn knowledge_base_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.knowledge_base_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_knowledge_base_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.knowledge_base_id = input;
self
}
pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
&self.knowledge_base_id
}
pub fn content_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.content_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_content_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.content_id = input;
self
}
pub fn get_content_id(&self) -> &::std::option::Option<::std::string::String> {
&self.content_id
}
pub fn association_type(mut self, input: crate::types::ContentAssociationType) -> Self {
self.association_type = ::std::option::Option::Some(input);
self
}
pub fn set_association_type(mut self, input: ::std::option::Option<crate::types::ContentAssociationType>) -> Self {
self.association_type = input;
self
}
pub fn get_association_type(&self) -> &::std::option::Option<crate::types::ContentAssociationType> {
&self.association_type
}
pub fn association(mut self, input: crate::types::ContentAssociationContents) -> Self {
self.association = ::std::option::Option::Some(input);
self
}
pub fn set_association(mut self, input: ::std::option::Option<crate::types::ContentAssociationContents>) -> Self {
self.association = input;
self
}
pub fn get_association(&self) -> &::std::option::Option<crate::types::ContentAssociationContents> {
&self.association
}
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_content_association::CreateContentAssociationInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::create_content_association::CreateContentAssociationInput {
client_token: self.client_token,
knowledge_base_id: self.knowledge_base_id,
content_id: self.content_id,
association_type: self.association_type,
association: self.association,
tags: self.tags,
})
}
}