{-# 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.ListCACertificates
-- 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)
--
-- Lists the CA certificates registered for your Amazon Web Services
-- account.
--
-- The results are paginated with a default page size of 25. You can use
-- the returned marker to retrieve additional results.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListCACertificates>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListCACertificates
  ( -- * Creating a Request
    ListCACertificates (..),
    newListCACertificates,

    -- * Request Lenses
    listCACertificates_marker,
    listCACertificates_ascendingOrder,
    listCACertificates_pageSize,

    -- * Destructuring the Response
    ListCACertificatesResponse (..),
    newListCACertificatesResponse,

    -- * Response Lenses
    listCACertificatesResponse_certificates,
    listCACertificatesResponse_nextMarker,
    listCACertificatesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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

-- | Input for the ListCACertificates operation.
--
-- /See:/ 'newListCACertificates' smart constructor.
data ListCACertificates = ListCACertificates'
  { -- | The marker for the next set of results.
    ListCACertificates -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Determines the order of the results.
    ListCACertificates -> Maybe Bool
ascendingOrder :: Prelude.Maybe Prelude.Bool,
    -- | The result page size.
    ListCACertificates -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListCACertificates -> ListCACertificates -> Bool
(ListCACertificates -> ListCACertificates -> Bool)
-> (ListCACertificates -> ListCACertificates -> Bool)
-> Eq ListCACertificates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCACertificates -> ListCACertificates -> Bool
$c/= :: ListCACertificates -> ListCACertificates -> Bool
== :: ListCACertificates -> ListCACertificates -> Bool
$c== :: ListCACertificates -> ListCACertificates -> Bool
Prelude.Eq, ReadPrec [ListCACertificates]
ReadPrec ListCACertificates
Int -> ReadS ListCACertificates
ReadS [ListCACertificates]
(Int -> ReadS ListCACertificates)
-> ReadS [ListCACertificates]
-> ReadPrec ListCACertificates
-> ReadPrec [ListCACertificates]
-> Read ListCACertificates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCACertificates]
$creadListPrec :: ReadPrec [ListCACertificates]
readPrec :: ReadPrec ListCACertificates
$creadPrec :: ReadPrec ListCACertificates
readList :: ReadS [ListCACertificates]
$creadList :: ReadS [ListCACertificates]
readsPrec :: Int -> ReadS ListCACertificates
$creadsPrec :: Int -> ReadS ListCACertificates
Prelude.Read, Int -> ListCACertificates -> ShowS
[ListCACertificates] -> ShowS
ListCACertificates -> String
(Int -> ListCACertificates -> ShowS)
-> (ListCACertificates -> String)
-> ([ListCACertificates] -> ShowS)
-> Show ListCACertificates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCACertificates] -> ShowS
$cshowList :: [ListCACertificates] -> ShowS
show :: ListCACertificates -> String
$cshow :: ListCACertificates -> String
showsPrec :: Int -> ListCACertificates -> ShowS
$cshowsPrec :: Int -> ListCACertificates -> ShowS
Prelude.Show, (forall x. ListCACertificates -> Rep ListCACertificates x)
-> (forall x. Rep ListCACertificates x -> ListCACertificates)
-> Generic ListCACertificates
forall x. Rep ListCACertificates x -> ListCACertificates
forall x. ListCACertificates -> Rep ListCACertificates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCACertificates x -> ListCACertificates
$cfrom :: forall x. ListCACertificates -> Rep ListCACertificates x
Prelude.Generic)

-- |
-- Create a value of 'ListCACertificates' 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', 'listCACertificates_marker' - The marker for the next set of results.
--
-- 'ascendingOrder', 'listCACertificates_ascendingOrder' - Determines the order of the results.
--
-- 'pageSize', 'listCACertificates_pageSize' - The result page size.
newListCACertificates ::
  ListCACertificates
newListCACertificates :: ListCACertificates
newListCACertificates =
  ListCACertificates' :: Maybe Text -> Maybe Bool -> Maybe Natural -> ListCACertificates
ListCACertificates'
    { $sel:marker:ListCACertificates' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ascendingOrder:ListCACertificates' :: Maybe Bool
ascendingOrder = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListCACertificates' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The marker for the next set of results.
listCACertificates_marker :: Lens.Lens' ListCACertificates (Prelude.Maybe Prelude.Text)
listCACertificates_marker :: (Maybe Text -> f (Maybe Text))
-> ListCACertificates -> f ListCACertificates
listCACertificates_marker = (ListCACertificates -> Maybe Text)
-> (ListCACertificates -> Maybe Text -> ListCACertificates)
-> Lens
     ListCACertificates ListCACertificates (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCACertificates' {Maybe Text
marker :: Maybe Text
$sel:marker:ListCACertificates' :: ListCACertificates -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListCACertificates
s@ListCACertificates' {} Maybe Text
a -> ListCACertificates
s {$sel:marker:ListCACertificates' :: Maybe Text
marker = Maybe Text
a} :: ListCACertificates)

-- | Determines the order of the results.
listCACertificates_ascendingOrder :: Lens.Lens' ListCACertificates (Prelude.Maybe Prelude.Bool)
listCACertificates_ascendingOrder :: (Maybe Bool -> f (Maybe Bool))
-> ListCACertificates -> f ListCACertificates
listCACertificates_ascendingOrder = (ListCACertificates -> Maybe Bool)
-> (ListCACertificates -> Maybe Bool -> ListCACertificates)
-> Lens
     ListCACertificates ListCACertificates (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCACertificates' {Maybe Bool
ascendingOrder :: Maybe Bool
$sel:ascendingOrder:ListCACertificates' :: ListCACertificates -> Maybe Bool
ascendingOrder} -> Maybe Bool
ascendingOrder) (\s :: ListCACertificates
s@ListCACertificates' {} Maybe Bool
a -> ListCACertificates
s {$sel:ascendingOrder:ListCACertificates' :: Maybe Bool
ascendingOrder = Maybe Bool
a} :: ListCACertificates)

-- | The result page size.
listCACertificates_pageSize :: Lens.Lens' ListCACertificates (Prelude.Maybe Prelude.Natural)
listCACertificates_pageSize :: (Maybe Natural -> f (Maybe Natural))
-> ListCACertificates -> f ListCACertificates
listCACertificates_pageSize = (ListCACertificates -> Maybe Natural)
-> (ListCACertificates -> Maybe Natural -> ListCACertificates)
-> Lens
     ListCACertificates
     ListCACertificates
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCACertificates' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListCACertificates' :: ListCACertificates -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListCACertificates
s@ListCACertificates' {} Maybe Natural
a -> ListCACertificates
s {$sel:pageSize:ListCACertificates' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListCACertificates)

instance Core.AWSPager ListCACertificates where
  page :: ListCACertificates
-> AWSResponse ListCACertificates -> Maybe ListCACertificates
page ListCACertificates
rq AWSResponse ListCACertificates
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCACertificates
ListCACertificatesResponse
rs
            ListCACertificatesResponse
-> Getting (First Text) ListCACertificatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCACertificatesResponse
-> Const (First Text) ListCACertificatesResponse
Lens' ListCACertificatesResponse (Maybe Text)
listCACertificatesResponse_nextMarker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCACertificatesResponse
 -> Const (First Text) ListCACertificatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCACertificatesResponse 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 ListCACertificates
forall a. Maybe a
Prelude.Nothing
    | Maybe [CACertificate] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCACertificates
ListCACertificatesResponse
rs
            ListCACertificatesResponse
-> Getting
     (First [CACertificate]) ListCACertificatesResponse [CACertificate]
-> Maybe [CACertificate]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [CACertificate]
 -> Const (First [CACertificate]) (Maybe [CACertificate]))
-> ListCACertificatesResponse
-> Const (First [CACertificate]) ListCACertificatesResponse
Lens' ListCACertificatesResponse (Maybe [CACertificate])
listCACertificatesResponse_certificates
              ((Maybe [CACertificate]
  -> Const (First [CACertificate]) (Maybe [CACertificate]))
 -> ListCACertificatesResponse
 -> Const (First [CACertificate]) ListCACertificatesResponse)
-> (([CACertificate]
     -> Const (First [CACertificate]) [CACertificate])
    -> Maybe [CACertificate]
    -> Const (First [CACertificate]) (Maybe [CACertificate]))
-> Getting
     (First [CACertificate]) ListCACertificatesResponse [CACertificate]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CACertificate] -> Const (First [CACertificate]) [CACertificate])
-> Maybe [CACertificate]
-> Const (First [CACertificate]) (Maybe [CACertificate])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListCACertificates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListCACertificates -> Maybe ListCACertificates
forall a. a -> Maybe a
Prelude.Just (ListCACertificates -> Maybe ListCACertificates)
-> ListCACertificates -> Maybe ListCACertificates
forall a b. (a -> b) -> a -> b
Prelude.$
        ListCACertificates
rq
          ListCACertificates
-> (ListCACertificates -> ListCACertificates) -> ListCACertificates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListCACertificates -> Identity ListCACertificates
Lens
  ListCACertificates ListCACertificates (Maybe Text) (Maybe Text)
listCACertificates_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListCACertificates -> Identity ListCACertificates)
-> Maybe Text -> ListCACertificates -> ListCACertificates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCACertificates
ListCACertificatesResponse
rs
          ListCACertificatesResponse
-> Getting (First Text) ListCACertificatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCACertificatesResponse
-> Const (First Text) ListCACertificatesResponse
Lens' ListCACertificatesResponse (Maybe Text)
listCACertificatesResponse_nextMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCACertificatesResponse
 -> Const (First Text) ListCACertificatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCACertificatesResponse 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 ListCACertificates where
  type
    AWSResponse ListCACertificates =
      ListCACertificatesResponse
  request :: ListCACertificates -> Request ListCACertificates
request = Service -> ListCACertificates -> Request ListCACertificates
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListCACertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCACertificates)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListCACertificates))
-> Logger
-> Service
-> Proxy ListCACertificates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCACertificates)))
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 [CACertificate]
-> Maybe Text -> Int -> ListCACertificatesResponse
ListCACertificatesResponse'
            (Maybe [CACertificate]
 -> Maybe Text -> Int -> ListCACertificatesResponse)
-> Either String (Maybe [CACertificate])
-> Either String (Maybe Text -> Int -> ListCACertificatesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [CACertificate]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"certificates" Either String (Maybe (Maybe [CACertificate]))
-> Maybe [CACertificate] -> Either String (Maybe [CACertificate])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CACertificate]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListCACertificatesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListCACertificatesResponse)
forall (f :: * -> *) a b. Applicative f => 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
"nextMarker")
            Either String (Int -> ListCACertificatesResponse)
-> Either String Int -> Either String ListCACertificatesResponse
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 ListCACertificates

instance Prelude.NFData ListCACertificates

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

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

instance Core.ToQuery ListCACertificates where
  toQuery :: ListCACertificates -> QueryString
toQuery ListCACertificates' {Maybe Bool
Maybe Natural
Maybe Text
pageSize :: Maybe Natural
ascendingOrder :: Maybe Bool
marker :: Maybe Text
$sel:pageSize:ListCACertificates' :: ListCACertificates -> Maybe Natural
$sel:ascendingOrder:ListCACertificates' :: ListCACertificates -> Maybe Bool
$sel:marker:ListCACertificates' :: ListCACertificates -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"isAscendingOrder" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
ascendingOrder,
        ByteString
"pageSize" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
pageSize
      ]

-- | The output from the ListCACertificates operation.
--
-- /See:/ 'newListCACertificatesResponse' smart constructor.
data ListCACertificatesResponse = ListCACertificatesResponse'
  { -- | The CA certificates registered in your Amazon Web Services account.
    ListCACertificatesResponse -> Maybe [CACertificate]
certificates :: Prelude.Maybe [CACertificate],
    -- | The current position within the list of CA certificates.
    ListCACertificatesResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListCACertificatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCACertificatesResponse -> ListCACertificatesResponse -> Bool
(ListCACertificatesResponse -> ListCACertificatesResponse -> Bool)
-> (ListCACertificatesResponse
    -> ListCACertificatesResponse -> Bool)
-> Eq ListCACertificatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCACertificatesResponse -> ListCACertificatesResponse -> Bool
$c/= :: ListCACertificatesResponse -> ListCACertificatesResponse -> Bool
== :: ListCACertificatesResponse -> ListCACertificatesResponse -> Bool
$c== :: ListCACertificatesResponse -> ListCACertificatesResponse -> Bool
Prelude.Eq, ReadPrec [ListCACertificatesResponse]
ReadPrec ListCACertificatesResponse
Int -> ReadS ListCACertificatesResponse
ReadS [ListCACertificatesResponse]
(Int -> ReadS ListCACertificatesResponse)
-> ReadS [ListCACertificatesResponse]
-> ReadPrec ListCACertificatesResponse
-> ReadPrec [ListCACertificatesResponse]
-> Read ListCACertificatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCACertificatesResponse]
$creadListPrec :: ReadPrec [ListCACertificatesResponse]
readPrec :: ReadPrec ListCACertificatesResponse
$creadPrec :: ReadPrec ListCACertificatesResponse
readList :: ReadS [ListCACertificatesResponse]
$creadList :: ReadS [ListCACertificatesResponse]
readsPrec :: Int -> ReadS ListCACertificatesResponse
$creadsPrec :: Int -> ReadS ListCACertificatesResponse
Prelude.Read, Int -> ListCACertificatesResponse -> ShowS
[ListCACertificatesResponse] -> ShowS
ListCACertificatesResponse -> String
(Int -> ListCACertificatesResponse -> ShowS)
-> (ListCACertificatesResponse -> String)
-> ([ListCACertificatesResponse] -> ShowS)
-> Show ListCACertificatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCACertificatesResponse] -> ShowS
$cshowList :: [ListCACertificatesResponse] -> ShowS
show :: ListCACertificatesResponse -> String
$cshow :: ListCACertificatesResponse -> String
showsPrec :: Int -> ListCACertificatesResponse -> ShowS
$cshowsPrec :: Int -> ListCACertificatesResponse -> ShowS
Prelude.Show, (forall x.
 ListCACertificatesResponse -> Rep ListCACertificatesResponse x)
-> (forall x.
    Rep ListCACertificatesResponse x -> ListCACertificatesResponse)
-> Generic ListCACertificatesResponse
forall x.
Rep ListCACertificatesResponse x -> ListCACertificatesResponse
forall x.
ListCACertificatesResponse -> Rep ListCACertificatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCACertificatesResponse x -> ListCACertificatesResponse
$cfrom :: forall x.
ListCACertificatesResponse -> Rep ListCACertificatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCACertificatesResponse' 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:
--
-- 'certificates', 'listCACertificatesResponse_certificates' - The CA certificates registered in your Amazon Web Services account.
--
-- 'nextMarker', 'listCACertificatesResponse_nextMarker' - The current position within the list of CA certificates.
--
-- 'httpStatus', 'listCACertificatesResponse_httpStatus' - The response's http status code.
newListCACertificatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCACertificatesResponse
newListCACertificatesResponse :: Int -> ListCACertificatesResponse
newListCACertificatesResponse Int
pHttpStatus_ =
  ListCACertificatesResponse' :: Maybe [CACertificate]
-> Maybe Text -> Int -> ListCACertificatesResponse
ListCACertificatesResponse'
    { $sel:certificates:ListCACertificatesResponse' :: Maybe [CACertificate]
certificates =
        Maybe [CACertificate]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:ListCACertificatesResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCACertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The CA certificates registered in your Amazon Web Services account.
listCACertificatesResponse_certificates :: Lens.Lens' ListCACertificatesResponse (Prelude.Maybe [CACertificate])
listCACertificatesResponse_certificates :: (Maybe [CACertificate] -> f (Maybe [CACertificate]))
-> ListCACertificatesResponse -> f ListCACertificatesResponse
listCACertificatesResponse_certificates = (ListCACertificatesResponse -> Maybe [CACertificate])
-> (ListCACertificatesResponse
    -> Maybe [CACertificate] -> ListCACertificatesResponse)
-> Lens' ListCACertificatesResponse (Maybe [CACertificate])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCACertificatesResponse' {Maybe [CACertificate]
certificates :: Maybe [CACertificate]
$sel:certificates:ListCACertificatesResponse' :: ListCACertificatesResponse -> Maybe [CACertificate]
certificates} -> Maybe [CACertificate]
certificates) (\s :: ListCACertificatesResponse
s@ListCACertificatesResponse' {} Maybe [CACertificate]
a -> ListCACertificatesResponse
s {$sel:certificates:ListCACertificatesResponse' :: Maybe [CACertificate]
certificates = Maybe [CACertificate]
a} :: ListCACertificatesResponse) ((Maybe [CACertificate] -> f (Maybe [CACertificate]))
 -> ListCACertificatesResponse -> f ListCACertificatesResponse)
-> ((Maybe [CACertificate] -> f (Maybe [CACertificate]))
    -> Maybe [CACertificate] -> f (Maybe [CACertificate]))
-> (Maybe [CACertificate] -> f (Maybe [CACertificate]))
-> ListCACertificatesResponse
-> f ListCACertificatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CACertificate] [CACertificate] [CACertificate] [CACertificate]
-> Iso
     (Maybe [CACertificate])
     (Maybe [CACertificate])
     (Maybe [CACertificate])
     (Maybe [CACertificate])
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
  [CACertificate] [CACertificate] [CACertificate] [CACertificate]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The current position within the list of CA certificates.
listCACertificatesResponse_nextMarker :: Lens.Lens' ListCACertificatesResponse (Prelude.Maybe Prelude.Text)
listCACertificatesResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListCACertificatesResponse -> f ListCACertificatesResponse
listCACertificatesResponse_nextMarker = (ListCACertificatesResponse -> Maybe Text)
-> (ListCACertificatesResponse
    -> Maybe Text -> ListCACertificatesResponse)
-> Lens' ListCACertificatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCACertificatesResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListCACertificatesResponse' :: ListCACertificatesResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListCACertificatesResponse
s@ListCACertificatesResponse' {} Maybe Text
a -> ListCACertificatesResponse
s {$sel:nextMarker:ListCACertificatesResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListCACertificatesResponse)

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

instance Prelude.NFData ListCACertificatesResponse