aws_sdk_neptunegraph/operation/create_graph/
_create_graph_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateGraphOutput {
6    /// <p>The ID of the graph.</p>
7    pub id: ::std::string::String,
8    /// <p>The graph name. For example: <code>my-graph-1</code>.</p>
9    /// <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>
10    pub name: ::std::string::String,
11    /// <p>The ARN of the graph.</p>
12    pub arn: ::std::string::String,
13    /// <p>The current status of the graph.</p>
14    pub status: ::std::option::Option<crate::types::GraphStatus>,
15    /// <p>The reason the status was given.</p>
16    pub status_reason: ::std::option::Option<::std::string::String>,
17    /// <p>The time when the graph was created.</p>
18    pub create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
19    /// <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph.</p>
20    /// <p>Min = 16</p>
21    pub provisioned_memory: ::std::option::Option<i32>,
22    /// <p>The graph endpoint.</p>
23    pub endpoint: ::std::option::Option<::std::string::String>,
24    /// <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated.</p><note>
25    /// <p>If enabling public connectivity for the first time, there will be a delay while it is enabled.</p>
26    /// </note>
27    pub public_connectivity: ::std::option::Option<bool>,
28    /// <p>The vector-search configuration for the graph, which specifies the vector dimension to use in the vector index, if any.</p>
29    pub vector_search_configuration: ::std::option::Option<crate::types::VectorSearchConfiguration>,
30    /// <p>The number of replicas in other AZs.</p>
31    /// <p>Default: If not specified, the default value is 1.</p>
32    pub replica_count: ::std::option::Option<i32>,
33    /// <p>Specifies the KMS key used to encrypt data in the new graph.</p>
34    pub kms_key_identifier: ::std::option::Option<::std::string::String>,
35    /// <p>The ID of the source graph.</p>
36    pub source_snapshot_id: ::std::option::Option<::std::string::String>,
37    /// <p>A value that indicates whether the graph has deletion protection enabled. The graph can't be deleted when deletion protection is enabled.</p>
38    pub deletion_protection: ::std::option::Option<bool>,
39    /// <p>The build number of the graph software.</p>
40    pub build_number: ::std::option::Option<::std::string::String>,
41    _request_id: Option<String>,
42}
43impl CreateGraphOutput {
44    /// <p>The ID of the graph.</p>
45    pub fn id(&self) -> &str {
46        use std::ops::Deref;
47        self.id.deref()
48    }
49    /// <p>The graph name. For example: <code>my-graph-1</code>.</p>
50    /// <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>
51    pub fn name(&self) -> &str {
52        use std::ops::Deref;
53        self.name.deref()
54    }
55    /// <p>The ARN of the graph.</p>
56    pub fn arn(&self) -> &str {
57        use std::ops::Deref;
58        self.arn.deref()
59    }
60    /// <p>The current status of the graph.</p>
61    pub fn status(&self) -> ::std::option::Option<&crate::types::GraphStatus> {
62        self.status.as_ref()
63    }
64    /// <p>The reason the status was given.</p>
65    pub fn status_reason(&self) -> ::std::option::Option<&str> {
66        self.status_reason.as_deref()
67    }
68    /// <p>The time when the graph was created.</p>
69    pub fn create_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
70        self.create_time.as_ref()
71    }
72    /// <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph.</p>
73    /// <p>Min = 16</p>
74    pub fn provisioned_memory(&self) -> ::std::option::Option<i32> {
75        self.provisioned_memory
76    }
77    /// <p>The graph endpoint.</p>
78    pub fn endpoint(&self) -> ::std::option::Option<&str> {
79        self.endpoint.as_deref()
80    }
81    /// <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated.</p><note>
82    /// <p>If enabling public connectivity for the first time, there will be a delay while it is enabled.</p>
83    /// </note>
84    pub fn public_connectivity(&self) -> ::std::option::Option<bool> {
85        self.public_connectivity
86    }
87    /// <p>The vector-search configuration for the graph, which specifies the vector dimension to use in the vector index, if any.</p>
88    pub fn vector_search_configuration(&self) -> ::std::option::Option<&crate::types::VectorSearchConfiguration> {
89        self.vector_search_configuration.as_ref()
90    }
91    /// <p>The number of replicas in other AZs.</p>
92    /// <p>Default: If not specified, the default value is 1.</p>
93    pub fn replica_count(&self) -> ::std::option::Option<i32> {
94        self.replica_count
95    }
96    /// <p>Specifies the KMS key used to encrypt data in the new graph.</p>
97    pub fn kms_key_identifier(&self) -> ::std::option::Option<&str> {
98        self.kms_key_identifier.as_deref()
99    }
100    /// <p>The ID of the source graph.</p>
101    pub fn source_snapshot_id(&self) -> ::std::option::Option<&str> {
102        self.source_snapshot_id.as_deref()
103    }
104    /// <p>A value that indicates whether the graph has deletion protection enabled. The graph can't be deleted when deletion protection is enabled.</p>
105    pub fn deletion_protection(&self) -> ::std::option::Option<bool> {
106        self.deletion_protection
107    }
108    /// <p>The build number of the graph software.</p>
109    pub fn build_number(&self) -> ::std::option::Option<&str> {
110        self.build_number.as_deref()
111    }
112}
113impl ::aws_types::request_id::RequestId for CreateGraphOutput {
114    fn request_id(&self) -> Option<&str> {
115        self._request_id.as_deref()
116    }
117}
118impl CreateGraphOutput {
119    /// Creates a new builder-style object to manufacture [`CreateGraphOutput`](crate::operation::create_graph::CreateGraphOutput).
120    pub fn builder() -> crate::operation::create_graph::builders::CreateGraphOutputBuilder {
121        crate::operation::create_graph::builders::CreateGraphOutputBuilder::default()
122    }
123}
124
125/// A builder for [`CreateGraphOutput`](crate::operation::create_graph::CreateGraphOutput).
126#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
127#[non_exhaustive]
128pub struct CreateGraphOutputBuilder {
129    pub(crate) id: ::std::option::Option<::std::string::String>,
130    pub(crate) name: ::std::option::Option<::std::string::String>,
131    pub(crate) arn: ::std::option::Option<::std::string::String>,
132    pub(crate) status: ::std::option::Option<crate::types::GraphStatus>,
133    pub(crate) status_reason: ::std::option::Option<::std::string::String>,
134    pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
135    pub(crate) provisioned_memory: ::std::option::Option<i32>,
136    pub(crate) endpoint: ::std::option::Option<::std::string::String>,
137    pub(crate) public_connectivity: ::std::option::Option<bool>,
138    pub(crate) vector_search_configuration: ::std::option::Option<crate::types::VectorSearchConfiguration>,
139    pub(crate) replica_count: ::std::option::Option<i32>,
140    pub(crate) kms_key_identifier: ::std::option::Option<::std::string::String>,
141    pub(crate) source_snapshot_id: ::std::option::Option<::std::string::String>,
142    pub(crate) deletion_protection: ::std::option::Option<bool>,
143    pub(crate) build_number: ::std::option::Option<::std::string::String>,
144    _request_id: Option<String>,
145}
146impl CreateGraphOutputBuilder {
147    /// <p>The ID of the graph.</p>
148    /// This field is required.
149    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.id = ::std::option::Option::Some(input.into());
151        self
152    }
153    /// <p>The ID of the graph.</p>
154    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.id = input;
156        self
157    }
158    /// <p>The ID of the graph.</p>
159    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
160        &self.id
161    }
162    /// <p>The graph name. For example: <code>my-graph-1</code>.</p>
163    /// <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>
164    /// This field is required.
165    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.name = ::std::option::Option::Some(input.into());
167        self
168    }
169    /// <p>The graph name. For example: <code>my-graph-1</code>.</p>
170    /// <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>
171    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.name = input;
173        self
174    }
175    /// <p>The graph name. For example: <code>my-graph-1</code>.</p>
176    /// <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>
177    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
178        &self.name
179    }
180    /// <p>The ARN of the graph.</p>
181    /// This field is required.
182    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.arn = ::std::option::Option::Some(input.into());
184        self
185    }
186    /// <p>The ARN of the graph.</p>
187    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.arn = input;
189        self
190    }
191    /// <p>The ARN of the graph.</p>
192    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
193        &self.arn
194    }
195    /// <p>The current status of the graph.</p>
196    pub fn status(mut self, input: crate::types::GraphStatus) -> Self {
197        self.status = ::std::option::Option::Some(input);
198        self
199    }
200    /// <p>The current status of the graph.</p>
201    pub fn set_status(mut self, input: ::std::option::Option<crate::types::GraphStatus>) -> Self {
202        self.status = input;
203        self
204    }
205    /// <p>The current status of the graph.</p>
206    pub fn get_status(&self) -> &::std::option::Option<crate::types::GraphStatus> {
207        &self.status
208    }
209    /// <p>The reason the status was given.</p>
210    pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.status_reason = ::std::option::Option::Some(input.into());
212        self
213    }
214    /// <p>The reason the status was given.</p>
215    pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.status_reason = input;
217        self
218    }
219    /// <p>The reason the status was given.</p>
220    pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
221        &self.status_reason
222    }
223    /// <p>The time when the graph was created.</p>
224    pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
225        self.create_time = ::std::option::Option::Some(input);
226        self
227    }
228    /// <p>The time when the graph was created.</p>
229    pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
230        self.create_time = input;
231        self
232    }
233    /// <p>The time when the graph was created.</p>
234    pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
235        &self.create_time
236    }
237    /// <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph.</p>
238    /// <p>Min = 16</p>
239    pub fn provisioned_memory(mut self, input: i32) -> Self {
240        self.provisioned_memory = ::std::option::Option::Some(input);
241        self
242    }
243    /// <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph.</p>
244    /// <p>Min = 16</p>
245    pub fn set_provisioned_memory(mut self, input: ::std::option::Option<i32>) -> Self {
246        self.provisioned_memory = input;
247        self
248    }
249    /// <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph.</p>
250    /// <p>Min = 16</p>
251    pub fn get_provisioned_memory(&self) -> &::std::option::Option<i32> {
252        &self.provisioned_memory
253    }
254    /// <p>The graph endpoint.</p>
255    pub fn endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
256        self.endpoint = ::std::option::Option::Some(input.into());
257        self
258    }
259    /// <p>The graph endpoint.</p>
260    pub fn set_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
261        self.endpoint = input;
262        self
263    }
264    /// <p>The graph endpoint.</p>
265    pub fn get_endpoint(&self) -> &::std::option::Option<::std::string::String> {
266        &self.endpoint
267    }
268    /// <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated.</p><note>
269    /// <p>If enabling public connectivity for the first time, there will be a delay while it is enabled.</p>
270    /// </note>
271    pub fn public_connectivity(mut self, input: bool) -> Self {
272        self.public_connectivity = ::std::option::Option::Some(input);
273        self
274    }
275    /// <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated.</p><note>
276    /// <p>If enabling public connectivity for the first time, there will be a delay while it is enabled.</p>
277    /// </note>
278    pub fn set_public_connectivity(mut self, input: ::std::option::Option<bool>) -> Self {
279        self.public_connectivity = input;
280        self
281    }
282    /// <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated.</p><note>
283    /// <p>If enabling public connectivity for the first time, there will be a delay while it is enabled.</p>
284    /// </note>
285    pub fn get_public_connectivity(&self) -> &::std::option::Option<bool> {
286        &self.public_connectivity
287    }
288    /// <p>The vector-search configuration for the graph, which specifies the vector dimension to use in the vector index, if any.</p>
289    pub fn vector_search_configuration(mut self, input: crate::types::VectorSearchConfiguration) -> Self {
290        self.vector_search_configuration = ::std::option::Option::Some(input);
291        self
292    }
293    /// <p>The vector-search configuration for the graph, which specifies the vector dimension to use in the vector index, if any.</p>
294    pub fn set_vector_search_configuration(mut self, input: ::std::option::Option<crate::types::VectorSearchConfiguration>) -> Self {
295        self.vector_search_configuration = input;
296        self
297    }
298    /// <p>The vector-search configuration for the graph, which specifies the vector dimension to use in the vector index, if any.</p>
299    pub fn get_vector_search_configuration(&self) -> &::std::option::Option<crate::types::VectorSearchConfiguration> {
300        &self.vector_search_configuration
301    }
302    /// <p>The number of replicas in other AZs.</p>
303    /// <p>Default: If not specified, the default value is 1.</p>
304    pub fn replica_count(mut self, input: i32) -> Self {
305        self.replica_count = ::std::option::Option::Some(input);
306        self
307    }
308    /// <p>The number of replicas in other AZs.</p>
309    /// <p>Default: If not specified, the default value is 1.</p>
310    pub fn set_replica_count(mut self, input: ::std::option::Option<i32>) -> Self {
311        self.replica_count = input;
312        self
313    }
314    /// <p>The number of replicas in other AZs.</p>
315    /// <p>Default: If not specified, the default value is 1.</p>
316    pub fn get_replica_count(&self) -> &::std::option::Option<i32> {
317        &self.replica_count
318    }
319    /// <p>Specifies the KMS key used to encrypt data in the new graph.</p>
320    pub fn kms_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
321        self.kms_key_identifier = ::std::option::Option::Some(input.into());
322        self
323    }
324    /// <p>Specifies the KMS key used to encrypt data in the new graph.</p>
325    pub fn set_kms_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
326        self.kms_key_identifier = input;
327        self
328    }
329    /// <p>Specifies the KMS key used to encrypt data in the new graph.</p>
330    pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
331        &self.kms_key_identifier
332    }
333    /// <p>The ID of the source graph.</p>
334    pub fn source_snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
335        self.source_snapshot_id = ::std::option::Option::Some(input.into());
336        self
337    }
338    /// <p>The ID of the source graph.</p>
339    pub fn set_source_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
340        self.source_snapshot_id = input;
341        self
342    }
343    /// <p>The ID of the source graph.</p>
344    pub fn get_source_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
345        &self.source_snapshot_id
346    }
347    /// <p>A value that indicates whether the graph has deletion protection enabled. The graph can't be deleted when deletion protection is enabled.</p>
348    pub fn deletion_protection(mut self, input: bool) -> Self {
349        self.deletion_protection = ::std::option::Option::Some(input);
350        self
351    }
352    /// <p>A value that indicates whether the graph has deletion protection enabled. The graph can't be deleted when deletion protection is enabled.</p>
353    pub fn set_deletion_protection(mut self, input: ::std::option::Option<bool>) -> Self {
354        self.deletion_protection = input;
355        self
356    }
357    /// <p>A value that indicates whether the graph has deletion protection enabled. The graph can't be deleted when deletion protection is enabled.</p>
358    pub fn get_deletion_protection(&self) -> &::std::option::Option<bool> {
359        &self.deletion_protection
360    }
361    /// <p>The build number of the graph software.</p>
362    pub fn build_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
363        self.build_number = ::std::option::Option::Some(input.into());
364        self
365    }
366    /// <p>The build number of the graph software.</p>
367    pub fn set_build_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
368        self.build_number = input;
369        self
370    }
371    /// <p>The build number of the graph software.</p>
372    pub fn get_build_number(&self) -> &::std::option::Option<::std::string::String> {
373        &self.build_number
374    }
375    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
376        self._request_id = Some(request_id.into());
377        self
378    }
379
380    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
381        self._request_id = request_id;
382        self
383    }
384    /// Consumes the builder and constructs a [`CreateGraphOutput`](crate::operation::create_graph::CreateGraphOutput).
385    /// This method will fail if any of the following fields are not set:
386    /// - [`id`](crate::operation::create_graph::builders::CreateGraphOutputBuilder::id)
387    /// - [`name`](crate::operation::create_graph::builders::CreateGraphOutputBuilder::name)
388    /// - [`arn`](crate::operation::create_graph::builders::CreateGraphOutputBuilder::arn)
389    pub fn build(self) -> ::std::result::Result<crate::operation::create_graph::CreateGraphOutput, ::aws_smithy_types::error::operation::BuildError> {
390        ::std::result::Result::Ok(crate::operation::create_graph::CreateGraphOutput {
391            id: self.id.ok_or_else(|| {
392                ::aws_smithy_types::error::operation::BuildError::missing_field(
393                    "id",
394                    "id was not specified but it is required when building CreateGraphOutput",
395                )
396            })?,
397            name: self.name.ok_or_else(|| {
398                ::aws_smithy_types::error::operation::BuildError::missing_field(
399                    "name",
400                    "name was not specified but it is required when building CreateGraphOutput",
401                )
402            })?,
403            arn: self.arn.ok_or_else(|| {
404                ::aws_smithy_types::error::operation::BuildError::missing_field(
405                    "arn",
406                    "arn was not specified but it is required when building CreateGraphOutput",
407                )
408            })?,
409            status: self.status,
410            status_reason: self.status_reason,
411            create_time: self.create_time,
412            provisioned_memory: self.provisioned_memory,
413            endpoint: self.endpoint,
414            public_connectivity: self.public_connectivity,
415            vector_search_configuration: self.vector_search_configuration,
416            replica_count: self.replica_count,
417            kms_key_identifier: self.kms_key_identifier,
418            source_snapshot_id: self.source_snapshot_id,
419            deletion_protection: self.deletion_protection,
420            build_number: self.build_number,
421            _request_id: self._request_id,
422        })
423    }
424}