{-# 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.IoT.ListAttachedPolicies
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the policies attached to the specified thing group.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListAttachedPolicies>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListAttachedPolicies
  ( -- * Creating a Request
    ListAttachedPolicies (..),
    newListAttachedPolicies,

    -- * Request Lenses
    listAttachedPolicies_marker,
    listAttachedPolicies_pageSize,
    listAttachedPolicies_recursive,
    listAttachedPolicies_target,

    -- * Destructuring the Response
    ListAttachedPoliciesResponse (..),
    newListAttachedPoliciesResponse,

    -- * Response Lenses
    listAttachedPoliciesResponse_nextMarker,
    listAttachedPoliciesResponse_policies,
    listAttachedPoliciesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListAttachedPolicies' smart constructor.
data ListAttachedPolicies = ListAttachedPolicies'
  { -- | The token to retrieve the next set of results.
    ListAttachedPolicies -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListAttachedPolicies -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | When true, recursively list attached policies.
    ListAttachedPolicies -> Maybe Bool
recursive :: Prelude.Maybe Prelude.Bool,
    -- | The group or principal for which the policies will be listed. Valid
    -- principals are CertificateArn
    -- (arn:aws:iot:/region/:/accountId/:cert\//certificateId/), thingGroupArn
    -- (arn:aws:iot:/region/:/accountId/:thinggroup\//groupName/) and CognitoId
    -- (/region/:/id/).
    ListAttachedPolicies -> Text
target :: Prelude.Text
  }
  deriving (ListAttachedPolicies -> ListAttachedPolicies -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAttachedPolicies -> ListAttachedPolicies -> Bool
$c/= :: ListAttachedPolicies -> ListAttachedPolicies -> Bool
== :: ListAttachedPolicies -> ListAttachedPolicies -> Bool
$c== :: ListAttachedPolicies -> ListAttachedPolicies -> Bool
Prelude.Eq, ReadPrec [ListAttachedPolicies]
ReadPrec ListAttachedPolicies
Int -> ReadS ListAttachedPolicies
ReadS [ListAttachedPolicies]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAttachedPolicies]
$creadListPrec :: ReadPrec [ListAttachedPolicies]
readPrec :: ReadPrec ListAttachedPolicies
$creadPrec :: ReadPrec ListAttachedPolicies
readList :: ReadS [ListAttachedPolicies]
$creadList :: ReadS [ListAttachedPolicies]
readsPrec :: Int -> ReadS ListAttachedPolicies
$creadsPrec :: Int -> ReadS ListAttachedPolicies
Prelude.Read, Int -> ListAttachedPolicies -> ShowS
[ListAttachedPolicies] -> ShowS
ListAttachedPolicies -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAttachedPolicies] -> ShowS
$cshowList :: [ListAttachedPolicies] -> ShowS
show :: ListAttachedPolicies -> String
$cshow :: ListAttachedPolicies -> String
showsPrec :: Int -> ListAttachedPolicies -> ShowS
$cshowsPrec :: Int -> ListAttachedPolicies -> ShowS
Prelude.Show, forall x. Rep ListAttachedPolicies x -> ListAttachedPolicies
forall x. ListAttachedPolicies -> Rep ListAttachedPolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAttachedPolicies x -> ListAttachedPolicies
$cfrom :: forall x. ListAttachedPolicies -> Rep ListAttachedPolicies x
Prelude.Generic)

-- |
-- Create a value of 'ListAttachedPolicies' 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:
--
-- 'marker', 'listAttachedPolicies_marker' - The token to retrieve the next set of results.
--
-- 'pageSize', 'listAttachedPolicies_pageSize' - The maximum number of results to be returned per request.
--
-- 'recursive', 'listAttachedPolicies_recursive' - When true, recursively list attached policies.
--
-- 'target', 'listAttachedPolicies_target' - The group or principal for which the policies will be listed. Valid
-- principals are CertificateArn
-- (arn:aws:iot:/region/:/accountId/:cert\//certificateId/), thingGroupArn
-- (arn:aws:iot:/region/:/accountId/:thinggroup\//groupName/) and CognitoId
-- (/region/:/id/).
newListAttachedPolicies ::
  -- | 'target'
  Prelude.Text ->
  ListAttachedPolicies
newListAttachedPolicies :: Text -> ListAttachedPolicies
newListAttachedPolicies Text
pTarget_ =
  ListAttachedPolicies'
    { $sel:marker:ListAttachedPolicies' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListAttachedPolicies' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
      $sel:recursive:ListAttachedPolicies' :: Maybe Bool
recursive = forall a. Maybe a
Prelude.Nothing,
      $sel:target:ListAttachedPolicies' :: Text
target = Text
pTarget_
    }

-- | The token to retrieve the next set of results.
listAttachedPolicies_marker :: Lens.Lens' ListAttachedPolicies (Prelude.Maybe Prelude.Text)
listAttachedPolicies_marker :: Lens' ListAttachedPolicies (Maybe Text)
listAttachedPolicies_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttachedPolicies' {Maybe Text
marker :: Maybe Text
$sel:marker:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListAttachedPolicies
s@ListAttachedPolicies' {} Maybe Text
a -> ListAttachedPolicies
s {$sel:marker:ListAttachedPolicies' :: Maybe Text
marker = Maybe Text
a} :: ListAttachedPolicies)

-- | The maximum number of results to be returned per request.
listAttachedPolicies_pageSize :: Lens.Lens' ListAttachedPolicies (Prelude.Maybe Prelude.Natural)
listAttachedPolicies_pageSize :: Lens' ListAttachedPolicies (Maybe Natural)
listAttachedPolicies_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttachedPolicies' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListAttachedPolicies
s@ListAttachedPolicies' {} Maybe Natural
a -> ListAttachedPolicies
s {$sel:pageSize:ListAttachedPolicies' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListAttachedPolicies)

-- | When true, recursively list attached policies.
listAttachedPolicies_recursive :: Lens.Lens' ListAttachedPolicies (Prelude.Maybe Prelude.Bool)
listAttachedPolicies_recursive :: Lens' ListAttachedPolicies (Maybe Bool)
listAttachedPolicies_recursive = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttachedPolicies' {Maybe Bool
recursive :: Maybe Bool
$sel:recursive:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Bool
recursive} -> Maybe Bool
recursive) (\s :: ListAttachedPolicies
s@ListAttachedPolicies' {} Maybe Bool
a -> ListAttachedPolicies
s {$sel:recursive:ListAttachedPolicies' :: Maybe Bool
recursive = Maybe Bool
a} :: ListAttachedPolicies)

-- | The group or principal for which the policies will be listed. Valid
-- principals are CertificateArn
-- (arn:aws:iot:/region/:/accountId/:cert\//certificateId/), thingGroupArn
-- (arn:aws:iot:/region/:/accountId/:thinggroup\//groupName/) and CognitoId
-- (/region/:/id/).
listAttachedPolicies_target :: Lens.Lens' ListAttachedPolicies Prelude.Text
listAttachedPolicies_target :: Lens' ListAttachedPolicies Text
listAttachedPolicies_target = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttachedPolicies' {Text
target :: Text
$sel:target:ListAttachedPolicies' :: ListAttachedPolicies -> Text
target} -> Text
target) (\s :: ListAttachedPolicies
s@ListAttachedPolicies' {} Text
a -> ListAttachedPolicies
s {$sel:target:ListAttachedPolicies' :: Text
target = Text
a} :: ListAttachedPolicies)

instance Core.AWSPager ListAttachedPolicies where
  page :: ListAttachedPolicies
-> AWSResponse ListAttachedPolicies -> Maybe ListAttachedPolicies
page ListAttachedPolicies
rq AWSResponse ListAttachedPolicies
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAttachedPolicies
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAttachedPoliciesResponse (Maybe Text)
listAttachedPoliciesResponse_nextMarker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAttachedPolicies
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAttachedPoliciesResponse (Maybe [Policy])
listAttachedPoliciesResponse_policies
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListAttachedPolicies
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAttachedPolicies (Maybe Text)
listAttachedPolicies_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAttachedPolicies
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAttachedPoliciesResponse (Maybe Text)
listAttachedPoliciesResponse_nextMarker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListAttachedPolicies where
  type
    AWSResponse ListAttachedPolicies =
      ListAttachedPoliciesResponse
  request :: (Service -> Service)
-> ListAttachedPolicies -> Request ListAttachedPolicies
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAttachedPolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAttachedPolicies)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe [Policy] -> Int -> ListAttachedPoliciesResponse
ListAttachedPoliciesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextMarker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"policies" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListAttachedPolicies where
  hashWithSalt :: Int -> ListAttachedPolicies -> Int
hashWithSalt Int
_salt ListAttachedPolicies' {Maybe Bool
Maybe Natural
Maybe Text
Text
target :: Text
recursive :: Maybe Bool
pageSize :: Maybe Natural
marker :: Maybe Text
$sel:target:ListAttachedPolicies' :: ListAttachedPolicies -> Text
$sel:recursive:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Bool
$sel:pageSize:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Natural
$sel:marker:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
recursive
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
target

instance Prelude.NFData ListAttachedPolicies where
  rnf :: ListAttachedPolicies -> ()
rnf ListAttachedPolicies' {Maybe Bool
Maybe Natural
Maybe Text
Text
target :: Text
recursive :: Maybe Bool
pageSize :: Maybe Natural
marker :: Maybe Text
$sel:target:ListAttachedPolicies' :: ListAttachedPolicies -> Text
$sel:recursive:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Bool
$sel:pageSize:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Natural
$sel:marker:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pageSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
recursive
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
target

instance Data.ToHeaders ListAttachedPolicies where
  toHeaders :: ListAttachedPolicies -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToJSON ListAttachedPolicies where
  toJSON :: ListAttachedPolicies -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)

instance Data.ToPath ListAttachedPolicies where
  toPath :: ListAttachedPolicies -> ByteString
toPath ListAttachedPolicies' {Maybe Bool
Maybe Natural
Maybe Text
Text
target :: Text
recursive :: Maybe Bool
pageSize :: Maybe Natural
marker :: Maybe Text
$sel:target:ListAttachedPolicies' :: ListAttachedPolicies -> Text
$sel:recursive:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Bool
$sel:pageSize:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Natural
$sel:marker:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/attached-policies/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
target]

instance Data.ToQuery ListAttachedPolicies where
  toQuery :: ListAttachedPolicies -> QueryString
toQuery ListAttachedPolicies' {Maybe Bool
Maybe Natural
Maybe Text
Text
target :: Text
recursive :: Maybe Bool
pageSize :: Maybe Natural
marker :: Maybe Text
$sel:target:ListAttachedPolicies' :: ListAttachedPolicies -> Text
$sel:recursive:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Bool
$sel:pageSize:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Natural
$sel:marker:ListAttachedPolicies' :: ListAttachedPolicies -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"pageSize" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
pageSize,
        ByteString
"recursive" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
recursive
      ]

-- | /See:/ 'newListAttachedPoliciesResponse' smart constructor.
data ListAttachedPoliciesResponse = ListAttachedPoliciesResponse'
  { -- | The token to retrieve the next set of results, or \`\`null\`\` if there
    -- are no more results.
    ListAttachedPoliciesResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The policies.
    ListAttachedPoliciesResponse -> Maybe [Policy]
policies :: Prelude.Maybe [Policy],
    -- | The response's http status code.
    ListAttachedPoliciesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAttachedPoliciesResponse
-> ListAttachedPoliciesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAttachedPoliciesResponse
-> ListAttachedPoliciesResponse -> Bool
$c/= :: ListAttachedPoliciesResponse
-> ListAttachedPoliciesResponse -> Bool
== :: ListAttachedPoliciesResponse
-> ListAttachedPoliciesResponse -> Bool
$c== :: ListAttachedPoliciesResponse
-> ListAttachedPoliciesResponse -> Bool
Prelude.Eq, ReadPrec [ListAttachedPoliciesResponse]
ReadPrec ListAttachedPoliciesResponse
Int -> ReadS ListAttachedPoliciesResponse
ReadS [ListAttachedPoliciesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAttachedPoliciesResponse]
$creadListPrec :: ReadPrec [ListAttachedPoliciesResponse]
readPrec :: ReadPrec ListAttachedPoliciesResponse
$creadPrec :: ReadPrec ListAttachedPoliciesResponse
readList :: ReadS [ListAttachedPoliciesResponse]
$creadList :: ReadS [ListAttachedPoliciesResponse]
readsPrec :: Int -> ReadS ListAttachedPoliciesResponse
$creadsPrec :: Int -> ReadS ListAttachedPoliciesResponse
Prelude.Read, Int -> ListAttachedPoliciesResponse -> ShowS
[ListAttachedPoliciesResponse] -> ShowS
ListAttachedPoliciesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAttachedPoliciesResponse] -> ShowS
$cshowList :: [ListAttachedPoliciesResponse] -> ShowS
show :: ListAttachedPoliciesResponse -> String
$cshow :: ListAttachedPoliciesResponse -> String
showsPrec :: Int -> ListAttachedPoliciesResponse -> ShowS
$cshowsPrec :: Int -> ListAttachedPoliciesResponse -> ShowS
Prelude.Show, forall x.
Rep ListAttachedPoliciesResponse x -> ListAttachedPoliciesResponse
forall x.
ListAttachedPoliciesResponse -> Rep ListAttachedPoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAttachedPoliciesResponse x -> ListAttachedPoliciesResponse
$cfrom :: forall x.
ListAttachedPoliciesResponse -> Rep ListAttachedPoliciesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAttachedPoliciesResponse' 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:
--
-- 'nextMarker', 'listAttachedPoliciesResponse_nextMarker' - The token to retrieve the next set of results, or \`\`null\`\` if there
-- are no more results.
--
-- 'policies', 'listAttachedPoliciesResponse_policies' - The policies.
--
-- 'httpStatus', 'listAttachedPoliciesResponse_httpStatus' - The response's http status code.
newListAttachedPoliciesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAttachedPoliciesResponse
newListAttachedPoliciesResponse :: Int -> ListAttachedPoliciesResponse
newListAttachedPoliciesResponse Int
pHttpStatus_ =
  ListAttachedPoliciesResponse'
    { $sel:nextMarker:ListAttachedPoliciesResponse' :: Maybe Text
nextMarker =
        forall a. Maybe a
Prelude.Nothing,
      $sel:policies:ListAttachedPoliciesResponse' :: Maybe [Policy]
policies = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAttachedPoliciesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to retrieve the next set of results, or \`\`null\`\` if there
-- are no more results.
listAttachedPoliciesResponse_nextMarker :: Lens.Lens' ListAttachedPoliciesResponse (Prelude.Maybe Prelude.Text)
listAttachedPoliciesResponse_nextMarker :: Lens' ListAttachedPoliciesResponse (Maybe Text)
listAttachedPoliciesResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttachedPoliciesResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListAttachedPoliciesResponse' :: ListAttachedPoliciesResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListAttachedPoliciesResponse
s@ListAttachedPoliciesResponse' {} Maybe Text
a -> ListAttachedPoliciesResponse
s {$sel:nextMarker:ListAttachedPoliciesResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListAttachedPoliciesResponse)

-- | The policies.
listAttachedPoliciesResponse_policies :: Lens.Lens' ListAttachedPoliciesResponse (Prelude.Maybe [Policy])
listAttachedPoliciesResponse_policies :: Lens' ListAttachedPoliciesResponse (Maybe [Policy])
listAttachedPoliciesResponse_policies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttachedPoliciesResponse' {Maybe [Policy]
policies :: Maybe [Policy]
$sel:policies:ListAttachedPoliciesResponse' :: ListAttachedPoliciesResponse -> Maybe [Policy]
policies} -> Maybe [Policy]
policies) (\s :: ListAttachedPoliciesResponse
s@ListAttachedPoliciesResponse' {} Maybe [Policy]
a -> ListAttachedPoliciesResponse
s {$sel:policies:ListAttachedPoliciesResponse' :: Maybe [Policy]
policies = Maybe [Policy]
a} :: ListAttachedPoliciesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListAttachedPoliciesResponse where
  rnf :: ListAttachedPoliciesResponse -> ()
rnf ListAttachedPoliciesResponse' {Int
Maybe [Policy]
Maybe Text
httpStatus :: Int
policies :: Maybe [Policy]
nextMarker :: Maybe Text
$sel:httpStatus:ListAttachedPoliciesResponse' :: ListAttachedPoliciesResponse -> Int
$sel:policies:ListAttachedPoliciesResponse' :: ListAttachedPoliciesResponse -> Maybe [Policy]
$sel:nextMarker:ListAttachedPoliciesResponse' :: ListAttachedPoliciesResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Policy]
policies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus