{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTSecureTunneling.Types.Tunnel
-- 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)
module Amazonka.IoTSecureTunneling.Types.Tunnel where

import qualified Amazonka.Core as Core
import Amazonka.IoTSecureTunneling.Types.ConnectionState
import Amazonka.IoTSecureTunneling.Types.DestinationConfig
import Amazonka.IoTSecureTunneling.Types.Tag
import Amazonka.IoTSecureTunneling.Types.TimeoutConfig
import Amazonka.IoTSecureTunneling.Types.TunnelStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A connection between a source computer and a destination device.
--
-- /See:/ 'newTunnel' smart constructor.
data Tunnel = Tunnel'
  { -- | The status of a tunnel. Valid values are: Open and Closed.
    Tunnel -> Maybe TunnelStatus
status :: Prelude.Maybe TunnelStatus,
    -- | The last time the tunnel was updated.
    Tunnel -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | The time when the tunnel was created.
    Tunnel -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of a tunnel. The tunnel ARN format is
    -- @arn:aws:tunnel:\<region>:\<account-id>:tunnel\/\<tunnel-id>@
    Tunnel -> Maybe Text
tunnelArn :: Prelude.Maybe Prelude.Text,
    -- | The connection state of the source application.
    Tunnel -> Maybe ConnectionState
sourceConnectionState :: Prelude.Maybe ConnectionState,
    -- | The connection state of the destination application.
    Tunnel -> Maybe ConnectionState
destinationConnectionState :: Prelude.Maybe ConnectionState,
    -- | A unique alpha-numeric ID that identifies a tunnel.
    Tunnel -> Maybe Text
tunnelId :: Prelude.Maybe Prelude.Text,
    -- | The destination configuration that specifies the thing name of the
    -- destination device and a service name that the local proxy uses to
    -- connect to the destination application.
    Tunnel -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
    -- | A description of the tunnel.
    Tunnel -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Timeout configuration for the tunnel.
    Tunnel -> Maybe TimeoutConfig
timeoutConfig :: Prelude.Maybe TimeoutConfig,
    -- | A list of tag metadata associated with the secure tunnel.
    Tunnel -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag)
  }
  deriving (Tunnel -> Tunnel -> Bool
(Tunnel -> Tunnel -> Bool)
-> (Tunnel -> Tunnel -> Bool) -> Eq Tunnel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tunnel -> Tunnel -> Bool
$c/= :: Tunnel -> Tunnel -> Bool
== :: Tunnel -> Tunnel -> Bool
$c== :: Tunnel -> Tunnel -> Bool
Prelude.Eq, ReadPrec [Tunnel]
ReadPrec Tunnel
Int -> ReadS Tunnel
ReadS [Tunnel]
(Int -> ReadS Tunnel)
-> ReadS [Tunnel]
-> ReadPrec Tunnel
-> ReadPrec [Tunnel]
-> Read Tunnel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Tunnel]
$creadListPrec :: ReadPrec [Tunnel]
readPrec :: ReadPrec Tunnel
$creadPrec :: ReadPrec Tunnel
readList :: ReadS [Tunnel]
$creadList :: ReadS [Tunnel]
readsPrec :: Int -> ReadS Tunnel
$creadsPrec :: Int -> ReadS Tunnel
Prelude.Read, Int -> Tunnel -> ShowS
[Tunnel] -> ShowS
Tunnel -> String
(Int -> Tunnel -> ShowS)
-> (Tunnel -> String) -> ([Tunnel] -> ShowS) -> Show Tunnel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Tunnel] -> ShowS
$cshowList :: [Tunnel] -> ShowS
show :: Tunnel -> String
$cshow :: Tunnel -> String
showsPrec :: Int -> Tunnel -> ShowS
$cshowsPrec :: Int -> Tunnel -> ShowS
Prelude.Show, (forall x. Tunnel -> Rep Tunnel x)
-> (forall x. Rep Tunnel x -> Tunnel) -> Generic Tunnel
forall x. Rep Tunnel x -> Tunnel
forall x. Tunnel -> Rep Tunnel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Tunnel x -> Tunnel
$cfrom :: forall x. Tunnel -> Rep Tunnel x
Prelude.Generic)

-- |
-- Create a value of 'Tunnel' 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:
--
-- 'status', 'tunnel_status' - The status of a tunnel. Valid values are: Open and Closed.
--
-- 'lastUpdatedAt', 'tunnel_lastUpdatedAt' - The last time the tunnel was updated.
--
-- 'createdAt', 'tunnel_createdAt' - The time when the tunnel was created.
--
-- 'tunnelArn', 'tunnel_tunnelArn' - The Amazon Resource Name (ARN) of a tunnel. The tunnel ARN format is
-- @arn:aws:tunnel:\<region>:\<account-id>:tunnel\/\<tunnel-id>@
--
-- 'sourceConnectionState', 'tunnel_sourceConnectionState' - The connection state of the source application.
--
-- 'destinationConnectionState', 'tunnel_destinationConnectionState' - The connection state of the destination application.
--
-- 'tunnelId', 'tunnel_tunnelId' - A unique alpha-numeric ID that identifies a tunnel.
--
-- 'destinationConfig', 'tunnel_destinationConfig' - The destination configuration that specifies the thing name of the
-- destination device and a service name that the local proxy uses to
-- connect to the destination application.
--
-- 'description', 'tunnel_description' - A description of the tunnel.
--
-- 'timeoutConfig', 'tunnel_timeoutConfig' - Timeout configuration for the tunnel.
--
-- 'tags', 'tunnel_tags' - A list of tag metadata associated with the secure tunnel.
newTunnel ::
  Tunnel
newTunnel :: Tunnel
newTunnel =
  Tunnel' :: Maybe TunnelStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ConnectionState
-> Maybe ConnectionState
-> Maybe Text
-> Maybe DestinationConfig
-> Maybe Text
-> Maybe TimeoutConfig
-> Maybe (NonEmpty Tag)
-> Tunnel
Tunnel'
    { $sel:status:Tunnel' :: Maybe TunnelStatus
status = Maybe TunnelStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedAt:Tunnel' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Tunnel' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:tunnelArn:Tunnel' :: Maybe Text
tunnelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceConnectionState:Tunnel' :: Maybe ConnectionState
sourceConnectionState = Maybe ConnectionState
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationConnectionState:Tunnel' :: Maybe ConnectionState
destinationConnectionState = Maybe ConnectionState
forall a. Maybe a
Prelude.Nothing,
      $sel:tunnelId:Tunnel' :: Maybe Text
tunnelId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationConfig:Tunnel' :: Maybe DestinationConfig
destinationConfig = Maybe DestinationConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Tunnel' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutConfig:Tunnel' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Tunnel' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of a tunnel. Valid values are: Open and Closed.
tunnel_status :: Lens.Lens' Tunnel (Prelude.Maybe TunnelStatus)
tunnel_status :: (Maybe TunnelStatus -> f (Maybe TunnelStatus))
-> Tunnel -> f Tunnel
tunnel_status = (Tunnel -> Maybe TunnelStatus)
-> (Tunnel -> Maybe TunnelStatus -> Tunnel)
-> Lens Tunnel Tunnel (Maybe TunnelStatus) (Maybe TunnelStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe TunnelStatus
status :: Maybe TunnelStatus
$sel:status:Tunnel' :: Tunnel -> Maybe TunnelStatus
status} -> Maybe TunnelStatus
status) (\s :: Tunnel
s@Tunnel' {} Maybe TunnelStatus
a -> Tunnel
s {$sel:status:Tunnel' :: Maybe TunnelStatus
status = Maybe TunnelStatus
a} :: Tunnel)

-- | The last time the tunnel was updated.
tunnel_lastUpdatedAt :: Lens.Lens' Tunnel (Prelude.Maybe Prelude.UTCTime)
tunnel_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Tunnel -> f Tunnel
tunnel_lastUpdatedAt = (Tunnel -> Maybe POSIX)
-> (Tunnel -> Maybe POSIX -> Tunnel)
-> Lens Tunnel Tunnel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:Tunnel' :: Tunnel -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: Tunnel
s@Tunnel' {} Maybe POSIX
a -> Tunnel
s {$sel:lastUpdatedAt:Tunnel' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: Tunnel) ((Maybe POSIX -> f (Maybe POSIX)) -> Tunnel -> f Tunnel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Tunnel
-> f Tunnel
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 time when the tunnel was created.
tunnel_createdAt :: Lens.Lens' Tunnel (Prelude.Maybe Prelude.UTCTime)
tunnel_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Tunnel -> f Tunnel
tunnel_createdAt = (Tunnel -> Maybe POSIX)
-> (Tunnel -> Maybe POSIX -> Tunnel)
-> Lens Tunnel Tunnel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Tunnel' :: Tunnel -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Tunnel
s@Tunnel' {} Maybe POSIX
a -> Tunnel
s {$sel:createdAt:Tunnel' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Tunnel) ((Maybe POSIX -> f (Maybe POSIX)) -> Tunnel -> f Tunnel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Tunnel
-> f Tunnel
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 a tunnel. The tunnel ARN format is
-- @arn:aws:tunnel:\<region>:\<account-id>:tunnel\/\<tunnel-id>@
tunnel_tunnelArn :: Lens.Lens' Tunnel (Prelude.Maybe Prelude.Text)
tunnel_tunnelArn :: (Maybe Text -> f (Maybe Text)) -> Tunnel -> f Tunnel
tunnel_tunnelArn = (Tunnel -> Maybe Text)
-> (Tunnel -> Maybe Text -> Tunnel)
-> Lens Tunnel Tunnel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe Text
tunnelArn :: Maybe Text
$sel:tunnelArn:Tunnel' :: Tunnel -> Maybe Text
tunnelArn} -> Maybe Text
tunnelArn) (\s :: Tunnel
s@Tunnel' {} Maybe Text
a -> Tunnel
s {$sel:tunnelArn:Tunnel' :: Maybe Text
tunnelArn = Maybe Text
a} :: Tunnel)

-- | The connection state of the source application.
tunnel_sourceConnectionState :: Lens.Lens' Tunnel (Prelude.Maybe ConnectionState)
tunnel_sourceConnectionState :: (Maybe ConnectionState -> f (Maybe ConnectionState))
-> Tunnel -> f Tunnel
tunnel_sourceConnectionState = (Tunnel -> Maybe ConnectionState)
-> (Tunnel -> Maybe ConnectionState -> Tunnel)
-> Lens
     Tunnel Tunnel (Maybe ConnectionState) (Maybe ConnectionState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe ConnectionState
sourceConnectionState :: Maybe ConnectionState
$sel:sourceConnectionState:Tunnel' :: Tunnel -> Maybe ConnectionState
sourceConnectionState} -> Maybe ConnectionState
sourceConnectionState) (\s :: Tunnel
s@Tunnel' {} Maybe ConnectionState
a -> Tunnel
s {$sel:sourceConnectionState:Tunnel' :: Maybe ConnectionState
sourceConnectionState = Maybe ConnectionState
a} :: Tunnel)

-- | The connection state of the destination application.
tunnel_destinationConnectionState :: Lens.Lens' Tunnel (Prelude.Maybe ConnectionState)
tunnel_destinationConnectionState :: (Maybe ConnectionState -> f (Maybe ConnectionState))
-> Tunnel -> f Tunnel
tunnel_destinationConnectionState = (Tunnel -> Maybe ConnectionState)
-> (Tunnel -> Maybe ConnectionState -> Tunnel)
-> Lens
     Tunnel Tunnel (Maybe ConnectionState) (Maybe ConnectionState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe ConnectionState
destinationConnectionState :: Maybe ConnectionState
$sel:destinationConnectionState:Tunnel' :: Tunnel -> Maybe ConnectionState
destinationConnectionState} -> Maybe ConnectionState
destinationConnectionState) (\s :: Tunnel
s@Tunnel' {} Maybe ConnectionState
a -> Tunnel
s {$sel:destinationConnectionState:Tunnel' :: Maybe ConnectionState
destinationConnectionState = Maybe ConnectionState
a} :: Tunnel)

-- | A unique alpha-numeric ID that identifies a tunnel.
tunnel_tunnelId :: Lens.Lens' Tunnel (Prelude.Maybe Prelude.Text)
tunnel_tunnelId :: (Maybe Text -> f (Maybe Text)) -> Tunnel -> f Tunnel
tunnel_tunnelId = (Tunnel -> Maybe Text)
-> (Tunnel -> Maybe Text -> Tunnel)
-> Lens Tunnel Tunnel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe Text
tunnelId :: Maybe Text
$sel:tunnelId:Tunnel' :: Tunnel -> Maybe Text
tunnelId} -> Maybe Text
tunnelId) (\s :: Tunnel
s@Tunnel' {} Maybe Text
a -> Tunnel
s {$sel:tunnelId:Tunnel' :: Maybe Text
tunnelId = Maybe Text
a} :: Tunnel)

-- | The destination configuration that specifies the thing name of the
-- destination device and a service name that the local proxy uses to
-- connect to the destination application.
tunnel_destinationConfig :: Lens.Lens' Tunnel (Prelude.Maybe DestinationConfig)
tunnel_destinationConfig :: (Maybe DestinationConfig -> f (Maybe DestinationConfig))
-> Tunnel -> f Tunnel
tunnel_destinationConfig = (Tunnel -> Maybe DestinationConfig)
-> (Tunnel -> Maybe DestinationConfig -> Tunnel)
-> Lens
     Tunnel Tunnel (Maybe DestinationConfig) (Maybe DestinationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe DestinationConfig
destinationConfig :: Maybe DestinationConfig
$sel:destinationConfig:Tunnel' :: Tunnel -> Maybe DestinationConfig
destinationConfig} -> Maybe DestinationConfig
destinationConfig) (\s :: Tunnel
s@Tunnel' {} Maybe DestinationConfig
a -> Tunnel
s {$sel:destinationConfig:Tunnel' :: Maybe DestinationConfig
destinationConfig = Maybe DestinationConfig
a} :: Tunnel)

-- | A description of the tunnel.
tunnel_description :: Lens.Lens' Tunnel (Prelude.Maybe Prelude.Text)
tunnel_description :: (Maybe Text -> f (Maybe Text)) -> Tunnel -> f Tunnel
tunnel_description = (Tunnel -> Maybe Text)
-> (Tunnel -> Maybe Text -> Tunnel)
-> Lens Tunnel Tunnel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe Text
description :: Maybe Text
$sel:description:Tunnel' :: Tunnel -> Maybe Text
description} -> Maybe Text
description) (\s :: Tunnel
s@Tunnel' {} Maybe Text
a -> Tunnel
s {$sel:description:Tunnel' :: Maybe Text
description = Maybe Text
a} :: Tunnel)

-- | Timeout configuration for the tunnel.
tunnel_timeoutConfig :: Lens.Lens' Tunnel (Prelude.Maybe TimeoutConfig)
tunnel_timeoutConfig :: (Maybe TimeoutConfig -> f (Maybe TimeoutConfig))
-> Tunnel -> f Tunnel
tunnel_timeoutConfig = (Tunnel -> Maybe TimeoutConfig)
-> (Tunnel -> Maybe TimeoutConfig -> Tunnel)
-> Lens Tunnel Tunnel (Maybe TimeoutConfig) (Maybe TimeoutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe TimeoutConfig
timeoutConfig :: Maybe TimeoutConfig
$sel:timeoutConfig:Tunnel' :: Tunnel -> Maybe TimeoutConfig
timeoutConfig} -> Maybe TimeoutConfig
timeoutConfig) (\s :: Tunnel
s@Tunnel' {} Maybe TimeoutConfig
a -> Tunnel
s {$sel:timeoutConfig:Tunnel' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
a} :: Tunnel)

-- | A list of tag metadata associated with the secure tunnel.
tunnel_tags :: Lens.Lens' Tunnel (Prelude.Maybe (Prelude.NonEmpty Tag))
tunnel_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Tunnel -> f Tunnel
tunnel_tags = (Tunnel -> Maybe (NonEmpty Tag))
-> (Tunnel -> Maybe (NonEmpty Tag) -> Tunnel)
-> Lens Tunnel Tunnel (Maybe (NonEmpty Tag)) (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tunnel' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:Tunnel' :: Tunnel -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: Tunnel
s@Tunnel' {} Maybe (NonEmpty Tag)
a -> Tunnel
s {$sel:tags:Tunnel' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: Tunnel) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> Tunnel -> f Tunnel)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Tunnel
-> f Tunnel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Tunnel where
  parseJSON :: Value -> Parser Tunnel
parseJSON =
    String -> (Object -> Parser Tunnel) -> Value -> Parser Tunnel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Tunnel"
      ( \Object
x ->
          Maybe TunnelStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ConnectionState
-> Maybe ConnectionState
-> Maybe Text
-> Maybe DestinationConfig
-> Maybe Text
-> Maybe TimeoutConfig
-> Maybe (NonEmpty Tag)
-> Tunnel
Tunnel'
            (Maybe TunnelStatus
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ConnectionState
 -> Maybe ConnectionState
 -> Maybe Text
 -> Maybe DestinationConfig
 -> Maybe Text
 -> Maybe TimeoutConfig
 -> Maybe (NonEmpty Tag)
 -> Tunnel)
-> Parser (Maybe TunnelStatus)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe ConnectionState
      -> Maybe Text
      -> Maybe DestinationConfig
      -> Maybe Text
      -> Maybe TimeoutConfig
      -> Maybe (NonEmpty Tag)
      -> Tunnel)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TunnelStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe ConnectionState
   -> Maybe Text
   -> Maybe DestinationConfig
   -> Maybe Text
   -> Maybe TimeoutConfig
   -> Maybe (NonEmpty Tag)
   -> Tunnel)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe ConnectionState
      -> Maybe Text
      -> Maybe DestinationConfig
      -> Maybe Text
      -> Maybe TimeoutConfig
      -> Maybe (NonEmpty Tag)
      -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedAt")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe ConnectionState
   -> Maybe Text
   -> Maybe DestinationConfig
   -> Maybe Text
   -> Maybe TimeoutConfig
   -> Maybe (NonEmpty Tag)
   -> Tunnel)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe ConnectionState
      -> Maybe ConnectionState
      -> Maybe Text
      -> Maybe DestinationConfig
      -> Maybe Text
      -> Maybe TimeoutConfig
      -> Maybe (NonEmpty Tag)
      -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
            Parser
  (Maybe Text
   -> Maybe ConnectionState
   -> Maybe ConnectionState
   -> Maybe Text
   -> Maybe DestinationConfig
   -> Maybe Text
   -> Maybe TimeoutConfig
   -> Maybe (NonEmpty Tag)
   -> Tunnel)
-> Parser (Maybe Text)
-> Parser
     (Maybe ConnectionState
      -> Maybe ConnectionState
      -> Maybe Text
      -> Maybe DestinationConfig
      -> Maybe Text
      -> Maybe TimeoutConfig
      -> Maybe (NonEmpty Tag)
      -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tunnelArn")
            Parser
  (Maybe ConnectionState
   -> Maybe ConnectionState
   -> Maybe Text
   -> Maybe DestinationConfig
   -> Maybe Text
   -> Maybe TimeoutConfig
   -> Maybe (NonEmpty Tag)
   -> Tunnel)
-> Parser (Maybe ConnectionState)
-> Parser
     (Maybe ConnectionState
      -> Maybe Text
      -> Maybe DestinationConfig
      -> Maybe Text
      -> Maybe TimeoutConfig
      -> Maybe (NonEmpty Tag)
      -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConnectionState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceConnectionState")
            Parser
  (Maybe ConnectionState
   -> Maybe Text
   -> Maybe DestinationConfig
   -> Maybe Text
   -> Maybe TimeoutConfig
   -> Maybe (NonEmpty Tag)
   -> Tunnel)
-> Parser (Maybe ConnectionState)
-> Parser
     (Maybe Text
      -> Maybe DestinationConfig
      -> Maybe Text
      -> Maybe TimeoutConfig
      -> Maybe (NonEmpty Tag)
      -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConnectionState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"destinationConnectionState")
            Parser
  (Maybe Text
   -> Maybe DestinationConfig
   -> Maybe Text
   -> Maybe TimeoutConfig
   -> Maybe (NonEmpty Tag)
   -> Tunnel)
-> Parser (Maybe Text)
-> Parser
     (Maybe DestinationConfig
      -> Maybe Text
      -> Maybe TimeoutConfig
      -> Maybe (NonEmpty Tag)
      -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tunnelId")
            Parser
  (Maybe DestinationConfig
   -> Maybe Text
   -> Maybe TimeoutConfig
   -> Maybe (NonEmpty Tag)
   -> Tunnel)
-> Parser (Maybe DestinationConfig)
-> Parser
     (Maybe Text
      -> Maybe TimeoutConfig -> Maybe (NonEmpty Tag) -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DestinationConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"destinationConfig")
            Parser
  (Maybe Text
   -> Maybe TimeoutConfig -> Maybe (NonEmpty Tag) -> Tunnel)
-> Parser (Maybe Text)
-> Parser (Maybe TimeoutConfig -> Maybe (NonEmpty Tag) -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
            Parser (Maybe TimeoutConfig -> Maybe (NonEmpty Tag) -> Tunnel)
-> Parser (Maybe TimeoutConfig)
-> Parser (Maybe (NonEmpty Tag) -> Tunnel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TimeoutConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"timeoutConfig")
            Parser (Maybe (NonEmpty Tag) -> Tunnel)
-> Parser (Maybe (NonEmpty Tag)) -> Parser Tunnel
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Tag))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags")
      )

instance Prelude.Hashable Tunnel

instance Prelude.NFData Tunnel