{-# 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 #-}
module Amazonka.ResourceGroupsTagging.GetComplianceSummary
(
GetComplianceSummary (..),
newGetComplianceSummary,
getComplianceSummary_groupBy,
getComplianceSummary_paginationToken,
getComplianceSummary_targetIdFilters,
getComplianceSummary_resourceTypeFilters,
getComplianceSummary_regionFilters,
getComplianceSummary_tagKeyFilters,
getComplianceSummary_maxResults,
GetComplianceSummaryResponse (..),
newGetComplianceSummaryResponse,
getComplianceSummaryResponse_paginationToken,
getComplianceSummaryResponse_summaryList,
getComplianceSummaryResponse_httpStatus,
)
where
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 Amazonka.ResourceGroupsTagging.Types
import qualified Amazonka.Response as Response
data GetComplianceSummary = GetComplianceSummary'
{
GetComplianceSummary -> Maybe [GroupByAttribute]
groupBy :: Prelude.Maybe [GroupByAttribute],
:: Prelude.Maybe Prelude.Text,
GetComplianceSummary -> Maybe (NonEmpty Text)
targetIdFilters :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
GetComplianceSummary -> Maybe [Text]
resourceTypeFilters :: Prelude.Maybe [Prelude.Text],
GetComplianceSummary -> Maybe (NonEmpty Text)
regionFilters :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
GetComplianceSummary -> Maybe (NonEmpty Text)
tagKeyFilters :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
GetComplianceSummary -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (GetComplianceSummary -> GetComplianceSummary -> Bool
(GetComplianceSummary -> GetComplianceSummary -> Bool)
-> (GetComplianceSummary -> GetComplianceSummary -> Bool)
-> Eq GetComplianceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetComplianceSummary -> GetComplianceSummary -> Bool
$c/= :: GetComplianceSummary -> GetComplianceSummary -> Bool
== :: GetComplianceSummary -> GetComplianceSummary -> Bool
$c== :: GetComplianceSummary -> GetComplianceSummary -> Bool
Prelude.Eq, ReadPrec [GetComplianceSummary]
ReadPrec GetComplianceSummary
Int -> ReadS GetComplianceSummary
ReadS [GetComplianceSummary]
(Int -> ReadS GetComplianceSummary)
-> ReadS [GetComplianceSummary]
-> ReadPrec GetComplianceSummary
-> ReadPrec [GetComplianceSummary]
-> Read GetComplianceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetComplianceSummary]
$creadListPrec :: ReadPrec [GetComplianceSummary]
readPrec :: ReadPrec GetComplianceSummary
$creadPrec :: ReadPrec GetComplianceSummary
readList :: ReadS [GetComplianceSummary]
$creadList :: ReadS [GetComplianceSummary]
readsPrec :: Int -> ReadS GetComplianceSummary
$creadsPrec :: Int -> ReadS GetComplianceSummary
Prelude.Read, Int -> GetComplianceSummary -> ShowS
[GetComplianceSummary] -> ShowS
GetComplianceSummary -> String
(Int -> GetComplianceSummary -> ShowS)
-> (GetComplianceSummary -> String)
-> ([GetComplianceSummary] -> ShowS)
-> Show GetComplianceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetComplianceSummary] -> ShowS
$cshowList :: [GetComplianceSummary] -> ShowS
show :: GetComplianceSummary -> String
$cshow :: GetComplianceSummary -> String
showsPrec :: Int -> GetComplianceSummary -> ShowS
$cshowsPrec :: Int -> GetComplianceSummary -> ShowS
Prelude.Show, (forall x. GetComplianceSummary -> Rep GetComplianceSummary x)
-> (forall x. Rep GetComplianceSummary x -> GetComplianceSummary)
-> Generic GetComplianceSummary
forall x. Rep GetComplianceSummary x -> GetComplianceSummary
forall x. GetComplianceSummary -> Rep GetComplianceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetComplianceSummary x -> GetComplianceSummary
$cfrom :: forall x. GetComplianceSummary -> Rep GetComplianceSummary x
Prelude.Generic)
newGetComplianceSummary ::
GetComplianceSummary
newGetComplianceSummary :: GetComplianceSummary
newGetComplianceSummary =
GetComplianceSummary' :: Maybe [GroupByAttribute]
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe [Text]
-> Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text)
-> Maybe Natural
-> GetComplianceSummary
GetComplianceSummary'
{ $sel:groupBy:GetComplianceSummary' :: Maybe [GroupByAttribute]
groupBy = Maybe [GroupByAttribute]
forall a. Maybe a
Prelude.Nothing,
$sel:paginationToken:GetComplianceSummary' :: Maybe Text
paginationToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targetIdFilters:GetComplianceSummary' :: Maybe (NonEmpty Text)
targetIdFilters = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:resourceTypeFilters:GetComplianceSummary' :: Maybe [Text]
resourceTypeFilters = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:regionFilters:GetComplianceSummary' :: Maybe (NonEmpty Text)
regionFilters = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:tagKeyFilters:GetComplianceSummary' :: Maybe (NonEmpty Text)
tagKeyFilters = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetComplianceSummary' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
getComplianceSummary_groupBy :: Lens.Lens' GetComplianceSummary (Prelude.Maybe [GroupByAttribute])
getComplianceSummary_groupBy :: (Maybe [GroupByAttribute] -> f (Maybe [GroupByAttribute]))
-> GetComplianceSummary -> f GetComplianceSummary
getComplianceSummary_groupBy = (GetComplianceSummary -> Maybe [GroupByAttribute])
-> (GetComplianceSummary
-> Maybe [GroupByAttribute] -> GetComplianceSummary)
-> Lens
GetComplianceSummary
GetComplianceSummary
(Maybe [GroupByAttribute])
(Maybe [GroupByAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummary' {Maybe [GroupByAttribute]
groupBy :: Maybe [GroupByAttribute]
$sel:groupBy:GetComplianceSummary' :: GetComplianceSummary -> Maybe [GroupByAttribute]
groupBy} -> Maybe [GroupByAttribute]
groupBy) (\s :: GetComplianceSummary
s@GetComplianceSummary' {} Maybe [GroupByAttribute]
a -> GetComplianceSummary
s {$sel:groupBy:GetComplianceSummary' :: Maybe [GroupByAttribute]
groupBy = Maybe [GroupByAttribute]
a} :: GetComplianceSummary) ((Maybe [GroupByAttribute] -> f (Maybe [GroupByAttribute]))
-> GetComplianceSummary -> f GetComplianceSummary)
-> ((Maybe [GroupByAttribute] -> f (Maybe [GroupByAttribute]))
-> Maybe [GroupByAttribute] -> f (Maybe [GroupByAttribute]))
-> (Maybe [GroupByAttribute] -> f (Maybe [GroupByAttribute]))
-> GetComplianceSummary
-> f GetComplianceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GroupByAttribute]
[GroupByAttribute]
[GroupByAttribute]
[GroupByAttribute]
-> Iso
(Maybe [GroupByAttribute])
(Maybe [GroupByAttribute])
(Maybe [GroupByAttribute])
(Maybe [GroupByAttribute])
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
[GroupByAttribute]
[GroupByAttribute]
[GroupByAttribute]
[GroupByAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getComplianceSummary_paginationToken :: Lens.Lens' GetComplianceSummary (Prelude.Maybe Prelude.Text)
= (GetComplianceSummary -> Maybe Text)
-> (GetComplianceSummary -> Maybe Text -> GetComplianceSummary)
-> Lens
GetComplianceSummary GetComplianceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummary' {Maybe Text
paginationToken :: Maybe Text
$sel:paginationToken:GetComplianceSummary' :: GetComplianceSummary -> Maybe Text
paginationToken} -> Maybe Text
paginationToken) (\s :: GetComplianceSummary
s@GetComplianceSummary' {} Maybe Text
a -> GetComplianceSummary
s {$sel:paginationToken:GetComplianceSummary' :: Maybe Text
paginationToken = Maybe Text
a} :: GetComplianceSummary)
getComplianceSummary_targetIdFilters :: Lens.Lens' GetComplianceSummary (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
getComplianceSummary_targetIdFilters :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary -> f GetComplianceSummary
getComplianceSummary_targetIdFilters = (GetComplianceSummary -> Maybe (NonEmpty Text))
-> (GetComplianceSummary
-> Maybe (NonEmpty Text) -> GetComplianceSummary)
-> Lens
GetComplianceSummary
GetComplianceSummary
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummary' {Maybe (NonEmpty Text)
targetIdFilters :: Maybe (NonEmpty Text)
$sel:targetIdFilters:GetComplianceSummary' :: GetComplianceSummary -> Maybe (NonEmpty Text)
targetIdFilters} -> Maybe (NonEmpty Text)
targetIdFilters) (\s :: GetComplianceSummary
s@GetComplianceSummary' {} Maybe (NonEmpty Text)
a -> GetComplianceSummary
s {$sel:targetIdFilters:GetComplianceSummary' :: Maybe (NonEmpty Text)
targetIdFilters = Maybe (NonEmpty Text)
a} :: GetComplianceSummary) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary -> f GetComplianceSummary)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary
-> f GetComplianceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty 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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getComplianceSummary_resourceTypeFilters :: Lens.Lens' GetComplianceSummary (Prelude.Maybe [Prelude.Text])
getComplianceSummary_resourceTypeFilters :: (Maybe [Text] -> f (Maybe [Text]))
-> GetComplianceSummary -> f GetComplianceSummary
getComplianceSummary_resourceTypeFilters = (GetComplianceSummary -> Maybe [Text])
-> (GetComplianceSummary -> Maybe [Text] -> GetComplianceSummary)
-> Lens
GetComplianceSummary
GetComplianceSummary
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummary' {Maybe [Text]
resourceTypeFilters :: Maybe [Text]
$sel:resourceTypeFilters:GetComplianceSummary' :: GetComplianceSummary -> Maybe [Text]
resourceTypeFilters} -> Maybe [Text]
resourceTypeFilters) (\s :: GetComplianceSummary
s@GetComplianceSummary' {} Maybe [Text]
a -> GetComplianceSummary
s {$sel:resourceTypeFilters:GetComplianceSummary' :: Maybe [Text]
resourceTypeFilters = Maybe [Text]
a} :: GetComplianceSummary) ((Maybe [Text] -> f (Maybe [Text]))
-> GetComplianceSummary -> f GetComplianceSummary)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetComplianceSummary
-> f GetComplianceSummary
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
getComplianceSummary_regionFilters :: Lens.Lens' GetComplianceSummary (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
getComplianceSummary_regionFilters :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary -> f GetComplianceSummary
getComplianceSummary_regionFilters = (GetComplianceSummary -> Maybe (NonEmpty Text))
-> (GetComplianceSummary
-> Maybe (NonEmpty Text) -> GetComplianceSummary)
-> Lens
GetComplianceSummary
GetComplianceSummary
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummary' {Maybe (NonEmpty Text)
regionFilters :: Maybe (NonEmpty Text)
$sel:regionFilters:GetComplianceSummary' :: GetComplianceSummary -> Maybe (NonEmpty Text)
regionFilters} -> Maybe (NonEmpty Text)
regionFilters) (\s :: GetComplianceSummary
s@GetComplianceSummary' {} Maybe (NonEmpty Text)
a -> GetComplianceSummary
s {$sel:regionFilters:GetComplianceSummary' :: Maybe (NonEmpty Text)
regionFilters = Maybe (NonEmpty Text)
a} :: GetComplianceSummary) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary -> f GetComplianceSummary)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary
-> f GetComplianceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty 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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getComplianceSummary_tagKeyFilters :: Lens.Lens' GetComplianceSummary (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
getComplianceSummary_tagKeyFilters :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary -> f GetComplianceSummary
getComplianceSummary_tagKeyFilters = (GetComplianceSummary -> Maybe (NonEmpty Text))
-> (GetComplianceSummary
-> Maybe (NonEmpty Text) -> GetComplianceSummary)
-> Lens
GetComplianceSummary
GetComplianceSummary
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummary' {Maybe (NonEmpty Text)
tagKeyFilters :: Maybe (NonEmpty Text)
$sel:tagKeyFilters:GetComplianceSummary' :: GetComplianceSummary -> Maybe (NonEmpty Text)
tagKeyFilters} -> Maybe (NonEmpty Text)
tagKeyFilters) (\s :: GetComplianceSummary
s@GetComplianceSummary' {} Maybe (NonEmpty Text)
a -> GetComplianceSummary
s {$sel:tagKeyFilters:GetComplianceSummary' :: Maybe (NonEmpty Text)
tagKeyFilters = Maybe (NonEmpty Text)
a} :: GetComplianceSummary) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary -> f GetComplianceSummary)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetComplianceSummary
-> f GetComplianceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty 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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getComplianceSummary_maxResults :: Lens.Lens' GetComplianceSummary (Prelude.Maybe Prelude.Natural)
getComplianceSummary_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetComplianceSummary -> f GetComplianceSummary
getComplianceSummary_maxResults = (GetComplianceSummary -> Maybe Natural)
-> (GetComplianceSummary -> Maybe Natural -> GetComplianceSummary)
-> Lens
GetComplianceSummary
GetComplianceSummary
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummary' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetComplianceSummary' :: GetComplianceSummary -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetComplianceSummary
s@GetComplianceSummary' {} Maybe Natural
a -> GetComplianceSummary
s {$sel:maxResults:GetComplianceSummary' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetComplianceSummary)
instance Core.AWSPager GetComplianceSummary where
page :: GetComplianceSummary
-> AWSResponse GetComplianceSummary -> Maybe GetComplianceSummary
page GetComplianceSummary
rq AWSResponse GetComplianceSummary
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse GetComplianceSummary
GetComplianceSummaryResponse
rs
GetComplianceSummaryResponse
-> Getting (First Text) GetComplianceSummaryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetComplianceSummaryResponse
-> Const (First Text) GetComplianceSummaryResponse
Lens' GetComplianceSummaryResponse (Maybe Text)
getComplianceSummaryResponse_paginationToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> GetComplianceSummaryResponse
-> Const (First Text) GetComplianceSummaryResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetComplianceSummaryResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe GetComplianceSummary
forall a. Maybe a
Prelude.Nothing
| Maybe [Summary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse GetComplianceSummary
GetComplianceSummaryResponse
rs
GetComplianceSummaryResponse
-> Getting (First [Summary]) GetComplianceSummaryResponse [Summary]
-> Maybe [Summary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Summary] -> Const (First [Summary]) (Maybe [Summary]))
-> GetComplianceSummaryResponse
-> Const (First [Summary]) GetComplianceSummaryResponse
Lens' GetComplianceSummaryResponse (Maybe [Summary])
getComplianceSummaryResponse_summaryList
((Maybe [Summary] -> Const (First [Summary]) (Maybe [Summary]))
-> GetComplianceSummaryResponse
-> Const (First [Summary]) GetComplianceSummaryResponse)
-> (([Summary] -> Const (First [Summary]) [Summary])
-> Maybe [Summary] -> Const (First [Summary]) (Maybe [Summary]))
-> Getting (First [Summary]) GetComplianceSummaryResponse [Summary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Summary] -> Const (First [Summary]) [Summary])
-> Maybe [Summary] -> Const (First [Summary]) (Maybe [Summary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe GetComplianceSummary
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
GetComplianceSummary -> Maybe GetComplianceSummary
forall a. a -> Maybe a
Prelude.Just (GetComplianceSummary -> Maybe GetComplianceSummary)
-> GetComplianceSummary -> Maybe GetComplianceSummary
forall a b. (a -> b) -> a -> b
Prelude.$
GetComplianceSummary
rq
GetComplianceSummary
-> (GetComplianceSummary -> GetComplianceSummary)
-> GetComplianceSummary
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetComplianceSummary -> Identity GetComplianceSummary
Lens
GetComplianceSummary GetComplianceSummary (Maybe Text) (Maybe Text)
getComplianceSummary_paginationToken
((Maybe Text -> Identity (Maybe Text))
-> GetComplianceSummary -> Identity GetComplianceSummary)
-> Maybe Text -> GetComplianceSummary -> GetComplianceSummary
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetComplianceSummary
GetComplianceSummaryResponse
rs
GetComplianceSummaryResponse
-> Getting (First Text) GetComplianceSummaryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetComplianceSummaryResponse
-> Const (First Text) GetComplianceSummaryResponse
Lens' GetComplianceSummaryResponse (Maybe Text)
getComplianceSummaryResponse_paginationToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> GetComplianceSummaryResponse
-> Const (First Text) GetComplianceSummaryResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetComplianceSummaryResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest GetComplianceSummary where
type
AWSResponse GetComplianceSummary =
GetComplianceSummaryResponse
request :: GetComplianceSummary -> Request GetComplianceSummary
request = Service -> GetComplianceSummary -> Request GetComplianceSummary
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetComplianceSummary
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetComplianceSummary)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetComplianceSummary))
-> Logger
-> Service
-> Proxy GetComplianceSummary
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetComplianceSummary)))
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 ->
Maybe Text
-> Maybe [Summary] -> Int -> GetComplianceSummaryResponse
GetComplianceSummaryResponse'
(Maybe Text
-> Maybe [Summary] -> Int -> GetComplianceSummaryResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [Summary] -> Int -> GetComplianceSummaryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PaginationToken")
Either
String (Maybe [Summary] -> Int -> GetComplianceSummaryResponse)
-> Either String (Maybe [Summary])
-> Either String (Int -> GetComplianceSummaryResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Summary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SummaryList" Either String (Maybe (Maybe [Summary]))
-> Maybe [Summary] -> Either String (Maybe [Summary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Summary]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetComplianceSummaryResponse)
-> Either String Int -> Either String GetComplianceSummaryResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable GetComplianceSummary
instance Prelude.NFData GetComplianceSummary
instance Core.ToHeaders GetComplianceSummary where
toHeaders :: GetComplianceSummary -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetComplianceSummary -> 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
"ResourceGroupsTaggingAPI_20170126.GetComplianceSummary" ::
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 GetComplianceSummary where
toJSON :: GetComplianceSummary -> Value
toJSON GetComplianceSummary' {Maybe Natural
Maybe [Text]
Maybe [GroupByAttribute]
Maybe (NonEmpty Text)
Maybe Text
maxResults :: Maybe Natural
tagKeyFilters :: Maybe (NonEmpty Text)
regionFilters :: Maybe (NonEmpty Text)
resourceTypeFilters :: Maybe [Text]
targetIdFilters :: Maybe (NonEmpty Text)
paginationToken :: Maybe Text
groupBy :: Maybe [GroupByAttribute]
$sel:maxResults:GetComplianceSummary' :: GetComplianceSummary -> Maybe Natural
$sel:tagKeyFilters:GetComplianceSummary' :: GetComplianceSummary -> Maybe (NonEmpty Text)
$sel:regionFilters:GetComplianceSummary' :: GetComplianceSummary -> Maybe (NonEmpty Text)
$sel:resourceTypeFilters:GetComplianceSummary' :: GetComplianceSummary -> Maybe [Text]
$sel:targetIdFilters:GetComplianceSummary' :: GetComplianceSummary -> Maybe (NonEmpty Text)
$sel:paginationToken:GetComplianceSummary' :: GetComplianceSummary -> Maybe Text
$sel:groupBy:GetComplianceSummary' :: GetComplianceSummary -> Maybe [GroupByAttribute]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"GroupBy" Text -> [GroupByAttribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([GroupByAttribute] -> Pair)
-> Maybe [GroupByAttribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [GroupByAttribute]
groupBy,
(Text
"PaginationToken" 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
paginationToken,
(Text
"TargetIdFilters" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
targetIdFilters,
(Text
"ResourceTypeFilters" 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]
resourceTypeFilters,
(Text
"RegionFilters" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
regionFilters,
(Text
"TagKeyFilters" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
tagKeyFilters,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
]
)
instance Core.ToPath GetComplianceSummary where
toPath :: GetComplianceSummary -> ByteString
toPath = ByteString -> GetComplianceSummary -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetComplianceSummary where
toQuery :: GetComplianceSummary -> QueryString
toQuery = QueryString -> GetComplianceSummary -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetComplianceSummaryResponse = GetComplianceSummaryResponse'
{
:: Prelude.Maybe Prelude.Text,
GetComplianceSummaryResponse -> Maybe [Summary]
summaryList :: Prelude.Maybe [Summary],
GetComplianceSummaryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetComplianceSummaryResponse
-> GetComplianceSummaryResponse -> Bool
(GetComplianceSummaryResponse
-> GetComplianceSummaryResponse -> Bool)
-> (GetComplianceSummaryResponse
-> GetComplianceSummaryResponse -> Bool)
-> Eq GetComplianceSummaryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetComplianceSummaryResponse
-> GetComplianceSummaryResponse -> Bool
$c/= :: GetComplianceSummaryResponse
-> GetComplianceSummaryResponse -> Bool
== :: GetComplianceSummaryResponse
-> GetComplianceSummaryResponse -> Bool
$c== :: GetComplianceSummaryResponse
-> GetComplianceSummaryResponse -> Bool
Prelude.Eq, ReadPrec [GetComplianceSummaryResponse]
ReadPrec GetComplianceSummaryResponse
Int -> ReadS GetComplianceSummaryResponse
ReadS [GetComplianceSummaryResponse]
(Int -> ReadS GetComplianceSummaryResponse)
-> ReadS [GetComplianceSummaryResponse]
-> ReadPrec GetComplianceSummaryResponse
-> ReadPrec [GetComplianceSummaryResponse]
-> Read GetComplianceSummaryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetComplianceSummaryResponse]
$creadListPrec :: ReadPrec [GetComplianceSummaryResponse]
readPrec :: ReadPrec GetComplianceSummaryResponse
$creadPrec :: ReadPrec GetComplianceSummaryResponse
readList :: ReadS [GetComplianceSummaryResponse]
$creadList :: ReadS [GetComplianceSummaryResponse]
readsPrec :: Int -> ReadS GetComplianceSummaryResponse
$creadsPrec :: Int -> ReadS GetComplianceSummaryResponse
Prelude.Read, Int -> GetComplianceSummaryResponse -> ShowS
[GetComplianceSummaryResponse] -> ShowS
GetComplianceSummaryResponse -> String
(Int -> GetComplianceSummaryResponse -> ShowS)
-> (GetComplianceSummaryResponse -> String)
-> ([GetComplianceSummaryResponse] -> ShowS)
-> Show GetComplianceSummaryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetComplianceSummaryResponse] -> ShowS
$cshowList :: [GetComplianceSummaryResponse] -> ShowS
show :: GetComplianceSummaryResponse -> String
$cshow :: GetComplianceSummaryResponse -> String
showsPrec :: Int -> GetComplianceSummaryResponse -> ShowS
$cshowsPrec :: Int -> GetComplianceSummaryResponse -> ShowS
Prelude.Show, (forall x.
GetComplianceSummaryResponse -> Rep GetComplianceSummaryResponse x)
-> (forall x.
Rep GetComplianceSummaryResponse x -> GetComplianceSummaryResponse)
-> Generic GetComplianceSummaryResponse
forall x.
Rep GetComplianceSummaryResponse x -> GetComplianceSummaryResponse
forall x.
GetComplianceSummaryResponse -> Rep GetComplianceSummaryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetComplianceSummaryResponse x -> GetComplianceSummaryResponse
$cfrom :: forall x.
GetComplianceSummaryResponse -> Rep GetComplianceSummaryResponse x
Prelude.Generic)
newGetComplianceSummaryResponse ::
Prelude.Int ->
GetComplianceSummaryResponse
newGetComplianceSummaryResponse :: Int -> GetComplianceSummaryResponse
newGetComplianceSummaryResponse Int
pHttpStatus_ =
GetComplianceSummaryResponse' :: Maybe Text
-> Maybe [Summary] -> Int -> GetComplianceSummaryResponse
GetComplianceSummaryResponse'
{ $sel:paginationToken:GetComplianceSummaryResponse' :: Maybe Text
paginationToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:summaryList:GetComplianceSummaryResponse' :: Maybe [Summary]
summaryList = Maybe [Summary]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetComplianceSummaryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getComplianceSummaryResponse_paginationToken :: Lens.Lens' GetComplianceSummaryResponse (Prelude.Maybe Prelude.Text)
= (GetComplianceSummaryResponse -> Maybe Text)
-> (GetComplianceSummaryResponse
-> Maybe Text -> GetComplianceSummaryResponse)
-> Lens' GetComplianceSummaryResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummaryResponse' {Maybe Text
paginationToken :: Maybe Text
$sel:paginationToken:GetComplianceSummaryResponse' :: GetComplianceSummaryResponse -> Maybe Text
paginationToken} -> Maybe Text
paginationToken) (\s :: GetComplianceSummaryResponse
s@GetComplianceSummaryResponse' {} Maybe Text
a -> GetComplianceSummaryResponse
s {$sel:paginationToken:GetComplianceSummaryResponse' :: Maybe Text
paginationToken = Maybe Text
a} :: GetComplianceSummaryResponse)
getComplianceSummaryResponse_summaryList :: Lens.Lens' GetComplianceSummaryResponse (Prelude.Maybe [Summary])
getComplianceSummaryResponse_summaryList :: (Maybe [Summary] -> f (Maybe [Summary]))
-> GetComplianceSummaryResponse -> f GetComplianceSummaryResponse
getComplianceSummaryResponse_summaryList = (GetComplianceSummaryResponse -> Maybe [Summary])
-> (GetComplianceSummaryResponse
-> Maybe [Summary] -> GetComplianceSummaryResponse)
-> Lens' GetComplianceSummaryResponse (Maybe [Summary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummaryResponse' {Maybe [Summary]
summaryList :: Maybe [Summary]
$sel:summaryList:GetComplianceSummaryResponse' :: GetComplianceSummaryResponse -> Maybe [Summary]
summaryList} -> Maybe [Summary]
summaryList) (\s :: GetComplianceSummaryResponse
s@GetComplianceSummaryResponse' {} Maybe [Summary]
a -> GetComplianceSummaryResponse
s {$sel:summaryList:GetComplianceSummaryResponse' :: Maybe [Summary]
summaryList = Maybe [Summary]
a} :: GetComplianceSummaryResponse) ((Maybe [Summary] -> f (Maybe [Summary]))
-> GetComplianceSummaryResponse -> f GetComplianceSummaryResponse)
-> ((Maybe [Summary] -> f (Maybe [Summary]))
-> Maybe [Summary] -> f (Maybe [Summary]))
-> (Maybe [Summary] -> f (Maybe [Summary]))
-> GetComplianceSummaryResponse
-> f GetComplianceSummaryResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Summary] [Summary] [Summary] [Summary]
-> Iso
(Maybe [Summary])
(Maybe [Summary])
(Maybe [Summary])
(Maybe [Summary])
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 [Summary] [Summary] [Summary] [Summary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getComplianceSummaryResponse_httpStatus :: Lens.Lens' GetComplianceSummaryResponse Prelude.Int
getComplianceSummaryResponse_httpStatus :: (Int -> f Int)
-> GetComplianceSummaryResponse -> f GetComplianceSummaryResponse
getComplianceSummaryResponse_httpStatus = (GetComplianceSummaryResponse -> Int)
-> (GetComplianceSummaryResponse
-> Int -> GetComplianceSummaryResponse)
-> Lens
GetComplianceSummaryResponse GetComplianceSummaryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComplianceSummaryResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetComplianceSummaryResponse' :: GetComplianceSummaryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetComplianceSummaryResponse
s@GetComplianceSummaryResponse' {} Int
a -> GetComplianceSummaryResponse
s {$sel:httpStatus:GetComplianceSummaryResponse' :: Int
httpStatus = Int
a} :: GetComplianceSummaryResponse)
instance Prelude.NFData GetComplianceSummaryResponse