// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Specifies the provider configuration and name for the new integration.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateIntegrationInput {
/// An optional token identifying one create attempt within the caller's account, Region, and operation. SDKs generate a token when omitted. If a request reaches the service without a token, the service generates one for that request. Each request without a token starts a new attempt. To replay an attempt, supply the same token and identical input. Authorized users and roles in the same account can retry an attempt this way. Token records are retained for eight hours after success or terminal failure, including after deletion of a successfully created integration. Different input with the same token returns ValidationException.
pub client_token: ::std::option::Option<::std::string::String>,
/// The name for the integration.
pub name: ::std::option::Option<::std::string::String>,
/// The provider-specific configuration required to create the integration. Only one member may be specified.
pub provider_configuration: ::std::option::Option<crate::types::ProviderConfiguration>,
}
impl CreateIntegrationInput {
/// An optional token identifying one create attempt within the caller's account, Region, and operation. SDKs generate a token when omitted. If a request reaches the service without a token, the service generates one for that request. Each request without a token starts a new attempt. To replay an attempt, supply the same token and identical input. Authorized users and roles in the same account can retry an attempt this way. Token records are retained for eight hours after success or terminal failure, including after deletion of a successfully created integration. Different input with the same token returns ValidationException.
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
/// The name for the integration.
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// The provider-specific configuration required to create the integration. Only one member may be specified.
pub fn provider_configuration(&self) -> ::std::option::Option<&crate::types::ProviderConfiguration> {
self.provider_configuration.as_ref()
}
}
impl CreateIntegrationInput {
/// Creates a new builder-style object to manufacture [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
pub fn builder() -> crate::operation::create_integration::builders::CreateIntegrationInputBuilder {
crate::operation::create_integration::builders::CreateIntegrationInputBuilder::default()
}
}
/// A builder for [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateIntegrationInputBuilder {
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) provider_configuration: ::std::option::Option<crate::types::ProviderConfiguration>,
}
impl CreateIntegrationInputBuilder {
/// An optional token identifying one create attempt within the caller's account, Region, and operation. SDKs generate a token when omitted. If a request reaches the service without a token, the service generates one for that request. Each request without a token starts a new attempt. To replay an attempt, supply the same token and identical input. Authorized users and roles in the same account can retry an attempt this way. Token records are retained for eight hours after success or terminal failure, including after deletion of a successfully created integration. Different input with the same token returns ValidationException.
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
/// An optional token identifying one create attempt within the caller's account, Region, and operation. SDKs generate a token when omitted. If a request reaches the service without a token, the service generates one for that request. Each request without a token starts a new attempt. To replay an attempt, supply the same token and identical input. Authorized users and roles in the same account can retry an attempt this way. Token records are retained for eight hours after success or terminal failure, including after deletion of a successfully created integration. Different input with the same token returns ValidationException.
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// An optional token identifying one create attempt within the caller's account, Region, and operation. SDKs generate a token when omitted. If a request reaches the service without a token, the service generates one for that request. Each request without a token starts a new attempt. To replay an attempt, supply the same token and identical input. Authorized users and roles in the same account can retry an attempt this way. Token records are retained for eight hours after success or terminal failure, including after deletion of a successfully created integration. Different input with the same token returns ValidationException.
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// The name for the integration.
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// The name for the integration.
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// The name for the integration.
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// The provider-specific configuration required to create the integration. Only one member may be specified.
/// This field is required.
pub fn provider_configuration(mut self, input: crate::types::ProviderConfiguration) -> Self {
self.provider_configuration = ::std::option::Option::Some(input);
self
}
/// The provider-specific configuration required to create the integration. Only one member may be specified.
pub fn set_provider_configuration(mut self, input: ::std::option::Option<crate::types::ProviderConfiguration>) -> Self {
self.provider_configuration = input;
self
}
/// The provider-specific configuration required to create the integration. Only one member may be specified.
pub fn get_provider_configuration(&self) -> &::std::option::Option<crate::types::ProviderConfiguration> {
&self.provider_configuration
}
/// Consumes the builder and constructs a [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_integration::CreateIntegrationInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_integration::CreateIntegrationInput {
client_token: self.client_token,
name: self.name,
provider_configuration: self.provider_configuration,
})
}
}