aws_sdk_cloudwatchlogs/operation/put_integration/
_put_integration_input.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 PutIntegrationInput {
6    /// <p>A name for the integration.</p>
7    pub integration_name: ::std::option::Option<::std::string::String>,
8    /// <p>A structure that contains configuration information for the integration that you are creating.</p>
9    pub resource_config: ::std::option::Option<crate::types::ResourceConfig>,
10    /// <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>
11    pub integration_type: ::std::option::Option<crate::types::IntegrationType>,
12}
13impl PutIntegrationInput {
14    /// <p>A name for the integration.</p>
15    pub fn integration_name(&self) -> ::std::option::Option<&str> {
16        self.integration_name.as_deref()
17    }
18    /// <p>A structure that contains configuration information for the integration that you are creating.</p>
19    pub fn resource_config(&self) -> ::std::option::Option<&crate::types::ResourceConfig> {
20        self.resource_config.as_ref()
21    }
22    /// <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>
23    pub fn integration_type(&self) -> ::std::option::Option<&crate::types::IntegrationType> {
24        self.integration_type.as_ref()
25    }
26}
27impl PutIntegrationInput {
28    /// Creates a new builder-style object to manufacture [`PutIntegrationInput`](crate::operation::put_integration::PutIntegrationInput).
29    pub fn builder() -> crate::operation::put_integration::builders::PutIntegrationInputBuilder {
30        crate::operation::put_integration::builders::PutIntegrationInputBuilder::default()
31    }
32}
33
34/// A builder for [`PutIntegrationInput`](crate::operation::put_integration::PutIntegrationInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct PutIntegrationInputBuilder {
38    pub(crate) integration_name: ::std::option::Option<::std::string::String>,
39    pub(crate) resource_config: ::std::option::Option<crate::types::ResourceConfig>,
40    pub(crate) integration_type: ::std::option::Option<crate::types::IntegrationType>,
41}
42impl PutIntegrationInputBuilder {
43    /// <p>A name for the integration.</p>
44    /// This field is required.
45    pub fn integration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.integration_name = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>A name for the integration.</p>
50    pub fn set_integration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.integration_name = input;
52        self
53    }
54    /// <p>A name for the integration.</p>
55    pub fn get_integration_name(&self) -> &::std::option::Option<::std::string::String> {
56        &self.integration_name
57    }
58    /// <p>A structure that contains configuration information for the integration that you are creating.</p>
59    /// This field is required.
60    pub fn resource_config(mut self, input: crate::types::ResourceConfig) -> Self {
61        self.resource_config = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>A structure that contains configuration information for the integration that you are creating.</p>
65    pub fn set_resource_config(mut self, input: ::std::option::Option<crate::types::ResourceConfig>) -> Self {
66        self.resource_config = input;
67        self
68    }
69    /// <p>A structure that contains configuration information for the integration that you are creating.</p>
70    pub fn get_resource_config(&self) -> &::std::option::Option<crate::types::ResourceConfig> {
71        &self.resource_config
72    }
73    /// <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>
74    /// This field is required.
75    pub fn integration_type(mut self, input: crate::types::IntegrationType) -> Self {
76        self.integration_type = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>
80    pub fn set_integration_type(mut self, input: ::std::option::Option<crate::types::IntegrationType>) -> Self {
81        self.integration_type = input;
82        self
83    }
84    /// <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>
85    pub fn get_integration_type(&self) -> &::std::option::Option<crate::types::IntegrationType> {
86        &self.integration_type
87    }
88    /// Consumes the builder and constructs a [`PutIntegrationInput`](crate::operation::put_integration::PutIntegrationInput).
89    pub fn build(
90        self,
91    ) -> ::std::result::Result<crate::operation::put_integration::PutIntegrationInput, ::aws_smithy_types::error::operation::BuildError> {
92        ::std::result::Result::Ok(crate::operation::put_integration::PutIntegrationInput {
93            integration_name: self.integration_name,
94            resource_config: self.resource_config,
95            integration_type: self.integration_type,
96        })
97    }
98}