aws-sdk-context 1.0.0

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

/// <p>A reference by entity identity into retrievedContext (one of nodeId, edgeId, or documentId).</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Reference {
    /// <p>Identifier of the referenced node. Set when the reference is a node.</p>
    pub node_id: ::std::option::Option<::std::string::String>,
    /// <p>Identifier of the referenced edge. Set when the reference is an edge.</p>
    pub edge_id: ::std::option::Option<crate::types::EdgeIdentifier>,
    /// <p>Identifier of the referenced document. Set when the reference is a document.</p>
    pub document_id: ::std::option::Option<::std::string::String>,
}
impl Reference {
    /// <p>Identifier of the referenced node. Set when the reference is a node.</p>
    pub fn node_id(&self) -> ::std::option::Option<&str> {
        self.node_id.as_deref()
    }
    /// <p>Identifier of the referenced edge. Set when the reference is an edge.</p>
    pub fn edge_id(&self) -> ::std::option::Option<&crate::types::EdgeIdentifier> {
        self.edge_id.as_ref()
    }
    /// <p>Identifier of the referenced document. Set when the reference is a document.</p>
    pub fn document_id(&self) -> ::std::option::Option<&str> {
        self.document_id.as_deref()
    }
}
impl Reference {
    /// Creates a new builder-style object to manufacture [`Reference`](crate::types::Reference).
    pub fn builder() -> crate::types::builders::ReferenceBuilder {
        crate::types::builders::ReferenceBuilder::default()
    }
}

/// A builder for [`Reference`](crate::types::Reference).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ReferenceBuilder {
    pub(crate) node_id: ::std::option::Option<::std::string::String>,
    pub(crate) edge_id: ::std::option::Option<crate::types::EdgeIdentifier>,
    pub(crate) document_id: ::std::option::Option<::std::string::String>,
}
impl ReferenceBuilder {
    /// <p>Identifier of the referenced node. Set when the reference is a node.</p>
    pub fn node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.node_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Identifier of the referenced node. Set when the reference is a node.</p>
    pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.node_id = input;
        self
    }
    /// <p>Identifier of the referenced node. Set when the reference is a node.</p>
    pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.node_id
    }
    /// <p>Identifier of the referenced edge. Set when the reference is an edge.</p>
    pub fn edge_id(mut self, input: crate::types::EdgeIdentifier) -> Self {
        self.edge_id = ::std::option::Option::Some(input);
        self
    }
    /// <p>Identifier of the referenced edge. Set when the reference is an edge.</p>
    pub fn set_edge_id(mut self, input: ::std::option::Option<crate::types::EdgeIdentifier>) -> Self {
        self.edge_id = input;
        self
    }
    /// <p>Identifier of the referenced edge. Set when the reference is an edge.</p>
    pub fn get_edge_id(&self) -> &::std::option::Option<crate::types::EdgeIdentifier> {
        &self.edge_id
    }
    /// <p>Identifier of the referenced document. Set when the reference is a document.</p>
    pub fn document_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.document_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Identifier of the referenced document. Set when the reference is a document.</p>
    pub fn set_document_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.document_id = input;
        self
    }
    /// <p>Identifier of the referenced document. Set when the reference is a document.</p>
    pub fn get_document_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.document_id
    }
    /// Consumes the builder and constructs a [`Reference`](crate::types::Reference).
    pub fn build(self) -> crate::types::Reference {
        crate::types::Reference {
            node_id: self.node_id,
            edge_id: self.edge_id,
            document_id: self.document_id,
        }
    }
}