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

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

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

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

instance Prelude.Hashable DeviceNetworkProfileInfo where
  hashWithSalt :: Int -> DeviceNetworkProfileInfo -> Int
hashWithSalt Int
_salt DeviceNetworkProfileInfo' {Maybe Text
Maybe POSIX
networkProfileArn :: Maybe Text
certificateExpirationTime :: Maybe POSIX
certificateArn :: Maybe Text
$sel:networkProfileArn:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe Text
$sel:certificateExpirationTime:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe POSIX
$sel:certificateArn:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
certificateExpirationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
networkProfileArn

instance Prelude.NFData DeviceNetworkProfileInfo where
  rnf :: DeviceNetworkProfileInfo -> ()
rnf DeviceNetworkProfileInfo' {Maybe Text
Maybe POSIX
networkProfileArn :: Maybe Text
certificateExpirationTime :: Maybe POSIX
certificateArn :: Maybe Text
$sel:networkProfileArn:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe Text
$sel:certificateExpirationTime:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe POSIX
$sel:certificateArn:DeviceNetworkProfileInfo' :: DeviceNetworkProfileInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
certificateExpirationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
networkProfileArn