{-# 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.BackupGateway.Types.GatewayDetails
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.BackupGateway.Types.GatewayDetails where

import Amazonka.BackupGateway.Types.GatewayType
import Amazonka.BackupGateway.Types.MaintenanceStartTime
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The details of gateway.
--
-- /See:/ 'newGatewayDetails' smart constructor.
data GatewayDetails = GatewayDetails'
  { -- | The Amazon Resource Name (ARN) of the gateway. Use the @ListGateways@
    -- operation to return a list of gateways for your account and Amazon Web
    -- Services Region.
    GatewayDetails -> Maybe Text
gatewayArn :: Prelude.Maybe Prelude.Text,
    -- | The display name of the gateway.
    GatewayDetails -> Maybe Text
gatewayDisplayName :: Prelude.Maybe Prelude.Text,
    -- | The type of the gateway type.
    GatewayDetails -> Maybe GatewayType
gatewayType :: Prelude.Maybe GatewayType,
    -- | The hypervisor ID of the gateway.
    GatewayDetails -> Maybe Text
hypervisorId :: Prelude.Maybe Prelude.Text,
    -- | Details showing the last time Backup gateway communicated with the
    -- cloud, in Unix format and UTC time.
    GatewayDetails -> Maybe POSIX
lastSeenTime :: Prelude.Maybe Data.POSIX,
    -- | Returns your gateway\'s weekly maintenance start time including the day
    -- and time of the week. Note that values are in terms of the gateway\'s
    -- time zone. Can be weekly or monthly.
    GatewayDetails -> Maybe MaintenanceStartTime
maintenanceStartTime :: Prelude.Maybe MaintenanceStartTime,
    -- | Details showing the next update availability time of the gateway.
    GatewayDetails -> Maybe POSIX
nextUpdateAvailabilityTime :: Prelude.Maybe Data.POSIX,
    -- | The DNS name for the virtual private cloud (VPC) endpoint the gateway
    -- uses to connect to the cloud for backup gateway.
    GatewayDetails -> Maybe Text
vpcEndpoint :: Prelude.Maybe Prelude.Text
  }
  deriving (GatewayDetails -> GatewayDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatewayDetails -> GatewayDetails -> Bool
$c/= :: GatewayDetails -> GatewayDetails -> Bool
== :: GatewayDetails -> GatewayDetails -> Bool
$c== :: GatewayDetails -> GatewayDetails -> Bool
Prelude.Eq, ReadPrec [GatewayDetails]
ReadPrec GatewayDetails
Int -> ReadS GatewayDetails
ReadS [GatewayDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatewayDetails]
$creadListPrec :: ReadPrec [GatewayDetails]
readPrec :: ReadPrec GatewayDetails
$creadPrec :: ReadPrec GatewayDetails
readList :: ReadS [GatewayDetails]
$creadList :: ReadS [GatewayDetails]
readsPrec :: Int -> ReadS GatewayDetails
$creadsPrec :: Int -> ReadS GatewayDetails
Prelude.Read, Int -> GatewayDetails -> ShowS
[GatewayDetails] -> ShowS
GatewayDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatewayDetails] -> ShowS
$cshowList :: [GatewayDetails] -> ShowS
show :: GatewayDetails -> String
$cshow :: GatewayDetails -> String
showsPrec :: Int -> GatewayDetails -> ShowS
$cshowsPrec :: Int -> GatewayDetails -> ShowS
Prelude.Show, forall x. Rep GatewayDetails x -> GatewayDetails
forall x. GatewayDetails -> Rep GatewayDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GatewayDetails x -> GatewayDetails
$cfrom :: forall x. GatewayDetails -> Rep GatewayDetails x
Prelude.Generic)

-- |
-- Create a value of 'GatewayDetails' 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:
--
-- 'gatewayArn', 'gatewayDetails_gatewayArn' - The Amazon Resource Name (ARN) of the gateway. Use the @ListGateways@
-- operation to return a list of gateways for your account and Amazon Web
-- Services Region.
--
-- 'gatewayDisplayName', 'gatewayDetails_gatewayDisplayName' - The display name of the gateway.
--
-- 'gatewayType', 'gatewayDetails_gatewayType' - The type of the gateway type.
--
-- 'hypervisorId', 'gatewayDetails_hypervisorId' - The hypervisor ID of the gateway.
--
-- 'lastSeenTime', 'gatewayDetails_lastSeenTime' - Details showing the last time Backup gateway communicated with the
-- cloud, in Unix format and UTC time.
--
-- 'maintenanceStartTime', 'gatewayDetails_maintenanceStartTime' - Returns your gateway\'s weekly maintenance start time including the day
-- and time of the week. Note that values are in terms of the gateway\'s
-- time zone. Can be weekly or monthly.
--
-- 'nextUpdateAvailabilityTime', 'gatewayDetails_nextUpdateAvailabilityTime' - Details showing the next update availability time of the gateway.
--
-- 'vpcEndpoint', 'gatewayDetails_vpcEndpoint' - The DNS name for the virtual private cloud (VPC) endpoint the gateway
-- uses to connect to the cloud for backup gateway.
newGatewayDetails ::
  GatewayDetails
newGatewayDetails :: GatewayDetails
newGatewayDetails =
  GatewayDetails'
    { $sel:gatewayArn:GatewayDetails' :: Maybe Text
gatewayArn = forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayDisplayName:GatewayDetails' :: Maybe Text
gatewayDisplayName = forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayType:GatewayDetails' :: Maybe GatewayType
gatewayType = forall a. Maybe a
Prelude.Nothing,
      $sel:hypervisorId:GatewayDetails' :: Maybe Text
hypervisorId = forall a. Maybe a
Prelude.Nothing,
      $sel:lastSeenTime:GatewayDetails' :: Maybe POSIX
lastSeenTime = forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceStartTime:GatewayDetails' :: Maybe MaintenanceStartTime
maintenanceStartTime = forall a. Maybe a
Prelude.Nothing,
      $sel:nextUpdateAvailabilityTime:GatewayDetails' :: Maybe POSIX
nextUpdateAvailabilityTime = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcEndpoint:GatewayDetails' :: Maybe Text
vpcEndpoint = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the gateway. Use the @ListGateways@
-- operation to return a list of gateways for your account and Amazon Web
-- Services Region.
gatewayDetails_gatewayArn :: Lens.Lens' GatewayDetails (Prelude.Maybe Prelude.Text)
gatewayDetails_gatewayArn :: Lens' GatewayDetails (Maybe Text)
gatewayDetails_gatewayArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayDetails' {Maybe Text
gatewayArn :: Maybe Text
$sel:gatewayArn:GatewayDetails' :: GatewayDetails -> Maybe Text
gatewayArn} -> Maybe Text
gatewayArn) (\s :: GatewayDetails
s@GatewayDetails' {} Maybe Text
a -> GatewayDetails
s {$sel:gatewayArn:GatewayDetails' :: Maybe Text
gatewayArn = Maybe Text
a} :: GatewayDetails)

-- | The display name of the gateway.
gatewayDetails_gatewayDisplayName :: Lens.Lens' GatewayDetails (Prelude.Maybe Prelude.Text)
gatewayDetails_gatewayDisplayName :: Lens' GatewayDetails (Maybe Text)
gatewayDetails_gatewayDisplayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayDetails' {Maybe Text
gatewayDisplayName :: Maybe Text
$sel:gatewayDisplayName:GatewayDetails' :: GatewayDetails -> Maybe Text
gatewayDisplayName} -> Maybe Text
gatewayDisplayName) (\s :: GatewayDetails
s@GatewayDetails' {} Maybe Text
a -> GatewayDetails
s {$sel:gatewayDisplayName:GatewayDetails' :: Maybe Text
gatewayDisplayName = Maybe Text
a} :: GatewayDetails)

-- | The type of the gateway type.
gatewayDetails_gatewayType :: Lens.Lens' GatewayDetails (Prelude.Maybe GatewayType)
gatewayDetails_gatewayType :: Lens' GatewayDetails (Maybe GatewayType)
gatewayDetails_gatewayType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayDetails' {Maybe GatewayType
gatewayType :: Maybe GatewayType
$sel:gatewayType:GatewayDetails' :: GatewayDetails -> Maybe GatewayType
gatewayType} -> Maybe GatewayType
gatewayType) (\s :: GatewayDetails
s@GatewayDetails' {} Maybe GatewayType
a -> GatewayDetails
s {$sel:gatewayType:GatewayDetails' :: Maybe GatewayType
gatewayType = Maybe GatewayType
a} :: GatewayDetails)

-- | The hypervisor ID of the gateway.
gatewayDetails_hypervisorId :: Lens.Lens' GatewayDetails (Prelude.Maybe Prelude.Text)
gatewayDetails_hypervisorId :: Lens' GatewayDetails (Maybe Text)
gatewayDetails_hypervisorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayDetails' {Maybe Text
hypervisorId :: Maybe Text
$sel:hypervisorId:GatewayDetails' :: GatewayDetails -> Maybe Text
hypervisorId} -> Maybe Text
hypervisorId) (\s :: GatewayDetails
s@GatewayDetails' {} Maybe Text
a -> GatewayDetails
s {$sel:hypervisorId:GatewayDetails' :: Maybe Text
hypervisorId = Maybe Text
a} :: GatewayDetails)

-- | Details showing the last time Backup gateway communicated with the
-- cloud, in Unix format and UTC time.
gatewayDetails_lastSeenTime :: Lens.Lens' GatewayDetails (Prelude.Maybe Prelude.UTCTime)
gatewayDetails_lastSeenTime :: Lens' GatewayDetails (Maybe UTCTime)
gatewayDetails_lastSeenTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayDetails' {Maybe POSIX
lastSeenTime :: Maybe POSIX
$sel:lastSeenTime:GatewayDetails' :: GatewayDetails -> Maybe POSIX
lastSeenTime} -> Maybe POSIX
lastSeenTime) (\s :: GatewayDetails
s@GatewayDetails' {} Maybe POSIX
a -> GatewayDetails
s {$sel:lastSeenTime:GatewayDetails' :: Maybe POSIX
lastSeenTime = Maybe POSIX
a} :: GatewayDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Returns your gateway\'s weekly maintenance start time including the day
-- and time of the week. Note that values are in terms of the gateway\'s
-- time zone. Can be weekly or monthly.
gatewayDetails_maintenanceStartTime :: Lens.Lens' GatewayDetails (Prelude.Maybe MaintenanceStartTime)
gatewayDetails_maintenanceStartTime :: Lens' GatewayDetails (Maybe MaintenanceStartTime)
gatewayDetails_maintenanceStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayDetails' {Maybe MaintenanceStartTime
maintenanceStartTime :: Maybe MaintenanceStartTime
$sel:maintenanceStartTime:GatewayDetails' :: GatewayDetails -> Maybe MaintenanceStartTime
maintenanceStartTime} -> Maybe MaintenanceStartTime
maintenanceStartTime) (\s :: GatewayDetails
s@GatewayDetails' {} Maybe MaintenanceStartTime
a -> GatewayDetails
s {$sel:maintenanceStartTime:GatewayDetails' :: Maybe MaintenanceStartTime
maintenanceStartTime = Maybe MaintenanceStartTime
a} :: GatewayDetails)

-- | Details showing the next update availability time of the gateway.
gatewayDetails_nextUpdateAvailabilityTime :: Lens.Lens' GatewayDetails (Prelude.Maybe Prelude.UTCTime)
gatewayDetails_nextUpdateAvailabilityTime :: Lens' GatewayDetails (Maybe UTCTime)
gatewayDetails_nextUpdateAvailabilityTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayDetails' {Maybe POSIX
nextUpdateAvailabilityTime :: Maybe POSIX
$sel:nextUpdateAvailabilityTime:GatewayDetails' :: GatewayDetails -> Maybe POSIX
nextUpdateAvailabilityTime} -> Maybe POSIX
nextUpdateAvailabilityTime) (\s :: GatewayDetails
s@GatewayDetails' {} Maybe POSIX
a -> GatewayDetails
s {$sel:nextUpdateAvailabilityTime:GatewayDetails' :: Maybe POSIX
nextUpdateAvailabilityTime = Maybe POSIX
a} :: GatewayDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The DNS name for the virtual private cloud (VPC) endpoint the gateway
-- uses to connect to the cloud for backup gateway.
gatewayDetails_vpcEndpoint :: Lens.Lens' GatewayDetails (Prelude.Maybe Prelude.Text)
gatewayDetails_vpcEndpoint :: Lens' GatewayDetails (Maybe Text)
gatewayDetails_vpcEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayDetails' {Maybe Text
vpcEndpoint :: Maybe Text
$sel:vpcEndpoint:GatewayDetails' :: GatewayDetails -> Maybe Text
vpcEndpoint} -> Maybe Text
vpcEndpoint) (\s :: GatewayDetails
s@GatewayDetails' {} Maybe Text
a -> GatewayDetails
s {$sel:vpcEndpoint:GatewayDetails' :: Maybe Text
vpcEndpoint = Maybe Text
a} :: GatewayDetails)

instance Data.FromJSON GatewayDetails where
  parseJSON :: Value -> Parser GatewayDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GatewayDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe GatewayType
-> Maybe Text
-> Maybe POSIX
-> Maybe MaintenanceStartTime
-> Maybe POSIX
-> Maybe Text
-> GatewayDetails
GatewayDetails'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GatewayArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GatewayDisplayName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GatewayType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HypervisorId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastSeenTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaintenanceStartTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NextUpdateAvailabilityTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VpcEndpoint")
      )

instance Prelude.Hashable GatewayDetails where
  hashWithSalt :: Int -> GatewayDetails -> Int
hashWithSalt Int
_salt GatewayDetails' {Maybe Text
Maybe POSIX
Maybe GatewayType
Maybe MaintenanceStartTime
vpcEndpoint :: Maybe Text
nextUpdateAvailabilityTime :: Maybe POSIX
maintenanceStartTime :: Maybe MaintenanceStartTime
lastSeenTime :: Maybe POSIX
hypervisorId :: Maybe Text
gatewayType :: Maybe GatewayType
gatewayDisplayName :: Maybe Text
gatewayArn :: Maybe Text
$sel:vpcEndpoint:GatewayDetails' :: GatewayDetails -> Maybe Text
$sel:nextUpdateAvailabilityTime:GatewayDetails' :: GatewayDetails -> Maybe POSIX
$sel:maintenanceStartTime:GatewayDetails' :: GatewayDetails -> Maybe MaintenanceStartTime
$sel:lastSeenTime:GatewayDetails' :: GatewayDetails -> Maybe POSIX
$sel:hypervisorId:GatewayDetails' :: GatewayDetails -> Maybe Text
$sel:gatewayType:GatewayDetails' :: GatewayDetails -> Maybe GatewayType
$sel:gatewayDisplayName:GatewayDetails' :: GatewayDetails -> Maybe Text
$sel:gatewayArn:GatewayDetails' :: GatewayDetails -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayDisplayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GatewayType
gatewayType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hypervisorId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastSeenTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MaintenanceStartTime
maintenanceStartTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
nextUpdateAvailabilityTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcEndpoint

instance Prelude.NFData GatewayDetails where
  rnf :: GatewayDetails -> ()
rnf GatewayDetails' {Maybe Text
Maybe POSIX
Maybe GatewayType
Maybe MaintenanceStartTime
vpcEndpoint :: Maybe Text
nextUpdateAvailabilityTime :: Maybe POSIX
maintenanceStartTime :: Maybe MaintenanceStartTime
lastSeenTime :: Maybe POSIX
hypervisorId :: Maybe Text
gatewayType :: Maybe GatewayType
gatewayDisplayName :: Maybe Text
gatewayArn :: Maybe Text
$sel:vpcEndpoint:GatewayDetails' :: GatewayDetails -> Maybe Text
$sel:nextUpdateAvailabilityTime:GatewayDetails' :: GatewayDetails -> Maybe POSIX
$sel:maintenanceStartTime:GatewayDetails' :: GatewayDetails -> Maybe MaintenanceStartTime
$sel:lastSeenTime:GatewayDetails' :: GatewayDetails -> Maybe POSIX
$sel:hypervisorId:GatewayDetails' :: GatewayDetails -> Maybe Text
$sel:gatewayType:GatewayDetails' :: GatewayDetails -> Maybe GatewayType
$sel:gatewayDisplayName:GatewayDetails' :: GatewayDetails -> Maybe Text
$sel:gatewayArn:GatewayDetails' :: GatewayDetails -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayDisplayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GatewayType
gatewayType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hypervisorId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastSeenTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MaintenanceStartTime
maintenanceStartTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
nextUpdateAvailabilityTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcEndpoint