{-# 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.AlexaBusiness.Types.DeviceNetworkProfileInfo
-- 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.AlexaBusiness.Types.DeviceNetworkProfileInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Detailed information about a device\'s network profile.
--
-- /See:/ 'newDeviceNetworkProfileInfo' smart constructor.
data DeviceNetworkProfileInfo = DeviceNetworkProfileInfo'
  { -- | The ARN of the certificate associated with a device.
    DeviceNetworkProfileInfo -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the network profile associated with a device.
    DeviceNetworkProfileInfo -> Maybe Text
networkProfileArn :: Prelude.Maybe Prelude.Text,
    -- | The time (in epoch) when the certificate expires.
    DeviceNetworkProfileInfo -> Maybe POSIX
certificateExpirationTime :: Prelude.Maybe Core.POSIX
  }
  deriving (DeviceNetworkProfileInfo -> DeviceNetworkProfileInfo -> Bool
(DeviceNetworkProfileInfo -> DeviceNetworkProfileInfo -> Bool)
-> (DeviceNetworkProfileInfo -> DeviceNetworkProfileInfo -> Bool)
-> Eq DeviceNetworkProfileInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceNetworkProfileInfo -> DeviceNetworkProfileInfo -> Bool
$c/= :: DeviceNetworkProfileInfo -> DeviceNetworkProfileInfo -> Bool
== :: DeviceNetworkProfileInfo -> DeviceNetworkProfileInfo -> Bool
$c== :: DeviceNetworkProfileInfo -> DeviceNetworkProfileInfo -> Bool
Prelude.Eq, ReadPrec [DeviceNetworkProfileInfo]
ReadPrec DeviceNetworkProfileInfo
Int -> ReadS DeviceNetworkProfileInfo
ReadS [DeviceNetworkProfileInfo]
(Int -> ReadS DeviceNetworkProfileInfo)
-> ReadS [DeviceNetworkProfileInfo]
-> ReadPrec DeviceNetworkProfileInfo
-> ReadPrec [DeviceNetworkProfileInfo]
-> Read DeviceNetworkProfileInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceNetworkProfileInfo]
$creadListPrec :: ReadPrec [DeviceNetworkProfileInfo]
readPrec :: ReadPrec DeviceNetworkProfileInfo
$creadPrec :: ReadPrec DeviceNetworkProfileInfo
readList :: ReadS [DeviceNetworkProfileInfo]
$creadList :: ReadS [DeviceNetworkProfileInfo]
readsPrec :: Int -> ReadS DeviceNetworkProfileInfo
$creadsPrec :: Int -> ReadS DeviceNetworkProfileInfo
Prelude.Read, Int -> DeviceNetworkProfileInfo -> ShowS
[DeviceNetworkProfileInfo] -> ShowS
DeviceNetworkProfileInfo -> String
(Int -> DeviceNetworkProfileInfo -> ShowS)
-> (DeviceNetworkProfileInfo -> String)
-> ([DeviceNetworkProfileInfo] -> ShowS)
-> Show DeviceNetworkProfileInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceNetworkProfileInfo] -> ShowS
$cshowList :: [DeviceNetworkProfileInfo] -> ShowS
show :: DeviceNetworkProfileInfo -> String
$cshow :: DeviceNetworkProfileInfo -> String
showsPrec :: Int -> DeviceNetworkProfileInfo -> ShowS
$cshowsPrec :: Int -> DeviceNetworkProfileInfo -> ShowS
Prelude.Show, (forall x.
 DeviceNetworkProfileInfo -> Rep DeviceNetworkProfileInfo x)
-> (forall x.
    Rep DeviceNetworkProfileInfo x -> DeviceNetworkProfileInfo)
-> Generic DeviceNetworkProfileInfo
forall x.
Rep DeviceNetworkProfileInfo x -> DeviceNetworkProfileInfo
forall x.
DeviceNetworkProfileInfo -> Rep DeviceNetworkProfileInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeviceNetworkProfileInfo x -> DeviceNetworkProfileInfo
$cfrom :: forall x.
DeviceNetworkProfileInfo -> Rep DeviceNetworkProfileInfo x
Prelude.Generic)

-- |
-- Create a value of 'DeviceNetworkProfileInfo' 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:
--
-- 'certificateArn', 'deviceNetworkProfileInfo_certificateArn' - The ARN of the certificate associated with a device.
--
-- 'networkProfileArn', 'deviceNetworkProfileInfo_networkProfileArn' - The ARN of the network profile associated with a device.
--
-- 'certificateExpirationTime', 'deviceNetworkProfileInfo_certificateExpirationTime' - The time (in epoch) when the certificate expires.
newDeviceNetworkProfileInfo ::
  DeviceNetworkProfileInfo
newDeviceNetworkProfileInfo :: DeviceNetworkProfileInfo
newDeviceNetworkProfileInfo =
  DeviceNetworkProfileInfo' :: Maybe Text -> Maybe Text -> Maybe POSIX -> DeviceNetworkProfileInfo
DeviceNetworkProfileInfo'
    { $sel:certificateArn:DeviceNetworkProfileInfo' :: Maybe Text
certificateArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkProfileArn:DeviceNetworkProfileInfo' :: Maybe Text
networkProfileArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateExpirationTime:DeviceNetworkProfileInfo' :: Maybe POSIX
certificateExpirationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the certificate associated with a device.
deviceNetworkProfileInfo_certificateArn :: Lens.Lens' DeviceNetworkProfileInfo (Prelude.Maybe Prelude.Text)
deviceNetworkProfileInfo_certificateArn :: (Maybe Text -> f (Maybe Text))
-> DeviceNetworkProfileInfo -> f DeviceNetworkProfileInfo
deviceNetworkProfileInfo_certificateArn = (DeviceNetworkProfileInfo -> Maybe Text)
-> (DeviceNetworkProfileInfo
    -> Maybe Text -> DeviceNetworkProfileInfo)
-> Lens
     DeviceNetworkProfileInfo
     DeviceNetworkProfileInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceNetworkProfileInfo' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: DeviceNetworkProfileInfo
s@DeviceNetworkProfileInfo' {} Maybe Text
a -> DeviceNetworkProfileInfo
s {$sel:certificateArn:DeviceNetworkProfileInfo' :: Maybe Text
certificateArn = Maybe Text
a} :: DeviceNetworkProfileInfo)

-- | The ARN of the network profile associated with a device.
deviceNetworkProfileInfo_networkProfileArn :: Lens.Lens' DeviceNetworkProfileInfo (Prelude.Maybe Prelude.Text)
deviceNetworkProfileInfo_networkProfileArn :: (Maybe Text -> f (Maybe Text))
-> DeviceNetworkProfileInfo -> f DeviceNetworkProfileInfo
deviceNetworkProfileInfo_networkProfileArn = (DeviceNetworkProfileInfo -> Maybe Text)
-> (DeviceNetworkProfileInfo
    -> Maybe Text -> DeviceNetworkProfileInfo)
-> Lens
     DeviceNetworkProfileInfo
     DeviceNetworkProfileInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceNetworkProfileInfo' {Maybe Text
networkProfileArn :: Maybe Text
$sel:networkProfileArn:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe Text
networkProfileArn} -> Maybe Text
networkProfileArn) (\s :: DeviceNetworkProfileInfo
s@DeviceNetworkProfileInfo' {} Maybe Text
a -> DeviceNetworkProfileInfo
s {$sel:networkProfileArn:DeviceNetworkProfileInfo' :: Maybe Text
networkProfileArn = Maybe Text
a} :: DeviceNetworkProfileInfo)

-- | The time (in epoch) when the certificate expires.
deviceNetworkProfileInfo_certificateExpirationTime :: Lens.Lens' DeviceNetworkProfileInfo (Prelude.Maybe Prelude.UTCTime)
deviceNetworkProfileInfo_certificateExpirationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DeviceNetworkProfileInfo -> f DeviceNetworkProfileInfo
deviceNetworkProfileInfo_certificateExpirationTime = (DeviceNetworkProfileInfo -> Maybe POSIX)
-> (DeviceNetworkProfileInfo
    -> Maybe POSIX -> DeviceNetworkProfileInfo)
-> Lens
     DeviceNetworkProfileInfo
     DeviceNetworkProfileInfo
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceNetworkProfileInfo' {Maybe POSIX
certificateExpirationTime :: Maybe POSIX
$sel:certificateExpirationTime:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe POSIX
certificateExpirationTime} -> Maybe POSIX
certificateExpirationTime) (\s :: DeviceNetworkProfileInfo
s@DeviceNetworkProfileInfo' {} Maybe POSIX
a -> DeviceNetworkProfileInfo
s {$sel:certificateExpirationTime:DeviceNetworkProfileInfo' :: Maybe POSIX
certificateExpirationTime = Maybe POSIX
a} :: DeviceNetworkProfileInfo) ((Maybe POSIX -> f (Maybe POSIX))
 -> DeviceNetworkProfileInfo -> f DeviceNetworkProfileInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DeviceNetworkProfileInfo
-> f DeviceNetworkProfileInfo
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

instance Core.FromJSON DeviceNetworkProfileInfo where
  parseJSON :: Value -> Parser DeviceNetworkProfileInfo
parseJSON =
    String
-> (Object -> Parser DeviceNetworkProfileInfo)
-> Value
-> Parser DeviceNetworkProfileInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DeviceNetworkProfileInfo"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe POSIX -> DeviceNetworkProfileInfo
DeviceNetworkProfileInfo'
            (Maybe Text
 -> Maybe Text -> Maybe POSIX -> DeviceNetworkProfileInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> DeviceNetworkProfileInfo)
forall (f :: * -> *) a b. Functor 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
"CertificateArn")
            Parser (Maybe Text -> Maybe POSIX -> DeviceNetworkProfileInfo)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> DeviceNetworkProfileInfo)
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
"NetworkProfileArn")
            Parser (Maybe POSIX -> DeviceNetworkProfileInfo)
-> Parser (Maybe POSIX) -> Parser DeviceNetworkProfileInfo
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
"CertificateExpirationTime")
      )

instance Prelude.Hashable DeviceNetworkProfileInfo

instance Prelude.NFData DeviceNetworkProfileInfo