{-# 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.Support.Types.CaseDetails
-- 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.Support.Types.CaseDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Support.Types.RecentCaseCommunications

-- | A JSON-formatted object that contains the metadata for a support case.
-- It is contained in the response from a DescribeCases request.
-- __CaseDetails__ contains the following fields:
--
-- -   __caseId__ - The support case ID requested or returned in the call.
--     The case ID is an alphanumeric string formatted as shown in this
--     example: case-/12345678910-2013-c4c1d2bf33c5cf47/.
--
-- -   __categoryCode__ - The category of problem for the support case.
--     Corresponds to the @CategoryCode@ values returned by a call to
--     DescribeServices.
--
-- -   __displayId__ - The identifier for the case on pages in the AWS
--     Support Center.
--
-- -   __language__ - The ISO 639-1 code for the language in which AWS
--     provides support. AWS Support currently supports English (\"en\")
--     and Japanese (\"ja\"). Language parameters must be passed explicitly
--     for operations that take them.
--
-- -   __nextToken__ - A resumption point for pagination.
--
-- -   __recentCommunications__ - One or more Communication objects. Fields
--     of these objects are @attachments@, @body@, @caseId@, @submittedBy@,
--     and @timeCreated@.
--
-- -   __serviceCode__ - The identifier for the AWS service that
--     corresponds to the service code defined in the call to
--     DescribeServices.
--
-- -   __severityCode__ - The severity code assigned to the case. Contains
--     one of the values returned by the call to DescribeSeverityLevels.
--     The possible values are: @low@, @normal@, @high@, @urgent@, and
--     @critical@.
--
-- -   __status__ - The status of the case in the AWS Support Center. Valid
--     values:
--
--     -   @opened@
--
--     -   @pending-customer-action@
--
--     -   @reopened@
--
--     -   @resolved@
--
--     -   @unassigned@
--
--     -   @work-in-progress@
--
-- -   __subject__ - The subject line of the case.
--
-- -   __submittedBy__ - The email address of the account that submitted
--     the case.
--
-- -   __timeCreated__ - The time the case was created, in ISO-8601 format.
--
-- /See:/ 'newCaseDetails' smart constructor.
data CaseDetails = CaseDetails'
  { -- | The subject line for the case in the AWS Support Center.
    CaseDetails -> Maybe Text
subject :: Prelude.Maybe Prelude.Text,
    -- | The status of the case.
    --
    -- Valid values:
    --
    -- -   @opened@
    --
    -- -   @pending-customer-action@
    --
    -- -   @reopened@
    --
    -- -   @resolved@
    --
    -- -   @unassigned@
    --
    -- -   @work-in-progress@
    CaseDetails -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The five most recent communications between you and AWS Support Center,
    -- including the IDs of any attachments to the communications. Also
    -- includes a @nextToken@ that you can use to retrieve earlier
    -- communications.
    CaseDetails -> Maybe RecentCaseCommunications
recentCommunications :: Prelude.Maybe RecentCaseCommunications,
    -- | The code for the severity level returned by the call to
    -- DescribeSeverityLevels.
    CaseDetails -> Maybe Text
severityCode :: Prelude.Maybe Prelude.Text,
    -- | The support case ID requested or returned in the call. The case ID is an
    -- alphanumeric string formatted as shown in this example:
    -- case-/12345678910-2013-c4c1d2bf33c5cf47/
    CaseDetails -> Maybe Text
caseId :: Prelude.Maybe Prelude.Text,
    -- | The email addresses that receive copies of communication about the case.
    CaseDetails -> Maybe [Text]
ccEmailAddresses :: Prelude.Maybe [Prelude.Text],
    -- | The ID displayed for the case in the AWS Support Center. This is a
    -- numeric string.
    CaseDetails -> Maybe Text
displayId :: Prelude.Maybe Prelude.Text,
    -- | The email address of the account that submitted the case.
    CaseDetails -> Maybe Text
submittedBy :: Prelude.Maybe Prelude.Text,
    -- | The ISO 639-1 code for the language in which AWS provides support. AWS
    -- Support currently supports English (\"en\") and Japanese (\"ja\").
    -- Language parameters must be passed explicitly for operations that take
    -- them.
    CaseDetails -> Maybe Text
language :: Prelude.Maybe Prelude.Text,
    -- | The time that the case was created in the AWS Support Center.
    CaseDetails -> Maybe Text
timeCreated :: Prelude.Maybe Prelude.Text,
    -- | The category of problem for the support case.
    CaseDetails -> Maybe Text
categoryCode :: Prelude.Maybe Prelude.Text,
    -- | The code for the AWS service. You can get a list of codes and the
    -- corresponding service names by calling DescribeServices.
    CaseDetails -> Maybe Text
serviceCode :: Prelude.Maybe Prelude.Text
  }
  deriving (CaseDetails -> CaseDetails -> Bool
(CaseDetails -> CaseDetails -> Bool)
-> (CaseDetails -> CaseDetails -> Bool) -> Eq CaseDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaseDetails -> CaseDetails -> Bool
$c/= :: CaseDetails -> CaseDetails -> Bool
== :: CaseDetails -> CaseDetails -> Bool
$c== :: CaseDetails -> CaseDetails -> Bool
Prelude.Eq, ReadPrec [CaseDetails]
ReadPrec CaseDetails
Int -> ReadS CaseDetails
ReadS [CaseDetails]
(Int -> ReadS CaseDetails)
-> ReadS [CaseDetails]
-> ReadPrec CaseDetails
-> ReadPrec [CaseDetails]
-> Read CaseDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaseDetails]
$creadListPrec :: ReadPrec [CaseDetails]
readPrec :: ReadPrec CaseDetails
$creadPrec :: ReadPrec CaseDetails
readList :: ReadS [CaseDetails]
$creadList :: ReadS [CaseDetails]
readsPrec :: Int -> ReadS CaseDetails
$creadsPrec :: Int -> ReadS CaseDetails
Prelude.Read, Int -> CaseDetails -> ShowS
[CaseDetails] -> ShowS
CaseDetails -> String
(Int -> CaseDetails -> ShowS)
-> (CaseDetails -> String)
-> ([CaseDetails] -> ShowS)
-> Show CaseDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaseDetails] -> ShowS
$cshowList :: [CaseDetails] -> ShowS
show :: CaseDetails -> String
$cshow :: CaseDetails -> String
showsPrec :: Int -> CaseDetails -> ShowS
$cshowsPrec :: Int -> CaseDetails -> ShowS
Prelude.Show, (forall x. CaseDetails -> Rep CaseDetails x)
-> (forall x. Rep CaseDetails x -> CaseDetails)
-> Generic CaseDetails
forall x. Rep CaseDetails x -> CaseDetails
forall x. CaseDetails -> Rep CaseDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaseDetails x -> CaseDetails
$cfrom :: forall x. CaseDetails -> Rep CaseDetails x
Prelude.Generic)

-- |
-- Create a value of 'CaseDetails' 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:
--
-- 'subject', 'caseDetails_subject' - The subject line for the case in the AWS Support Center.
--
-- 'status', 'caseDetails_status' - The status of the case.
--
-- Valid values:
--
-- -   @opened@
--
-- -   @pending-customer-action@
--
-- -   @reopened@
--
-- -   @resolved@
--
-- -   @unassigned@
--
-- -   @work-in-progress@
--
-- 'recentCommunications', 'caseDetails_recentCommunications' - The five most recent communications between you and AWS Support Center,
-- including the IDs of any attachments to the communications. Also
-- includes a @nextToken@ that you can use to retrieve earlier
-- communications.
--
-- 'severityCode', 'caseDetails_severityCode' - The code for the severity level returned by the call to
-- DescribeSeverityLevels.
--
-- 'caseId', 'caseDetails_caseId' - The support case ID requested or returned in the call. The case ID is an
-- alphanumeric string formatted as shown in this example:
-- case-/12345678910-2013-c4c1d2bf33c5cf47/
--
-- 'ccEmailAddresses', 'caseDetails_ccEmailAddresses' - The email addresses that receive copies of communication about the case.
--
-- 'displayId', 'caseDetails_displayId' - The ID displayed for the case in the AWS Support Center. This is a
-- numeric string.
--
-- 'submittedBy', 'caseDetails_submittedBy' - The email address of the account that submitted the case.
--
-- 'language', 'caseDetails_language' - The ISO 639-1 code for the language in which AWS provides support. AWS
-- Support currently supports English (\"en\") and Japanese (\"ja\").
-- Language parameters must be passed explicitly for operations that take
-- them.
--
-- 'timeCreated', 'caseDetails_timeCreated' - The time that the case was created in the AWS Support Center.
--
-- 'categoryCode', 'caseDetails_categoryCode' - The category of problem for the support case.
--
-- 'serviceCode', 'caseDetails_serviceCode' - The code for the AWS service. You can get a list of codes and the
-- corresponding service names by calling DescribeServices.
newCaseDetails ::
  CaseDetails
newCaseDetails :: CaseDetails
newCaseDetails =
  CaseDetails' :: Maybe Text
-> Maybe Text
-> Maybe RecentCaseCommunications
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CaseDetails
CaseDetails'
    { $sel:subject:CaseDetails' :: Maybe Text
subject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:CaseDetails' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recentCommunications:CaseDetails' :: Maybe RecentCaseCommunications
recentCommunications = Maybe RecentCaseCommunications
forall a. Maybe a
Prelude.Nothing,
      $sel:severityCode:CaseDetails' :: Maybe Text
severityCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:caseId:CaseDetails' :: Maybe Text
caseId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ccEmailAddresses:CaseDetails' :: Maybe [Text]
ccEmailAddresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:displayId:CaseDetails' :: Maybe Text
displayId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:submittedBy:CaseDetails' :: Maybe Text
submittedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:language:CaseDetails' :: Maybe Text
language = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timeCreated:CaseDetails' :: Maybe Text
timeCreated = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:categoryCode:CaseDetails' :: Maybe Text
categoryCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceCode:CaseDetails' :: Maybe Text
serviceCode = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The subject line for the case in the AWS Support Center.
caseDetails_subject :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_subject :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_subject = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
subject :: Maybe Text
$sel:subject:CaseDetails' :: CaseDetails -> Maybe Text
subject} -> Maybe Text
subject) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:subject:CaseDetails' :: Maybe Text
subject = Maybe Text
a} :: CaseDetails)

-- | The status of the case.
--
-- Valid values:
--
-- -   @opened@
--
-- -   @pending-customer-action@
--
-- -   @reopened@
--
-- -   @resolved@
--
-- -   @unassigned@
--
-- -   @work-in-progress@
caseDetails_status :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_status :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_status = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
status :: Maybe Text
$sel:status:CaseDetails' :: CaseDetails -> Maybe Text
status} -> Maybe Text
status) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:status:CaseDetails' :: Maybe Text
status = Maybe Text
a} :: CaseDetails)

-- | The five most recent communications between you and AWS Support Center,
-- including the IDs of any attachments to the communications. Also
-- includes a @nextToken@ that you can use to retrieve earlier
-- communications.
caseDetails_recentCommunications :: Lens.Lens' CaseDetails (Prelude.Maybe RecentCaseCommunications)
caseDetails_recentCommunications :: (Maybe RecentCaseCommunications
 -> f (Maybe RecentCaseCommunications))
-> CaseDetails -> f CaseDetails
caseDetails_recentCommunications = (CaseDetails -> Maybe RecentCaseCommunications)
-> (CaseDetails -> Maybe RecentCaseCommunications -> CaseDetails)
-> Lens
     CaseDetails
     CaseDetails
     (Maybe RecentCaseCommunications)
     (Maybe RecentCaseCommunications)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe RecentCaseCommunications
recentCommunications :: Maybe RecentCaseCommunications
$sel:recentCommunications:CaseDetails' :: CaseDetails -> Maybe RecentCaseCommunications
recentCommunications} -> Maybe RecentCaseCommunications
recentCommunications) (\s :: CaseDetails
s@CaseDetails' {} Maybe RecentCaseCommunications
a -> CaseDetails
s {$sel:recentCommunications:CaseDetails' :: Maybe RecentCaseCommunications
recentCommunications = Maybe RecentCaseCommunications
a} :: CaseDetails)

-- | The code for the severity level returned by the call to
-- DescribeSeverityLevels.
caseDetails_severityCode :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_severityCode :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_severityCode = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
severityCode :: Maybe Text
$sel:severityCode:CaseDetails' :: CaseDetails -> Maybe Text
severityCode} -> Maybe Text
severityCode) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:severityCode:CaseDetails' :: Maybe Text
severityCode = Maybe Text
a} :: CaseDetails)

-- | The support case ID requested or returned in the call. The case ID is an
-- alphanumeric string formatted as shown in this example:
-- case-/12345678910-2013-c4c1d2bf33c5cf47/
caseDetails_caseId :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_caseId :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_caseId = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
caseId :: Maybe Text
$sel:caseId:CaseDetails' :: CaseDetails -> Maybe Text
caseId} -> Maybe Text
caseId) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:caseId:CaseDetails' :: Maybe Text
caseId = Maybe Text
a} :: CaseDetails)

-- | The email addresses that receive copies of communication about the case.
caseDetails_ccEmailAddresses :: Lens.Lens' CaseDetails (Prelude.Maybe [Prelude.Text])
caseDetails_ccEmailAddresses :: (Maybe [Text] -> f (Maybe [Text])) -> CaseDetails -> f CaseDetails
caseDetails_ccEmailAddresses = (CaseDetails -> Maybe [Text])
-> (CaseDetails -> Maybe [Text] -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe [Text]
ccEmailAddresses :: Maybe [Text]
$sel:ccEmailAddresses:CaseDetails' :: CaseDetails -> Maybe [Text]
ccEmailAddresses} -> Maybe [Text]
ccEmailAddresses) (\s :: CaseDetails
s@CaseDetails' {} Maybe [Text]
a -> CaseDetails
s {$sel:ccEmailAddresses:CaseDetails' :: Maybe [Text]
ccEmailAddresses = Maybe [Text]
a} :: CaseDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> CaseDetails -> f CaseDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CaseDetails
-> f CaseDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID displayed for the case in the AWS Support Center. This is a
-- numeric string.
caseDetails_displayId :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_displayId :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_displayId = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
displayId :: Maybe Text
$sel:displayId:CaseDetails' :: CaseDetails -> Maybe Text
displayId} -> Maybe Text
displayId) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:displayId:CaseDetails' :: Maybe Text
displayId = Maybe Text
a} :: CaseDetails)

-- | The email address of the account that submitted the case.
caseDetails_submittedBy :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_submittedBy :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_submittedBy = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
submittedBy :: Maybe Text
$sel:submittedBy:CaseDetails' :: CaseDetails -> Maybe Text
submittedBy} -> Maybe Text
submittedBy) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:submittedBy:CaseDetails' :: Maybe Text
submittedBy = Maybe Text
a} :: CaseDetails)

-- | The ISO 639-1 code for the language in which AWS provides support. AWS
-- Support currently supports English (\"en\") and Japanese (\"ja\").
-- Language parameters must be passed explicitly for operations that take
-- them.
caseDetails_language :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_language :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_language = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
language :: Maybe Text
$sel:language:CaseDetails' :: CaseDetails -> Maybe Text
language} -> Maybe Text
language) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:language:CaseDetails' :: Maybe Text
language = Maybe Text
a} :: CaseDetails)

-- | The time that the case was created in the AWS Support Center.
caseDetails_timeCreated :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_timeCreated :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_timeCreated = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
timeCreated :: Maybe Text
$sel:timeCreated:CaseDetails' :: CaseDetails -> Maybe Text
timeCreated} -> Maybe Text
timeCreated) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:timeCreated:CaseDetails' :: Maybe Text
timeCreated = Maybe Text
a} :: CaseDetails)

-- | The category of problem for the support case.
caseDetails_categoryCode :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_categoryCode :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_categoryCode = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
categoryCode :: Maybe Text
$sel:categoryCode:CaseDetails' :: CaseDetails -> Maybe Text
categoryCode} -> Maybe Text
categoryCode) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:categoryCode:CaseDetails' :: Maybe Text
categoryCode = Maybe Text
a} :: CaseDetails)

-- | The code for the AWS service. You can get a list of codes and the
-- corresponding service names by calling DescribeServices.
caseDetails_serviceCode :: Lens.Lens' CaseDetails (Prelude.Maybe Prelude.Text)
caseDetails_serviceCode :: (Maybe Text -> f (Maybe Text)) -> CaseDetails -> f CaseDetails
caseDetails_serviceCode = (CaseDetails -> Maybe Text)
-> (CaseDetails -> Maybe Text -> CaseDetails)
-> Lens CaseDetails CaseDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseDetails' {Maybe Text
serviceCode :: Maybe Text
$sel:serviceCode:CaseDetails' :: CaseDetails -> Maybe Text
serviceCode} -> Maybe Text
serviceCode) (\s :: CaseDetails
s@CaseDetails' {} Maybe Text
a -> CaseDetails
s {$sel:serviceCode:CaseDetails' :: Maybe Text
serviceCode = Maybe Text
a} :: CaseDetails)

instance Core.FromJSON CaseDetails where
  parseJSON :: Value -> Parser CaseDetails
parseJSON =
    String
-> (Object -> Parser CaseDetails) -> Value -> Parser CaseDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CaseDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe RecentCaseCommunications
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CaseDetails
CaseDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe RecentCaseCommunications
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> CaseDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe RecentCaseCommunications
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CaseDetails)
forall (f :: * -> *) a b. Functor 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
"subject")
            Parser
  (Maybe Text
   -> Maybe RecentCaseCommunications
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CaseDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe RecentCaseCommunications
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CaseDetails)
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
"status")
            Parser
  (Maybe RecentCaseCommunications
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CaseDetails)
-> Parser (Maybe RecentCaseCommunications)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CaseDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RecentCaseCommunications)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"recentCommunications")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CaseDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CaseDetails)
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
"severityCode")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CaseDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CaseDetails)
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
"caseId")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CaseDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CaseDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ccEmailAddresses"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CaseDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CaseDetails)
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
"displayId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CaseDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> CaseDetails)
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
"submittedBy")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> CaseDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> CaseDetails)
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
"language")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> CaseDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> CaseDetails)
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
"timeCreated")
            Parser (Maybe Text -> Maybe Text -> CaseDetails)
-> Parser (Maybe Text) -> Parser (Maybe Text -> CaseDetails)
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
"categoryCode")
            Parser (Maybe Text -> CaseDetails)
-> Parser (Maybe Text) -> Parser CaseDetails
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
"serviceCode")
      )

instance Prelude.Hashable CaseDetails

instance Prelude.NFData CaseDetails