Skip to main content

aws_sdk_continuum/operation/create_integration/
_create_integration_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Contains the original identifier, ARN, and creation time of the new or replayed integration. A replay can refer to an integration that has since been deleted.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateIntegrationOutput {
7    /// The unique identifier of the created integration.
8    pub integration_id: ::std::string::String,
9    /// The ARN of the created integration.
10    pub integration_arn: ::std::string::String,
11    /// The timestamp when the integration was created.
12    pub created_at: ::aws_smithy_types::DateTime,
13    _request_id: Option<String>,
14}
15impl CreateIntegrationOutput {
16    /// The unique identifier of the created integration.
17    pub fn integration_id(&self) -> &str {
18        use std::ops::Deref;
19        self.integration_id.deref()
20    }
21    /// The ARN of the created integration.
22    pub fn integration_arn(&self) -> &str {
23        use std::ops::Deref;
24        self.integration_arn.deref()
25    }
26    /// The timestamp when the integration was created.
27    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
28        &self.created_at
29    }
30}
31impl ::aws_types::request_id::RequestId for CreateIntegrationOutput {
32    fn request_id(&self) -> Option<&str> {
33        self._request_id.as_deref()
34    }
35}
36impl CreateIntegrationOutput {
37    /// Creates a new builder-style object to manufacture [`CreateIntegrationOutput`](crate::operation::create_integration::CreateIntegrationOutput).
38    pub fn builder() -> crate::operation::create_integration::builders::CreateIntegrationOutputBuilder {
39        crate::operation::create_integration::builders::CreateIntegrationOutputBuilder::default()
40    }
41}
42
43/// A builder for [`CreateIntegrationOutput`](crate::operation::create_integration::CreateIntegrationOutput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct CreateIntegrationOutputBuilder {
47    pub(crate) integration_id: ::std::option::Option<::std::string::String>,
48    pub(crate) integration_arn: ::std::option::Option<::std::string::String>,
49    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
50    _request_id: Option<String>,
51}
52impl CreateIntegrationOutputBuilder {
53    /// The unique identifier of the created integration.
54    /// This field is required.
55    pub fn integration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.integration_id = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// The unique identifier of the created integration.
60    pub fn set_integration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.integration_id = input;
62        self
63    }
64    /// The unique identifier of the created integration.
65    pub fn get_integration_id(&self) -> &::std::option::Option<::std::string::String> {
66        &self.integration_id
67    }
68    /// The ARN of the created integration.
69    /// This field is required.
70    pub fn integration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.integration_arn = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// The ARN of the created integration.
75    pub fn set_integration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.integration_arn = input;
77        self
78    }
79    /// The ARN of the created integration.
80    pub fn get_integration_arn(&self) -> &::std::option::Option<::std::string::String> {
81        &self.integration_arn
82    }
83    /// The timestamp when the integration was created.
84    /// This field is required.
85    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
86        self.created_at = ::std::option::Option::Some(input);
87        self
88    }
89    /// The timestamp when the integration was created.
90    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
91        self.created_at = input;
92        self
93    }
94    /// The timestamp when the integration was created.
95    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
96        &self.created_at
97    }
98    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
99        self._request_id = Some(request_id.into());
100        self
101    }
102
103    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
104        self._request_id = request_id;
105        self
106    }
107    /// Consumes the builder and constructs a [`CreateIntegrationOutput`](crate::operation::create_integration::CreateIntegrationOutput).
108    /// This method will fail if any of the following fields are not set:
109    /// - [`integration_id`](crate::operation::create_integration::builders::CreateIntegrationOutputBuilder::integration_id)
110    /// - [`integration_arn`](crate::operation::create_integration::builders::CreateIntegrationOutputBuilder::integration_arn)
111    /// - [`created_at`](crate::operation::create_integration::builders::CreateIntegrationOutputBuilder::created_at)
112    pub fn build(
113        self,
114    ) -> ::std::result::Result<crate::operation::create_integration::CreateIntegrationOutput, ::aws_smithy_types::error::operation::BuildError> {
115        ::std::result::Result::Ok(crate::operation::create_integration::CreateIntegrationOutput {
116            integration_id: self.integration_id.ok_or_else(|| {
117                ::aws_smithy_types::error::operation::BuildError::missing_field(
118                    "integration_id",
119                    "integration_id was not specified but it is required when building CreateIntegrationOutput",
120                )
121            })?,
122            integration_arn: self.integration_arn.ok_or_else(|| {
123                ::aws_smithy_types::error::operation::BuildError::missing_field(
124                    "integration_arn",
125                    "integration_arn was not specified but it is required when building CreateIntegrationOutput",
126                )
127            })?,
128            created_at: self.created_at.ok_or_else(|| {
129                ::aws_smithy_types::error::operation::BuildError::missing_field(
130                    "created_at",
131                    "created_at was not specified but it is required when building CreateIntegrationOutput",
132                )
133            })?,
134            _request_id: self._request_id,
135        })
136    }
137}