{-# 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.Inspector.DescribeRulesPackages
-- 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)
--
-- Describes the rules packages that are specified by the ARNs of the rules
-- packages.
module Amazonka.Inspector.DescribeRulesPackages
  ( -- * Creating a Request
    DescribeRulesPackages (..),
    newDescribeRulesPackages,

    -- * Request Lenses
    describeRulesPackages_locale,
    describeRulesPackages_rulesPackageArns,

    -- * Destructuring the Response
    DescribeRulesPackagesResponse (..),
    newDescribeRulesPackagesResponse,

    -- * Response Lenses
    describeRulesPackagesResponse_httpStatus,
    describeRulesPackagesResponse_rulesPackages,
    describeRulesPackagesResponse_failedItems,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types
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:/ 'newDescribeRulesPackages' smart constructor.
data DescribeRulesPackages = DescribeRulesPackages'
  { -- | The locale that you want to translate a rules package description into.
    DescribeRulesPackages -> Maybe Locale
locale :: Prelude.Maybe Locale,
    -- | The ARN that specifies the rules package that you want to describe.
    DescribeRulesPackages -> NonEmpty Text
rulesPackageArns :: Prelude.NonEmpty Prelude.Text
  }
  deriving (DescribeRulesPackages -> DescribeRulesPackages -> Bool
(DescribeRulesPackages -> DescribeRulesPackages -> Bool)
-> (DescribeRulesPackages -> DescribeRulesPackages -> Bool)
-> Eq DescribeRulesPackages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRulesPackages -> DescribeRulesPackages -> Bool
$c/= :: DescribeRulesPackages -> DescribeRulesPackages -> Bool
== :: DescribeRulesPackages -> DescribeRulesPackages -> Bool
$c== :: DescribeRulesPackages -> DescribeRulesPackages -> Bool
Prelude.Eq, ReadPrec [DescribeRulesPackages]
ReadPrec DescribeRulesPackages
Int -> ReadS DescribeRulesPackages
ReadS [DescribeRulesPackages]
(Int -> ReadS DescribeRulesPackages)
-> ReadS [DescribeRulesPackages]
-> ReadPrec DescribeRulesPackages
-> ReadPrec [DescribeRulesPackages]
-> Read DescribeRulesPackages
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRulesPackages]
$creadListPrec :: ReadPrec [DescribeRulesPackages]
readPrec :: ReadPrec DescribeRulesPackages
$creadPrec :: ReadPrec DescribeRulesPackages
readList :: ReadS [DescribeRulesPackages]
$creadList :: ReadS [DescribeRulesPackages]
readsPrec :: Int -> ReadS DescribeRulesPackages
$creadsPrec :: Int -> ReadS DescribeRulesPackages
Prelude.Read, Int -> DescribeRulesPackages -> ShowS
[DescribeRulesPackages] -> ShowS
DescribeRulesPackages -> String
(Int -> DescribeRulesPackages -> ShowS)
-> (DescribeRulesPackages -> String)
-> ([DescribeRulesPackages] -> ShowS)
-> Show DescribeRulesPackages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRulesPackages] -> ShowS
$cshowList :: [DescribeRulesPackages] -> ShowS
show :: DescribeRulesPackages -> String
$cshow :: DescribeRulesPackages -> String
showsPrec :: Int -> DescribeRulesPackages -> ShowS
$cshowsPrec :: Int -> DescribeRulesPackages -> ShowS
Prelude.Show, (forall x. DescribeRulesPackages -> Rep DescribeRulesPackages x)
-> (forall x. Rep DescribeRulesPackages x -> DescribeRulesPackages)
-> Generic DescribeRulesPackages
forall x. Rep DescribeRulesPackages x -> DescribeRulesPackages
forall x. DescribeRulesPackages -> Rep DescribeRulesPackages x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRulesPackages x -> DescribeRulesPackages
$cfrom :: forall x. DescribeRulesPackages -> Rep DescribeRulesPackages x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRulesPackages' 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:
--
-- 'locale', 'describeRulesPackages_locale' - The locale that you want to translate a rules package description into.
--
-- 'rulesPackageArns', 'describeRulesPackages_rulesPackageArns' - The ARN that specifies the rules package that you want to describe.
newDescribeRulesPackages ::
  -- | 'rulesPackageArns'
  Prelude.NonEmpty Prelude.Text ->
  DescribeRulesPackages
newDescribeRulesPackages :: NonEmpty Text -> DescribeRulesPackages
newDescribeRulesPackages NonEmpty Text
pRulesPackageArns_ =
  DescribeRulesPackages' :: Maybe Locale -> NonEmpty Text -> DescribeRulesPackages
DescribeRulesPackages'
    { $sel:locale:DescribeRulesPackages' :: Maybe Locale
locale = Maybe Locale
forall a. Maybe a
Prelude.Nothing,
      $sel:rulesPackageArns:DescribeRulesPackages' :: NonEmpty Text
rulesPackageArns =
        Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pRulesPackageArns_
    }

-- | The locale that you want to translate a rules package description into.
describeRulesPackages_locale :: Lens.Lens' DescribeRulesPackages (Prelude.Maybe Locale)
describeRulesPackages_locale :: (Maybe Locale -> f (Maybe Locale))
-> DescribeRulesPackages -> f DescribeRulesPackages
describeRulesPackages_locale = (DescribeRulesPackages -> Maybe Locale)
-> (DescribeRulesPackages -> Maybe Locale -> DescribeRulesPackages)
-> Lens
     DescribeRulesPackages
     DescribeRulesPackages
     (Maybe Locale)
     (Maybe Locale)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRulesPackages' {Maybe Locale
locale :: Maybe Locale
$sel:locale:DescribeRulesPackages' :: DescribeRulesPackages -> Maybe Locale
locale} -> Maybe Locale
locale) (\s :: DescribeRulesPackages
s@DescribeRulesPackages' {} Maybe Locale
a -> DescribeRulesPackages
s {$sel:locale:DescribeRulesPackages' :: Maybe Locale
locale = Maybe Locale
a} :: DescribeRulesPackages)

-- | The ARN that specifies the rules package that you want to describe.
describeRulesPackages_rulesPackageArns :: Lens.Lens' DescribeRulesPackages (Prelude.NonEmpty Prelude.Text)
describeRulesPackages_rulesPackageArns :: (NonEmpty Text -> f (NonEmpty Text))
-> DescribeRulesPackages -> f DescribeRulesPackages
describeRulesPackages_rulesPackageArns = (DescribeRulesPackages -> NonEmpty Text)
-> (DescribeRulesPackages
    -> NonEmpty Text -> DescribeRulesPackages)
-> Lens
     DescribeRulesPackages
     DescribeRulesPackages
     (NonEmpty Text)
     (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRulesPackages' {NonEmpty Text
rulesPackageArns :: NonEmpty Text
$sel:rulesPackageArns:DescribeRulesPackages' :: DescribeRulesPackages -> NonEmpty Text
rulesPackageArns} -> NonEmpty Text
rulesPackageArns) (\s :: DescribeRulesPackages
s@DescribeRulesPackages' {} NonEmpty Text
a -> DescribeRulesPackages
s {$sel:rulesPackageArns:DescribeRulesPackages' :: NonEmpty Text
rulesPackageArns = NonEmpty Text
a} :: DescribeRulesPackages) ((NonEmpty Text -> f (NonEmpty Text))
 -> DescribeRulesPackages -> f DescribeRulesPackages)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> DescribeRulesPackages
-> f DescribeRulesPackages
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest DescribeRulesPackages where
  type
    AWSResponse DescribeRulesPackages =
      DescribeRulesPackagesResponse
  request :: DescribeRulesPackages -> Request DescribeRulesPackages
request = Service -> DescribeRulesPackages -> Request DescribeRulesPackages
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeRulesPackages
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeRulesPackages)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeRulesPackages))
-> Logger
-> Service
-> Proxy DescribeRulesPackages
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeRulesPackages)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> [RulesPackage]
-> HashMap Text FailedItemDetails
-> DescribeRulesPackagesResponse
DescribeRulesPackagesResponse'
            (Int
 -> [RulesPackage]
 -> HashMap Text FailedItemDetails
 -> DescribeRulesPackagesResponse)
-> Either String Int
-> Either
     String
     ([RulesPackage]
      -> HashMap Text FailedItemDetails -> DescribeRulesPackagesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([RulesPackage]
   -> HashMap Text FailedItemDetails -> DescribeRulesPackagesResponse)
-> Either String [RulesPackage]
-> Either
     String
     (HashMap Text FailedItemDetails -> DescribeRulesPackagesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [RulesPackage])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"rulesPackages" Either String (Maybe [RulesPackage])
-> [RulesPackage] -> Either String [RulesPackage]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [RulesPackage]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (HashMap Text FailedItemDetails -> DescribeRulesPackagesResponse)
-> Either String (HashMap Text FailedItemDetails)
-> Either String DescribeRulesPackagesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (HashMap Text FailedItemDetails))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failedItems" Either String (Maybe (HashMap Text FailedItemDetails))
-> HashMap Text FailedItemDetails
-> Either String (HashMap Text FailedItemDetails)
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ HashMap Text FailedItemDetails
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable DescribeRulesPackages

instance Prelude.NFData DescribeRulesPackages

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

instance Core.ToJSON DescribeRulesPackages where
  toJSON :: DescribeRulesPackages -> Value
toJSON DescribeRulesPackages' {Maybe Locale
NonEmpty Text
rulesPackageArns :: NonEmpty Text
locale :: Maybe Locale
$sel:rulesPackageArns:DescribeRulesPackages' :: DescribeRulesPackages -> NonEmpty Text
$sel:locale:DescribeRulesPackages' :: DescribeRulesPackages -> Maybe Locale
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"locale" Text -> Locale -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Locale -> Pair) -> Maybe Locale -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Locale
locale,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"rulesPackageArns" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
rulesPackageArns)
          ]
      )

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

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

-- | /See:/ 'newDescribeRulesPackagesResponse' smart constructor.
data DescribeRulesPackagesResponse = DescribeRulesPackagesResponse'
  { -- | The response's http status code.
    DescribeRulesPackagesResponse -> Int
httpStatus :: Prelude.Int,
    -- | Information about the rules package.
    DescribeRulesPackagesResponse -> [RulesPackage]
rulesPackages :: [RulesPackage],
    -- | Rules package details that cannot be described. An error code is
    -- provided for each failed item.
    DescribeRulesPackagesResponse -> HashMap Text FailedItemDetails
failedItems :: Prelude.HashMap Prelude.Text FailedItemDetails
  }
  deriving (DescribeRulesPackagesResponse
-> DescribeRulesPackagesResponse -> Bool
(DescribeRulesPackagesResponse
 -> DescribeRulesPackagesResponse -> Bool)
-> (DescribeRulesPackagesResponse
    -> DescribeRulesPackagesResponse -> Bool)
-> Eq DescribeRulesPackagesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRulesPackagesResponse
-> DescribeRulesPackagesResponse -> Bool
$c/= :: DescribeRulesPackagesResponse
-> DescribeRulesPackagesResponse -> Bool
== :: DescribeRulesPackagesResponse
-> DescribeRulesPackagesResponse -> Bool
$c== :: DescribeRulesPackagesResponse
-> DescribeRulesPackagesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRulesPackagesResponse]
ReadPrec DescribeRulesPackagesResponse
Int -> ReadS DescribeRulesPackagesResponse
ReadS [DescribeRulesPackagesResponse]
(Int -> ReadS DescribeRulesPackagesResponse)
-> ReadS [DescribeRulesPackagesResponse]
-> ReadPrec DescribeRulesPackagesResponse
-> ReadPrec [DescribeRulesPackagesResponse]
-> Read DescribeRulesPackagesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRulesPackagesResponse]
$creadListPrec :: ReadPrec [DescribeRulesPackagesResponse]
readPrec :: ReadPrec DescribeRulesPackagesResponse
$creadPrec :: ReadPrec DescribeRulesPackagesResponse
readList :: ReadS [DescribeRulesPackagesResponse]
$creadList :: ReadS [DescribeRulesPackagesResponse]
readsPrec :: Int -> ReadS DescribeRulesPackagesResponse
$creadsPrec :: Int -> ReadS DescribeRulesPackagesResponse
Prelude.Read, Int -> DescribeRulesPackagesResponse -> ShowS
[DescribeRulesPackagesResponse] -> ShowS
DescribeRulesPackagesResponse -> String
(Int -> DescribeRulesPackagesResponse -> ShowS)
-> (DescribeRulesPackagesResponse -> String)
-> ([DescribeRulesPackagesResponse] -> ShowS)
-> Show DescribeRulesPackagesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRulesPackagesResponse] -> ShowS
$cshowList :: [DescribeRulesPackagesResponse] -> ShowS
show :: DescribeRulesPackagesResponse -> String
$cshow :: DescribeRulesPackagesResponse -> String
showsPrec :: Int -> DescribeRulesPackagesResponse -> ShowS
$cshowsPrec :: Int -> DescribeRulesPackagesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeRulesPackagesResponse
 -> Rep DescribeRulesPackagesResponse x)
-> (forall x.
    Rep DescribeRulesPackagesResponse x
    -> DescribeRulesPackagesResponse)
-> Generic DescribeRulesPackagesResponse
forall x.
Rep DescribeRulesPackagesResponse x
-> DescribeRulesPackagesResponse
forall x.
DescribeRulesPackagesResponse
-> Rep DescribeRulesPackagesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRulesPackagesResponse x
-> DescribeRulesPackagesResponse
$cfrom :: forall x.
DescribeRulesPackagesResponse
-> Rep DescribeRulesPackagesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRulesPackagesResponse' 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:
--
-- 'httpStatus', 'describeRulesPackagesResponse_httpStatus' - The response's http status code.
--
-- 'rulesPackages', 'describeRulesPackagesResponse_rulesPackages' - Information about the rules package.
--
-- 'failedItems', 'describeRulesPackagesResponse_failedItems' - Rules package details that cannot be described. An error code is
-- provided for each failed item.
newDescribeRulesPackagesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeRulesPackagesResponse
newDescribeRulesPackagesResponse :: Int -> DescribeRulesPackagesResponse
newDescribeRulesPackagesResponse Int
pHttpStatus_ =
  DescribeRulesPackagesResponse' :: Int
-> [RulesPackage]
-> HashMap Text FailedItemDetails
-> DescribeRulesPackagesResponse
DescribeRulesPackagesResponse'
    { $sel:httpStatus:DescribeRulesPackagesResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:rulesPackages:DescribeRulesPackagesResponse' :: [RulesPackage]
rulesPackages = [RulesPackage]
forall a. Monoid a => a
Prelude.mempty,
      $sel:failedItems:DescribeRulesPackagesResponse' :: HashMap Text FailedItemDetails
failedItems = HashMap Text FailedItemDetails
forall a. Monoid a => a
Prelude.mempty
    }

-- | The response's http status code.
describeRulesPackagesResponse_httpStatus :: Lens.Lens' DescribeRulesPackagesResponse Prelude.Int
describeRulesPackagesResponse_httpStatus :: (Int -> f Int)
-> DescribeRulesPackagesResponse -> f DescribeRulesPackagesResponse
describeRulesPackagesResponse_httpStatus = (DescribeRulesPackagesResponse -> Int)
-> (DescribeRulesPackagesResponse
    -> Int -> DescribeRulesPackagesResponse)
-> Lens
     DescribeRulesPackagesResponse DescribeRulesPackagesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRulesPackagesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRulesPackagesResponse' :: DescribeRulesPackagesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRulesPackagesResponse
s@DescribeRulesPackagesResponse' {} Int
a -> DescribeRulesPackagesResponse
s {$sel:httpStatus:DescribeRulesPackagesResponse' :: Int
httpStatus = Int
a} :: DescribeRulesPackagesResponse)

-- | Information about the rules package.
describeRulesPackagesResponse_rulesPackages :: Lens.Lens' DescribeRulesPackagesResponse [RulesPackage]
describeRulesPackagesResponse_rulesPackages :: ([RulesPackage] -> f [RulesPackage])
-> DescribeRulesPackagesResponse -> f DescribeRulesPackagesResponse
describeRulesPackagesResponse_rulesPackages = (DescribeRulesPackagesResponse -> [RulesPackage])
-> (DescribeRulesPackagesResponse
    -> [RulesPackage] -> DescribeRulesPackagesResponse)
-> Lens
     DescribeRulesPackagesResponse
     DescribeRulesPackagesResponse
     [RulesPackage]
     [RulesPackage]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRulesPackagesResponse' {[RulesPackage]
rulesPackages :: [RulesPackage]
$sel:rulesPackages:DescribeRulesPackagesResponse' :: DescribeRulesPackagesResponse -> [RulesPackage]
rulesPackages} -> [RulesPackage]
rulesPackages) (\s :: DescribeRulesPackagesResponse
s@DescribeRulesPackagesResponse' {} [RulesPackage]
a -> DescribeRulesPackagesResponse
s {$sel:rulesPackages:DescribeRulesPackagesResponse' :: [RulesPackage]
rulesPackages = [RulesPackage]
a} :: DescribeRulesPackagesResponse) (([RulesPackage] -> f [RulesPackage])
 -> DescribeRulesPackagesResponse
 -> f DescribeRulesPackagesResponse)
-> (([RulesPackage] -> f [RulesPackage])
    -> [RulesPackage] -> f [RulesPackage])
-> ([RulesPackage] -> f [RulesPackage])
-> DescribeRulesPackagesResponse
-> f DescribeRulesPackagesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RulesPackage] -> f [RulesPackage])
-> [RulesPackage] -> f [RulesPackage]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Rules package details that cannot be described. An error code is
-- provided for each failed item.
describeRulesPackagesResponse_failedItems :: Lens.Lens' DescribeRulesPackagesResponse (Prelude.HashMap Prelude.Text FailedItemDetails)
describeRulesPackagesResponse_failedItems :: (HashMap Text FailedItemDetails
 -> f (HashMap Text FailedItemDetails))
-> DescribeRulesPackagesResponse -> f DescribeRulesPackagesResponse
describeRulesPackagesResponse_failedItems = (DescribeRulesPackagesResponse -> HashMap Text FailedItemDetails)
-> (DescribeRulesPackagesResponse
    -> HashMap Text FailedItemDetails -> DescribeRulesPackagesResponse)
-> Lens
     DescribeRulesPackagesResponse
     DescribeRulesPackagesResponse
     (HashMap Text FailedItemDetails)
     (HashMap Text FailedItemDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRulesPackagesResponse' {HashMap Text FailedItemDetails
failedItems :: HashMap Text FailedItemDetails
$sel:failedItems:DescribeRulesPackagesResponse' :: DescribeRulesPackagesResponse -> HashMap Text FailedItemDetails
failedItems} -> HashMap Text FailedItemDetails
failedItems) (\s :: DescribeRulesPackagesResponse
s@DescribeRulesPackagesResponse' {} HashMap Text FailedItemDetails
a -> DescribeRulesPackagesResponse
s {$sel:failedItems:DescribeRulesPackagesResponse' :: HashMap Text FailedItemDetails
failedItems = HashMap Text FailedItemDetails
a} :: DescribeRulesPackagesResponse) ((HashMap Text FailedItemDetails
  -> f (HashMap Text FailedItemDetails))
 -> DescribeRulesPackagesResponse
 -> f DescribeRulesPackagesResponse)
-> ((HashMap Text FailedItemDetails
     -> f (HashMap Text FailedItemDetails))
    -> HashMap Text FailedItemDetails
    -> f (HashMap Text FailedItemDetails))
-> (HashMap Text FailedItemDetails
    -> f (HashMap Text FailedItemDetails))
-> DescribeRulesPackagesResponse
-> f DescribeRulesPackagesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text FailedItemDetails
 -> f (HashMap Text FailedItemDetails))
-> HashMap Text FailedItemDetails
-> f (HashMap Text FailedItemDetails)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData DescribeRulesPackagesResponse