{-# 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.SecurityHub.DescribeStandardsControls
-- 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)
--
-- Returns a list of security standards controls.
--
-- For each control, the results include information about whether it is
-- currently enabled, the severity, and a link to remediation information.
--
-- This operation returns paginated results.
module Amazonka.SecurityHub.DescribeStandardsControls
  ( -- * Creating a Request
    DescribeStandardsControls (..),
    newDescribeStandardsControls,

    -- * Request Lenses
    describeStandardsControls_nextToken,
    describeStandardsControls_maxResults,
    describeStandardsControls_standardsSubscriptionArn,

    -- * Destructuring the Response
    DescribeStandardsControlsResponse (..),
    newDescribeStandardsControlsResponse,

    -- * Response Lenses
    describeStandardsControlsResponse_controls,
    describeStandardsControlsResponse_nextToken,
    describeStandardsControlsResponse_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 qualified Amazonka.Response as Response
import Amazonka.SecurityHub.Types

-- | /See:/ 'newDescribeStandardsControls' smart constructor.
data DescribeStandardsControls = DescribeStandardsControls'
  { -- | The token that is required for pagination. On your first call to the
    -- @DescribeStandardsControls@ operation, set the value of this parameter
    -- to @NULL@.
    --
    -- For subsequent calls to the operation, to continue listing data, set the
    -- value of this parameter to the value returned from the previous
    -- response.
    DescribeStandardsControls -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of security standard controls to return.
    DescribeStandardsControls -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of a resource that represents your subscription to a supported
    -- standard. To get the subscription ARNs of the standards you have
    -- enabled, use the @GetEnabledStandards@ operation.
    DescribeStandardsControls -> Text
standardsSubscriptionArn :: Prelude.Text
  }
  deriving (DescribeStandardsControls -> DescribeStandardsControls -> Bool
(DescribeStandardsControls -> DescribeStandardsControls -> Bool)
-> (DescribeStandardsControls -> DescribeStandardsControls -> Bool)
-> Eq DescribeStandardsControls
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStandardsControls -> DescribeStandardsControls -> Bool
$c/= :: DescribeStandardsControls -> DescribeStandardsControls -> Bool
== :: DescribeStandardsControls -> DescribeStandardsControls -> Bool
$c== :: DescribeStandardsControls -> DescribeStandardsControls -> Bool
Prelude.Eq, ReadPrec [DescribeStandardsControls]
ReadPrec DescribeStandardsControls
Int -> ReadS DescribeStandardsControls
ReadS [DescribeStandardsControls]
(Int -> ReadS DescribeStandardsControls)
-> ReadS [DescribeStandardsControls]
-> ReadPrec DescribeStandardsControls
-> ReadPrec [DescribeStandardsControls]
-> Read DescribeStandardsControls
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStandardsControls]
$creadListPrec :: ReadPrec [DescribeStandardsControls]
readPrec :: ReadPrec DescribeStandardsControls
$creadPrec :: ReadPrec DescribeStandardsControls
readList :: ReadS [DescribeStandardsControls]
$creadList :: ReadS [DescribeStandardsControls]
readsPrec :: Int -> ReadS DescribeStandardsControls
$creadsPrec :: Int -> ReadS DescribeStandardsControls
Prelude.Read, Int -> DescribeStandardsControls -> ShowS
[DescribeStandardsControls] -> ShowS
DescribeStandardsControls -> String
(Int -> DescribeStandardsControls -> ShowS)
-> (DescribeStandardsControls -> String)
-> ([DescribeStandardsControls] -> ShowS)
-> Show DescribeStandardsControls
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStandardsControls] -> ShowS
$cshowList :: [DescribeStandardsControls] -> ShowS
show :: DescribeStandardsControls -> String
$cshow :: DescribeStandardsControls -> String
showsPrec :: Int -> DescribeStandardsControls -> ShowS
$cshowsPrec :: Int -> DescribeStandardsControls -> ShowS
Prelude.Show, (forall x.
 DescribeStandardsControls -> Rep DescribeStandardsControls x)
-> (forall x.
    Rep DescribeStandardsControls x -> DescribeStandardsControls)
-> Generic DescribeStandardsControls
forall x.
Rep DescribeStandardsControls x -> DescribeStandardsControls
forall x.
DescribeStandardsControls -> Rep DescribeStandardsControls x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStandardsControls x -> DescribeStandardsControls
$cfrom :: forall x.
DescribeStandardsControls -> Rep DescribeStandardsControls x
Prelude.Generic)

-- |
-- Create a value of 'DescribeStandardsControls' 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:
--
-- 'nextToken', 'describeStandardsControls_nextToken' - The token that is required for pagination. On your first call to the
-- @DescribeStandardsControls@ operation, set the value of this parameter
-- to @NULL@.
--
-- For subsequent calls to the operation, to continue listing data, set the
-- value of this parameter to the value returned from the previous
-- response.
--
-- 'maxResults', 'describeStandardsControls_maxResults' - The maximum number of security standard controls to return.
--
-- 'standardsSubscriptionArn', 'describeStandardsControls_standardsSubscriptionArn' - The ARN of a resource that represents your subscription to a supported
-- standard. To get the subscription ARNs of the standards you have
-- enabled, use the @GetEnabledStandards@ operation.
newDescribeStandardsControls ::
  -- | 'standardsSubscriptionArn'
  Prelude.Text ->
  DescribeStandardsControls
newDescribeStandardsControls :: Text -> DescribeStandardsControls
newDescribeStandardsControls
  Text
pStandardsSubscriptionArn_ =
    DescribeStandardsControls' :: Maybe Text -> Maybe Natural -> Text -> DescribeStandardsControls
DescribeStandardsControls'
      { $sel:nextToken:DescribeStandardsControls' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:DescribeStandardsControls' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:standardsSubscriptionArn:DescribeStandardsControls' :: Text
standardsSubscriptionArn =
          Text
pStandardsSubscriptionArn_
      }

-- | The token that is required for pagination. On your first call to the
-- @DescribeStandardsControls@ operation, set the value of this parameter
-- to @NULL@.
--
-- For subsequent calls to the operation, to continue listing data, set the
-- value of this parameter to the value returned from the previous
-- response.
describeStandardsControls_nextToken :: Lens.Lens' DescribeStandardsControls (Prelude.Maybe Prelude.Text)
describeStandardsControls_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeStandardsControls -> f DescribeStandardsControls
describeStandardsControls_nextToken = (DescribeStandardsControls -> Maybe Text)
-> (DescribeStandardsControls
    -> Maybe Text -> DescribeStandardsControls)
-> Lens
     DescribeStandardsControls
     DescribeStandardsControls
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStandardsControls' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeStandardsControls' :: DescribeStandardsControls -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeStandardsControls
s@DescribeStandardsControls' {} Maybe Text
a -> DescribeStandardsControls
s {$sel:nextToken:DescribeStandardsControls' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeStandardsControls)

-- | The maximum number of security standard controls to return.
describeStandardsControls_maxResults :: Lens.Lens' DescribeStandardsControls (Prelude.Maybe Prelude.Natural)
describeStandardsControls_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeStandardsControls -> f DescribeStandardsControls
describeStandardsControls_maxResults = (DescribeStandardsControls -> Maybe Natural)
-> (DescribeStandardsControls
    -> Maybe Natural -> DescribeStandardsControls)
-> Lens
     DescribeStandardsControls
     DescribeStandardsControls
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStandardsControls' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeStandardsControls' :: DescribeStandardsControls -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeStandardsControls
s@DescribeStandardsControls' {} Maybe Natural
a -> DescribeStandardsControls
s {$sel:maxResults:DescribeStandardsControls' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeStandardsControls)

-- | The ARN of a resource that represents your subscription to a supported
-- standard. To get the subscription ARNs of the standards you have
-- enabled, use the @GetEnabledStandards@ operation.
describeStandardsControls_standardsSubscriptionArn :: Lens.Lens' DescribeStandardsControls Prelude.Text
describeStandardsControls_standardsSubscriptionArn :: (Text -> f Text)
-> DescribeStandardsControls -> f DescribeStandardsControls
describeStandardsControls_standardsSubscriptionArn = (DescribeStandardsControls -> Text)
-> (DescribeStandardsControls -> Text -> DescribeStandardsControls)
-> Lens
     DescribeStandardsControls DescribeStandardsControls Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStandardsControls' {Text
standardsSubscriptionArn :: Text
$sel:standardsSubscriptionArn:DescribeStandardsControls' :: DescribeStandardsControls -> Text
standardsSubscriptionArn} -> Text
standardsSubscriptionArn) (\s :: DescribeStandardsControls
s@DescribeStandardsControls' {} Text
a -> DescribeStandardsControls
s {$sel:standardsSubscriptionArn:DescribeStandardsControls' :: Text
standardsSubscriptionArn = Text
a} :: DescribeStandardsControls)

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

instance Prelude.NFData DescribeStandardsControls

instance Core.ToHeaders DescribeStandardsControls where
  toHeaders :: DescribeStandardsControls -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeStandardsControls -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DescribeStandardsControls where
  toPath :: DescribeStandardsControls -> ByteString
toPath DescribeStandardsControls' {Maybe Natural
Maybe Text
Text
standardsSubscriptionArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:standardsSubscriptionArn:DescribeStandardsControls' :: DescribeStandardsControls -> Text
$sel:maxResults:DescribeStandardsControls' :: DescribeStandardsControls -> Maybe Natural
$sel:nextToken:DescribeStandardsControls' :: DescribeStandardsControls -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/standards/controls/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
standardsSubscriptionArn
      ]

instance Core.ToQuery DescribeStandardsControls where
  toQuery :: DescribeStandardsControls -> QueryString
toQuery DescribeStandardsControls' {Maybe Natural
Maybe Text
Text
standardsSubscriptionArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:standardsSubscriptionArn:DescribeStandardsControls' :: DescribeStandardsControls -> Text
$sel:maxResults:DescribeStandardsControls' :: DescribeStandardsControls -> Maybe Natural
$sel:nextToken:DescribeStandardsControls' :: DescribeStandardsControls -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newDescribeStandardsControlsResponse' smart constructor.
data DescribeStandardsControlsResponse = DescribeStandardsControlsResponse'
  { -- | A list of security standards controls.
    DescribeStandardsControlsResponse -> Maybe [StandardsControl]
controls :: Prelude.Maybe [StandardsControl],
    -- | The pagination token to use to request the next page of results.
    DescribeStandardsControlsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeStandardsControlsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeStandardsControlsResponse
-> DescribeStandardsControlsResponse -> Bool
(DescribeStandardsControlsResponse
 -> DescribeStandardsControlsResponse -> Bool)
-> (DescribeStandardsControlsResponse
    -> DescribeStandardsControlsResponse -> Bool)
-> Eq DescribeStandardsControlsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStandardsControlsResponse
-> DescribeStandardsControlsResponse -> Bool
$c/= :: DescribeStandardsControlsResponse
-> DescribeStandardsControlsResponse -> Bool
== :: DescribeStandardsControlsResponse
-> DescribeStandardsControlsResponse -> Bool
$c== :: DescribeStandardsControlsResponse
-> DescribeStandardsControlsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeStandardsControlsResponse]
ReadPrec DescribeStandardsControlsResponse
Int -> ReadS DescribeStandardsControlsResponse
ReadS [DescribeStandardsControlsResponse]
(Int -> ReadS DescribeStandardsControlsResponse)
-> ReadS [DescribeStandardsControlsResponse]
-> ReadPrec DescribeStandardsControlsResponse
-> ReadPrec [DescribeStandardsControlsResponse]
-> Read DescribeStandardsControlsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStandardsControlsResponse]
$creadListPrec :: ReadPrec [DescribeStandardsControlsResponse]
readPrec :: ReadPrec DescribeStandardsControlsResponse
$creadPrec :: ReadPrec DescribeStandardsControlsResponse
readList :: ReadS [DescribeStandardsControlsResponse]
$creadList :: ReadS [DescribeStandardsControlsResponse]
readsPrec :: Int -> ReadS DescribeStandardsControlsResponse
$creadsPrec :: Int -> ReadS DescribeStandardsControlsResponse
Prelude.Read, Int -> DescribeStandardsControlsResponse -> ShowS
[DescribeStandardsControlsResponse] -> ShowS
DescribeStandardsControlsResponse -> String
(Int -> DescribeStandardsControlsResponse -> ShowS)
-> (DescribeStandardsControlsResponse -> String)
-> ([DescribeStandardsControlsResponse] -> ShowS)
-> Show DescribeStandardsControlsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStandardsControlsResponse] -> ShowS
$cshowList :: [DescribeStandardsControlsResponse] -> ShowS
show :: DescribeStandardsControlsResponse -> String
$cshow :: DescribeStandardsControlsResponse -> String
showsPrec :: Int -> DescribeStandardsControlsResponse -> ShowS
$cshowsPrec :: Int -> DescribeStandardsControlsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeStandardsControlsResponse
 -> Rep DescribeStandardsControlsResponse x)
-> (forall x.
    Rep DescribeStandardsControlsResponse x
    -> DescribeStandardsControlsResponse)
-> Generic DescribeStandardsControlsResponse
forall x.
Rep DescribeStandardsControlsResponse x
-> DescribeStandardsControlsResponse
forall x.
DescribeStandardsControlsResponse
-> Rep DescribeStandardsControlsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStandardsControlsResponse x
-> DescribeStandardsControlsResponse
$cfrom :: forall x.
DescribeStandardsControlsResponse
-> Rep DescribeStandardsControlsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeStandardsControlsResponse' 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:
--
-- 'controls', 'describeStandardsControlsResponse_controls' - A list of security standards controls.
--
-- 'nextToken', 'describeStandardsControlsResponse_nextToken' - The pagination token to use to request the next page of results.
--
-- 'httpStatus', 'describeStandardsControlsResponse_httpStatus' - The response's http status code.
newDescribeStandardsControlsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeStandardsControlsResponse
newDescribeStandardsControlsResponse :: Int -> DescribeStandardsControlsResponse
newDescribeStandardsControlsResponse Int
pHttpStatus_ =
  DescribeStandardsControlsResponse' :: Maybe [StandardsControl]
-> Maybe Text -> Int -> DescribeStandardsControlsResponse
DescribeStandardsControlsResponse'
    { $sel:controls:DescribeStandardsControlsResponse' :: Maybe [StandardsControl]
controls =
        Maybe [StandardsControl]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeStandardsControlsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeStandardsControlsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of security standards controls.
describeStandardsControlsResponse_controls :: Lens.Lens' DescribeStandardsControlsResponse (Prelude.Maybe [StandardsControl])
describeStandardsControlsResponse_controls :: (Maybe [StandardsControl] -> f (Maybe [StandardsControl]))
-> DescribeStandardsControlsResponse
-> f DescribeStandardsControlsResponse
describeStandardsControlsResponse_controls = (DescribeStandardsControlsResponse -> Maybe [StandardsControl])
-> (DescribeStandardsControlsResponse
    -> Maybe [StandardsControl] -> DescribeStandardsControlsResponse)
-> Lens'
     DescribeStandardsControlsResponse (Maybe [StandardsControl])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStandardsControlsResponse' {Maybe [StandardsControl]
controls :: Maybe [StandardsControl]
$sel:controls:DescribeStandardsControlsResponse' :: DescribeStandardsControlsResponse -> Maybe [StandardsControl]
controls} -> Maybe [StandardsControl]
controls) (\s :: DescribeStandardsControlsResponse
s@DescribeStandardsControlsResponse' {} Maybe [StandardsControl]
a -> DescribeStandardsControlsResponse
s {$sel:controls:DescribeStandardsControlsResponse' :: Maybe [StandardsControl]
controls = Maybe [StandardsControl]
a} :: DescribeStandardsControlsResponse) ((Maybe [StandardsControl] -> f (Maybe [StandardsControl]))
 -> DescribeStandardsControlsResponse
 -> f DescribeStandardsControlsResponse)
-> ((Maybe [StandardsControl] -> f (Maybe [StandardsControl]))
    -> Maybe [StandardsControl] -> f (Maybe [StandardsControl]))
-> (Maybe [StandardsControl] -> f (Maybe [StandardsControl]))
-> DescribeStandardsControlsResponse
-> f DescribeStandardsControlsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [StandardsControl]
  [StandardsControl]
  [StandardsControl]
  [StandardsControl]
-> Iso
     (Maybe [StandardsControl])
     (Maybe [StandardsControl])
     (Maybe [StandardsControl])
     (Maybe [StandardsControl])
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
  [StandardsControl]
  [StandardsControl]
  [StandardsControl]
  [StandardsControl]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token to use to request the next page of results.
describeStandardsControlsResponse_nextToken :: Lens.Lens' DescribeStandardsControlsResponse (Prelude.Maybe Prelude.Text)
describeStandardsControlsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeStandardsControlsResponse
-> f DescribeStandardsControlsResponse
describeStandardsControlsResponse_nextToken = (DescribeStandardsControlsResponse -> Maybe Text)
-> (DescribeStandardsControlsResponse
    -> Maybe Text -> DescribeStandardsControlsResponse)
-> Lens' DescribeStandardsControlsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStandardsControlsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeStandardsControlsResponse' :: DescribeStandardsControlsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeStandardsControlsResponse
s@DescribeStandardsControlsResponse' {} Maybe Text
a -> DescribeStandardsControlsResponse
s {$sel:nextToken:DescribeStandardsControlsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeStandardsControlsResponse)

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

instance
  Prelude.NFData
    DescribeStandardsControlsResponse