{-# 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.PrivateNetworks.Types.DeviceIdentifier
-- 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.PrivateNetworks.Types.DeviceIdentifier 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
import Amazonka.PrivateNetworks.Types.DeviceIdentifierStatus

-- | Information about a subscriber of a device that can use a network.
--
-- /See:/ 'newDeviceIdentifier' smart constructor.
data DeviceIdentifier = DeviceIdentifier'
  { -- | The creation time of this device identifier.
    DeviceIdentifier -> Maybe ISO8601
createdAt :: Prelude.Maybe Data.ISO8601,
    -- | The Amazon Resource Name (ARN) of the device identifier.
    DeviceIdentifier -> Maybe Text
deviceIdentifierArn :: Prelude.Maybe Prelude.Text,
    -- | The Integrated Circuit Card Identifier of the device identifier.
    DeviceIdentifier -> Maybe Text
iccid :: Prelude.Maybe Prelude.Text,
    -- | The International Mobile Subscriber Identity of the device identifier.
    DeviceIdentifier -> Maybe (Sensitive Text)
imsi :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the network on which the device
    -- identifier appears.
    DeviceIdentifier -> Maybe Text
networkArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the order used to purchase the device
    -- identifier.
    DeviceIdentifier -> Maybe Text
orderArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the device identifier.
    DeviceIdentifier -> Maybe DeviceIdentifierStatus
status :: Prelude.Maybe DeviceIdentifierStatus,
    -- | The Amazon Resource Name (ARN) of the traffic group to which the device
    -- identifier belongs.
    DeviceIdentifier -> Maybe Text
trafficGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The vendor of the device identifier.
    DeviceIdentifier -> Maybe Text
vendor :: Prelude.Maybe Prelude.Text
  }
  deriving (DeviceIdentifier -> DeviceIdentifier -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceIdentifier -> DeviceIdentifier -> Bool
$c/= :: DeviceIdentifier -> DeviceIdentifier -> Bool
== :: DeviceIdentifier -> DeviceIdentifier -> Bool
$c== :: DeviceIdentifier -> DeviceIdentifier -> Bool
Prelude.Eq, Int -> DeviceIdentifier -> ShowS
[DeviceIdentifier] -> ShowS
DeviceIdentifier -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceIdentifier] -> ShowS
$cshowList :: [DeviceIdentifier] -> ShowS
show :: DeviceIdentifier -> String
$cshow :: DeviceIdentifier -> String
showsPrec :: Int -> DeviceIdentifier -> ShowS
$cshowsPrec :: Int -> DeviceIdentifier -> ShowS
Prelude.Show, forall x. Rep DeviceIdentifier x -> DeviceIdentifier
forall x. DeviceIdentifier -> Rep DeviceIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceIdentifier x -> DeviceIdentifier
$cfrom :: forall x. DeviceIdentifier -> Rep DeviceIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'DeviceIdentifier' 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:
--
-- 'createdAt', 'deviceIdentifier_createdAt' - The creation time of this device identifier.
--
-- 'deviceIdentifierArn', 'deviceIdentifier_deviceIdentifierArn' - The Amazon Resource Name (ARN) of the device identifier.
--
-- 'iccid', 'deviceIdentifier_iccid' - The Integrated Circuit Card Identifier of the device identifier.
--
-- 'imsi', 'deviceIdentifier_imsi' - The International Mobile Subscriber Identity of the device identifier.
--
-- 'networkArn', 'deviceIdentifier_networkArn' - The Amazon Resource Name (ARN) of the network on which the device
-- identifier appears.
--
-- 'orderArn', 'deviceIdentifier_orderArn' - The Amazon Resource Name (ARN) of the order used to purchase the device
-- identifier.
--
-- 'status', 'deviceIdentifier_status' - The status of the device identifier.
--
-- 'trafficGroupArn', 'deviceIdentifier_trafficGroupArn' - The Amazon Resource Name (ARN) of the traffic group to which the device
-- identifier belongs.
--
-- 'vendor', 'deviceIdentifier_vendor' - The vendor of the device identifier.
newDeviceIdentifier ::
  DeviceIdentifier
newDeviceIdentifier :: DeviceIdentifier
newDeviceIdentifier =
  DeviceIdentifier'
    { $sel:createdAt:DeviceIdentifier' :: Maybe ISO8601
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceIdentifierArn:DeviceIdentifier' :: Maybe Text
deviceIdentifierArn = forall a. Maybe a
Prelude.Nothing,
      $sel:iccid:DeviceIdentifier' :: Maybe Text
iccid = forall a. Maybe a
Prelude.Nothing,
      $sel:imsi:DeviceIdentifier' :: Maybe (Sensitive Text)
imsi = forall a. Maybe a
Prelude.Nothing,
      $sel:networkArn:DeviceIdentifier' :: Maybe Text
networkArn = forall a. Maybe a
Prelude.Nothing,
      $sel:orderArn:DeviceIdentifier' :: Maybe Text
orderArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DeviceIdentifier' :: Maybe DeviceIdentifierStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:trafficGroupArn:DeviceIdentifier' :: Maybe Text
trafficGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:vendor:DeviceIdentifier' :: Maybe Text
vendor = forall a. Maybe a
Prelude.Nothing
    }

-- | The creation time of this device identifier.
deviceIdentifier_createdAt :: Lens.Lens' DeviceIdentifier (Prelude.Maybe Prelude.UTCTime)
deviceIdentifier_createdAt :: Lens' DeviceIdentifier (Maybe UTCTime)
deviceIdentifier_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe ISO8601
createdAt :: Maybe ISO8601
$sel:createdAt:DeviceIdentifier' :: DeviceIdentifier -> Maybe ISO8601
createdAt} -> Maybe ISO8601
createdAt) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe ISO8601
a -> DeviceIdentifier
s {$sel:createdAt:DeviceIdentifier' :: Maybe ISO8601
createdAt = Maybe ISO8601
a} :: DeviceIdentifier) 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 Amazon Resource Name (ARN) of the device identifier.
deviceIdentifier_deviceIdentifierArn :: Lens.Lens' DeviceIdentifier (Prelude.Maybe Prelude.Text)
deviceIdentifier_deviceIdentifierArn :: Lens' DeviceIdentifier (Maybe Text)
deviceIdentifier_deviceIdentifierArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe Text
deviceIdentifierArn :: Maybe Text
$sel:deviceIdentifierArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
deviceIdentifierArn} -> Maybe Text
deviceIdentifierArn) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe Text
a -> DeviceIdentifier
s {$sel:deviceIdentifierArn:DeviceIdentifier' :: Maybe Text
deviceIdentifierArn = Maybe Text
a} :: DeviceIdentifier)

-- | The Integrated Circuit Card Identifier of the device identifier.
deviceIdentifier_iccid :: Lens.Lens' DeviceIdentifier (Prelude.Maybe Prelude.Text)
deviceIdentifier_iccid :: Lens' DeviceIdentifier (Maybe Text)
deviceIdentifier_iccid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe Text
iccid :: Maybe Text
$sel:iccid:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
iccid} -> Maybe Text
iccid) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe Text
a -> DeviceIdentifier
s {$sel:iccid:DeviceIdentifier' :: Maybe Text
iccid = Maybe Text
a} :: DeviceIdentifier)

-- | The International Mobile Subscriber Identity of the device identifier.
deviceIdentifier_imsi :: Lens.Lens' DeviceIdentifier (Prelude.Maybe Prelude.Text)
deviceIdentifier_imsi :: Lens' DeviceIdentifier (Maybe Text)
deviceIdentifier_imsi = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe (Sensitive Text)
imsi :: Maybe (Sensitive Text)
$sel:imsi:DeviceIdentifier' :: DeviceIdentifier -> Maybe (Sensitive Text)
imsi} -> Maybe (Sensitive Text)
imsi) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe (Sensitive Text)
a -> DeviceIdentifier
s {$sel:imsi:DeviceIdentifier' :: Maybe (Sensitive Text)
imsi = Maybe (Sensitive Text)
a} :: DeviceIdentifier) 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. Iso' (Sensitive a) a
Data._Sensitive

-- | The Amazon Resource Name (ARN) of the network on which the device
-- identifier appears.
deviceIdentifier_networkArn :: Lens.Lens' DeviceIdentifier (Prelude.Maybe Prelude.Text)
deviceIdentifier_networkArn :: Lens' DeviceIdentifier (Maybe Text)
deviceIdentifier_networkArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe Text
networkArn :: Maybe Text
$sel:networkArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
networkArn} -> Maybe Text
networkArn) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe Text
a -> DeviceIdentifier
s {$sel:networkArn:DeviceIdentifier' :: Maybe Text
networkArn = Maybe Text
a} :: DeviceIdentifier)

-- | The Amazon Resource Name (ARN) of the order used to purchase the device
-- identifier.
deviceIdentifier_orderArn :: Lens.Lens' DeviceIdentifier (Prelude.Maybe Prelude.Text)
deviceIdentifier_orderArn :: Lens' DeviceIdentifier (Maybe Text)
deviceIdentifier_orderArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe Text
orderArn :: Maybe Text
$sel:orderArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
orderArn} -> Maybe Text
orderArn) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe Text
a -> DeviceIdentifier
s {$sel:orderArn:DeviceIdentifier' :: Maybe Text
orderArn = Maybe Text
a} :: DeviceIdentifier)

-- | The status of the device identifier.
deviceIdentifier_status :: Lens.Lens' DeviceIdentifier (Prelude.Maybe DeviceIdentifierStatus)
deviceIdentifier_status :: Lens' DeviceIdentifier (Maybe DeviceIdentifierStatus)
deviceIdentifier_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe DeviceIdentifierStatus
status :: Maybe DeviceIdentifierStatus
$sel:status:DeviceIdentifier' :: DeviceIdentifier -> Maybe DeviceIdentifierStatus
status} -> Maybe DeviceIdentifierStatus
status) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe DeviceIdentifierStatus
a -> DeviceIdentifier
s {$sel:status:DeviceIdentifier' :: Maybe DeviceIdentifierStatus
status = Maybe DeviceIdentifierStatus
a} :: DeviceIdentifier)

-- | The Amazon Resource Name (ARN) of the traffic group to which the device
-- identifier belongs.
deviceIdentifier_trafficGroupArn :: Lens.Lens' DeviceIdentifier (Prelude.Maybe Prelude.Text)
deviceIdentifier_trafficGroupArn :: Lens' DeviceIdentifier (Maybe Text)
deviceIdentifier_trafficGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe Text
trafficGroupArn :: Maybe Text
$sel:trafficGroupArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
trafficGroupArn} -> Maybe Text
trafficGroupArn) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe Text
a -> DeviceIdentifier
s {$sel:trafficGroupArn:DeviceIdentifier' :: Maybe Text
trafficGroupArn = Maybe Text
a} :: DeviceIdentifier)

-- | The vendor of the device identifier.
deviceIdentifier_vendor :: Lens.Lens' DeviceIdentifier (Prelude.Maybe Prelude.Text)
deviceIdentifier_vendor :: Lens' DeviceIdentifier (Maybe Text)
deviceIdentifier_vendor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceIdentifier' {Maybe Text
vendor :: Maybe Text
$sel:vendor:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
vendor} -> Maybe Text
vendor) (\s :: DeviceIdentifier
s@DeviceIdentifier' {} Maybe Text
a -> DeviceIdentifier
s {$sel:vendor:DeviceIdentifier' :: Maybe Text
vendor = Maybe Text
a} :: DeviceIdentifier)

instance Data.FromJSON DeviceIdentifier where
  parseJSON :: Value -> Parser DeviceIdentifier
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DeviceIdentifier"
      ( \Object
x ->
          Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe DeviceIdentifierStatus
-> Maybe Text
-> Maybe Text
-> DeviceIdentifier
DeviceIdentifier'
            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
"createdAt")
            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
"deviceIdentifierArn")
            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
"iccid")
            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
"imsi")
            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
"networkArn")
            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
"orderArn")
            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
"status")
            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
"trafficGroupArn")
            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
"vendor")
      )

instance Prelude.Hashable DeviceIdentifier where
  hashWithSalt :: Int -> DeviceIdentifier -> Int
hashWithSalt Int
_salt DeviceIdentifier' {Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe DeviceIdentifierStatus
vendor :: Maybe Text
trafficGroupArn :: Maybe Text
status :: Maybe DeviceIdentifierStatus
orderArn :: Maybe Text
networkArn :: Maybe Text
imsi :: Maybe (Sensitive Text)
iccid :: Maybe Text
deviceIdentifierArn :: Maybe Text
createdAt :: Maybe ISO8601
$sel:vendor:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:trafficGroupArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:status:DeviceIdentifier' :: DeviceIdentifier -> Maybe DeviceIdentifierStatus
$sel:orderArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:networkArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:imsi:DeviceIdentifier' :: DeviceIdentifier -> Maybe (Sensitive Text)
$sel:iccid:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:deviceIdentifierArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:createdAt:DeviceIdentifier' :: DeviceIdentifier -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceIdentifierArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
iccid
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
imsi
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
networkArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
orderArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceIdentifierStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trafficGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vendor

instance Prelude.NFData DeviceIdentifier where
  rnf :: DeviceIdentifier -> ()
rnf DeviceIdentifier' {Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe DeviceIdentifierStatus
vendor :: Maybe Text
trafficGroupArn :: Maybe Text
status :: Maybe DeviceIdentifierStatus
orderArn :: Maybe Text
networkArn :: Maybe Text
imsi :: Maybe (Sensitive Text)
iccid :: Maybe Text
deviceIdentifierArn :: Maybe Text
createdAt :: Maybe ISO8601
$sel:vendor:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:trafficGroupArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:status:DeviceIdentifier' :: DeviceIdentifier -> Maybe DeviceIdentifierStatus
$sel:orderArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:networkArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:imsi:DeviceIdentifier' :: DeviceIdentifier -> Maybe (Sensitive Text)
$sel:iccid:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:deviceIdentifierArn:DeviceIdentifier' :: DeviceIdentifier -> Maybe Text
$sel:createdAt:DeviceIdentifier' :: DeviceIdentifier -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceIdentifierArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iccid
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
imsi
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
networkArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
orderArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceIdentifierStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trafficGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vendor