aws_sdk_ssmsap/types/
_backint_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Configuration parameters for AWS Backint Agent for SAP HANA. You can backup your SAP HANA database with AWS Backup or Amazon S3.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BackintConfig {
7    /// <p>AWS service for your database backup.</p>
8    pub backint_mode: crate::types::BackintMode,
9    /// <p></p>
10    pub ensure_no_backup_in_process: bool,
11}
12impl BackintConfig {
13    /// <p>AWS service for your database backup.</p>
14    pub fn backint_mode(&self) -> &crate::types::BackintMode {
15        &self.backint_mode
16    }
17    /// <p></p>
18    pub fn ensure_no_backup_in_process(&self) -> bool {
19        self.ensure_no_backup_in_process
20    }
21}
22impl BackintConfig {
23    /// Creates a new builder-style object to manufacture [`BackintConfig`](crate::types::BackintConfig).
24    pub fn builder() -> crate::types::builders::BackintConfigBuilder {
25        crate::types::builders::BackintConfigBuilder::default()
26    }
27}
28
29/// A builder for [`BackintConfig`](crate::types::BackintConfig).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct BackintConfigBuilder {
33    pub(crate) backint_mode: ::std::option::Option<crate::types::BackintMode>,
34    pub(crate) ensure_no_backup_in_process: ::std::option::Option<bool>,
35}
36impl BackintConfigBuilder {
37    /// <p>AWS service for your database backup.</p>
38    /// This field is required.
39    pub fn backint_mode(mut self, input: crate::types::BackintMode) -> Self {
40        self.backint_mode = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>AWS service for your database backup.</p>
44    pub fn set_backint_mode(mut self, input: ::std::option::Option<crate::types::BackintMode>) -> Self {
45        self.backint_mode = input;
46        self
47    }
48    /// <p>AWS service for your database backup.</p>
49    pub fn get_backint_mode(&self) -> &::std::option::Option<crate::types::BackintMode> {
50        &self.backint_mode
51    }
52    /// <p></p>
53    /// This field is required.
54    pub fn ensure_no_backup_in_process(mut self, input: bool) -> Self {
55        self.ensure_no_backup_in_process = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p></p>
59    pub fn set_ensure_no_backup_in_process(mut self, input: ::std::option::Option<bool>) -> Self {
60        self.ensure_no_backup_in_process = input;
61        self
62    }
63    /// <p></p>
64    pub fn get_ensure_no_backup_in_process(&self) -> &::std::option::Option<bool> {
65        &self.ensure_no_backup_in_process
66    }
67    /// Consumes the builder and constructs a [`BackintConfig`](crate::types::BackintConfig).
68    /// This method will fail if any of the following fields are not set:
69    /// - [`backint_mode`](crate::types::builders::BackintConfigBuilder::backint_mode)
70    /// - [`ensure_no_backup_in_process`](crate::types::builders::BackintConfigBuilder::ensure_no_backup_in_process)
71    pub fn build(self) -> ::std::result::Result<crate::types::BackintConfig, ::aws_smithy_types::error::operation::BuildError> {
72        ::std::result::Result::Ok(crate::types::BackintConfig {
73            backint_mode: self.backint_mode.ok_or_else(|| {
74                ::aws_smithy_types::error::operation::BuildError::missing_field(
75                    "backint_mode",
76                    "backint_mode was not specified but it is required when building BackintConfig",
77                )
78            })?,
79            ensure_no_backup_in_process: self.ensure_no_backup_in_process.ok_or_else(|| {
80                ::aws_smithy_types::error::operation::BuildError::missing_field(
81                    "ensure_no_backup_in_process",
82                    "ensure_no_backup_in_process was not specified but it is required when building BackintConfig",
83                )
84            })?,
85        })
86    }
87}