{-# 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.Organizations.ListPoliciesForTarget
(
ListPoliciesForTarget (..),
newListPoliciesForTarget,
listPoliciesForTarget_nextToken,
listPoliciesForTarget_maxResults,
listPoliciesForTarget_targetId,
listPoliciesForTarget_filter,
ListPoliciesForTargetResponse (..),
newListPoliciesForTargetResponse,
listPoliciesForTargetResponse_nextToken,
listPoliciesForTargetResponse_policies,
listPoliciesForTargetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListPoliciesForTarget = ListPoliciesForTarget'
{
ListPoliciesForTarget -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPoliciesForTarget -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListPoliciesForTarget -> Text
targetId :: Prelude.Text,
ListPoliciesForTarget -> PolicyType
filter' :: PolicyType
}
deriving (ListPoliciesForTarget -> ListPoliciesForTarget -> Bool
(ListPoliciesForTarget -> ListPoliciesForTarget -> Bool)
-> (ListPoliciesForTarget -> ListPoliciesForTarget -> Bool)
-> Eq ListPoliciesForTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPoliciesForTarget -> ListPoliciesForTarget -> Bool
$c/= :: ListPoliciesForTarget -> ListPoliciesForTarget -> Bool
== :: ListPoliciesForTarget -> ListPoliciesForTarget -> Bool
$c== :: ListPoliciesForTarget -> ListPoliciesForTarget -> Bool
Prelude.Eq, ReadPrec [ListPoliciesForTarget]
ReadPrec ListPoliciesForTarget
Int -> ReadS ListPoliciesForTarget
ReadS [ListPoliciesForTarget]
(Int -> ReadS ListPoliciesForTarget)
-> ReadS [ListPoliciesForTarget]
-> ReadPrec ListPoliciesForTarget
-> ReadPrec [ListPoliciesForTarget]
-> Read ListPoliciesForTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPoliciesForTarget]
$creadListPrec :: ReadPrec [ListPoliciesForTarget]
readPrec :: ReadPrec ListPoliciesForTarget
$creadPrec :: ReadPrec ListPoliciesForTarget
readList :: ReadS [ListPoliciesForTarget]
$creadList :: ReadS [ListPoliciesForTarget]
readsPrec :: Int -> ReadS ListPoliciesForTarget
$creadsPrec :: Int -> ReadS ListPoliciesForTarget
Prelude.Read, Int -> ListPoliciesForTarget -> ShowS
[ListPoliciesForTarget] -> ShowS
ListPoliciesForTarget -> String
(Int -> ListPoliciesForTarget -> ShowS)
-> (ListPoliciesForTarget -> String)
-> ([ListPoliciesForTarget] -> ShowS)
-> Show ListPoliciesForTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPoliciesForTarget] -> ShowS
$cshowList :: [ListPoliciesForTarget] -> ShowS
show :: ListPoliciesForTarget -> String
$cshow :: ListPoliciesForTarget -> String
showsPrec :: Int -> ListPoliciesForTarget -> ShowS
$cshowsPrec :: Int -> ListPoliciesForTarget -> ShowS
Prelude.Show, (forall x. ListPoliciesForTarget -> Rep ListPoliciesForTarget x)
-> (forall x. Rep ListPoliciesForTarget x -> ListPoliciesForTarget)
-> Generic ListPoliciesForTarget
forall x. Rep ListPoliciesForTarget x -> ListPoliciesForTarget
forall x. ListPoliciesForTarget -> Rep ListPoliciesForTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPoliciesForTarget x -> ListPoliciesForTarget
$cfrom :: forall x. ListPoliciesForTarget -> Rep ListPoliciesForTarget x
Prelude.Generic)
newListPoliciesForTarget ::
Prelude.Text ->
PolicyType ->
ListPoliciesForTarget
newListPoliciesForTarget :: Text -> PolicyType -> ListPoliciesForTarget
newListPoliciesForTarget Text
pTargetId_ PolicyType
pFilter_ =
ListPoliciesForTarget' :: Maybe Text
-> Maybe Natural -> Text -> PolicyType -> ListPoliciesForTarget
ListPoliciesForTarget'
{ $sel:nextToken:ListPoliciesForTarget' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListPoliciesForTarget' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:targetId:ListPoliciesForTarget' :: Text
targetId = Text
pTargetId_,
$sel:filter':ListPoliciesForTarget' :: PolicyType
filter' = PolicyType
pFilter_
}
listPoliciesForTarget_nextToken :: Lens.Lens' ListPoliciesForTarget (Prelude.Maybe Prelude.Text)
listPoliciesForTarget_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPoliciesForTarget -> f ListPoliciesForTarget
listPoliciesForTarget_nextToken = (ListPoliciesForTarget -> Maybe Text)
-> (ListPoliciesForTarget -> Maybe Text -> ListPoliciesForTarget)
-> Lens
ListPoliciesForTarget
ListPoliciesForTarget
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesForTarget' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPoliciesForTarget' :: ListPoliciesForTarget -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPoliciesForTarget
s@ListPoliciesForTarget' {} Maybe Text
a -> ListPoliciesForTarget
s {$sel:nextToken:ListPoliciesForTarget' :: Maybe Text
nextToken = Maybe Text
a} :: ListPoliciesForTarget)
listPoliciesForTarget_maxResults :: Lens.Lens' ListPoliciesForTarget (Prelude.Maybe Prelude.Natural)
listPoliciesForTarget_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPoliciesForTarget -> f ListPoliciesForTarget
listPoliciesForTarget_maxResults = (ListPoliciesForTarget -> Maybe Natural)
-> (ListPoliciesForTarget
-> Maybe Natural -> ListPoliciesForTarget)
-> Lens
ListPoliciesForTarget
ListPoliciesForTarget
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesForTarget' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPoliciesForTarget' :: ListPoliciesForTarget -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPoliciesForTarget
s@ListPoliciesForTarget' {} Maybe Natural
a -> ListPoliciesForTarget
s {$sel:maxResults:ListPoliciesForTarget' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPoliciesForTarget)
listPoliciesForTarget_targetId :: Lens.Lens' ListPoliciesForTarget Prelude.Text
listPoliciesForTarget_targetId :: (Text -> f Text)
-> ListPoliciesForTarget -> f ListPoliciesForTarget
listPoliciesForTarget_targetId = (ListPoliciesForTarget -> Text)
-> (ListPoliciesForTarget -> Text -> ListPoliciesForTarget)
-> Lens ListPoliciesForTarget ListPoliciesForTarget Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesForTarget' {Text
targetId :: Text
$sel:targetId:ListPoliciesForTarget' :: ListPoliciesForTarget -> Text
targetId} -> Text
targetId) (\s :: ListPoliciesForTarget
s@ListPoliciesForTarget' {} Text
a -> ListPoliciesForTarget
s {$sel:targetId:ListPoliciesForTarget' :: Text
targetId = Text
a} :: ListPoliciesForTarget)
listPoliciesForTarget_filter :: Lens.Lens' ListPoliciesForTarget PolicyType
listPoliciesForTarget_filter :: (PolicyType -> f PolicyType)
-> ListPoliciesForTarget -> f ListPoliciesForTarget
listPoliciesForTarget_filter = (ListPoliciesForTarget -> PolicyType)
-> (ListPoliciesForTarget -> PolicyType -> ListPoliciesForTarget)
-> Lens
ListPoliciesForTarget ListPoliciesForTarget PolicyType PolicyType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesForTarget' {PolicyType
filter' :: PolicyType
$sel:filter':ListPoliciesForTarget' :: ListPoliciesForTarget -> PolicyType
filter'} -> PolicyType
filter') (\s :: ListPoliciesForTarget
s@ListPoliciesForTarget' {} PolicyType
a -> ListPoliciesForTarget
s {$sel:filter':ListPoliciesForTarget' :: PolicyType
filter' = PolicyType
a} :: ListPoliciesForTarget)
instance Core.AWSPager ListPoliciesForTarget where
page :: ListPoliciesForTarget
-> AWSResponse ListPoliciesForTarget -> Maybe ListPoliciesForTarget
page ListPoliciesForTarget
rq AWSResponse ListPoliciesForTarget
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPoliciesForTarget
ListPoliciesForTargetResponse
rs
ListPoliciesForTargetResponse
-> Getting (First Text) ListPoliciesForTargetResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPoliciesForTargetResponse
-> Const (First Text) ListPoliciesForTargetResponse
Lens' ListPoliciesForTargetResponse (Maybe Text)
listPoliciesForTargetResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListPoliciesForTargetResponse
-> Const (First Text) ListPoliciesForTargetResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPoliciesForTargetResponse 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 ListPoliciesForTarget
forall a. Maybe a
Prelude.Nothing
| Maybe [PolicySummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPoliciesForTarget
ListPoliciesForTargetResponse
rs
ListPoliciesForTargetResponse
-> Getting
(First [PolicySummary])
ListPoliciesForTargetResponse
[PolicySummary]
-> Maybe [PolicySummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PolicySummary]
-> Const (First [PolicySummary]) (Maybe [PolicySummary]))
-> ListPoliciesForTargetResponse
-> Const (First [PolicySummary]) ListPoliciesForTargetResponse
Lens' ListPoliciesForTargetResponse (Maybe [PolicySummary])
listPoliciesForTargetResponse_policies
((Maybe [PolicySummary]
-> Const (First [PolicySummary]) (Maybe [PolicySummary]))
-> ListPoliciesForTargetResponse
-> Const (First [PolicySummary]) ListPoliciesForTargetResponse)
-> (([PolicySummary]
-> Const (First [PolicySummary]) [PolicySummary])
-> Maybe [PolicySummary]
-> Const (First [PolicySummary]) (Maybe [PolicySummary]))
-> Getting
(First [PolicySummary])
ListPoliciesForTargetResponse
[PolicySummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PolicySummary] -> Const (First [PolicySummary]) [PolicySummary])
-> Maybe [PolicySummary]
-> Const (First [PolicySummary]) (Maybe [PolicySummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListPoliciesForTarget
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListPoliciesForTarget -> Maybe ListPoliciesForTarget
forall a. a -> Maybe a
Prelude.Just (ListPoliciesForTarget -> Maybe ListPoliciesForTarget)
-> ListPoliciesForTarget -> Maybe ListPoliciesForTarget
forall a b. (a -> b) -> a -> b
Prelude.$
ListPoliciesForTarget
rq
ListPoliciesForTarget
-> (ListPoliciesForTarget -> ListPoliciesForTarget)
-> ListPoliciesForTarget
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPoliciesForTarget -> Identity ListPoliciesForTarget
Lens
ListPoliciesForTarget
ListPoliciesForTarget
(Maybe Text)
(Maybe Text)
listPoliciesForTarget_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListPoliciesForTarget -> Identity ListPoliciesForTarget)
-> Maybe Text -> ListPoliciesForTarget -> ListPoliciesForTarget
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPoliciesForTarget
ListPoliciesForTargetResponse
rs
ListPoliciesForTargetResponse
-> Getting (First Text) ListPoliciesForTargetResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPoliciesForTargetResponse
-> Const (First Text) ListPoliciesForTargetResponse
Lens' ListPoliciesForTargetResponse (Maybe Text)
listPoliciesForTargetResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListPoliciesForTargetResponse
-> Const (First Text) ListPoliciesForTargetResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPoliciesForTargetResponse 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 ListPoliciesForTarget where
type
AWSResponse ListPoliciesForTarget =
ListPoliciesForTargetResponse
request :: ListPoliciesForTarget -> Request ListPoliciesForTarget
request = Service -> ListPoliciesForTarget -> Request ListPoliciesForTarget
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListPoliciesForTarget
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPoliciesForTarget)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListPoliciesForTarget))
-> Logger
-> Service
-> Proxy ListPoliciesForTarget
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPoliciesForTarget)))
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 [PolicySummary] -> Int -> ListPoliciesForTargetResponse
ListPoliciesForTargetResponse'
(Maybe Text
-> Maybe [PolicySummary] -> Int -> ListPoliciesForTargetResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [PolicySummary] -> Int -> ListPoliciesForTargetResponse)
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
"NextToken")
Either
String
(Maybe [PolicySummary] -> Int -> ListPoliciesForTargetResponse)
-> Either String (Maybe [PolicySummary])
-> Either String (Int -> ListPoliciesForTargetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [PolicySummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Policies" Either String (Maybe (Maybe [PolicySummary]))
-> Maybe [PolicySummary] -> Either String (Maybe [PolicySummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PolicySummary]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> ListPoliciesForTargetResponse)
-> Either String Int -> Either String ListPoliciesForTargetResponse
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 ListPoliciesForTarget
instance Prelude.NFData ListPoliciesForTarget
instance Core.ToHeaders ListPoliciesForTarget where
toHeaders :: ListPoliciesForTarget -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListPoliciesForTarget -> 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
"AWSOrganizationsV20161128.ListPoliciesForTarget" ::
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 ListPoliciesForTarget where
toJSON :: ListPoliciesForTarget -> Value
toJSON ListPoliciesForTarget' {Maybe Natural
Maybe Text
Text
PolicyType
filter' :: PolicyType
targetId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:filter':ListPoliciesForTarget' :: ListPoliciesForTarget -> PolicyType
$sel:targetId:ListPoliciesForTarget' :: ListPoliciesForTarget -> Text
$sel:maxResults:ListPoliciesForTarget' :: ListPoliciesForTarget -> Maybe Natural
$sel:nextToken:ListPoliciesForTarget' :: ListPoliciesForTarget -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NextToken" 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
nextToken,
(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,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TargetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
targetId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Filter" Text -> PolicyType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PolicyType
filter')
]
)
instance Core.ToPath ListPoliciesForTarget where
toPath :: ListPoliciesForTarget -> ByteString
toPath = ByteString -> ListPoliciesForTarget -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListPoliciesForTarget where
toQuery :: ListPoliciesForTarget -> QueryString
toQuery = QueryString -> ListPoliciesForTarget -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListPoliciesForTargetResponse = ListPoliciesForTargetResponse'
{
ListPoliciesForTargetResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPoliciesForTargetResponse -> Maybe [PolicySummary]
policies :: Prelude.Maybe [PolicySummary],
ListPoliciesForTargetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListPoliciesForTargetResponse
-> ListPoliciesForTargetResponse -> Bool
(ListPoliciesForTargetResponse
-> ListPoliciesForTargetResponse -> Bool)
-> (ListPoliciesForTargetResponse
-> ListPoliciesForTargetResponse -> Bool)
-> Eq ListPoliciesForTargetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPoliciesForTargetResponse
-> ListPoliciesForTargetResponse -> Bool
$c/= :: ListPoliciesForTargetResponse
-> ListPoliciesForTargetResponse -> Bool
== :: ListPoliciesForTargetResponse
-> ListPoliciesForTargetResponse -> Bool
$c== :: ListPoliciesForTargetResponse
-> ListPoliciesForTargetResponse -> Bool
Prelude.Eq, ReadPrec [ListPoliciesForTargetResponse]
ReadPrec ListPoliciesForTargetResponse
Int -> ReadS ListPoliciesForTargetResponse
ReadS [ListPoliciesForTargetResponse]
(Int -> ReadS ListPoliciesForTargetResponse)
-> ReadS [ListPoliciesForTargetResponse]
-> ReadPrec ListPoliciesForTargetResponse
-> ReadPrec [ListPoliciesForTargetResponse]
-> Read ListPoliciesForTargetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPoliciesForTargetResponse]
$creadListPrec :: ReadPrec [ListPoliciesForTargetResponse]
readPrec :: ReadPrec ListPoliciesForTargetResponse
$creadPrec :: ReadPrec ListPoliciesForTargetResponse
readList :: ReadS [ListPoliciesForTargetResponse]
$creadList :: ReadS [ListPoliciesForTargetResponse]
readsPrec :: Int -> ReadS ListPoliciesForTargetResponse
$creadsPrec :: Int -> ReadS ListPoliciesForTargetResponse
Prelude.Read, Int -> ListPoliciesForTargetResponse -> ShowS
[ListPoliciesForTargetResponse] -> ShowS
ListPoliciesForTargetResponse -> String
(Int -> ListPoliciesForTargetResponse -> ShowS)
-> (ListPoliciesForTargetResponse -> String)
-> ([ListPoliciesForTargetResponse] -> ShowS)
-> Show ListPoliciesForTargetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPoliciesForTargetResponse] -> ShowS
$cshowList :: [ListPoliciesForTargetResponse] -> ShowS
show :: ListPoliciesForTargetResponse -> String
$cshow :: ListPoliciesForTargetResponse -> String
showsPrec :: Int -> ListPoliciesForTargetResponse -> ShowS
$cshowsPrec :: Int -> ListPoliciesForTargetResponse -> ShowS
Prelude.Show, (forall x.
ListPoliciesForTargetResponse
-> Rep ListPoliciesForTargetResponse x)
-> (forall x.
Rep ListPoliciesForTargetResponse x
-> ListPoliciesForTargetResponse)
-> Generic ListPoliciesForTargetResponse
forall x.
Rep ListPoliciesForTargetResponse x
-> ListPoliciesForTargetResponse
forall x.
ListPoliciesForTargetResponse
-> Rep ListPoliciesForTargetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPoliciesForTargetResponse x
-> ListPoliciesForTargetResponse
$cfrom :: forall x.
ListPoliciesForTargetResponse
-> Rep ListPoliciesForTargetResponse x
Prelude.Generic)
newListPoliciesForTargetResponse ::
Prelude.Int ->
ListPoliciesForTargetResponse
newListPoliciesForTargetResponse :: Int -> ListPoliciesForTargetResponse
newListPoliciesForTargetResponse Int
pHttpStatus_ =
ListPoliciesForTargetResponse' :: Maybe Text
-> Maybe [PolicySummary] -> Int -> ListPoliciesForTargetResponse
ListPoliciesForTargetResponse'
{ $sel:nextToken:ListPoliciesForTargetResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:policies:ListPoliciesForTargetResponse' :: Maybe [PolicySummary]
policies = Maybe [PolicySummary]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPoliciesForTargetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listPoliciesForTargetResponse_nextToken :: Lens.Lens' ListPoliciesForTargetResponse (Prelude.Maybe Prelude.Text)
listPoliciesForTargetResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPoliciesForTargetResponse -> f ListPoliciesForTargetResponse
listPoliciesForTargetResponse_nextToken = (ListPoliciesForTargetResponse -> Maybe Text)
-> (ListPoliciesForTargetResponse
-> Maybe Text -> ListPoliciesForTargetResponse)
-> Lens' ListPoliciesForTargetResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesForTargetResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPoliciesForTargetResponse' :: ListPoliciesForTargetResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPoliciesForTargetResponse
s@ListPoliciesForTargetResponse' {} Maybe Text
a -> ListPoliciesForTargetResponse
s {$sel:nextToken:ListPoliciesForTargetResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPoliciesForTargetResponse)
listPoliciesForTargetResponse_policies :: Lens.Lens' ListPoliciesForTargetResponse (Prelude.Maybe [PolicySummary])
listPoliciesForTargetResponse_policies :: (Maybe [PolicySummary] -> f (Maybe [PolicySummary]))
-> ListPoliciesForTargetResponse -> f ListPoliciesForTargetResponse
listPoliciesForTargetResponse_policies = (ListPoliciesForTargetResponse -> Maybe [PolicySummary])
-> (ListPoliciesForTargetResponse
-> Maybe [PolicySummary] -> ListPoliciesForTargetResponse)
-> Lens' ListPoliciesForTargetResponse (Maybe [PolicySummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesForTargetResponse' {Maybe [PolicySummary]
policies :: Maybe [PolicySummary]
$sel:policies:ListPoliciesForTargetResponse' :: ListPoliciesForTargetResponse -> Maybe [PolicySummary]
policies} -> Maybe [PolicySummary]
policies) (\s :: ListPoliciesForTargetResponse
s@ListPoliciesForTargetResponse' {} Maybe [PolicySummary]
a -> ListPoliciesForTargetResponse
s {$sel:policies:ListPoliciesForTargetResponse' :: Maybe [PolicySummary]
policies = Maybe [PolicySummary]
a} :: ListPoliciesForTargetResponse) ((Maybe [PolicySummary] -> f (Maybe [PolicySummary]))
-> ListPoliciesForTargetResponse
-> f ListPoliciesForTargetResponse)
-> ((Maybe [PolicySummary] -> f (Maybe [PolicySummary]))
-> Maybe [PolicySummary] -> f (Maybe [PolicySummary]))
-> (Maybe [PolicySummary] -> f (Maybe [PolicySummary]))
-> ListPoliciesForTargetResponse
-> f ListPoliciesForTargetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PolicySummary] [PolicySummary] [PolicySummary] [PolicySummary]
-> Iso
(Maybe [PolicySummary])
(Maybe [PolicySummary])
(Maybe [PolicySummary])
(Maybe [PolicySummary])
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
[PolicySummary] [PolicySummary] [PolicySummary] [PolicySummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listPoliciesForTargetResponse_httpStatus :: Lens.Lens' ListPoliciesForTargetResponse Prelude.Int
listPoliciesForTargetResponse_httpStatus :: (Int -> f Int)
-> ListPoliciesForTargetResponse -> f ListPoliciesForTargetResponse
listPoliciesForTargetResponse_httpStatus = (ListPoliciesForTargetResponse -> Int)
-> (ListPoliciesForTargetResponse
-> Int -> ListPoliciesForTargetResponse)
-> Lens
ListPoliciesForTargetResponse ListPoliciesForTargetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesForTargetResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListPoliciesForTargetResponse' :: ListPoliciesForTargetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListPoliciesForTargetResponse
s@ListPoliciesForTargetResponse' {} Int
a -> ListPoliciesForTargetResponse
s {$sel:httpStatus:ListPoliciesForTargetResponse' :: Int
httpStatus = Int
a} :: ListPoliciesForTargetResponse)
instance Prelude.NFData ListPoliciesForTargetResponse