{-# 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.WorkmailAction -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.SES.Types.WorkmailAction where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import qualified Amazonka.Prelude as Prelude -- | When included in a receipt rule, this action calls Amazon WorkMail and, -- optionally, publishes a notification to Amazon Simple Notification -- Service (Amazon SNS). You will typically not use this action directly -- because Amazon WorkMail adds the rule automatically during its setup -- procedure. -- -- For information using a receipt rule to call Amazon WorkMail, see the -- . -- -- /See:/ 'newWorkmailAction' smart constructor. data WorkmailAction = WorkmailAction' { -- | The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when -- the WorkMail action is called. An example of an Amazon SNS topic ARN is -- @arn:aws:sns:us-west-2:123456789012:MyTopic@. For more information about -- Amazon SNS topics, see the -- . topicArn :: Prelude.Maybe Prelude.Text, -- | The ARN of the Amazon WorkMail organization. An example of an Amazon -- WorkMail organization ARN is -- @arn:aws:workmail:us-west-2:123456789012:organization\/m-68755160c4cb4e29a2b2f8fb58f359d7@. -- For information about Amazon WorkMail organizations, see the -- . organizationArn :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'WorkmailAction' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'topicArn', 'workmailAction_topicArn' - The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when -- the WorkMail action is called. An example of an Amazon SNS topic ARN is -- @arn:aws:sns:us-west-2:123456789012:MyTopic@. For more information about -- Amazon SNS topics, see the -- . -- -- 'organizationArn', 'workmailAction_organizationArn' - The ARN of the Amazon WorkMail organization. An example of an Amazon -- WorkMail organization ARN is -- @arn:aws:workmail:us-west-2:123456789012:organization\/m-68755160c4cb4e29a2b2f8fb58f359d7@. -- For information about Amazon WorkMail organizations, see the -- . newWorkmailAction :: -- | 'organizationArn' Prelude.Text -> WorkmailAction newWorkmailAction pOrganizationArn_ = WorkmailAction' { topicArn = Prelude.Nothing, organizationArn = pOrganizationArn_ } -- | The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when -- the WorkMail action is called. An example of an Amazon SNS topic ARN is -- @arn:aws:sns:us-west-2:123456789012:MyTopic@. For more information about -- Amazon SNS topics, see the -- . workmailAction_topicArn :: Lens.Lens' WorkmailAction (Prelude.Maybe Prelude.Text) workmailAction_topicArn = Lens.lens (\WorkmailAction' {topicArn} -> topicArn) (\s@WorkmailAction' {} a -> s {topicArn = a} :: WorkmailAction) -- | The ARN of the Amazon WorkMail organization. An example of an Amazon -- WorkMail organization ARN is -- @arn:aws:workmail:us-west-2:123456789012:organization\/m-68755160c4cb4e29a2b2f8fb58f359d7@. -- For information about Amazon WorkMail organizations, see the -- . workmailAction_organizationArn :: Lens.Lens' WorkmailAction Prelude.Text workmailAction_organizationArn = Lens.lens (\WorkmailAction' {organizationArn} -> organizationArn) (\s@WorkmailAction' {} a -> s {organizationArn = a} :: WorkmailAction) instance Data.FromXML WorkmailAction where parseXML x = WorkmailAction' Prelude.<$> (x Data..@? "TopicArn") Prelude.<*> (x Data..@ "OrganizationArn") instance Prelude.Hashable WorkmailAction where hashWithSalt _salt WorkmailAction' {..} = _salt `Prelude.hashWithSalt` topicArn `Prelude.hashWithSalt` organizationArn instance Prelude.NFData WorkmailAction where rnf WorkmailAction' {..} = Prelude.rnf topicArn `Prelude.seq` Prelude.rnf organizationArn instance Data.ToQuery WorkmailAction where toQuery WorkmailAction' {..} = Prelude.mconcat [ "TopicArn" Data.=: topicArn, "OrganizationArn" Data.=: organizationArn ]