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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies settings for invoking an AWS Lambda function that customizes a segment for a campaign.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CampaignHook {
    /// <p>The name or Amazon Resource Name (ARN) of the AWS Lambda function that Amazon Pinpoint invokes to customize a segment for a campaign.</p>
    pub lambda_function_name: ::std::option::Option<::std::string::String>,
    /// <p>The mode that Amazon Pinpoint uses to invoke the AWS Lambda function. Possible values are:</p>
    /// <ul>
    /// <li>
    /// <p>FILTER - Invoke the function to customize the segment that's used by a campaign.</p></li>
    /// <li>
    /// <p>DELIVERY - (Deprecated) Previously, invoked the function to send a campaign through a custom channel. This functionality is not supported anymore. To send a campaign through a custom channel, use the CustomDeliveryConfiguration and CampaignCustomMessage objects of the campaign.</p></li>
    /// </ul>
    pub mode: ::std::option::Option<crate::types::Mode>,
    /// <p>The web URL that Amazon Pinpoint calls to invoke the AWS Lambda function over HTTPS.</p>
    pub web_url: ::std::option::Option<::std::string::String>,
}
impl CampaignHook {
    /// <p>The name or Amazon Resource Name (ARN) of the AWS Lambda function that Amazon Pinpoint invokes to customize a segment for a campaign.</p>
    pub fn lambda_function_name(&self) -> ::std::option::Option<&str> {
        self.lambda_function_name.as_deref()
    }
    /// <p>The mode that Amazon Pinpoint uses to invoke the AWS Lambda function. Possible values are:</p>
    /// <ul>
    /// <li>
    /// <p>FILTER - Invoke the function to customize the segment that's used by a campaign.</p></li>
    /// <li>
    /// <p>DELIVERY - (Deprecated) Previously, invoked the function to send a campaign through a custom channel. This functionality is not supported anymore. To send a campaign through a custom channel, use the CustomDeliveryConfiguration and CampaignCustomMessage objects of the campaign.</p></li>
    /// </ul>
    pub fn mode(&self) -> ::std::option::Option<&crate::types::Mode> {
        self.mode.as_ref()
    }
    /// <p>The web URL that Amazon Pinpoint calls to invoke the AWS Lambda function over HTTPS.</p>
    pub fn web_url(&self) -> ::std::option::Option<&str> {
        self.web_url.as_deref()
    }
}
impl CampaignHook {
    /// Creates a new builder-style object to manufacture [`CampaignHook`](crate::types::CampaignHook).
    pub fn builder() -> crate::types::builders::CampaignHookBuilder {
        crate::types::builders::CampaignHookBuilder::default()
    }
}

/// A builder for [`CampaignHook`](crate::types::CampaignHook).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CampaignHookBuilder {
    pub(crate) lambda_function_name: ::std::option::Option<::std::string::String>,
    pub(crate) mode: ::std::option::Option<crate::types::Mode>,
    pub(crate) web_url: ::std::option::Option<::std::string::String>,
}
impl CampaignHookBuilder {
    /// <p>The name or Amazon Resource Name (ARN) of the AWS Lambda function that Amazon Pinpoint invokes to customize a segment for a campaign.</p>
    pub fn lambda_function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.lambda_function_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) of the AWS Lambda function that Amazon Pinpoint invokes to customize a segment for a campaign.</p>
    pub fn set_lambda_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.lambda_function_name = input;
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) of the AWS Lambda function that Amazon Pinpoint invokes to customize a segment for a campaign.</p>
    pub fn get_lambda_function_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.lambda_function_name
    }
    /// <p>The mode that Amazon Pinpoint uses to invoke the AWS Lambda function. Possible values are:</p>
    /// <ul>
    /// <li>
    /// <p>FILTER - Invoke the function to customize the segment that's used by a campaign.</p></li>
    /// <li>
    /// <p>DELIVERY - (Deprecated) Previously, invoked the function to send a campaign through a custom channel. This functionality is not supported anymore. To send a campaign through a custom channel, use the CustomDeliveryConfiguration and CampaignCustomMessage objects of the campaign.</p></li>
    /// </ul>
    pub fn mode(mut self, input: crate::types::Mode) -> Self {
        self.mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The mode that Amazon Pinpoint uses to invoke the AWS Lambda function. Possible values are:</p>
    /// <ul>
    /// <li>
    /// <p>FILTER - Invoke the function to customize the segment that's used by a campaign.</p></li>
    /// <li>
    /// <p>DELIVERY - (Deprecated) Previously, invoked the function to send a campaign through a custom channel. This functionality is not supported anymore. To send a campaign through a custom channel, use the CustomDeliveryConfiguration and CampaignCustomMessage objects of the campaign.</p></li>
    /// </ul>
    pub fn set_mode(mut self, input: ::std::option::Option<crate::types::Mode>) -> Self {
        self.mode = input;
        self
    }
    /// <p>The mode that Amazon Pinpoint uses to invoke the AWS Lambda function. Possible values are:</p>
    /// <ul>
    /// <li>
    /// <p>FILTER - Invoke the function to customize the segment that's used by a campaign.</p></li>
    /// <li>
    /// <p>DELIVERY - (Deprecated) Previously, invoked the function to send a campaign through a custom channel. This functionality is not supported anymore. To send a campaign through a custom channel, use the CustomDeliveryConfiguration and CampaignCustomMessage objects of the campaign.</p></li>
    /// </ul>
    pub fn get_mode(&self) -> &::std::option::Option<crate::types::Mode> {
        &self.mode
    }
    /// <p>The web URL that Amazon Pinpoint calls to invoke the AWS Lambda function over HTTPS.</p>
    pub fn web_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.web_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The web URL that Amazon Pinpoint calls to invoke the AWS Lambda function over HTTPS.</p>
    pub fn set_web_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.web_url = input;
        self
    }
    /// <p>The web URL that Amazon Pinpoint calls to invoke the AWS Lambda function over HTTPS.</p>
    pub fn get_web_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.web_url
    }
    /// Consumes the builder and constructs a [`CampaignHook`](crate::types::CampaignHook).
    pub fn build(self) -> crate::types::CampaignHook {
        crate::types::CampaignHook {
            lambda_function_name: self.lambda_function_name,
            mode: self.mode,
            web_url: self.web_url,
        }
    }
}