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

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

-- |
-- Module      : Amazonka.CloudWatchLogs.PutSubscriptionFilter
-- 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)
--
-- Creates or updates a subscription filter and associates it with the
-- specified log group. Subscription filters allow you to subscribe to a
-- real-time stream of log events ingested through
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html PutLogEvents>
-- and have them delivered to a specific destination. When log events are
-- sent to the receiving service, they are Base64 encoded and compressed
-- with the gzip format.
--
-- The following destinations are supported for subscription filters:
--
-- -   An Amazon Kinesis stream belonging to the same account as the
--     subscription filter, for same-account delivery.
--
-- -   A logical destination that belongs to a different account, for
--     cross-account delivery.
--
-- -   An Amazon Kinesis Firehose delivery stream that belongs to the same
--     account as the subscription filter, for same-account delivery.
--
-- -   An Lambda function that belongs to the same account as the
--     subscription filter, for same-account delivery.
--
-- Each log group can have up to two subscription filters associated with
-- it. If you are updating an existing filter, you must specify the correct
-- name in @filterName@.
--
-- To perform a @PutSubscriptionFilter@ operation, you must also have the
-- @iam:PassRole@ permission.
module Amazonka.CloudWatchLogs.PutSubscriptionFilter
  ( -- * Creating a Request
    PutSubscriptionFilter (..),
    newPutSubscriptionFilter,

    -- * Request Lenses
    putSubscriptionFilter_distribution,
    putSubscriptionFilter_roleArn,
    putSubscriptionFilter_logGroupName,
    putSubscriptionFilter_filterName,
    putSubscriptionFilter_filterPattern,
    putSubscriptionFilter_destinationArn,

    -- * Destructuring the Response
    PutSubscriptionFilterResponse (..),
    newPutSubscriptionFilterResponse,
  )
where

import Amazonka.CloudWatchLogs.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newPutSubscriptionFilter' smart constructor.
data PutSubscriptionFilter = PutSubscriptionFilter'
  { -- | The method used to distribute log data to the destination. By default,
    -- log data is grouped by log stream, but the grouping can be set to random
    -- for a more even distribution. This property is only applicable when the
    -- destination is an Amazon Kinesis stream.
    PutSubscriptionFilter -> Maybe Distribution
distribution :: Prelude.Maybe Distribution,
    -- | The ARN of an IAM role that grants CloudWatch Logs permissions to
    -- deliver ingested log events to the destination stream. You don\'t need
    -- to provide the ARN when you are working with a logical destination for
    -- cross-account delivery.
    PutSubscriptionFilter -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the log group.
    PutSubscriptionFilter -> Text
logGroupName :: Prelude.Text,
    -- | A name for the subscription filter. If you are updating an existing
    -- filter, you must specify the correct name in @filterName@. To find the
    -- name of the filter currently associated with a log group, use
    -- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeSubscriptionFilters.html DescribeSubscriptionFilters>.
    PutSubscriptionFilter -> Text
filterName :: Prelude.Text,
    -- | A filter pattern for subscribing to a filtered stream of log events.
    PutSubscriptionFilter -> Text
filterPattern :: Prelude.Text,
    -- | The ARN of the destination to deliver matching log events to. Currently,
    -- the supported destinations are:
    --
    -- -   An Amazon Kinesis stream belonging to the same account as the
    --     subscription filter, for same-account delivery.
    --
    -- -   A logical destination (specified using an ARN) belonging to a
    --     different account, for cross-account delivery.
    --
    --     If you are setting up a cross-account subscription, the destination
    --     must have an IAM policy associated with it that allows the sender to
    --     send logs to the destination. For more information, see
    --     <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestinationPolicy.html PutDestinationPolicy>.
    --
    -- -   An Amazon Kinesis Firehose delivery stream belonging to the same
    --     account as the subscription filter, for same-account delivery.
    --
    -- -   A Lambda function belonging to the same account as the subscription
    --     filter, for same-account delivery.
    PutSubscriptionFilter -> Text
destinationArn :: Prelude.Text
  }
  deriving (PutSubscriptionFilter -> PutSubscriptionFilter -> Bool
(PutSubscriptionFilter -> PutSubscriptionFilter -> Bool)
-> (PutSubscriptionFilter -> PutSubscriptionFilter -> Bool)
-> Eq PutSubscriptionFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutSubscriptionFilter -> PutSubscriptionFilter -> Bool
$c/= :: PutSubscriptionFilter -> PutSubscriptionFilter -> Bool
== :: PutSubscriptionFilter -> PutSubscriptionFilter -> Bool
$c== :: PutSubscriptionFilter -> PutSubscriptionFilter -> Bool
Prelude.Eq, ReadPrec [PutSubscriptionFilter]
ReadPrec PutSubscriptionFilter
Int -> ReadS PutSubscriptionFilter
ReadS [PutSubscriptionFilter]
(Int -> ReadS PutSubscriptionFilter)
-> ReadS [PutSubscriptionFilter]
-> ReadPrec PutSubscriptionFilter
-> ReadPrec [PutSubscriptionFilter]
-> Read PutSubscriptionFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutSubscriptionFilter]
$creadListPrec :: ReadPrec [PutSubscriptionFilter]
readPrec :: ReadPrec PutSubscriptionFilter
$creadPrec :: ReadPrec PutSubscriptionFilter
readList :: ReadS [PutSubscriptionFilter]
$creadList :: ReadS [PutSubscriptionFilter]
readsPrec :: Int -> ReadS PutSubscriptionFilter
$creadsPrec :: Int -> ReadS PutSubscriptionFilter
Prelude.Read, Int -> PutSubscriptionFilter -> ShowS
[PutSubscriptionFilter] -> ShowS
PutSubscriptionFilter -> String
(Int -> PutSubscriptionFilter -> ShowS)
-> (PutSubscriptionFilter -> String)
-> ([PutSubscriptionFilter] -> ShowS)
-> Show PutSubscriptionFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutSubscriptionFilter] -> ShowS
$cshowList :: [PutSubscriptionFilter] -> ShowS
show :: PutSubscriptionFilter -> String
$cshow :: PutSubscriptionFilter -> String
showsPrec :: Int -> PutSubscriptionFilter -> ShowS
$cshowsPrec :: Int -> PutSubscriptionFilter -> ShowS
Prelude.Show, (forall x. PutSubscriptionFilter -> Rep PutSubscriptionFilter x)
-> (forall x. Rep PutSubscriptionFilter x -> PutSubscriptionFilter)
-> Generic PutSubscriptionFilter
forall x. Rep PutSubscriptionFilter x -> PutSubscriptionFilter
forall x. PutSubscriptionFilter -> Rep PutSubscriptionFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutSubscriptionFilter x -> PutSubscriptionFilter
$cfrom :: forall x. PutSubscriptionFilter -> Rep PutSubscriptionFilter x
Prelude.Generic)

-- |
-- Create a value of 'PutSubscriptionFilter' 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:
--
-- 'distribution', 'putSubscriptionFilter_distribution' - The method used to distribute log data to the destination. By default,
-- log data is grouped by log stream, but the grouping can be set to random
-- for a more even distribution. This property is only applicable when the
-- destination is an Amazon Kinesis stream.
--
-- 'roleArn', 'putSubscriptionFilter_roleArn' - The ARN of an IAM role that grants CloudWatch Logs permissions to
-- deliver ingested log events to the destination stream. You don\'t need
-- to provide the ARN when you are working with a logical destination for
-- cross-account delivery.
--
-- 'logGroupName', 'putSubscriptionFilter_logGroupName' - The name of the log group.
--
-- 'filterName', 'putSubscriptionFilter_filterName' - A name for the subscription filter. If you are updating an existing
-- filter, you must specify the correct name in @filterName@. To find the
-- name of the filter currently associated with a log group, use
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeSubscriptionFilters.html DescribeSubscriptionFilters>.
--
-- 'filterPattern', 'putSubscriptionFilter_filterPattern' - A filter pattern for subscribing to a filtered stream of log events.
--
-- 'destinationArn', 'putSubscriptionFilter_destinationArn' - The ARN of the destination to deliver matching log events to. Currently,
-- the supported destinations are:
--
-- -   An Amazon Kinesis stream belonging to the same account as the
--     subscription filter, for same-account delivery.
--
-- -   A logical destination (specified using an ARN) belonging to a
--     different account, for cross-account delivery.
--
--     If you are setting up a cross-account subscription, the destination
--     must have an IAM policy associated with it that allows the sender to
--     send logs to the destination. For more information, see
--     <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestinationPolicy.html PutDestinationPolicy>.
--
-- -   An Amazon Kinesis Firehose delivery stream belonging to the same
--     account as the subscription filter, for same-account delivery.
--
-- -   A Lambda function belonging to the same account as the subscription
--     filter, for same-account delivery.
newPutSubscriptionFilter ::
  -- | 'logGroupName'
  Prelude.Text ->
  -- | 'filterName'
  Prelude.Text ->
  -- | 'filterPattern'
  Prelude.Text ->
  -- | 'destinationArn'
  Prelude.Text ->
  PutSubscriptionFilter
newPutSubscriptionFilter :: Text -> Text -> Text -> Text -> PutSubscriptionFilter
newPutSubscriptionFilter
  Text
pLogGroupName_
  Text
pFilterName_
  Text
pFilterPattern_
  Text
pDestinationArn_ =
    PutSubscriptionFilter' :: Maybe Distribution
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> PutSubscriptionFilter
PutSubscriptionFilter'
      { $sel:distribution:PutSubscriptionFilter' :: Maybe Distribution
distribution =
          Maybe Distribution
forall a. Maybe a
Prelude.Nothing,
        $sel:roleArn:PutSubscriptionFilter' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:logGroupName:PutSubscriptionFilter' :: Text
logGroupName = Text
pLogGroupName_,
        $sel:filterName:PutSubscriptionFilter' :: Text
filterName = Text
pFilterName_,
        $sel:filterPattern:PutSubscriptionFilter' :: Text
filterPattern = Text
pFilterPattern_,
        $sel:destinationArn:PutSubscriptionFilter' :: Text
destinationArn = Text
pDestinationArn_
      }

-- | The method used to distribute log data to the destination. By default,
-- log data is grouped by log stream, but the grouping can be set to random
-- for a more even distribution. This property is only applicable when the
-- destination is an Amazon Kinesis stream.
putSubscriptionFilter_distribution :: Lens.Lens' PutSubscriptionFilter (Prelude.Maybe Distribution)
putSubscriptionFilter_distribution :: (Maybe Distribution -> f (Maybe Distribution))
-> PutSubscriptionFilter -> f PutSubscriptionFilter
putSubscriptionFilter_distribution = (PutSubscriptionFilter -> Maybe Distribution)
-> (PutSubscriptionFilter
    -> Maybe Distribution -> PutSubscriptionFilter)
-> Lens
     PutSubscriptionFilter
     PutSubscriptionFilter
     (Maybe Distribution)
     (Maybe Distribution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSubscriptionFilter' {Maybe Distribution
distribution :: Maybe Distribution
$sel:distribution:PutSubscriptionFilter' :: PutSubscriptionFilter -> Maybe Distribution
distribution} -> Maybe Distribution
distribution) (\s :: PutSubscriptionFilter
s@PutSubscriptionFilter' {} Maybe Distribution
a -> PutSubscriptionFilter
s {$sel:distribution:PutSubscriptionFilter' :: Maybe Distribution
distribution = Maybe Distribution
a} :: PutSubscriptionFilter)

-- | The ARN of an IAM role that grants CloudWatch Logs permissions to
-- deliver ingested log events to the destination stream. You don\'t need
-- to provide the ARN when you are working with a logical destination for
-- cross-account delivery.
putSubscriptionFilter_roleArn :: Lens.Lens' PutSubscriptionFilter (Prelude.Maybe Prelude.Text)
putSubscriptionFilter_roleArn :: (Maybe Text -> f (Maybe Text))
-> PutSubscriptionFilter -> f PutSubscriptionFilter
putSubscriptionFilter_roleArn = (PutSubscriptionFilter -> Maybe Text)
-> (PutSubscriptionFilter -> Maybe Text -> PutSubscriptionFilter)
-> Lens
     PutSubscriptionFilter
     PutSubscriptionFilter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSubscriptionFilter' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:PutSubscriptionFilter' :: PutSubscriptionFilter -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: PutSubscriptionFilter
s@PutSubscriptionFilter' {} Maybe Text
a -> PutSubscriptionFilter
s {$sel:roleArn:PutSubscriptionFilter' :: Maybe Text
roleArn = Maybe Text
a} :: PutSubscriptionFilter)

-- | The name of the log group.
putSubscriptionFilter_logGroupName :: Lens.Lens' PutSubscriptionFilter Prelude.Text
putSubscriptionFilter_logGroupName :: (Text -> f Text)
-> PutSubscriptionFilter -> f PutSubscriptionFilter
putSubscriptionFilter_logGroupName = (PutSubscriptionFilter -> Text)
-> (PutSubscriptionFilter -> Text -> PutSubscriptionFilter)
-> Lens PutSubscriptionFilter PutSubscriptionFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSubscriptionFilter' {Text
logGroupName :: Text
$sel:logGroupName:PutSubscriptionFilter' :: PutSubscriptionFilter -> Text
logGroupName} -> Text
logGroupName) (\s :: PutSubscriptionFilter
s@PutSubscriptionFilter' {} Text
a -> PutSubscriptionFilter
s {$sel:logGroupName:PutSubscriptionFilter' :: Text
logGroupName = Text
a} :: PutSubscriptionFilter)

-- | A name for the subscription filter. If you are updating an existing
-- filter, you must specify the correct name in @filterName@. To find the
-- name of the filter currently associated with a log group, use
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeSubscriptionFilters.html DescribeSubscriptionFilters>.
putSubscriptionFilter_filterName :: Lens.Lens' PutSubscriptionFilter Prelude.Text
putSubscriptionFilter_filterName :: (Text -> f Text)
-> PutSubscriptionFilter -> f PutSubscriptionFilter
putSubscriptionFilter_filterName = (PutSubscriptionFilter -> Text)
-> (PutSubscriptionFilter -> Text -> PutSubscriptionFilter)
-> Lens PutSubscriptionFilter PutSubscriptionFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSubscriptionFilter' {Text
filterName :: Text
$sel:filterName:PutSubscriptionFilter' :: PutSubscriptionFilter -> Text
filterName} -> Text
filterName) (\s :: PutSubscriptionFilter
s@PutSubscriptionFilter' {} Text
a -> PutSubscriptionFilter
s {$sel:filterName:PutSubscriptionFilter' :: Text
filterName = Text
a} :: PutSubscriptionFilter)

-- | A filter pattern for subscribing to a filtered stream of log events.
putSubscriptionFilter_filterPattern :: Lens.Lens' PutSubscriptionFilter Prelude.Text
putSubscriptionFilter_filterPattern :: (Text -> f Text)
-> PutSubscriptionFilter -> f PutSubscriptionFilter
putSubscriptionFilter_filterPattern = (PutSubscriptionFilter -> Text)
-> (PutSubscriptionFilter -> Text -> PutSubscriptionFilter)
-> Lens PutSubscriptionFilter PutSubscriptionFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSubscriptionFilter' {Text
filterPattern :: Text
$sel:filterPattern:PutSubscriptionFilter' :: PutSubscriptionFilter -> Text
filterPattern} -> Text
filterPattern) (\s :: PutSubscriptionFilter
s@PutSubscriptionFilter' {} Text
a -> PutSubscriptionFilter
s {$sel:filterPattern:PutSubscriptionFilter' :: Text
filterPattern = Text
a} :: PutSubscriptionFilter)

-- | The ARN of the destination to deliver matching log events to. Currently,
-- the supported destinations are:
--
-- -   An Amazon Kinesis stream belonging to the same account as the
--     subscription filter, for same-account delivery.
--
-- -   A logical destination (specified using an ARN) belonging to a
--     different account, for cross-account delivery.
--
--     If you are setting up a cross-account subscription, the destination
--     must have an IAM policy associated with it that allows the sender to
--     send logs to the destination. For more information, see
--     <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestinationPolicy.html PutDestinationPolicy>.
--
-- -   An Amazon Kinesis Firehose delivery stream belonging to the same
--     account as the subscription filter, for same-account delivery.
--
-- -   A Lambda function belonging to the same account as the subscription
--     filter, for same-account delivery.
putSubscriptionFilter_destinationArn :: Lens.Lens' PutSubscriptionFilter Prelude.Text
putSubscriptionFilter_destinationArn :: (Text -> f Text)
-> PutSubscriptionFilter -> f PutSubscriptionFilter
putSubscriptionFilter_destinationArn = (PutSubscriptionFilter -> Text)
-> (PutSubscriptionFilter -> Text -> PutSubscriptionFilter)
-> Lens PutSubscriptionFilter PutSubscriptionFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSubscriptionFilter' {Text
destinationArn :: Text
$sel:destinationArn:PutSubscriptionFilter' :: PutSubscriptionFilter -> Text
destinationArn} -> Text
destinationArn) (\s :: PutSubscriptionFilter
s@PutSubscriptionFilter' {} Text
a -> PutSubscriptionFilter
s {$sel:destinationArn:PutSubscriptionFilter' :: Text
destinationArn = Text
a} :: PutSubscriptionFilter)

instance Core.AWSRequest PutSubscriptionFilter where
  type
    AWSResponse PutSubscriptionFilter =
      PutSubscriptionFilterResponse
  request :: PutSubscriptionFilter -> Request PutSubscriptionFilter
request = Service -> PutSubscriptionFilter -> Request PutSubscriptionFilter
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutSubscriptionFilter
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutSubscriptionFilter)))
response =
    AWSResponse PutSubscriptionFilter
-> Logger
-> Service
-> Proxy PutSubscriptionFilter
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutSubscriptionFilter)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutSubscriptionFilter
PutSubscriptionFilterResponse
PutSubscriptionFilterResponse'

instance Prelude.Hashable PutSubscriptionFilter

instance Prelude.NFData PutSubscriptionFilter

instance Core.ToHeaders PutSubscriptionFilter where
  toHeaders :: PutSubscriptionFilter -> [Header]
toHeaders =
    [Header] -> PutSubscriptionFilter -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"Logs_20140328.PutSubscriptionFilter" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PutSubscriptionFilter where
  toJSON :: PutSubscriptionFilter -> Value
toJSON PutSubscriptionFilter' {Maybe Text
Maybe Distribution
Text
destinationArn :: Text
filterPattern :: Text
filterName :: Text
logGroupName :: Text
roleArn :: Maybe Text
distribution :: Maybe Distribution
$sel:destinationArn:PutSubscriptionFilter' :: PutSubscriptionFilter -> Text
$sel:filterPattern:PutSubscriptionFilter' :: PutSubscriptionFilter -> Text
$sel:filterName:PutSubscriptionFilter' :: PutSubscriptionFilter -> Text
$sel:logGroupName:PutSubscriptionFilter' :: PutSubscriptionFilter -> Text
$sel:roleArn:PutSubscriptionFilter' :: PutSubscriptionFilter -> Maybe Text
$sel:distribution:PutSubscriptionFilter' :: PutSubscriptionFilter -> Maybe Distribution
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"distribution" Text -> Distribution -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Distribution -> Pair) -> Maybe Distribution -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Distribution
distribution,
            (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleArn,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"logGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
logGroupName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filterName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
filterName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filterPattern" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
filterPattern),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"destinationArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationArn)
          ]
      )

instance Core.ToPath PutSubscriptionFilter where
  toPath :: PutSubscriptionFilter -> ByteString
toPath = ByteString -> PutSubscriptionFilter -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery PutSubscriptionFilter where
  toQuery :: PutSubscriptionFilter -> QueryString
toQuery = QueryString -> PutSubscriptionFilter -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutSubscriptionFilterResponse' smart constructor.
data PutSubscriptionFilterResponse = PutSubscriptionFilterResponse'
  {
  }
  deriving (PutSubscriptionFilterResponse
-> PutSubscriptionFilterResponse -> Bool
(PutSubscriptionFilterResponse
 -> PutSubscriptionFilterResponse -> Bool)
-> (PutSubscriptionFilterResponse
    -> PutSubscriptionFilterResponse -> Bool)
-> Eq PutSubscriptionFilterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutSubscriptionFilterResponse
-> PutSubscriptionFilterResponse -> Bool
$c/= :: PutSubscriptionFilterResponse
-> PutSubscriptionFilterResponse -> Bool
== :: PutSubscriptionFilterResponse
-> PutSubscriptionFilterResponse -> Bool
$c== :: PutSubscriptionFilterResponse
-> PutSubscriptionFilterResponse -> Bool
Prelude.Eq, ReadPrec [PutSubscriptionFilterResponse]
ReadPrec PutSubscriptionFilterResponse
Int -> ReadS PutSubscriptionFilterResponse
ReadS [PutSubscriptionFilterResponse]
(Int -> ReadS PutSubscriptionFilterResponse)
-> ReadS [PutSubscriptionFilterResponse]
-> ReadPrec PutSubscriptionFilterResponse
-> ReadPrec [PutSubscriptionFilterResponse]
-> Read PutSubscriptionFilterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutSubscriptionFilterResponse]
$creadListPrec :: ReadPrec [PutSubscriptionFilterResponse]
readPrec :: ReadPrec PutSubscriptionFilterResponse
$creadPrec :: ReadPrec PutSubscriptionFilterResponse
readList :: ReadS [PutSubscriptionFilterResponse]
$creadList :: ReadS [PutSubscriptionFilterResponse]
readsPrec :: Int -> ReadS PutSubscriptionFilterResponse
$creadsPrec :: Int -> ReadS PutSubscriptionFilterResponse
Prelude.Read, Int -> PutSubscriptionFilterResponse -> ShowS
[PutSubscriptionFilterResponse] -> ShowS
PutSubscriptionFilterResponse -> String
(Int -> PutSubscriptionFilterResponse -> ShowS)
-> (PutSubscriptionFilterResponse -> String)
-> ([PutSubscriptionFilterResponse] -> ShowS)
-> Show PutSubscriptionFilterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutSubscriptionFilterResponse] -> ShowS
$cshowList :: [PutSubscriptionFilterResponse] -> ShowS
show :: PutSubscriptionFilterResponse -> String
$cshow :: PutSubscriptionFilterResponse -> String
showsPrec :: Int -> PutSubscriptionFilterResponse -> ShowS
$cshowsPrec :: Int -> PutSubscriptionFilterResponse -> ShowS
Prelude.Show, (forall x.
 PutSubscriptionFilterResponse
 -> Rep PutSubscriptionFilterResponse x)
-> (forall x.
    Rep PutSubscriptionFilterResponse x
    -> PutSubscriptionFilterResponse)
-> Generic PutSubscriptionFilterResponse
forall x.
Rep PutSubscriptionFilterResponse x
-> PutSubscriptionFilterResponse
forall x.
PutSubscriptionFilterResponse
-> Rep PutSubscriptionFilterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutSubscriptionFilterResponse x
-> PutSubscriptionFilterResponse
$cfrom :: forall x.
PutSubscriptionFilterResponse
-> Rep PutSubscriptionFilterResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutSubscriptionFilterResponse' 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.
newPutSubscriptionFilterResponse ::
  PutSubscriptionFilterResponse
newPutSubscriptionFilterResponse :: PutSubscriptionFilterResponse
newPutSubscriptionFilterResponse =
  PutSubscriptionFilterResponse
PutSubscriptionFilterResponse'

instance Prelude.NFData PutSubscriptionFilterResponse