{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | A unique identifier for the attachment.
    AttachmentItem -> Maybe Text
attachmentId :: Prelude.Maybe Prelude.Text,
    -- | A case-sensitive name of the attachment being uploaded.
    AttachmentItem -> Maybe Text
attachmentName :: 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/feature-limits.html Feature specifications>
    -- in the /Amazon Connect Administrator Guide/.
    AttachmentItem -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | Status of the attachment.
    AttachmentItem -> Maybe ArtifactStatus
status :: Prelude.Maybe ArtifactStatus
  }
  deriving (AttachmentItem -> AttachmentItem -> Bool
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]
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
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. 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:
--
-- 'attachmentId', 'attachmentItem_attachmentId' - A unique identifier for the attachment.
--
-- 'attachmentName', 'attachmentItem_attachmentName' - A case-sensitive name of the attachment being uploaded.
--
-- '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/feature-limits.html Feature specifications>
-- in the /Amazon Connect Administrator Guide/.
--
-- 'status', 'attachmentItem_status' - Status of the attachment.
newAttachmentItem ::
  AttachmentItem
newAttachmentItem :: AttachmentItem
newAttachmentItem =
  AttachmentItem'
    { $sel:attachmentId:AttachmentItem' :: Maybe Text
attachmentId = forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentName:AttachmentItem' :: Maybe Text
attachmentName = forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:AttachmentItem' :: Maybe Text
contentType = forall a. Maybe a
Prelude.Nothing,
      $sel:status:AttachmentItem' :: Maybe ArtifactStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier for the attachment.
attachmentItem_attachmentId :: Lens.Lens' AttachmentItem (Prelude.Maybe Prelude.Text)
attachmentItem_attachmentId :: Lens' AttachmentItem (Maybe Text)
attachmentItem_attachmentId = 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)

-- | A case-sensitive name of the attachment being uploaded.
attachmentItem_attachmentName :: Lens.Lens' AttachmentItem (Prelude.Maybe Prelude.Text)
attachmentItem_attachmentName :: Lens' AttachmentItem (Maybe Text)
attachmentItem_attachmentName = 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)

-- | Describes the MIME file type of the attachment. For a list of supported
-- file types, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/feature-limits.html Feature specifications>
-- in the /Amazon Connect Administrator Guide/.
attachmentItem_contentType :: Lens.Lens' AttachmentItem (Prelude.Maybe Prelude.Text)
attachmentItem_contentType :: Lens' AttachmentItem (Maybe Text)
attachmentItem_contentType = 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)

-- | Status of the attachment.
attachmentItem_status :: Lens.Lens' AttachmentItem (Prelude.Maybe ArtifactStatus)
attachmentItem_status :: Lens' AttachmentItem (Maybe ArtifactStatus)
attachmentItem_status = 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)

instance Data.FromJSON AttachmentItem where
  parseJSON :: Value -> Parser AttachmentItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AttachmentItem"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ArtifactStatus
-> AttachmentItem
AttachmentItem'
            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
"AttachmentId")
            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
"AttachmentName")
            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
"ContentType")
            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")
      )

instance Prelude.Hashable AttachmentItem where
  hashWithSalt :: Int -> AttachmentItem -> Int
hashWithSalt Int
_salt AttachmentItem' {Maybe Text
Maybe ArtifactStatus
status :: Maybe ArtifactStatus
contentType :: Maybe Text
attachmentName :: Maybe Text
attachmentId :: Maybe Text
$sel:status:AttachmentItem' :: AttachmentItem -> Maybe ArtifactStatus
$sel:contentType:AttachmentItem' :: AttachmentItem -> Maybe Text
$sel:attachmentName:AttachmentItem' :: AttachmentItem -> Maybe Text
$sel:attachmentId:AttachmentItem' :: AttachmentItem -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attachmentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attachmentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ArtifactStatus
status

instance Prelude.NFData AttachmentItem where
  rnf :: AttachmentItem -> ()
rnf AttachmentItem' {Maybe Text
Maybe ArtifactStatus
status :: Maybe ArtifactStatus
contentType :: Maybe Text
attachmentName :: Maybe Text
attachmentId :: Maybe Text
$sel:status:AttachmentItem' :: AttachmentItem -> Maybe ArtifactStatus
$sel:contentType:AttachmentItem' :: AttachmentItem -> Maybe Text
$sel:attachmentName:AttachmentItem' :: AttachmentItem -> Maybe Text
$sel:attachmentId:AttachmentItem' :: AttachmentItem -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attachmentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attachmentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ArtifactStatus
status