{-# 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.DataSync.DescribeAgent
-- 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 metadata such as the name, the network interfaces, and the
-- status (that is, whether the agent is running or not) for an agent. To
-- specify which agent to describe, use the Amazon Resource Name (ARN) of
-- the agent in your request.
module Amazonka.DataSync.DescribeAgent
  ( -- * Creating a Request
    DescribeAgent (..),
    newDescribeAgent,

    -- * Request Lenses
    describeAgent_agentArn,

    -- * Destructuring the Response
    DescribeAgentResponse (..),
    newDescribeAgentResponse,

    -- * Response Lenses
    describeAgentResponse_creationTime,
    describeAgentResponse_status,
    describeAgentResponse_privateLinkConfig,
    describeAgentResponse_endpointType,
    describeAgentResponse_lastConnectionTime,
    describeAgentResponse_agentArn,
    describeAgentResponse_name,
    describeAgentResponse_httpStatus,
  )
where

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

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

-- |
-- Create a value of 'DescribeAgent' 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:
--
-- 'agentArn', 'describeAgent_agentArn' - The Amazon Resource Name (ARN) of the agent to describe.
newDescribeAgent ::
  -- | 'agentArn'
  Prelude.Text ->
  DescribeAgent
newDescribeAgent :: Text -> DescribeAgent
newDescribeAgent Text
pAgentArn_ =
  DescribeAgent' :: Text -> DescribeAgent
DescribeAgent' {$sel:agentArn:DescribeAgent' :: Text
agentArn = Text
pAgentArn_}

-- | The Amazon Resource Name (ARN) of the agent to describe.
describeAgent_agentArn :: Lens.Lens' DescribeAgent Prelude.Text
describeAgent_agentArn :: (Text -> f Text) -> DescribeAgent -> f DescribeAgent
describeAgent_agentArn = (DescribeAgent -> Text)
-> (DescribeAgent -> Text -> DescribeAgent)
-> Lens DescribeAgent DescribeAgent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAgent' {Text
agentArn :: Text
$sel:agentArn:DescribeAgent' :: DescribeAgent -> Text
agentArn} -> Text
agentArn) (\s :: DescribeAgent
s@DescribeAgent' {} Text
a -> DescribeAgent
s {$sel:agentArn:DescribeAgent' :: Text
agentArn = Text
a} :: DescribeAgent)

instance Core.AWSRequest DescribeAgent where
  type
    AWSResponse DescribeAgent =
      DescribeAgentResponse
  request :: DescribeAgent -> Request DescribeAgent
request = Service -> DescribeAgent -> Request DescribeAgent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAgent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeAgent)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeAgent))
-> Logger
-> Service
-> Proxy DescribeAgent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeAgent)))
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 POSIX
-> Maybe AgentStatus
-> Maybe PrivateLinkConfig
-> Maybe EndpointType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeAgentResponse
DescribeAgentResponse'
            (Maybe POSIX
 -> Maybe AgentStatus
 -> Maybe PrivateLinkConfig
 -> Maybe EndpointType
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> DescribeAgentResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe AgentStatus
      -> Maybe PrivateLinkConfig
      -> Maybe EndpointType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAgentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe AgentStatus
   -> Maybe PrivateLinkConfig
   -> Maybe EndpointType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAgentResponse)
-> Either String (Maybe AgentStatus)
-> Either
     String
     (Maybe PrivateLinkConfig
      -> Maybe EndpointType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAgentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AgentStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe PrivateLinkConfig
   -> Maybe EndpointType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAgentResponse)
-> Either String (Maybe PrivateLinkConfig)
-> Either
     String
     (Maybe EndpointType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAgentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe PrivateLinkConfig)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PrivateLinkConfig")
            Either
  String
  (Maybe EndpointType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAgentResponse)
-> Either String (Maybe EndpointType)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> Int -> DescribeAgentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe EndpointType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EndpointType")
            Either
  String
  (Maybe POSIX
   -> Maybe Text -> Maybe Text -> Int -> DescribeAgentResponse)
-> Either String (Maybe POSIX)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> DescribeAgentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastConnectionTime")
            Either
  String (Maybe Text -> Maybe Text -> Int -> DescribeAgentResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DescribeAgentResponse)
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
"AgentArn")
            Either String (Maybe Text -> Int -> DescribeAgentResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeAgentResponse)
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
"Name")
            Either String (Int -> DescribeAgentResponse)
-> Either String Int -> Either String DescribeAgentResponse
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 DescribeAgent

instance Prelude.NFData DescribeAgent

instance Core.ToHeaders DescribeAgent where
  toHeaders :: DescribeAgent -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeAgent -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"FmrsService.DescribeAgent" :: Prelude.ByteString),
            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 DescribeAgent where
  toJSON :: DescribeAgent -> Value
toJSON DescribeAgent' {Text
agentArn :: Text
$sel:agentArn:DescribeAgent' :: DescribeAgent -> 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
"AgentArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
agentArn)]
      )

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

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

-- | DescribeAgentResponse
--
-- /See:/ 'newDescribeAgentResponse' smart constructor.
data DescribeAgentResponse = DescribeAgentResponse'
  { -- | The time that the agent was activated (that is, created in your
    -- account).
    DescribeAgentResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the agent. If the status is ONLINE, then the agent is
    -- configured properly and is available to use. The Running status is the
    -- normal running status for an agent. If the status is OFFLINE, the
    -- agent\'s VM is turned off or the agent is in an unhealthy state. When
    -- the issue that caused the unhealthy state is resolved, the agent returns
    -- to ONLINE status.
    DescribeAgentResponse -> Maybe AgentStatus
status :: Prelude.Maybe AgentStatus,
    -- | The subnet and the security group that DataSync used to access a VPC
    -- endpoint.
    DescribeAgentResponse -> Maybe PrivateLinkConfig
privateLinkConfig :: Prelude.Maybe PrivateLinkConfig,
    -- | The type of endpoint that your agent is connected to. If the endpoint is
    -- a VPC endpoint, the agent is not accessible over the public internet.
    DescribeAgentResponse -> Maybe EndpointType
endpointType :: Prelude.Maybe EndpointType,
    -- | The time that the agent last connected to DataSync.
    DescribeAgentResponse -> Maybe POSIX
lastConnectionTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the agent.
    DescribeAgentResponse -> Maybe Text
agentArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the agent.
    DescribeAgentResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeAgentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAgentResponse -> DescribeAgentResponse -> Bool
(DescribeAgentResponse -> DescribeAgentResponse -> Bool)
-> (DescribeAgentResponse -> DescribeAgentResponse -> Bool)
-> Eq DescribeAgentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAgentResponse -> DescribeAgentResponse -> Bool
$c/= :: DescribeAgentResponse -> DescribeAgentResponse -> Bool
== :: DescribeAgentResponse -> DescribeAgentResponse -> Bool
$c== :: DescribeAgentResponse -> DescribeAgentResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAgentResponse]
ReadPrec DescribeAgentResponse
Int -> ReadS DescribeAgentResponse
ReadS [DescribeAgentResponse]
(Int -> ReadS DescribeAgentResponse)
-> ReadS [DescribeAgentResponse]
-> ReadPrec DescribeAgentResponse
-> ReadPrec [DescribeAgentResponse]
-> Read DescribeAgentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAgentResponse]
$creadListPrec :: ReadPrec [DescribeAgentResponse]
readPrec :: ReadPrec DescribeAgentResponse
$creadPrec :: ReadPrec DescribeAgentResponse
readList :: ReadS [DescribeAgentResponse]
$creadList :: ReadS [DescribeAgentResponse]
readsPrec :: Int -> ReadS DescribeAgentResponse
$creadsPrec :: Int -> ReadS DescribeAgentResponse
Prelude.Read, Int -> DescribeAgentResponse -> ShowS
[DescribeAgentResponse] -> ShowS
DescribeAgentResponse -> String
(Int -> DescribeAgentResponse -> ShowS)
-> (DescribeAgentResponse -> String)
-> ([DescribeAgentResponse] -> ShowS)
-> Show DescribeAgentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAgentResponse] -> ShowS
$cshowList :: [DescribeAgentResponse] -> ShowS
show :: DescribeAgentResponse -> String
$cshow :: DescribeAgentResponse -> String
showsPrec :: Int -> DescribeAgentResponse -> ShowS
$cshowsPrec :: Int -> DescribeAgentResponse -> ShowS
Prelude.Show, (forall x. DescribeAgentResponse -> Rep DescribeAgentResponse x)
-> (forall x. Rep DescribeAgentResponse x -> DescribeAgentResponse)
-> Generic DescribeAgentResponse
forall x. Rep DescribeAgentResponse x -> DescribeAgentResponse
forall x. DescribeAgentResponse -> Rep DescribeAgentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAgentResponse x -> DescribeAgentResponse
$cfrom :: forall x. DescribeAgentResponse -> Rep DescribeAgentResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAgentResponse' 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:
--
-- 'creationTime', 'describeAgentResponse_creationTime' - The time that the agent was activated (that is, created in your
-- account).
--
-- 'status', 'describeAgentResponse_status' - The status of the agent. If the status is ONLINE, then the agent is
-- configured properly and is available to use. The Running status is the
-- normal running status for an agent. If the status is OFFLINE, the
-- agent\'s VM is turned off or the agent is in an unhealthy state. When
-- the issue that caused the unhealthy state is resolved, the agent returns
-- to ONLINE status.
--
-- 'privateLinkConfig', 'describeAgentResponse_privateLinkConfig' - The subnet and the security group that DataSync used to access a VPC
-- endpoint.
--
-- 'endpointType', 'describeAgentResponse_endpointType' - The type of endpoint that your agent is connected to. If the endpoint is
-- a VPC endpoint, the agent is not accessible over the public internet.
--
-- 'lastConnectionTime', 'describeAgentResponse_lastConnectionTime' - The time that the agent last connected to DataSync.
--
-- 'agentArn', 'describeAgentResponse_agentArn' - The Amazon Resource Name (ARN) of the agent.
--
-- 'name', 'describeAgentResponse_name' - The name of the agent.
--
-- 'httpStatus', 'describeAgentResponse_httpStatus' - The response's http status code.
newDescribeAgentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAgentResponse
newDescribeAgentResponse :: Int -> DescribeAgentResponse
newDescribeAgentResponse Int
pHttpStatus_ =
  DescribeAgentResponse' :: Maybe POSIX
-> Maybe AgentStatus
-> Maybe PrivateLinkConfig
-> Maybe EndpointType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeAgentResponse
DescribeAgentResponse'
    { $sel:creationTime:DescribeAgentResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeAgentResponse' :: Maybe AgentStatus
status = Maybe AgentStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:privateLinkConfig:DescribeAgentResponse' :: Maybe PrivateLinkConfig
privateLinkConfig = Maybe PrivateLinkConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointType:DescribeAgentResponse' :: Maybe EndpointType
endpointType = Maybe EndpointType
forall a. Maybe a
Prelude.Nothing,
      $sel:lastConnectionTime:DescribeAgentResponse' :: Maybe POSIX
lastConnectionTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:agentArn:DescribeAgentResponse' :: Maybe Text
agentArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeAgentResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAgentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The time that the agent was activated (that is, created in your
-- account).
describeAgentResponse_creationTime :: Lens.Lens' DescribeAgentResponse (Prelude.Maybe Prelude.UTCTime)
describeAgentResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAgentResponse -> f DescribeAgentResponse
describeAgentResponse_creationTime = (DescribeAgentResponse -> Maybe POSIX)
-> (DescribeAgentResponse -> Maybe POSIX -> DescribeAgentResponse)
-> Lens
     DescribeAgentResponse
     DescribeAgentResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAgentResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeAgentResponse' :: DescribeAgentResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeAgentResponse
s@DescribeAgentResponse' {} Maybe POSIX
a -> DescribeAgentResponse
s {$sel:creationTime:DescribeAgentResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeAgentResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAgentResponse -> f DescribeAgentResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAgentResponse
-> f DescribeAgentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of the agent. If the status is ONLINE, then the agent is
-- configured properly and is available to use. The Running status is the
-- normal running status for an agent. If the status is OFFLINE, the
-- agent\'s VM is turned off or the agent is in an unhealthy state. When
-- the issue that caused the unhealthy state is resolved, the agent returns
-- to ONLINE status.
describeAgentResponse_status :: Lens.Lens' DescribeAgentResponse (Prelude.Maybe AgentStatus)
describeAgentResponse_status :: (Maybe AgentStatus -> f (Maybe AgentStatus))
-> DescribeAgentResponse -> f DescribeAgentResponse
describeAgentResponse_status = (DescribeAgentResponse -> Maybe AgentStatus)
-> (DescribeAgentResponse
    -> Maybe AgentStatus -> DescribeAgentResponse)
-> Lens
     DescribeAgentResponse
     DescribeAgentResponse
     (Maybe AgentStatus)
     (Maybe AgentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAgentResponse' {Maybe AgentStatus
status :: Maybe AgentStatus
$sel:status:DescribeAgentResponse' :: DescribeAgentResponse -> Maybe AgentStatus
status} -> Maybe AgentStatus
status) (\s :: DescribeAgentResponse
s@DescribeAgentResponse' {} Maybe AgentStatus
a -> DescribeAgentResponse
s {$sel:status:DescribeAgentResponse' :: Maybe AgentStatus
status = Maybe AgentStatus
a} :: DescribeAgentResponse)

-- | The subnet and the security group that DataSync used to access a VPC
-- endpoint.
describeAgentResponse_privateLinkConfig :: Lens.Lens' DescribeAgentResponse (Prelude.Maybe PrivateLinkConfig)
describeAgentResponse_privateLinkConfig :: (Maybe PrivateLinkConfig -> f (Maybe PrivateLinkConfig))
-> DescribeAgentResponse -> f DescribeAgentResponse
describeAgentResponse_privateLinkConfig = (DescribeAgentResponse -> Maybe PrivateLinkConfig)
-> (DescribeAgentResponse
    -> Maybe PrivateLinkConfig -> DescribeAgentResponse)
-> Lens
     DescribeAgentResponse
     DescribeAgentResponse
     (Maybe PrivateLinkConfig)
     (Maybe PrivateLinkConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAgentResponse' {Maybe PrivateLinkConfig
privateLinkConfig :: Maybe PrivateLinkConfig
$sel:privateLinkConfig:DescribeAgentResponse' :: DescribeAgentResponse -> Maybe PrivateLinkConfig
privateLinkConfig} -> Maybe PrivateLinkConfig
privateLinkConfig) (\s :: DescribeAgentResponse
s@DescribeAgentResponse' {} Maybe PrivateLinkConfig
a -> DescribeAgentResponse
s {$sel:privateLinkConfig:DescribeAgentResponse' :: Maybe PrivateLinkConfig
privateLinkConfig = Maybe PrivateLinkConfig
a} :: DescribeAgentResponse)

-- | The type of endpoint that your agent is connected to. If the endpoint is
-- a VPC endpoint, the agent is not accessible over the public internet.
describeAgentResponse_endpointType :: Lens.Lens' DescribeAgentResponse (Prelude.Maybe EndpointType)
describeAgentResponse_endpointType :: (Maybe EndpointType -> f (Maybe EndpointType))
-> DescribeAgentResponse -> f DescribeAgentResponse
describeAgentResponse_endpointType = (DescribeAgentResponse -> Maybe EndpointType)
-> (DescribeAgentResponse
    -> Maybe EndpointType -> DescribeAgentResponse)
-> Lens
     DescribeAgentResponse
     DescribeAgentResponse
     (Maybe EndpointType)
     (Maybe EndpointType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAgentResponse' {Maybe EndpointType
endpointType :: Maybe EndpointType
$sel:endpointType:DescribeAgentResponse' :: DescribeAgentResponse -> Maybe EndpointType
endpointType} -> Maybe EndpointType
endpointType) (\s :: DescribeAgentResponse
s@DescribeAgentResponse' {} Maybe EndpointType
a -> DescribeAgentResponse
s {$sel:endpointType:DescribeAgentResponse' :: Maybe EndpointType
endpointType = Maybe EndpointType
a} :: DescribeAgentResponse)

-- | The time that the agent last connected to DataSync.
describeAgentResponse_lastConnectionTime :: Lens.Lens' DescribeAgentResponse (Prelude.Maybe Prelude.UTCTime)
describeAgentResponse_lastConnectionTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAgentResponse -> f DescribeAgentResponse
describeAgentResponse_lastConnectionTime = (DescribeAgentResponse -> Maybe POSIX)
-> (DescribeAgentResponse -> Maybe POSIX -> DescribeAgentResponse)
-> Lens
     DescribeAgentResponse
     DescribeAgentResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAgentResponse' {Maybe POSIX
lastConnectionTime :: Maybe POSIX
$sel:lastConnectionTime:DescribeAgentResponse' :: DescribeAgentResponse -> Maybe POSIX
lastConnectionTime} -> Maybe POSIX
lastConnectionTime) (\s :: DescribeAgentResponse
s@DescribeAgentResponse' {} Maybe POSIX
a -> DescribeAgentResponse
s {$sel:lastConnectionTime:DescribeAgentResponse' :: Maybe POSIX
lastConnectionTime = Maybe POSIX
a} :: DescribeAgentResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAgentResponse -> f DescribeAgentResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAgentResponse
-> f DescribeAgentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Name (ARN) of the agent.
describeAgentResponse_agentArn :: Lens.Lens' DescribeAgentResponse (Prelude.Maybe Prelude.Text)
describeAgentResponse_agentArn :: (Maybe Text -> f (Maybe Text))
-> DescribeAgentResponse -> f DescribeAgentResponse
describeAgentResponse_agentArn = (DescribeAgentResponse -> Maybe Text)
-> (DescribeAgentResponse -> Maybe Text -> DescribeAgentResponse)
-> Lens
     DescribeAgentResponse
     DescribeAgentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAgentResponse' {Maybe Text
agentArn :: Maybe Text
$sel:agentArn:DescribeAgentResponse' :: DescribeAgentResponse -> Maybe Text
agentArn} -> Maybe Text
agentArn) (\s :: DescribeAgentResponse
s@DescribeAgentResponse' {} Maybe Text
a -> DescribeAgentResponse
s {$sel:agentArn:DescribeAgentResponse' :: Maybe Text
agentArn = Maybe Text
a} :: DescribeAgentResponse)

-- | The name of the agent.
describeAgentResponse_name :: Lens.Lens' DescribeAgentResponse (Prelude.Maybe Prelude.Text)
describeAgentResponse_name :: (Maybe Text -> f (Maybe Text))
-> DescribeAgentResponse -> f DescribeAgentResponse
describeAgentResponse_name = (DescribeAgentResponse -> Maybe Text)
-> (DescribeAgentResponse -> Maybe Text -> DescribeAgentResponse)
-> Lens
     DescribeAgentResponse
     DescribeAgentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAgentResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeAgentResponse' :: DescribeAgentResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeAgentResponse
s@DescribeAgentResponse' {} Maybe Text
a -> DescribeAgentResponse
s {$sel:name:DescribeAgentResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeAgentResponse)

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

instance Prelude.NFData DescribeAgentResponse