{-# 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.WorkLink.DescribeAuditStreamConfiguration
-- 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)
--
-- Describes the configuration for delivering audit streams to the customer
-- account.
module Amazonka.WorkLink.DescribeAuditStreamConfiguration
  ( -- * Creating a Request
    DescribeAuditStreamConfiguration (..),
    newDescribeAuditStreamConfiguration,

    -- * Request Lenses
    describeAuditStreamConfiguration_fleetArn,

    -- * Destructuring the Response
    DescribeAuditStreamConfigurationResponse (..),
    newDescribeAuditStreamConfigurationResponse,

    -- * Response Lenses
    describeAuditStreamConfigurationResponse_auditStreamArn,
    describeAuditStreamConfigurationResponse_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.WorkLink.Types

-- | /See:/ 'newDescribeAuditStreamConfiguration' smart constructor.
data DescribeAuditStreamConfiguration = DescribeAuditStreamConfiguration'
  { -- | The ARN of the fleet.
    DescribeAuditStreamConfiguration -> Text
fleetArn :: Prelude.Text
  }
  deriving (DescribeAuditStreamConfiguration
-> DescribeAuditStreamConfiguration -> Bool
(DescribeAuditStreamConfiguration
 -> DescribeAuditStreamConfiguration -> Bool)
-> (DescribeAuditStreamConfiguration
    -> DescribeAuditStreamConfiguration -> Bool)
-> Eq DescribeAuditStreamConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAuditStreamConfiguration
-> DescribeAuditStreamConfiguration -> Bool
$c/= :: DescribeAuditStreamConfiguration
-> DescribeAuditStreamConfiguration -> Bool
== :: DescribeAuditStreamConfiguration
-> DescribeAuditStreamConfiguration -> Bool
$c== :: DescribeAuditStreamConfiguration
-> DescribeAuditStreamConfiguration -> Bool
Prelude.Eq, ReadPrec [DescribeAuditStreamConfiguration]
ReadPrec DescribeAuditStreamConfiguration
Int -> ReadS DescribeAuditStreamConfiguration
ReadS [DescribeAuditStreamConfiguration]
(Int -> ReadS DescribeAuditStreamConfiguration)
-> ReadS [DescribeAuditStreamConfiguration]
-> ReadPrec DescribeAuditStreamConfiguration
-> ReadPrec [DescribeAuditStreamConfiguration]
-> Read DescribeAuditStreamConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAuditStreamConfiguration]
$creadListPrec :: ReadPrec [DescribeAuditStreamConfiguration]
readPrec :: ReadPrec DescribeAuditStreamConfiguration
$creadPrec :: ReadPrec DescribeAuditStreamConfiguration
readList :: ReadS [DescribeAuditStreamConfiguration]
$creadList :: ReadS [DescribeAuditStreamConfiguration]
readsPrec :: Int -> ReadS DescribeAuditStreamConfiguration
$creadsPrec :: Int -> ReadS DescribeAuditStreamConfiguration
Prelude.Read, Int -> DescribeAuditStreamConfiguration -> ShowS
[DescribeAuditStreamConfiguration] -> ShowS
DescribeAuditStreamConfiguration -> String
(Int -> DescribeAuditStreamConfiguration -> ShowS)
-> (DescribeAuditStreamConfiguration -> String)
-> ([DescribeAuditStreamConfiguration] -> ShowS)
-> Show DescribeAuditStreamConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAuditStreamConfiguration] -> ShowS
$cshowList :: [DescribeAuditStreamConfiguration] -> ShowS
show :: DescribeAuditStreamConfiguration -> String
$cshow :: DescribeAuditStreamConfiguration -> String
showsPrec :: Int -> DescribeAuditStreamConfiguration -> ShowS
$cshowsPrec :: Int -> DescribeAuditStreamConfiguration -> ShowS
Prelude.Show, (forall x.
 DescribeAuditStreamConfiguration
 -> Rep DescribeAuditStreamConfiguration x)
-> (forall x.
    Rep DescribeAuditStreamConfiguration x
    -> DescribeAuditStreamConfiguration)
-> Generic DescribeAuditStreamConfiguration
forall x.
Rep DescribeAuditStreamConfiguration x
-> DescribeAuditStreamConfiguration
forall x.
DescribeAuditStreamConfiguration
-> Rep DescribeAuditStreamConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAuditStreamConfiguration x
-> DescribeAuditStreamConfiguration
$cfrom :: forall x.
DescribeAuditStreamConfiguration
-> Rep DescribeAuditStreamConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAuditStreamConfiguration' 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:
--
-- 'fleetArn', 'describeAuditStreamConfiguration_fleetArn' - The ARN of the fleet.
newDescribeAuditStreamConfiguration ::
  -- | 'fleetArn'
  Prelude.Text ->
  DescribeAuditStreamConfiguration
newDescribeAuditStreamConfiguration :: Text -> DescribeAuditStreamConfiguration
newDescribeAuditStreamConfiguration Text
pFleetArn_ =
  DescribeAuditStreamConfiguration' :: Text -> DescribeAuditStreamConfiguration
DescribeAuditStreamConfiguration'
    { $sel:fleetArn:DescribeAuditStreamConfiguration' :: Text
fleetArn =
        Text
pFleetArn_
    }

-- | The ARN of the fleet.
describeAuditStreamConfiguration_fleetArn :: Lens.Lens' DescribeAuditStreamConfiguration Prelude.Text
describeAuditStreamConfiguration_fleetArn :: (Text -> f Text)
-> DescribeAuditStreamConfiguration
-> f DescribeAuditStreamConfiguration
describeAuditStreamConfiguration_fleetArn = (DescribeAuditStreamConfiguration -> Text)
-> (DescribeAuditStreamConfiguration
    -> Text -> DescribeAuditStreamConfiguration)
-> Lens
     DescribeAuditStreamConfiguration
     DescribeAuditStreamConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditStreamConfiguration' {Text
fleetArn :: Text
$sel:fleetArn:DescribeAuditStreamConfiguration' :: DescribeAuditStreamConfiguration -> Text
fleetArn} -> Text
fleetArn) (\s :: DescribeAuditStreamConfiguration
s@DescribeAuditStreamConfiguration' {} Text
a -> DescribeAuditStreamConfiguration
s {$sel:fleetArn:DescribeAuditStreamConfiguration' :: Text
fleetArn = Text
a} :: DescribeAuditStreamConfiguration)

instance
  Core.AWSRequest
    DescribeAuditStreamConfiguration
  where
  type
    AWSResponse DescribeAuditStreamConfiguration =
      DescribeAuditStreamConfigurationResponse
  request :: DescribeAuditStreamConfiguration
-> Request DescribeAuditStreamConfiguration
request = Service
-> DescribeAuditStreamConfiguration
-> Request DescribeAuditStreamConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAuditStreamConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeAuditStreamConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeAuditStreamConfiguration))
-> Logger
-> Service
-> Proxy DescribeAuditStreamConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeAuditStreamConfiguration)))
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 -> Int -> DescribeAuditStreamConfigurationResponse
DescribeAuditStreamConfigurationResponse'
            (Maybe Text -> Int -> DescribeAuditStreamConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeAuditStreamConfigurationResponse)
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
"AuditStreamArn")
            Either String (Int -> DescribeAuditStreamConfigurationResponse)
-> Either String Int
-> Either String DescribeAuditStreamConfigurationResponse
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
    DescribeAuditStreamConfiguration

instance
  Prelude.NFData
    DescribeAuditStreamConfiguration

instance
  Core.ToHeaders
    DescribeAuditStreamConfiguration
  where
  toHeaders :: DescribeAuditStreamConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DescribeAuditStreamConfiguration -> 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.ToJSON DescribeAuditStreamConfiguration where
  toJSON :: DescribeAuditStreamConfiguration -> Value
toJSON DescribeAuditStreamConfiguration' {Text
fleetArn :: Text
$sel:fleetArn:DescribeAuditStreamConfiguration' :: DescribeAuditStreamConfiguration -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetArn)]
      )

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

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

-- | /See:/ 'newDescribeAuditStreamConfigurationResponse' smart constructor.
data DescribeAuditStreamConfigurationResponse = DescribeAuditStreamConfigurationResponse'
  { -- | The ARN of the Amazon Kinesis data stream that will receive the audit
    -- events.
    DescribeAuditStreamConfigurationResponse -> Maybe Text
auditStreamArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeAuditStreamConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAuditStreamConfigurationResponse
-> DescribeAuditStreamConfigurationResponse -> Bool
(DescribeAuditStreamConfigurationResponse
 -> DescribeAuditStreamConfigurationResponse -> Bool)
-> (DescribeAuditStreamConfigurationResponse
    -> DescribeAuditStreamConfigurationResponse -> Bool)
-> Eq DescribeAuditStreamConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAuditStreamConfigurationResponse
-> DescribeAuditStreamConfigurationResponse -> Bool
$c/= :: DescribeAuditStreamConfigurationResponse
-> DescribeAuditStreamConfigurationResponse -> Bool
== :: DescribeAuditStreamConfigurationResponse
-> DescribeAuditStreamConfigurationResponse -> Bool
$c== :: DescribeAuditStreamConfigurationResponse
-> DescribeAuditStreamConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAuditStreamConfigurationResponse]
ReadPrec DescribeAuditStreamConfigurationResponse
Int -> ReadS DescribeAuditStreamConfigurationResponse
ReadS [DescribeAuditStreamConfigurationResponse]
(Int -> ReadS DescribeAuditStreamConfigurationResponse)
-> ReadS [DescribeAuditStreamConfigurationResponse]
-> ReadPrec DescribeAuditStreamConfigurationResponse
-> ReadPrec [DescribeAuditStreamConfigurationResponse]
-> Read DescribeAuditStreamConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAuditStreamConfigurationResponse]
$creadListPrec :: ReadPrec [DescribeAuditStreamConfigurationResponse]
readPrec :: ReadPrec DescribeAuditStreamConfigurationResponse
$creadPrec :: ReadPrec DescribeAuditStreamConfigurationResponse
readList :: ReadS [DescribeAuditStreamConfigurationResponse]
$creadList :: ReadS [DescribeAuditStreamConfigurationResponse]
readsPrec :: Int -> ReadS DescribeAuditStreamConfigurationResponse
$creadsPrec :: Int -> ReadS DescribeAuditStreamConfigurationResponse
Prelude.Read, Int -> DescribeAuditStreamConfigurationResponse -> ShowS
[DescribeAuditStreamConfigurationResponse] -> ShowS
DescribeAuditStreamConfigurationResponse -> String
(Int -> DescribeAuditStreamConfigurationResponse -> ShowS)
-> (DescribeAuditStreamConfigurationResponse -> String)
-> ([DescribeAuditStreamConfigurationResponse] -> ShowS)
-> Show DescribeAuditStreamConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAuditStreamConfigurationResponse] -> ShowS
$cshowList :: [DescribeAuditStreamConfigurationResponse] -> ShowS
show :: DescribeAuditStreamConfigurationResponse -> String
$cshow :: DescribeAuditStreamConfigurationResponse -> String
showsPrec :: Int -> DescribeAuditStreamConfigurationResponse -> ShowS
$cshowsPrec :: Int -> DescribeAuditStreamConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 DescribeAuditStreamConfigurationResponse
 -> Rep DescribeAuditStreamConfigurationResponse x)
-> (forall x.
    Rep DescribeAuditStreamConfigurationResponse x
    -> DescribeAuditStreamConfigurationResponse)
-> Generic DescribeAuditStreamConfigurationResponse
forall x.
Rep DescribeAuditStreamConfigurationResponse x
-> DescribeAuditStreamConfigurationResponse
forall x.
DescribeAuditStreamConfigurationResponse
-> Rep DescribeAuditStreamConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAuditStreamConfigurationResponse x
-> DescribeAuditStreamConfigurationResponse
$cfrom :: forall x.
DescribeAuditStreamConfigurationResponse
-> Rep DescribeAuditStreamConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAuditStreamConfigurationResponse' 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:
--
-- 'auditStreamArn', 'describeAuditStreamConfigurationResponse_auditStreamArn' - The ARN of the Amazon Kinesis data stream that will receive the audit
-- events.
--
-- 'httpStatus', 'describeAuditStreamConfigurationResponse_httpStatus' - The response's http status code.
newDescribeAuditStreamConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAuditStreamConfigurationResponse
newDescribeAuditStreamConfigurationResponse :: Int -> DescribeAuditStreamConfigurationResponse
newDescribeAuditStreamConfigurationResponse
  Int
pHttpStatus_ =
    DescribeAuditStreamConfigurationResponse' :: Maybe Text -> Int -> DescribeAuditStreamConfigurationResponse
DescribeAuditStreamConfigurationResponse'
      { $sel:auditStreamArn:DescribeAuditStreamConfigurationResponse' :: Maybe Text
auditStreamArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeAuditStreamConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The ARN of the Amazon Kinesis data stream that will receive the audit
-- events.
describeAuditStreamConfigurationResponse_auditStreamArn :: Lens.Lens' DescribeAuditStreamConfigurationResponse (Prelude.Maybe Prelude.Text)
describeAuditStreamConfigurationResponse_auditStreamArn :: (Maybe Text -> f (Maybe Text))
-> DescribeAuditStreamConfigurationResponse
-> f DescribeAuditStreamConfigurationResponse
describeAuditStreamConfigurationResponse_auditStreamArn = (DescribeAuditStreamConfigurationResponse -> Maybe Text)
-> (DescribeAuditStreamConfigurationResponse
    -> Maybe Text -> DescribeAuditStreamConfigurationResponse)
-> Lens
     DescribeAuditStreamConfigurationResponse
     DescribeAuditStreamConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditStreamConfigurationResponse' {Maybe Text
auditStreamArn :: Maybe Text
$sel:auditStreamArn:DescribeAuditStreamConfigurationResponse' :: DescribeAuditStreamConfigurationResponse -> Maybe Text
auditStreamArn} -> Maybe Text
auditStreamArn) (\s :: DescribeAuditStreamConfigurationResponse
s@DescribeAuditStreamConfigurationResponse' {} Maybe Text
a -> DescribeAuditStreamConfigurationResponse
s {$sel:auditStreamArn:DescribeAuditStreamConfigurationResponse' :: Maybe Text
auditStreamArn = Maybe Text
a} :: DescribeAuditStreamConfigurationResponse)

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

instance
  Prelude.NFData
    DescribeAuditStreamConfigurationResponse