aws_sdk_neptunegraph/operation/create_graph/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_graph::_create_graph_output::CreateGraphOutputBuilder;
3
4pub use crate::operation::create_graph::_create_graph_input::CreateGraphInputBuilder;
5
6impl crate::operation::create_graph::builders::CreateGraphInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_graph::CreateGraphOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_graph::CreateGraphError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_graph();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateGraph`.
24///
25/// <p>Creates a new Neptune Analytics graph.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateGraphFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_graph::builders::CreateGraphInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_graph::CreateGraphOutput,
35        crate::operation::create_graph::CreateGraphError,
36    > for CreateGraphFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_graph::CreateGraphOutput,
44            crate::operation::create_graph::CreateGraphError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateGraphFluentBuilder {
51    /// Creates a new `CreateGraphFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateGraph as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_graph::builders::CreateGraphInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_graph::CreateGraphOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_graph::CreateGraphError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_graph::CreateGraph::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_graph::CreateGraph::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_graph::CreateGraphOutput,
97        crate::operation::create_graph::CreateGraphError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>A name for the new Neptune Analytics graph to be created.</p>
112    /// <p>The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It cannot end with a hyphen or contain two consecutive hyphens. Only lowercase letters are allowed.</p>
113    pub fn graph_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.graph_name(input.into());
115        self
116    }
117    /// <p>A name for the new Neptune Analytics graph to be created.</p>
118    /// <p>The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It cannot end with a hyphen or contain two consecutive hyphens. Only lowercase letters are allowed.</p>
119    pub fn set_graph_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_graph_name(input);
121        self
122    }
123    /// <p>A name for the new Neptune Analytics graph to be created.</p>
124    /// <p>The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It cannot end with a hyphen or contain two consecutive hyphens. Only lowercase letters are allowed.</p>
125    pub fn get_graph_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_graph_name()
127    }
128    ///
129    /// Adds a key-value pair to `tags`.
130    ///
131    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
132    ///
133    /// <p>Adds metadata tags to the new graph. These tags can also be used with cost allocation reporting, or used in a Condition statement in an IAM policy.</p>
134    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.tags(k.into(), v.into());
136        self
137    }
138    /// <p>Adds metadata tags to the new graph. These tags can also be used with cost allocation reporting, or used in a Condition statement in an IAM policy.</p>
139    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
140        self.inner = self.inner.set_tags(input);
141        self
142    }
143    /// <p>Adds metadata tags to the new graph. These tags can also be used with cost allocation reporting, or used in a Condition statement in an IAM policy.</p>
144    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
145        self.inner.get_tags()
146    }
147    /// <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated. (<code>true</code> to enable, or <code>false</code> to disable.</p>
148    pub fn public_connectivity(mut self, input: bool) -> Self {
149        self.inner = self.inner.public_connectivity(input);
150        self
151    }
152    /// <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated. (<code>true</code> to enable, or <code>false</code> to disable.</p>
153    pub fn set_public_connectivity(mut self, input: ::std::option::Option<bool>) -> Self {
154        self.inner = self.inner.set_public_connectivity(input);
155        self
156    }
157    /// <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated. (<code>true</code> to enable, or <code>false</code> to disable.</p>
158    pub fn get_public_connectivity(&self) -> &::std::option::Option<bool> {
159        self.inner.get_public_connectivity()
160    }
161    /// <p>Specifies a KMS key to use to encrypt data in the new graph.</p>
162    pub fn kms_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.kms_key_identifier(input.into());
164        self
165    }
166    /// <p>Specifies a KMS key to use to encrypt data in the new graph.</p>
167    pub fn set_kms_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_kms_key_identifier(input);
169        self
170    }
171    /// <p>Specifies a KMS key to use to encrypt data in the new graph.</p>
172    pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_kms_key_identifier()
174    }
175    /// <p>Specifies the number of dimensions for vector embeddings that will be loaded into the graph. The value is specified as <code>dimension=</code>value. Max = 65,535</p>
176    pub fn vector_search_configuration(mut self, input: crate::types::VectorSearchConfiguration) -> Self {
177        self.inner = self.inner.vector_search_configuration(input);
178        self
179    }
180    /// <p>Specifies the number of dimensions for vector embeddings that will be loaded into the graph. The value is specified as <code>dimension=</code>value. Max = 65,535</p>
181    pub fn set_vector_search_configuration(mut self, input: ::std::option::Option<crate::types::VectorSearchConfiguration>) -> Self {
182        self.inner = self.inner.set_vector_search_configuration(input);
183        self
184    }
185    /// <p>Specifies the number of dimensions for vector embeddings that will be loaded into the graph. The value is specified as <code>dimension=</code>value. Max = 65,535</p>
186    pub fn get_vector_search_configuration(&self) -> &::std::option::Option<crate::types::VectorSearchConfiguration> {
187        self.inner.get_vector_search_configuration()
188    }
189    /// <p>The number of replicas in other AZs. Min =0, Max = 2, Default = 1.</p><important>
190    /// <p>Additional charges equivalent to the m-NCUs selected for the graph apply for each replica.</p>
191    /// </important>
192    pub fn replica_count(mut self, input: i32) -> Self {
193        self.inner = self.inner.replica_count(input);
194        self
195    }
196    /// <p>The number of replicas in other AZs. Min =0, Max = 2, Default = 1.</p><important>
197    /// <p>Additional charges equivalent to the m-NCUs selected for the graph apply for each replica.</p>
198    /// </important>
199    pub fn set_replica_count(mut self, input: ::std::option::Option<i32>) -> Self {
200        self.inner = self.inner.set_replica_count(input);
201        self
202    }
203    /// <p>The number of replicas in other AZs. Min =0, Max = 2, Default = 1.</p><important>
204    /// <p>Additional charges equivalent to the m-NCUs selected for the graph apply for each replica.</p>
205    /// </important>
206    pub fn get_replica_count(&self) -> &::std::option::Option<i32> {
207        self.inner.get_replica_count()
208    }
209    /// <p>Indicates whether or not to enable deletion protection on the graph. The graph can’t be deleted when deletion protection is enabled. (<code>true</code> or <code>false</code>).</p>
210    pub fn deletion_protection(mut self, input: bool) -> Self {
211        self.inner = self.inner.deletion_protection(input);
212        self
213    }
214    /// <p>Indicates whether or not to enable deletion protection on the graph. The graph can’t be deleted when deletion protection is enabled. (<code>true</code> or <code>false</code>).</p>
215    pub fn set_deletion_protection(mut self, input: ::std::option::Option<bool>) -> Self {
216        self.inner = self.inner.set_deletion_protection(input);
217        self
218    }
219    /// <p>Indicates whether or not to enable deletion protection on the graph. The graph can’t be deleted when deletion protection is enabled. (<code>true</code> or <code>false</code>).</p>
220    pub fn get_deletion_protection(&self) -> &::std::option::Option<bool> {
221        self.inner.get_deletion_protection()
222    }
223    /// <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph. Min = 16</p>
224    pub fn provisioned_memory(mut self, input: i32) -> Self {
225        self.inner = self.inner.provisioned_memory(input);
226        self
227    }
228    /// <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph. Min = 16</p>
229    pub fn set_provisioned_memory(mut self, input: ::std::option::Option<i32>) -> Self {
230        self.inner = self.inner.set_provisioned_memory(input);
231        self
232    }
233    /// <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph. Min = 16</p>
234    pub fn get_provisioned_memory(&self) -> &::std::option::Option<i32> {
235        self.inner.get_provisioned_memory()
236    }
237}