{-# 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.ConnectParticipant.Types.AttachmentItem
-- 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.ConnectParticipant.Types.AttachmentItem where

import Amazonka.ConnectParticipant.Types.ArtifactStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The case-insensitive input to indicate standard MIME type that describes
-- the format of the file that will be uploaded.
--
-- /See:/ 'newAttachmentItem' smart constructor.
data AttachmentItem = AttachmentItem'
  { -- | Status of the attachment.
    AttachmentItem -> Maybe ArtifactStatus
status :: Prelude.Maybe ArtifactStatus,
    -- | A case-sensitive name of the attachment being uploaded.
    AttachmentItem -> Maybe Text
attachmentName :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the attachment.
    AttachmentItem -> Maybe Text
attachmentId :: Prelude.Maybe Prelude.Text,
    -- | Describes the MIME file type of the attachment. For a list of supported
    -- file types, see
    -- <https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#feature-limits Feature specifications>
    -- in the /Amazon Connect Administrator Guide/.
    AttachmentItem -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text
  }
  deriving (AttachmentItem -> AttachmentItem -> Bool
(AttachmentItem -> AttachmentItem -> Bool)
-> (AttachmentItem -> AttachmentItem -> Bool) -> Eq AttachmentItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachmentItem -> AttachmentItem -> Bool
$c/= :: AttachmentItem -> AttachmentItem -> Bool
== :: AttachmentItem -> AttachmentItem -> Bool
$c== :: AttachmentItem -> AttachmentItem -> Bool
Prelude.Eq, ReadPrec [AttachmentItem]
ReadPrec AttachmentItem
Int -> ReadS AttachmentItem
ReadS [AttachmentItem]
(Int -> ReadS AttachmentItem)
-> ReadS [AttachmentItem]
-> ReadPrec AttachmentItem
-> ReadPrec [AttachmentItem]
-> Read AttachmentItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachmentItem]
$creadListPrec :: ReadPrec [AttachmentItem]
readPrec :: ReadPrec AttachmentItem
$creadPrec :: ReadPrec AttachmentItem
readList :: ReadS [AttachmentItem]
$creadList :: ReadS [AttachmentItem]
readsPrec :: Int -> ReadS AttachmentItem
$creadsPrec :: Int -> ReadS AttachmentItem
Prelude.Read, Int -> AttachmentItem -> ShowS
[AttachmentItem] -> ShowS
AttachmentItem -> String
(Int -> AttachmentItem -> ShowS)
-> (AttachmentItem -> String)
-> ([AttachmentItem] -> ShowS)
-> Show AttachmentItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachmentItem] -> ShowS
$cshowList :: [AttachmentItem] -> ShowS
show :: AttachmentItem -> String
$cshow :: AttachmentItem -> String
showsPrec :: Int -> AttachmentItem -> ShowS
$cshowsPrec :: Int -> AttachmentItem -> ShowS
Prelude.Show, (forall x. AttachmentItem -> Rep AttachmentItem x)
-> (forall x. Rep AttachmentItem x -> AttachmentItem)
-> Generic AttachmentItem
forall x. Rep AttachmentItem x -> AttachmentItem
forall x. AttachmentItem -> Rep AttachmentItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttachmentItem x -> AttachmentItem
$cfrom :: forall x. AttachmentItem -> Rep AttachmentItem x
Prelude.Generic)

-- |
-- Create a value of 'AttachmentItem' 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:
--
-- 'status', 'attachmentItem_status' - Status of the attachment.
--
-- 'attachmentName', 'attachmentItem_attachmentName' - A case-sensitive name of the attachment being uploaded.
--
-- 'attachmentId', 'attachmentItem_attachmentId' - A unique identifier for the attachment.
--
-- 'contentType', 'attachmentItem_contentType' - Describes the MIME file type of the attachment. For a list of supported
-- file types, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#feature-limits Feature specifications>
-- in the /Amazon Connect Administrator Guide/.
newAttachmentItem ::
  AttachmentItem
newAttachmentItem :: AttachmentItem
newAttachmentItem =
  AttachmentItem' :: Maybe ArtifactStatus
-> Maybe Text -> Maybe Text -> Maybe Text -> AttachmentItem
AttachmentItem'
    { $sel:status:AttachmentItem' :: Maybe ArtifactStatus
status = Maybe ArtifactStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentName:AttachmentItem' :: Maybe Text
attachmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentId:AttachmentItem' :: Maybe Text
attachmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:AttachmentItem' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Status of the attachment.
attachmentItem_status :: Lens.Lens' AttachmentItem (Prelude.Maybe ArtifactStatus)
attachmentItem_status :: (Maybe ArtifactStatus -> f (Maybe ArtifactStatus))
-> AttachmentItem -> f AttachmentItem
attachmentItem_status = (AttachmentItem -> Maybe ArtifactStatus)
-> (AttachmentItem -> Maybe ArtifactStatus -> AttachmentItem)
-> Lens
     AttachmentItem
     AttachmentItem
     (Maybe ArtifactStatus)
     (Maybe ArtifactStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentItem' {Maybe ArtifactStatus
status :: Maybe ArtifactStatus
$sel:status:AttachmentItem' :: AttachmentItem -> Maybe ArtifactStatus
status} -> Maybe ArtifactStatus
status) (\s :: AttachmentItem
s@AttachmentItem' {} Maybe ArtifactStatus
a -> AttachmentItem
s {$sel:status:AttachmentItem' :: Maybe ArtifactStatus
status = Maybe ArtifactStatus
a} :: AttachmentItem)

-- | A case-sensitive name of the attachment being uploaded.
attachmentItem_attachmentName :: Lens.Lens' AttachmentItem (Prelude.Maybe Prelude.Text)
attachmentItem_attachmentName :: (Maybe Text -> f (Maybe Text))
-> AttachmentItem -> f AttachmentItem
attachmentItem_attachmentName = (AttachmentItem -> Maybe Text)
-> (AttachmentItem -> Maybe Text -> AttachmentItem)
-> Lens AttachmentItem AttachmentItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentItem' {Maybe Text
attachmentName :: Maybe Text
$sel:attachmentName:AttachmentItem' :: AttachmentItem -> Maybe Text
attachmentName} -> Maybe Text
attachmentName) (\s :: AttachmentItem
s@AttachmentItem' {} Maybe Text
a -> AttachmentItem
s {$sel:attachmentName:AttachmentItem' :: Maybe Text
attachmentName = Maybe Text
a} :: AttachmentItem)

-- | A unique identifier for the attachment.
attachmentItem_attachmentId :: Lens.Lens' AttachmentItem (Prelude.Maybe Prelude.Text)
attachmentItem_attachmentId :: (Maybe Text -> f (Maybe Text))
-> AttachmentItem -> f AttachmentItem
attachmentItem_attachmentId = (AttachmentItem -> Maybe Text)
-> (AttachmentItem -> Maybe Text -> AttachmentItem)
-> Lens AttachmentItem AttachmentItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentItem' {Maybe Text
attachmentId :: Maybe Text
$sel:attachmentId:AttachmentItem' :: AttachmentItem -> Maybe Text
attachmentId} -> Maybe Text
attachmentId) (\s :: AttachmentItem
s@AttachmentItem' {} Maybe Text
a -> AttachmentItem
s {$sel:attachmentId:AttachmentItem' :: Maybe Text
attachmentId = Maybe Text
a} :: AttachmentItem)

-- | Describes the MIME file type of the attachment. For a list of supported
-- file types, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#feature-limits Feature specifications>
-- in the /Amazon Connect Administrator Guide/.
attachmentItem_contentType :: Lens.Lens' AttachmentItem (Prelude.Maybe Prelude.Text)
attachmentItem_contentType :: (Maybe Text -> f (Maybe Text))
-> AttachmentItem -> f AttachmentItem
attachmentItem_contentType = (AttachmentItem -> Maybe Text)
-> (AttachmentItem -> Maybe Text -> AttachmentItem)
-> Lens AttachmentItem AttachmentItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentItem' {Maybe Text
contentType :: Maybe Text
$sel:contentType:AttachmentItem' :: AttachmentItem -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: AttachmentItem
s@AttachmentItem' {} Maybe Text
a -> AttachmentItem
s {$sel:contentType:AttachmentItem' :: Maybe Text
contentType = Maybe Text
a} :: AttachmentItem)

instance Core.FromJSON AttachmentItem where
  parseJSON :: Value -> Parser AttachmentItem
parseJSON =
    String
-> (Object -> Parser AttachmentItem)
-> Value
-> Parser AttachmentItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AttachmentItem"
      ( \Object
x ->
          Maybe ArtifactStatus
-> Maybe Text -> Maybe Text -> Maybe Text -> AttachmentItem
AttachmentItem'
            (Maybe ArtifactStatus
 -> Maybe Text -> Maybe Text -> Maybe Text -> AttachmentItem)
-> Parser (Maybe ArtifactStatus)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> AttachmentItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ArtifactStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> AttachmentItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AttachmentItem)
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
"AttachmentName")
            Parser (Maybe Text -> Maybe Text -> AttachmentItem)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AttachmentItem)
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
"AttachmentId")
            Parser (Maybe Text -> AttachmentItem)
-> Parser (Maybe Text) -> Parser AttachmentItem
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
"ContentType")
      )

instance Prelude.Hashable AttachmentItem

instance Prelude.NFData AttachmentItem