1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The trigger settings that determine how and when Amazon AppFlow runs the specified flow.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TriggerConfig {
    /// <p>Specifies the type of flow trigger. It can be OnDemand, Scheduled, or Event.</p>
    pub trigger_type: crate::types::TriggerType,
    /// <p>Specifies the configuration details of a schedule-triggered flow that you define. Currently, these settings only apply to the Scheduled trigger type.</p>
    pub trigger_properties: ::std::option::Option<crate::types::TriggerProperties>,
}
impl TriggerConfig {
    /// <p>Specifies the type of flow trigger. It can be OnDemand, Scheduled, or Event.</p>
    pub fn trigger_type(&self) -> &crate::types::TriggerType {
        &self.trigger_type
    }
    /// <p>Specifies the configuration details of a schedule-triggered flow that you define. Currently, these settings only apply to the Scheduled trigger type.</p>
    pub fn trigger_properties(&self) -> ::std::option::Option<&crate::types::TriggerProperties> {
        self.trigger_properties.as_ref()
    }
}
impl TriggerConfig {
    /// Creates a new builder-style object to manufacture [`TriggerConfig`](crate::types::TriggerConfig).
    pub fn builder() -> crate::types::builders::TriggerConfigBuilder {
        crate::types::builders::TriggerConfigBuilder::default()
    }
}

/// A builder for [`TriggerConfig`](crate::types::TriggerConfig).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct TriggerConfigBuilder {
    pub(crate) trigger_type: ::std::option::Option<crate::types::TriggerType>,
    pub(crate) trigger_properties: ::std::option::Option<crate::types::TriggerProperties>,
}
impl TriggerConfigBuilder {
    /// <p>Specifies the type of flow trigger. It can be OnDemand, Scheduled, or Event.</p>
    /// This field is required.
    pub fn trigger_type(mut self, input: crate::types::TriggerType) -> Self {
        self.trigger_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the type of flow trigger. It can be OnDemand, Scheduled, or Event.</p>
    pub fn set_trigger_type(mut self, input: ::std::option::Option<crate::types::TriggerType>) -> Self {
        self.trigger_type = input;
        self
    }
    /// <p>Specifies the type of flow trigger. It can be OnDemand, Scheduled, or Event.</p>
    pub fn get_trigger_type(&self) -> &::std::option::Option<crate::types::TriggerType> {
        &self.trigger_type
    }
    /// <p>Specifies the configuration details of a schedule-triggered flow that you define. Currently, these settings only apply to the Scheduled trigger type.</p>
    pub fn trigger_properties(mut self, input: crate::types::TriggerProperties) -> Self {
        self.trigger_properties = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the configuration details of a schedule-triggered flow that you define. Currently, these settings only apply to the Scheduled trigger type.</p>
    pub fn set_trigger_properties(mut self, input: ::std::option::Option<crate::types::TriggerProperties>) -> Self {
        self.trigger_properties = input;
        self
    }
    /// <p>Specifies the configuration details of a schedule-triggered flow that you define. Currently, these settings only apply to the Scheduled trigger type.</p>
    pub fn get_trigger_properties(&self) -> &::std::option::Option<crate::types::TriggerProperties> {
        &self.trigger_properties
    }
    /// Consumes the builder and constructs a [`TriggerConfig`](crate::types::TriggerConfig).
    /// This method will fail if any of the following fields are not set:
    /// - [`trigger_type`](crate::types::builders::TriggerConfigBuilder::trigger_type)
    pub fn build(self) -> ::std::result::Result<crate::types::TriggerConfig, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::TriggerConfig {
            trigger_type: self.trigger_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "trigger_type",
                    "trigger_type was not specified but it is required when building TriggerConfig",
                )
            })?,
            trigger_properties: self.trigger_properties,
        })
    }
}