{-# 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.MediaLive.Types.TransferringInputDeviceSummary
-- 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.MediaLive.Types.TransferringInputDeviceSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.InputDeviceTransferType
import qualified Amazonka.Prelude as Prelude

-- | Details about the input device that is being transferred.
--
-- /See:/ 'newTransferringInputDeviceSummary' smart constructor.
data TransferringInputDeviceSummary = TransferringInputDeviceSummary'
  { -- | The type (direction) of the input device transfer.
    TransferringInputDeviceSummary -> Maybe InputDeviceTransferType
transferType :: Prelude.Maybe InputDeviceTransferType,
    -- | The unique ID of the input device.
    TransferringInputDeviceSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The AWS account ID for the recipient of the input device transfer.
    TransferringInputDeviceSummary -> Maybe Text
targetCustomerId :: Prelude.Maybe Prelude.Text,
    -- | The optional message that the sender has attached to the transfer.
    TransferringInputDeviceSummary -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (TransferringInputDeviceSummary
-> TransferringInputDeviceSummary -> Bool
(TransferringInputDeviceSummary
 -> TransferringInputDeviceSummary -> Bool)
-> (TransferringInputDeviceSummary
    -> TransferringInputDeviceSummary -> Bool)
-> Eq TransferringInputDeviceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransferringInputDeviceSummary
-> TransferringInputDeviceSummary -> Bool
$c/= :: TransferringInputDeviceSummary
-> TransferringInputDeviceSummary -> Bool
== :: TransferringInputDeviceSummary
-> TransferringInputDeviceSummary -> Bool
$c== :: TransferringInputDeviceSummary
-> TransferringInputDeviceSummary -> Bool
Prelude.Eq, ReadPrec [TransferringInputDeviceSummary]
ReadPrec TransferringInputDeviceSummary
Int -> ReadS TransferringInputDeviceSummary
ReadS [TransferringInputDeviceSummary]
(Int -> ReadS TransferringInputDeviceSummary)
-> ReadS [TransferringInputDeviceSummary]
-> ReadPrec TransferringInputDeviceSummary
-> ReadPrec [TransferringInputDeviceSummary]
-> Read TransferringInputDeviceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransferringInputDeviceSummary]
$creadListPrec :: ReadPrec [TransferringInputDeviceSummary]
readPrec :: ReadPrec TransferringInputDeviceSummary
$creadPrec :: ReadPrec TransferringInputDeviceSummary
readList :: ReadS [TransferringInputDeviceSummary]
$creadList :: ReadS [TransferringInputDeviceSummary]
readsPrec :: Int -> ReadS TransferringInputDeviceSummary
$creadsPrec :: Int -> ReadS TransferringInputDeviceSummary
Prelude.Read, Int -> TransferringInputDeviceSummary -> ShowS
[TransferringInputDeviceSummary] -> ShowS
TransferringInputDeviceSummary -> String
(Int -> TransferringInputDeviceSummary -> ShowS)
-> (TransferringInputDeviceSummary -> String)
-> ([TransferringInputDeviceSummary] -> ShowS)
-> Show TransferringInputDeviceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransferringInputDeviceSummary] -> ShowS
$cshowList :: [TransferringInputDeviceSummary] -> ShowS
show :: TransferringInputDeviceSummary -> String
$cshow :: TransferringInputDeviceSummary -> String
showsPrec :: Int -> TransferringInputDeviceSummary -> ShowS
$cshowsPrec :: Int -> TransferringInputDeviceSummary -> ShowS
Prelude.Show, (forall x.
 TransferringInputDeviceSummary
 -> Rep TransferringInputDeviceSummary x)
-> (forall x.
    Rep TransferringInputDeviceSummary x
    -> TransferringInputDeviceSummary)
-> Generic TransferringInputDeviceSummary
forall x.
Rep TransferringInputDeviceSummary x
-> TransferringInputDeviceSummary
forall x.
TransferringInputDeviceSummary
-> Rep TransferringInputDeviceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TransferringInputDeviceSummary x
-> TransferringInputDeviceSummary
$cfrom :: forall x.
TransferringInputDeviceSummary
-> Rep TransferringInputDeviceSummary x
Prelude.Generic)

-- |
-- Create a value of 'TransferringInputDeviceSummary' 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:
--
-- 'transferType', 'transferringInputDeviceSummary_transferType' - The type (direction) of the input device transfer.
--
-- 'id', 'transferringInputDeviceSummary_id' - The unique ID of the input device.
--
-- 'targetCustomerId', 'transferringInputDeviceSummary_targetCustomerId' - The AWS account ID for the recipient of the input device transfer.
--
-- 'message', 'transferringInputDeviceSummary_message' - The optional message that the sender has attached to the transfer.
newTransferringInputDeviceSummary ::
  TransferringInputDeviceSummary
newTransferringInputDeviceSummary :: TransferringInputDeviceSummary
newTransferringInputDeviceSummary =
  TransferringInputDeviceSummary' :: Maybe InputDeviceTransferType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TransferringInputDeviceSummary
TransferringInputDeviceSummary'
    { $sel:transferType:TransferringInputDeviceSummary' :: Maybe InputDeviceTransferType
transferType =
        Maybe InputDeviceTransferType
forall a. Maybe a
Prelude.Nothing,
      $sel:id:TransferringInputDeviceSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetCustomerId:TransferringInputDeviceSummary' :: Maybe Text
targetCustomerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:message:TransferringInputDeviceSummary' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The type (direction) of the input device transfer.
transferringInputDeviceSummary_transferType :: Lens.Lens' TransferringInputDeviceSummary (Prelude.Maybe InputDeviceTransferType)
transferringInputDeviceSummary_transferType :: (Maybe InputDeviceTransferType
 -> f (Maybe InputDeviceTransferType))
-> TransferringInputDeviceSummary
-> f TransferringInputDeviceSummary
transferringInputDeviceSummary_transferType = (TransferringInputDeviceSummary -> Maybe InputDeviceTransferType)
-> (TransferringInputDeviceSummary
    -> Maybe InputDeviceTransferType -> TransferringInputDeviceSummary)
-> Lens
     TransferringInputDeviceSummary
     TransferringInputDeviceSummary
     (Maybe InputDeviceTransferType)
     (Maybe InputDeviceTransferType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferringInputDeviceSummary' {Maybe InputDeviceTransferType
transferType :: Maybe InputDeviceTransferType
$sel:transferType:TransferringInputDeviceSummary' :: TransferringInputDeviceSummary -> Maybe InputDeviceTransferType
transferType} -> Maybe InputDeviceTransferType
transferType) (\s :: TransferringInputDeviceSummary
s@TransferringInputDeviceSummary' {} Maybe InputDeviceTransferType
a -> TransferringInputDeviceSummary
s {$sel:transferType:TransferringInputDeviceSummary' :: Maybe InputDeviceTransferType
transferType = Maybe InputDeviceTransferType
a} :: TransferringInputDeviceSummary)

-- | The unique ID of the input device.
transferringInputDeviceSummary_id :: Lens.Lens' TransferringInputDeviceSummary (Prelude.Maybe Prelude.Text)
transferringInputDeviceSummary_id :: (Maybe Text -> f (Maybe Text))
-> TransferringInputDeviceSummary
-> f TransferringInputDeviceSummary
transferringInputDeviceSummary_id = (TransferringInputDeviceSummary -> Maybe Text)
-> (TransferringInputDeviceSummary
    -> Maybe Text -> TransferringInputDeviceSummary)
-> Lens
     TransferringInputDeviceSummary
     TransferringInputDeviceSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferringInputDeviceSummary' {Maybe Text
id :: Maybe Text
$sel:id:TransferringInputDeviceSummary' :: TransferringInputDeviceSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: TransferringInputDeviceSummary
s@TransferringInputDeviceSummary' {} Maybe Text
a -> TransferringInputDeviceSummary
s {$sel:id:TransferringInputDeviceSummary' :: Maybe Text
id = Maybe Text
a} :: TransferringInputDeviceSummary)

-- | The AWS account ID for the recipient of the input device transfer.
transferringInputDeviceSummary_targetCustomerId :: Lens.Lens' TransferringInputDeviceSummary (Prelude.Maybe Prelude.Text)
transferringInputDeviceSummary_targetCustomerId :: (Maybe Text -> f (Maybe Text))
-> TransferringInputDeviceSummary
-> f TransferringInputDeviceSummary
transferringInputDeviceSummary_targetCustomerId = (TransferringInputDeviceSummary -> Maybe Text)
-> (TransferringInputDeviceSummary
    -> Maybe Text -> TransferringInputDeviceSummary)
-> Lens
     TransferringInputDeviceSummary
     TransferringInputDeviceSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferringInputDeviceSummary' {Maybe Text
targetCustomerId :: Maybe Text
$sel:targetCustomerId:TransferringInputDeviceSummary' :: TransferringInputDeviceSummary -> Maybe Text
targetCustomerId} -> Maybe Text
targetCustomerId) (\s :: TransferringInputDeviceSummary
s@TransferringInputDeviceSummary' {} Maybe Text
a -> TransferringInputDeviceSummary
s {$sel:targetCustomerId:TransferringInputDeviceSummary' :: Maybe Text
targetCustomerId = Maybe Text
a} :: TransferringInputDeviceSummary)

-- | The optional message that the sender has attached to the transfer.
transferringInputDeviceSummary_message :: Lens.Lens' TransferringInputDeviceSummary (Prelude.Maybe Prelude.Text)
transferringInputDeviceSummary_message :: (Maybe Text -> f (Maybe Text))
-> TransferringInputDeviceSummary
-> f TransferringInputDeviceSummary
transferringInputDeviceSummary_message = (TransferringInputDeviceSummary -> Maybe Text)
-> (TransferringInputDeviceSummary
    -> Maybe Text -> TransferringInputDeviceSummary)
-> Lens
     TransferringInputDeviceSummary
     TransferringInputDeviceSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferringInputDeviceSummary' {Maybe Text
message :: Maybe Text
$sel:message:TransferringInputDeviceSummary' :: TransferringInputDeviceSummary -> Maybe Text
message} -> Maybe Text
message) (\s :: TransferringInputDeviceSummary
s@TransferringInputDeviceSummary' {} Maybe Text
a -> TransferringInputDeviceSummary
s {$sel:message:TransferringInputDeviceSummary' :: Maybe Text
message = Maybe Text
a} :: TransferringInputDeviceSummary)

instance Core.FromJSON TransferringInputDeviceSummary where
  parseJSON :: Value -> Parser TransferringInputDeviceSummary
parseJSON =
    String
-> (Object -> Parser TransferringInputDeviceSummary)
-> Value
-> Parser TransferringInputDeviceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TransferringInputDeviceSummary"
      ( \Object
x ->
          Maybe InputDeviceTransferType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TransferringInputDeviceSummary
TransferringInputDeviceSummary'
            (Maybe InputDeviceTransferType
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> TransferringInputDeviceSummary)
-> Parser (Maybe InputDeviceTransferType)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> TransferringInputDeviceSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InputDeviceTransferType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"transferType")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> TransferringInputDeviceSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> TransferringInputDeviceSummary)
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
"id")
            Parser (Maybe Text -> Maybe Text -> TransferringInputDeviceSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> TransferringInputDeviceSummary)
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
"targetCustomerId")
            Parser (Maybe Text -> TransferringInputDeviceSummary)
-> Parser (Maybe Text) -> Parser TransferringInputDeviceSummary
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
"message")
      )

instance
  Prelude.Hashable
    TransferringInputDeviceSummary

instance
  Prelude.NFData
    TransferringInputDeviceSummary