{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SES.Types.ReceiptRule
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SES.Types.ReceiptRule where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.ReceiptAction
import Amazonka.SES.Types.TlsPolicy

-- | Receipt rules enable you to specify which actions Amazon SES should take
-- when it receives mail on behalf of one or more email addresses or
-- domains that you own.
--
-- Each receipt rule defines a set of email addresses or domains that it
-- applies to. If the email addresses or domains match at least one
-- recipient address of the message, Amazon SES executes all of the receipt
-- rule\'s actions on the message.
--
-- For information about setting up receipt rules, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-receipt-rules.html Amazon SES Developer Guide>.
--
-- /See:/ 'newReceiptRule' smart constructor.
data ReceiptRule = ReceiptRule'
  { -- | If @true@, then messages that this receipt rule applies to are scanned
    -- for spam and viruses. The default value is @false@.
    ReceiptRule -> Maybe Bool
scanEnabled :: Prelude.Maybe Prelude.Bool,
    -- | If @true@, the receipt rule is active. The default value is @false@.
    ReceiptRule -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | An ordered list of actions to perform on messages that match at least
    -- one of the recipient email addresses or domains specified in the receipt
    -- rule.
    ReceiptRule -> Maybe [ReceiptAction]
actions :: Prelude.Maybe [ReceiptAction],
    -- | The recipient domains and email addresses that the receipt rule applies
    -- to. If this field is not specified, this rule will match all recipients
    -- under all verified domains.
    ReceiptRule -> Maybe [Text]
recipients :: Prelude.Maybe [Prelude.Text],
    -- | Specifies whether Amazon SES should require that incoming email is
    -- delivered over a connection encrypted with Transport Layer Security
    -- (TLS). If this parameter is set to @Require@, Amazon SES will bounce
    -- emails that are not received over TLS. The default is @Optional@.
    ReceiptRule -> Maybe TlsPolicy
tlsPolicy :: Prelude.Maybe TlsPolicy,
    -- | The name of the receipt rule. The name must:
    --
    -- -   This value can only contain ASCII letters (a-z, A-Z), numbers (0-9),
    --     underscores (_), or dashes (-).
    --
    -- -   Start and end with a letter or number.
    --
    -- -   Contain less than 64 characters.
    ReceiptRule -> Text
name :: Prelude.Text
  }
  deriving (ReceiptRule -> ReceiptRule -> Bool
(ReceiptRule -> ReceiptRule -> Bool)
-> (ReceiptRule -> ReceiptRule -> Bool) -> Eq ReceiptRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReceiptRule -> ReceiptRule -> Bool
$c/= :: ReceiptRule -> ReceiptRule -> Bool
== :: ReceiptRule -> ReceiptRule -> Bool
$c== :: ReceiptRule -> ReceiptRule -> Bool
Prelude.Eq, ReadPrec [ReceiptRule]
ReadPrec ReceiptRule
Int -> ReadS ReceiptRule
ReadS [ReceiptRule]
(Int -> ReadS ReceiptRule)
-> ReadS [ReceiptRule]
-> ReadPrec ReceiptRule
-> ReadPrec [ReceiptRule]
-> Read ReceiptRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReceiptRule]
$creadListPrec :: ReadPrec [ReceiptRule]
readPrec :: ReadPrec ReceiptRule
$creadPrec :: ReadPrec ReceiptRule
readList :: ReadS [ReceiptRule]
$creadList :: ReadS [ReceiptRule]
readsPrec :: Int -> ReadS ReceiptRule
$creadsPrec :: Int -> ReadS ReceiptRule
Prelude.Read, Int -> ReceiptRule -> ShowS
[ReceiptRule] -> ShowS
ReceiptRule -> String
(Int -> ReceiptRule -> ShowS)
-> (ReceiptRule -> String)
-> ([ReceiptRule] -> ShowS)
-> Show ReceiptRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReceiptRule] -> ShowS
$cshowList :: [ReceiptRule] -> ShowS
show :: ReceiptRule -> String
$cshow :: ReceiptRule -> String
showsPrec :: Int -> ReceiptRule -> ShowS
$cshowsPrec :: Int -> ReceiptRule -> ShowS
Prelude.Show, (forall x. ReceiptRule -> Rep ReceiptRule x)
-> (forall x. Rep ReceiptRule x -> ReceiptRule)
-> Generic ReceiptRule
forall x. Rep ReceiptRule x -> ReceiptRule
forall x. ReceiptRule -> Rep ReceiptRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReceiptRule x -> ReceiptRule
$cfrom :: forall x. ReceiptRule -> Rep ReceiptRule x
Prelude.Generic)

-- |
-- Create a value of 'ReceiptRule' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'scanEnabled', 'receiptRule_scanEnabled' - If @true@, then messages that this receipt rule applies to are scanned
-- for spam and viruses. The default value is @false@.
--
-- 'enabled', 'receiptRule_enabled' - If @true@, the receipt rule is active. The default value is @false@.
--
-- 'actions', 'receiptRule_actions' - An ordered list of actions to perform on messages that match at least
-- one of the recipient email addresses or domains specified in the receipt
-- rule.
--
-- 'recipients', 'receiptRule_recipients' - The recipient domains and email addresses that the receipt rule applies
-- to. If this field is not specified, this rule will match all recipients
-- under all verified domains.
--
-- 'tlsPolicy', 'receiptRule_tlsPolicy' - Specifies whether Amazon SES should require that incoming email is
-- delivered over a connection encrypted with Transport Layer Security
-- (TLS). If this parameter is set to @Require@, Amazon SES will bounce
-- emails that are not received over TLS. The default is @Optional@.
--
-- 'name', 'receiptRule_name' - The name of the receipt rule. The name must:
--
-- -   This value can only contain ASCII letters (a-z, A-Z), numbers (0-9),
--     underscores (_), or dashes (-).
--
-- -   Start and end with a letter or number.
--
-- -   Contain less than 64 characters.
newReceiptRule ::
  -- | 'name'
  Prelude.Text ->
  ReceiptRule
newReceiptRule :: Text -> ReceiptRule
newReceiptRule Text
pName_ =
  ReceiptRule' :: Maybe Bool
-> Maybe Bool
-> Maybe [ReceiptAction]
-> Maybe [Text]
-> Maybe TlsPolicy
-> Text
-> ReceiptRule
ReceiptRule'
    { $sel:scanEnabled:ReceiptRule' :: Maybe Bool
scanEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:ReceiptRule' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:actions:ReceiptRule' :: Maybe [ReceiptAction]
actions = Maybe [ReceiptAction]
forall a. Maybe a
Prelude.Nothing,
      $sel:recipients:ReceiptRule' :: Maybe [Text]
recipients = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:tlsPolicy:ReceiptRule' :: Maybe TlsPolicy
tlsPolicy = Maybe TlsPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ReceiptRule' :: Text
name = Text
pName_
    }

-- | If @true@, then messages that this receipt rule applies to are scanned
-- for spam and viruses. The default value is @false@.
receiptRule_scanEnabled :: Lens.Lens' ReceiptRule (Prelude.Maybe Prelude.Bool)
receiptRule_scanEnabled :: (Maybe Bool -> f (Maybe Bool)) -> ReceiptRule -> f ReceiptRule
receiptRule_scanEnabled = (ReceiptRule -> Maybe Bool)
-> (ReceiptRule -> Maybe Bool -> ReceiptRule)
-> Lens ReceiptRule ReceiptRule (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiptRule' {Maybe Bool
scanEnabled :: Maybe Bool
$sel:scanEnabled:ReceiptRule' :: ReceiptRule -> Maybe Bool
scanEnabled} -> Maybe Bool
scanEnabled) (\s :: ReceiptRule
s@ReceiptRule' {} Maybe Bool
a -> ReceiptRule
s {$sel:scanEnabled:ReceiptRule' :: Maybe Bool
scanEnabled = Maybe Bool
a} :: ReceiptRule)

-- | If @true@, the receipt rule is active. The default value is @false@.
receiptRule_enabled :: Lens.Lens' ReceiptRule (Prelude.Maybe Prelude.Bool)
receiptRule_enabled :: (Maybe Bool -> f (Maybe Bool)) -> ReceiptRule -> f ReceiptRule
receiptRule_enabled = (ReceiptRule -> Maybe Bool)
-> (ReceiptRule -> Maybe Bool -> ReceiptRule)
-> Lens ReceiptRule ReceiptRule (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiptRule' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ReceiptRule' :: ReceiptRule -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ReceiptRule
s@ReceiptRule' {} Maybe Bool
a -> ReceiptRule
s {$sel:enabled:ReceiptRule' :: Maybe Bool
enabled = Maybe Bool
a} :: ReceiptRule)

-- | An ordered list of actions to perform on messages that match at least
-- one of the recipient email addresses or domains specified in the receipt
-- rule.
receiptRule_actions :: Lens.Lens' ReceiptRule (Prelude.Maybe [ReceiptAction])
receiptRule_actions :: (Maybe [ReceiptAction] -> f (Maybe [ReceiptAction]))
-> ReceiptRule -> f ReceiptRule
receiptRule_actions = (ReceiptRule -> Maybe [ReceiptAction])
-> (ReceiptRule -> Maybe [ReceiptAction] -> ReceiptRule)
-> Lens
     ReceiptRule
     ReceiptRule
     (Maybe [ReceiptAction])
     (Maybe [ReceiptAction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiptRule' {Maybe [ReceiptAction]
actions :: Maybe [ReceiptAction]
$sel:actions:ReceiptRule' :: ReceiptRule -> Maybe [ReceiptAction]
actions} -> Maybe [ReceiptAction]
actions) (\s :: ReceiptRule
s@ReceiptRule' {} Maybe [ReceiptAction]
a -> ReceiptRule
s {$sel:actions:ReceiptRule' :: Maybe [ReceiptAction]
actions = Maybe [ReceiptAction]
a} :: ReceiptRule) ((Maybe [ReceiptAction] -> f (Maybe [ReceiptAction]))
 -> ReceiptRule -> f ReceiptRule)
-> ((Maybe [ReceiptAction] -> f (Maybe [ReceiptAction]))
    -> Maybe [ReceiptAction] -> f (Maybe [ReceiptAction]))
-> (Maybe [ReceiptAction] -> f (Maybe [ReceiptAction]))
-> ReceiptRule
-> f ReceiptRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReceiptAction] [ReceiptAction] [ReceiptAction] [ReceiptAction]
-> Iso
     (Maybe [ReceiptAction])
     (Maybe [ReceiptAction])
     (Maybe [ReceiptAction])
     (Maybe [ReceiptAction])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ReceiptAction] [ReceiptAction] [ReceiptAction] [ReceiptAction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The recipient domains and email addresses that the receipt rule applies
-- to. If this field is not specified, this rule will match all recipients
-- under all verified domains.
receiptRule_recipients :: Lens.Lens' ReceiptRule (Prelude.Maybe [Prelude.Text])
receiptRule_recipients :: (Maybe [Text] -> f (Maybe [Text])) -> ReceiptRule -> f ReceiptRule
receiptRule_recipients = (ReceiptRule -> Maybe [Text])
-> (ReceiptRule -> Maybe [Text] -> ReceiptRule)
-> Lens ReceiptRule ReceiptRule (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiptRule' {Maybe [Text]
recipients :: Maybe [Text]
$sel:recipients:ReceiptRule' :: ReceiptRule -> Maybe [Text]
recipients} -> Maybe [Text]
recipients) (\s :: ReceiptRule
s@ReceiptRule' {} Maybe [Text]
a -> ReceiptRule
s {$sel:recipients:ReceiptRule' :: Maybe [Text]
recipients = Maybe [Text]
a} :: ReceiptRule) ((Maybe [Text] -> f (Maybe [Text]))
 -> ReceiptRule -> f ReceiptRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ReceiptRule
-> f ReceiptRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies whether Amazon SES should require that incoming email is
-- delivered over a connection encrypted with Transport Layer Security
-- (TLS). If this parameter is set to @Require@, Amazon SES will bounce
-- emails that are not received over TLS. The default is @Optional@.
receiptRule_tlsPolicy :: Lens.Lens' ReceiptRule (Prelude.Maybe TlsPolicy)
receiptRule_tlsPolicy :: (Maybe TlsPolicy -> f (Maybe TlsPolicy))
-> ReceiptRule -> f ReceiptRule
receiptRule_tlsPolicy = (ReceiptRule -> Maybe TlsPolicy)
-> (ReceiptRule -> Maybe TlsPolicy -> ReceiptRule)
-> Lens ReceiptRule ReceiptRule (Maybe TlsPolicy) (Maybe TlsPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiptRule' {Maybe TlsPolicy
tlsPolicy :: Maybe TlsPolicy
$sel:tlsPolicy:ReceiptRule' :: ReceiptRule -> Maybe TlsPolicy
tlsPolicy} -> Maybe TlsPolicy
tlsPolicy) (\s :: ReceiptRule
s@ReceiptRule' {} Maybe TlsPolicy
a -> ReceiptRule
s {$sel:tlsPolicy:ReceiptRule' :: Maybe TlsPolicy
tlsPolicy = Maybe TlsPolicy
a} :: ReceiptRule)

-- | The name of the receipt rule. The name must:
--
-- -   This value can only contain ASCII letters (a-z, A-Z), numbers (0-9),
--     underscores (_), or dashes (-).
--
-- -   Start and end with a letter or number.
--
-- -   Contain less than 64 characters.
receiptRule_name :: Lens.Lens' ReceiptRule Prelude.Text
receiptRule_name :: (Text -> f Text) -> ReceiptRule -> f ReceiptRule
receiptRule_name = (ReceiptRule -> Text)
-> (ReceiptRule -> Text -> ReceiptRule)
-> Lens ReceiptRule ReceiptRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiptRule' {Text
name :: Text
$sel:name:ReceiptRule' :: ReceiptRule -> Text
name} -> Text
name) (\s :: ReceiptRule
s@ReceiptRule' {} Text
a -> ReceiptRule
s {$sel:name:ReceiptRule' :: Text
name = Text
a} :: ReceiptRule)

instance Core.FromXML ReceiptRule where
  parseXML :: [Node] -> Either String ReceiptRule
parseXML [Node]
x =
    Maybe Bool
-> Maybe Bool
-> Maybe [ReceiptAction]
-> Maybe [Text]
-> Maybe TlsPolicy
-> Text
-> ReceiptRule
ReceiptRule'
      (Maybe Bool
 -> Maybe Bool
 -> Maybe [ReceiptAction]
 -> Maybe [Text]
 -> Maybe TlsPolicy
 -> Text
 -> ReceiptRule)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Bool
      -> Maybe [ReceiptAction]
      -> Maybe [Text]
      -> Maybe TlsPolicy
      -> Text
      -> ReceiptRule)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ScanEnabled")
      Either
  String
  (Maybe Bool
   -> Maybe [ReceiptAction]
   -> Maybe [Text]
   -> Maybe TlsPolicy
   -> Text
   -> ReceiptRule)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [ReceiptAction]
      -> Maybe [Text] -> Maybe TlsPolicy -> Text -> ReceiptRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Enabled")
      Either
  String
  (Maybe [ReceiptAction]
   -> Maybe [Text] -> Maybe TlsPolicy -> Text -> ReceiptRule)
-> Either String (Maybe [ReceiptAction])
-> Either
     String (Maybe [Text] -> Maybe TlsPolicy -> Text -> ReceiptRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Actions" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [ReceiptAction]))
-> Either String (Maybe [ReceiptAction])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ReceiptAction])
-> [Node] -> Either String (Maybe [ReceiptAction])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ReceiptAction]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String (Maybe [Text] -> Maybe TlsPolicy -> Text -> ReceiptRule)
-> Either String (Maybe [Text])
-> Either String (Maybe TlsPolicy -> Text -> ReceiptRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Recipients" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either String (Maybe TlsPolicy -> Text -> ReceiptRule)
-> Either String (Maybe TlsPolicy)
-> Either String (Text -> ReceiptRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TlsPolicy)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TlsPolicy")
      Either String (Text -> ReceiptRule)
-> Either String Text -> Either String ReceiptRule
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Name")

instance Prelude.Hashable ReceiptRule

instance Prelude.NFData ReceiptRule

instance Core.ToQuery ReceiptRule where
  toQuery :: ReceiptRule -> QueryString
toQuery ReceiptRule' {Maybe Bool
Maybe [Text]
Maybe [ReceiptAction]
Maybe TlsPolicy
Text
name :: Text
tlsPolicy :: Maybe TlsPolicy
recipients :: Maybe [Text]
actions :: Maybe [ReceiptAction]
enabled :: Maybe Bool
scanEnabled :: Maybe Bool
$sel:name:ReceiptRule' :: ReceiptRule -> Text
$sel:tlsPolicy:ReceiptRule' :: ReceiptRule -> Maybe TlsPolicy
$sel:recipients:ReceiptRule' :: ReceiptRule -> Maybe [Text]
$sel:actions:ReceiptRule' :: ReceiptRule -> Maybe [ReceiptAction]
$sel:enabled:ReceiptRule' :: ReceiptRule -> Maybe Bool
$sel:scanEnabled:ReceiptRule' :: ReceiptRule -> Maybe Bool
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"ScanEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
scanEnabled,
        ByteString
"Enabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
enabled,
        ByteString
"Actions"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [ReceiptAction] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([ReceiptAction] -> QueryString)
-> Maybe [ReceiptAction] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ReceiptAction]
actions),
        ByteString
"Recipients"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
recipients),
        ByteString
"TlsPolicy" ByteString -> Maybe TlsPolicy -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TlsPolicy
tlsPolicy,
        ByteString
"Name" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
name
      ]