{-# 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.GuardDuty.GetDetector
-- 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)
--
-- Retrieves an Amazon GuardDuty detector specified by the detectorId.
module Amazonka.GuardDuty.GetDetector
  ( -- * Creating a Request
    GetDetector (..),
    newGetDetector,

    -- * Request Lenses
    getDetector_detectorId,

    -- * Destructuring the Response
    GetDetectorResponse (..),
    newGetDetectorResponse,

    -- * Response Lenses
    getDetectorResponse_createdAt,
    getDetectorResponse_findingPublishingFrequency,
    getDetectorResponse_dataSources,
    getDetectorResponse_updatedAt,
    getDetectorResponse_tags,
    getDetectorResponse_httpStatus,
    getDetectorResponse_serviceRole,
    getDetectorResponse_status,
  )
where

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

-- | /See:/ 'newGetDetector' smart constructor.
data GetDetector = GetDetector'
  { -- | The unique ID of the detector that you want to get.
    GetDetector -> Text
detectorId :: Prelude.Text
  }
  deriving (GetDetector -> GetDetector -> Bool
(GetDetector -> GetDetector -> Bool)
-> (GetDetector -> GetDetector -> Bool) -> Eq GetDetector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDetector -> GetDetector -> Bool
$c/= :: GetDetector -> GetDetector -> Bool
== :: GetDetector -> GetDetector -> Bool
$c== :: GetDetector -> GetDetector -> Bool
Prelude.Eq, ReadPrec [GetDetector]
ReadPrec GetDetector
Int -> ReadS GetDetector
ReadS [GetDetector]
(Int -> ReadS GetDetector)
-> ReadS [GetDetector]
-> ReadPrec GetDetector
-> ReadPrec [GetDetector]
-> Read GetDetector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDetector]
$creadListPrec :: ReadPrec [GetDetector]
readPrec :: ReadPrec GetDetector
$creadPrec :: ReadPrec GetDetector
readList :: ReadS [GetDetector]
$creadList :: ReadS [GetDetector]
readsPrec :: Int -> ReadS GetDetector
$creadsPrec :: Int -> ReadS GetDetector
Prelude.Read, Int -> GetDetector -> ShowS
[GetDetector] -> ShowS
GetDetector -> String
(Int -> GetDetector -> ShowS)
-> (GetDetector -> String)
-> ([GetDetector] -> ShowS)
-> Show GetDetector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDetector] -> ShowS
$cshowList :: [GetDetector] -> ShowS
show :: GetDetector -> String
$cshow :: GetDetector -> String
showsPrec :: Int -> GetDetector -> ShowS
$cshowsPrec :: Int -> GetDetector -> ShowS
Prelude.Show, (forall x. GetDetector -> Rep GetDetector x)
-> (forall x. Rep GetDetector x -> GetDetector)
-> Generic GetDetector
forall x. Rep GetDetector x -> GetDetector
forall x. GetDetector -> Rep GetDetector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDetector x -> GetDetector
$cfrom :: forall x. GetDetector -> Rep GetDetector x
Prelude.Generic)

-- |
-- Create a value of 'GetDetector' 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:
--
-- 'detectorId', 'getDetector_detectorId' - The unique ID of the detector that you want to get.
newGetDetector ::
  -- | 'detectorId'
  Prelude.Text ->
  GetDetector
newGetDetector :: Text -> GetDetector
newGetDetector Text
pDetectorId_ =
  GetDetector' :: Text -> GetDetector
GetDetector' {$sel:detectorId:GetDetector' :: Text
detectorId = Text
pDetectorId_}

-- | The unique ID of the detector that you want to get.
getDetector_detectorId :: Lens.Lens' GetDetector Prelude.Text
getDetector_detectorId :: (Text -> f Text) -> GetDetector -> f GetDetector
getDetector_detectorId = (GetDetector -> Text)
-> (GetDetector -> Text -> GetDetector)
-> Lens GetDetector GetDetector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDetector' {Text
detectorId :: Text
$sel:detectorId:GetDetector' :: GetDetector -> Text
detectorId} -> Text
detectorId) (\s :: GetDetector
s@GetDetector' {} Text
a -> GetDetector
s {$sel:detectorId:GetDetector' :: Text
detectorId = Text
a} :: GetDetector)

instance Core.AWSRequest GetDetector where
  type AWSResponse GetDetector = GetDetectorResponse
  request :: GetDetector -> Request GetDetector
request = Service -> GetDetector -> Request GetDetector
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetDetector
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDetector)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetDetector))
-> Logger
-> Service
-> Proxy GetDetector
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDetector)))
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 FindingPublishingFrequency
-> Maybe DataSourceConfigurationsResult
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> DetectorStatus
-> GetDetectorResponse
GetDetectorResponse'
            (Maybe Text
 -> Maybe FindingPublishingFrequency
 -> Maybe DataSourceConfigurationsResult
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> Text
 -> DetectorStatus
 -> GetDetectorResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe FindingPublishingFrequency
      -> Maybe DataSourceConfigurationsResult
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> Text
      -> DetectorStatus
      -> GetDetectorResponse)
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
"createdAt")
            Either
  String
  (Maybe FindingPublishingFrequency
   -> Maybe DataSourceConfigurationsResult
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> Text
   -> DetectorStatus
   -> GetDetectorResponse)
-> Either String (Maybe FindingPublishingFrequency)
-> Either
     String
     (Maybe DataSourceConfigurationsResult
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> Text
      -> DetectorStatus
      -> GetDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe FindingPublishingFrequency)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"findingPublishingFrequency")
            Either
  String
  (Maybe DataSourceConfigurationsResult
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> Text
   -> DetectorStatus
   -> GetDetectorResponse)
-> Either String (Maybe DataSourceConfigurationsResult)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> Text
      -> DetectorStatus
      -> GetDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe DataSourceConfigurationsResult)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"dataSources")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> Text
   -> DetectorStatus
   -> GetDetectorResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Int -> Text -> DetectorStatus -> GetDetectorResponse)
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
"updatedAt")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Int -> Text -> DetectorStatus -> GetDetectorResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String (Int -> Text -> DetectorStatus -> GetDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Int -> Text -> DetectorStatus -> GetDetectorResponse)
-> Either String Int
-> Either String (Text -> DetectorStatus -> GetDetectorResponse)
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))
            Either String (Text -> DetectorStatus -> GetDetectorResponse)
-> Either String Text
-> Either String (DetectorStatus -> GetDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"serviceRole")
            Either String (DetectorStatus -> GetDetectorResponse)
-> Either String DetectorStatus
-> Either String GetDetectorResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DetectorStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"status")
      )

instance Prelude.Hashable GetDetector

instance Prelude.NFData GetDetector

instance Core.ToHeaders GetDetector where
  toHeaders :: GetDetector -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetDetector -> 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 GetDetector where
  toPath :: GetDetector -> ByteString
toPath GetDetector' {Text
detectorId :: Text
$sel:detectorId:GetDetector' :: GetDetector -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/detector/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
detectorId]

instance Core.ToQuery GetDetector where
  toQuery :: GetDetector -> QueryString
toQuery = QueryString -> GetDetector -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetDetectorResponse' smart constructor.
data GetDetectorResponse = GetDetectorResponse'
  { -- | The timestamp of when the detector was created.
    GetDetectorResponse -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text,
    -- | The publishing frequency of the finding.
    GetDetectorResponse -> Maybe FindingPublishingFrequency
findingPublishingFrequency :: Prelude.Maybe FindingPublishingFrequency,
    -- | Describes which data sources are enabled for the detector.
    GetDetectorResponse -> Maybe DataSourceConfigurationsResult
dataSources :: Prelude.Maybe DataSourceConfigurationsResult,
    -- | The last-updated timestamp for the detector.
    GetDetectorResponse -> Maybe Text
updatedAt :: Prelude.Maybe Prelude.Text,
    -- | The tags of the detector resource.
    GetDetectorResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    GetDetectorResponse -> Int
httpStatus :: Prelude.Int,
    -- | The GuardDuty service role.
    GetDetectorResponse -> Text
serviceRole :: Prelude.Text,
    -- | The detector status.
    GetDetectorResponse -> DetectorStatus
status :: DetectorStatus
  }
  deriving (GetDetectorResponse -> GetDetectorResponse -> Bool
(GetDetectorResponse -> GetDetectorResponse -> Bool)
-> (GetDetectorResponse -> GetDetectorResponse -> Bool)
-> Eq GetDetectorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDetectorResponse -> GetDetectorResponse -> Bool
$c/= :: GetDetectorResponse -> GetDetectorResponse -> Bool
== :: GetDetectorResponse -> GetDetectorResponse -> Bool
$c== :: GetDetectorResponse -> GetDetectorResponse -> Bool
Prelude.Eq, ReadPrec [GetDetectorResponse]
ReadPrec GetDetectorResponse
Int -> ReadS GetDetectorResponse
ReadS [GetDetectorResponse]
(Int -> ReadS GetDetectorResponse)
-> ReadS [GetDetectorResponse]
-> ReadPrec GetDetectorResponse
-> ReadPrec [GetDetectorResponse]
-> Read GetDetectorResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDetectorResponse]
$creadListPrec :: ReadPrec [GetDetectorResponse]
readPrec :: ReadPrec GetDetectorResponse
$creadPrec :: ReadPrec GetDetectorResponse
readList :: ReadS [GetDetectorResponse]
$creadList :: ReadS [GetDetectorResponse]
readsPrec :: Int -> ReadS GetDetectorResponse
$creadsPrec :: Int -> ReadS GetDetectorResponse
Prelude.Read, Int -> GetDetectorResponse -> ShowS
[GetDetectorResponse] -> ShowS
GetDetectorResponse -> String
(Int -> GetDetectorResponse -> ShowS)
-> (GetDetectorResponse -> String)
-> ([GetDetectorResponse] -> ShowS)
-> Show GetDetectorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDetectorResponse] -> ShowS
$cshowList :: [GetDetectorResponse] -> ShowS
show :: GetDetectorResponse -> String
$cshow :: GetDetectorResponse -> String
showsPrec :: Int -> GetDetectorResponse -> ShowS
$cshowsPrec :: Int -> GetDetectorResponse -> ShowS
Prelude.Show, (forall x. GetDetectorResponse -> Rep GetDetectorResponse x)
-> (forall x. Rep GetDetectorResponse x -> GetDetectorResponse)
-> Generic GetDetectorResponse
forall x. Rep GetDetectorResponse x -> GetDetectorResponse
forall x. GetDetectorResponse -> Rep GetDetectorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDetectorResponse x -> GetDetectorResponse
$cfrom :: forall x. GetDetectorResponse -> Rep GetDetectorResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDetectorResponse' 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:
--
-- 'createdAt', 'getDetectorResponse_createdAt' - The timestamp of when the detector was created.
--
-- 'findingPublishingFrequency', 'getDetectorResponse_findingPublishingFrequency' - The publishing frequency of the finding.
--
-- 'dataSources', 'getDetectorResponse_dataSources' - Describes which data sources are enabled for the detector.
--
-- 'updatedAt', 'getDetectorResponse_updatedAt' - The last-updated timestamp for the detector.
--
-- 'tags', 'getDetectorResponse_tags' - The tags of the detector resource.
--
-- 'httpStatus', 'getDetectorResponse_httpStatus' - The response's http status code.
--
-- 'serviceRole', 'getDetectorResponse_serviceRole' - The GuardDuty service role.
--
-- 'status', 'getDetectorResponse_status' - The detector status.
newGetDetectorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'serviceRole'
  Prelude.Text ->
  -- | 'status'
  DetectorStatus ->
  GetDetectorResponse
newGetDetectorResponse :: Int -> Text -> DetectorStatus -> GetDetectorResponse
newGetDetectorResponse
  Int
pHttpStatus_
  Text
pServiceRole_
  DetectorStatus
pStatus_ =
    GetDetectorResponse' :: Maybe Text
-> Maybe FindingPublishingFrequency
-> Maybe DataSourceConfigurationsResult
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> DetectorStatus
-> GetDetectorResponse
GetDetectorResponse'
      { $sel:createdAt:GetDetectorResponse' :: Maybe Text
createdAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:findingPublishingFrequency:GetDetectorResponse' :: Maybe FindingPublishingFrequency
findingPublishingFrequency = Maybe FindingPublishingFrequency
forall a. Maybe a
Prelude.Nothing,
        $sel:dataSources:GetDetectorResponse' :: Maybe DataSourceConfigurationsResult
dataSources = Maybe DataSourceConfigurationsResult
forall a. Maybe a
Prelude.Nothing,
        $sel:updatedAt:GetDetectorResponse' :: Maybe Text
updatedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:GetDetectorResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetDetectorResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:serviceRole:GetDetectorResponse' :: Text
serviceRole = Text
pServiceRole_,
        $sel:status:GetDetectorResponse' :: DetectorStatus
status = DetectorStatus
pStatus_
      }

-- | The timestamp of when the detector was created.
getDetectorResponse_createdAt :: Lens.Lens' GetDetectorResponse (Prelude.Maybe Prelude.Text)
getDetectorResponse_createdAt :: (Maybe Text -> f (Maybe Text))
-> GetDetectorResponse -> f GetDetectorResponse
getDetectorResponse_createdAt = (GetDetectorResponse -> Maybe Text)
-> (GetDetectorResponse -> Maybe Text -> GetDetectorResponse)
-> Lens
     GetDetectorResponse GetDetectorResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDetectorResponse' {Maybe Text
createdAt :: Maybe Text
$sel:createdAt:GetDetectorResponse' :: GetDetectorResponse -> Maybe Text
createdAt} -> Maybe Text
createdAt) (\s :: GetDetectorResponse
s@GetDetectorResponse' {} Maybe Text
a -> GetDetectorResponse
s {$sel:createdAt:GetDetectorResponse' :: Maybe Text
createdAt = Maybe Text
a} :: GetDetectorResponse)

-- | The publishing frequency of the finding.
getDetectorResponse_findingPublishingFrequency :: Lens.Lens' GetDetectorResponse (Prelude.Maybe FindingPublishingFrequency)
getDetectorResponse_findingPublishingFrequency :: (Maybe FindingPublishingFrequency
 -> f (Maybe FindingPublishingFrequency))
-> GetDetectorResponse -> f GetDetectorResponse
getDetectorResponse_findingPublishingFrequency = (GetDetectorResponse -> Maybe FindingPublishingFrequency)
-> (GetDetectorResponse
    -> Maybe FindingPublishingFrequency -> GetDetectorResponse)
-> Lens
     GetDetectorResponse
     GetDetectorResponse
     (Maybe FindingPublishingFrequency)
     (Maybe FindingPublishingFrequency)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDetectorResponse' {Maybe FindingPublishingFrequency
findingPublishingFrequency :: Maybe FindingPublishingFrequency
$sel:findingPublishingFrequency:GetDetectorResponse' :: GetDetectorResponse -> Maybe FindingPublishingFrequency
findingPublishingFrequency} -> Maybe FindingPublishingFrequency
findingPublishingFrequency) (\s :: GetDetectorResponse
s@GetDetectorResponse' {} Maybe FindingPublishingFrequency
a -> GetDetectorResponse
s {$sel:findingPublishingFrequency:GetDetectorResponse' :: Maybe FindingPublishingFrequency
findingPublishingFrequency = Maybe FindingPublishingFrequency
a} :: GetDetectorResponse)

-- | Describes which data sources are enabled for the detector.
getDetectorResponse_dataSources :: Lens.Lens' GetDetectorResponse (Prelude.Maybe DataSourceConfigurationsResult)
getDetectorResponse_dataSources :: (Maybe DataSourceConfigurationsResult
 -> f (Maybe DataSourceConfigurationsResult))
-> GetDetectorResponse -> f GetDetectorResponse
getDetectorResponse_dataSources = (GetDetectorResponse -> Maybe DataSourceConfigurationsResult)
-> (GetDetectorResponse
    -> Maybe DataSourceConfigurationsResult -> GetDetectorResponse)
-> Lens
     GetDetectorResponse
     GetDetectorResponse
     (Maybe DataSourceConfigurationsResult)
     (Maybe DataSourceConfigurationsResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDetectorResponse' {Maybe DataSourceConfigurationsResult
dataSources :: Maybe DataSourceConfigurationsResult
$sel:dataSources:GetDetectorResponse' :: GetDetectorResponse -> Maybe DataSourceConfigurationsResult
dataSources} -> Maybe DataSourceConfigurationsResult
dataSources) (\s :: GetDetectorResponse
s@GetDetectorResponse' {} Maybe DataSourceConfigurationsResult
a -> GetDetectorResponse
s {$sel:dataSources:GetDetectorResponse' :: Maybe DataSourceConfigurationsResult
dataSources = Maybe DataSourceConfigurationsResult
a} :: GetDetectorResponse)

-- | The last-updated timestamp for the detector.
getDetectorResponse_updatedAt :: Lens.Lens' GetDetectorResponse (Prelude.Maybe Prelude.Text)
getDetectorResponse_updatedAt :: (Maybe Text -> f (Maybe Text))
-> GetDetectorResponse -> f GetDetectorResponse
getDetectorResponse_updatedAt = (GetDetectorResponse -> Maybe Text)
-> (GetDetectorResponse -> Maybe Text -> GetDetectorResponse)
-> Lens
     GetDetectorResponse GetDetectorResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDetectorResponse' {Maybe Text
updatedAt :: Maybe Text
$sel:updatedAt:GetDetectorResponse' :: GetDetectorResponse -> Maybe Text
updatedAt} -> Maybe Text
updatedAt) (\s :: GetDetectorResponse
s@GetDetectorResponse' {} Maybe Text
a -> GetDetectorResponse
s {$sel:updatedAt:GetDetectorResponse' :: Maybe Text
updatedAt = Maybe Text
a} :: GetDetectorResponse)

-- | The tags of the detector resource.
getDetectorResponse_tags :: Lens.Lens' GetDetectorResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getDetectorResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetDetectorResponse -> f GetDetectorResponse
getDetectorResponse_tags = (GetDetectorResponse -> Maybe (HashMap Text Text))
-> (GetDetectorResponse
    -> Maybe (HashMap Text Text) -> GetDetectorResponse)
-> Lens
     GetDetectorResponse
     GetDetectorResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDetectorResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GetDetectorResponse' :: GetDetectorResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GetDetectorResponse
s@GetDetectorResponse' {} Maybe (HashMap Text Text)
a -> GetDetectorResponse
s {$sel:tags:GetDetectorResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GetDetectorResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetDetectorResponse -> f GetDetectorResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetDetectorResponse
-> f GetDetectorResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The GuardDuty service role.
getDetectorResponse_serviceRole :: Lens.Lens' GetDetectorResponse Prelude.Text
getDetectorResponse_serviceRole :: (Text -> f Text) -> GetDetectorResponse -> f GetDetectorResponse
getDetectorResponse_serviceRole = (GetDetectorResponse -> Text)
-> (GetDetectorResponse -> Text -> GetDetectorResponse)
-> Lens GetDetectorResponse GetDetectorResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDetectorResponse' {Text
serviceRole :: Text
$sel:serviceRole:GetDetectorResponse' :: GetDetectorResponse -> Text
serviceRole} -> Text
serviceRole) (\s :: GetDetectorResponse
s@GetDetectorResponse' {} Text
a -> GetDetectorResponse
s {$sel:serviceRole:GetDetectorResponse' :: Text
serviceRole = Text
a} :: GetDetectorResponse)

-- | The detector status.
getDetectorResponse_status :: Lens.Lens' GetDetectorResponse DetectorStatus
getDetectorResponse_status :: (DetectorStatus -> f DetectorStatus)
-> GetDetectorResponse -> f GetDetectorResponse
getDetectorResponse_status = (GetDetectorResponse -> DetectorStatus)
-> (GetDetectorResponse -> DetectorStatus -> GetDetectorResponse)
-> Lens
     GetDetectorResponse
     GetDetectorResponse
     DetectorStatus
     DetectorStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDetectorResponse' {DetectorStatus
status :: DetectorStatus
$sel:status:GetDetectorResponse' :: GetDetectorResponse -> DetectorStatus
status} -> DetectorStatus
status) (\s :: GetDetectorResponse
s@GetDetectorResponse' {} DetectorStatus
a -> GetDetectorResponse
s {$sel:status:GetDetectorResponse' :: DetectorStatus
status = DetectorStatus
a} :: GetDetectorResponse)

instance Prelude.NFData GetDetectorResponse