{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.AddCommunicationToCase
-- 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)
--
-- Adds additional customer communication to an AWS Support case. Use the
-- @caseId@ parameter to identify the case to which to add communication.
-- You can list a set of email addresses to copy on the communication by
-- using the @ccEmailAddresses@ parameter. The @communicationBody@ value
-- contains the text of the communication.
--
-- -   You must have a Business or Enterprise Support plan to use the AWS
--     Support API.
--
-- -   If you call the AWS Support API from an account that does not have a
--     Business or Enterprise Support plan, the
--     @SubscriptionRequiredException@ error message appears. For
--     information about changing your support plan, see
--     <http://aws.amazon.com/premiumsupport/ AWS Support>.
module Amazonka.Support.AddCommunicationToCase
  ( -- * Creating a Request
    AddCommunicationToCase (..),
    newAddCommunicationToCase,

    -- * Request Lenses
    addCommunicationToCase_caseId,
    addCommunicationToCase_ccEmailAddresses,
    addCommunicationToCase_attachmentSetId,
    addCommunicationToCase_communicationBody,

    -- * Destructuring the Response
    AddCommunicationToCaseResponse (..),
    newAddCommunicationToCaseResponse,

    -- * Response Lenses
    addCommunicationToCaseResponse_result,
    addCommunicationToCaseResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Support.Types

-- | /See:/ 'newAddCommunicationToCase' smart constructor.
data AddCommunicationToCase = AddCommunicationToCase'
  { -- | 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/
    AddCommunicationToCase -> Maybe Text
caseId :: Prelude.Maybe Prelude.Text,
    -- | The email addresses in the CC line of an email to be added to the
    -- support case.
    AddCommunicationToCase -> Maybe [Text]
ccEmailAddresses :: Prelude.Maybe [Prelude.Text],
    -- | The ID of a set of one or more attachments for the communication to add
    -- to the case. Create the set by calling AddAttachmentsToSet
    AddCommunicationToCase -> Maybe Text
attachmentSetId :: Prelude.Maybe Prelude.Text,
    -- | The body of an email communication to add to the support case.
    AddCommunicationToCase -> Text
communicationBody :: Prelude.Text
  }
  deriving (AddCommunicationToCase -> AddCommunicationToCase -> Bool
(AddCommunicationToCase -> AddCommunicationToCase -> Bool)
-> (AddCommunicationToCase -> AddCommunicationToCase -> Bool)
-> Eq AddCommunicationToCase
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddCommunicationToCase -> AddCommunicationToCase -> Bool
$c/= :: AddCommunicationToCase -> AddCommunicationToCase -> Bool
== :: AddCommunicationToCase -> AddCommunicationToCase -> Bool
$c== :: AddCommunicationToCase -> AddCommunicationToCase -> Bool
Prelude.Eq, ReadPrec [AddCommunicationToCase]
ReadPrec AddCommunicationToCase
Int -> ReadS AddCommunicationToCase
ReadS [AddCommunicationToCase]
(Int -> ReadS AddCommunicationToCase)
-> ReadS [AddCommunicationToCase]
-> ReadPrec AddCommunicationToCase
-> ReadPrec [AddCommunicationToCase]
-> Read AddCommunicationToCase
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddCommunicationToCase]
$creadListPrec :: ReadPrec [AddCommunicationToCase]
readPrec :: ReadPrec AddCommunicationToCase
$creadPrec :: ReadPrec AddCommunicationToCase
readList :: ReadS [AddCommunicationToCase]
$creadList :: ReadS [AddCommunicationToCase]
readsPrec :: Int -> ReadS AddCommunicationToCase
$creadsPrec :: Int -> ReadS AddCommunicationToCase
Prelude.Read, Int -> AddCommunicationToCase -> ShowS
[AddCommunicationToCase] -> ShowS
AddCommunicationToCase -> String
(Int -> AddCommunicationToCase -> ShowS)
-> (AddCommunicationToCase -> String)
-> ([AddCommunicationToCase] -> ShowS)
-> Show AddCommunicationToCase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddCommunicationToCase] -> ShowS
$cshowList :: [AddCommunicationToCase] -> ShowS
show :: AddCommunicationToCase -> String
$cshow :: AddCommunicationToCase -> String
showsPrec :: Int -> AddCommunicationToCase -> ShowS
$cshowsPrec :: Int -> AddCommunicationToCase -> ShowS
Prelude.Show, (forall x. AddCommunicationToCase -> Rep AddCommunicationToCase x)
-> (forall x.
    Rep AddCommunicationToCase x -> AddCommunicationToCase)
-> Generic AddCommunicationToCase
forall x. Rep AddCommunicationToCase x -> AddCommunicationToCase
forall x. AddCommunicationToCase -> Rep AddCommunicationToCase x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddCommunicationToCase x -> AddCommunicationToCase
$cfrom :: forall x. AddCommunicationToCase -> Rep AddCommunicationToCase x
Prelude.Generic)

-- |
-- Create a value of 'AddCommunicationToCase' 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:
--
-- 'caseId', 'addCommunicationToCase_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', 'addCommunicationToCase_ccEmailAddresses' - The email addresses in the CC line of an email to be added to the
-- support case.
--
-- 'attachmentSetId', 'addCommunicationToCase_attachmentSetId' - The ID of a set of one or more attachments for the communication to add
-- to the case. Create the set by calling AddAttachmentsToSet
--
-- 'communicationBody', 'addCommunicationToCase_communicationBody' - The body of an email communication to add to the support case.
newAddCommunicationToCase ::
  -- | 'communicationBody'
  Prelude.Text ->
  AddCommunicationToCase
newAddCommunicationToCase :: Text -> AddCommunicationToCase
newAddCommunicationToCase Text
pCommunicationBody_ =
  AddCommunicationToCase' :: Maybe Text
-> Maybe [Text] -> Maybe Text -> Text -> AddCommunicationToCase
AddCommunicationToCase'
    { $sel:caseId:AddCommunicationToCase' :: Maybe Text
caseId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ccEmailAddresses:AddCommunicationToCase' :: Maybe [Text]
ccEmailAddresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentSetId:AddCommunicationToCase' :: Maybe Text
attachmentSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:communicationBody:AddCommunicationToCase' :: Text
communicationBody = Text
pCommunicationBody_
    }

-- | 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/
addCommunicationToCase_caseId :: Lens.Lens' AddCommunicationToCase (Prelude.Maybe Prelude.Text)
addCommunicationToCase_caseId :: (Maybe Text -> f (Maybe Text))
-> AddCommunicationToCase -> f AddCommunicationToCase
addCommunicationToCase_caseId = (AddCommunicationToCase -> Maybe Text)
-> (AddCommunicationToCase -> Maybe Text -> AddCommunicationToCase)
-> Lens
     AddCommunicationToCase
     AddCommunicationToCase
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCommunicationToCase' {Maybe Text
caseId :: Maybe Text
$sel:caseId:AddCommunicationToCase' :: AddCommunicationToCase -> Maybe Text
caseId} -> Maybe Text
caseId) (\s :: AddCommunicationToCase
s@AddCommunicationToCase' {} Maybe Text
a -> AddCommunicationToCase
s {$sel:caseId:AddCommunicationToCase' :: Maybe Text
caseId = Maybe Text
a} :: AddCommunicationToCase)

-- | The email addresses in the CC line of an email to be added to the
-- support case.
addCommunicationToCase_ccEmailAddresses :: Lens.Lens' AddCommunicationToCase (Prelude.Maybe [Prelude.Text])
addCommunicationToCase_ccEmailAddresses :: (Maybe [Text] -> f (Maybe [Text]))
-> AddCommunicationToCase -> f AddCommunicationToCase
addCommunicationToCase_ccEmailAddresses = (AddCommunicationToCase -> Maybe [Text])
-> (AddCommunicationToCase
    -> Maybe [Text] -> AddCommunicationToCase)
-> Lens
     AddCommunicationToCase
     AddCommunicationToCase
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCommunicationToCase' {Maybe [Text]
ccEmailAddresses :: Maybe [Text]
$sel:ccEmailAddresses:AddCommunicationToCase' :: AddCommunicationToCase -> Maybe [Text]
ccEmailAddresses} -> Maybe [Text]
ccEmailAddresses) (\s :: AddCommunicationToCase
s@AddCommunicationToCase' {} Maybe [Text]
a -> AddCommunicationToCase
s {$sel:ccEmailAddresses:AddCommunicationToCase' :: Maybe [Text]
ccEmailAddresses = Maybe [Text]
a} :: AddCommunicationToCase) ((Maybe [Text] -> f (Maybe [Text]))
 -> AddCommunicationToCase -> f AddCommunicationToCase)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AddCommunicationToCase
-> f AddCommunicationToCase
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 of a set of one or more attachments for the communication to add
-- to the case. Create the set by calling AddAttachmentsToSet
addCommunicationToCase_attachmentSetId :: Lens.Lens' AddCommunicationToCase (Prelude.Maybe Prelude.Text)
addCommunicationToCase_attachmentSetId :: (Maybe Text -> f (Maybe Text))
-> AddCommunicationToCase -> f AddCommunicationToCase
addCommunicationToCase_attachmentSetId = (AddCommunicationToCase -> Maybe Text)
-> (AddCommunicationToCase -> Maybe Text -> AddCommunicationToCase)
-> Lens
     AddCommunicationToCase
     AddCommunicationToCase
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCommunicationToCase' {Maybe Text
attachmentSetId :: Maybe Text
$sel:attachmentSetId:AddCommunicationToCase' :: AddCommunicationToCase -> Maybe Text
attachmentSetId} -> Maybe Text
attachmentSetId) (\s :: AddCommunicationToCase
s@AddCommunicationToCase' {} Maybe Text
a -> AddCommunicationToCase
s {$sel:attachmentSetId:AddCommunicationToCase' :: Maybe Text
attachmentSetId = Maybe Text
a} :: AddCommunicationToCase)

-- | The body of an email communication to add to the support case.
addCommunicationToCase_communicationBody :: Lens.Lens' AddCommunicationToCase Prelude.Text
addCommunicationToCase_communicationBody :: (Text -> f Text)
-> AddCommunicationToCase -> f AddCommunicationToCase
addCommunicationToCase_communicationBody = (AddCommunicationToCase -> Text)
-> (AddCommunicationToCase -> Text -> AddCommunicationToCase)
-> Lens AddCommunicationToCase AddCommunicationToCase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCommunicationToCase' {Text
communicationBody :: Text
$sel:communicationBody:AddCommunicationToCase' :: AddCommunicationToCase -> Text
communicationBody} -> Text
communicationBody) (\s :: AddCommunicationToCase
s@AddCommunicationToCase' {} Text
a -> AddCommunicationToCase
s {$sel:communicationBody:AddCommunicationToCase' :: Text
communicationBody = Text
a} :: AddCommunicationToCase)

instance Core.AWSRequest AddCommunicationToCase where
  type
    AWSResponse AddCommunicationToCase =
      AddCommunicationToCaseResponse
  request :: AddCommunicationToCase -> Request AddCommunicationToCase
request = Service -> AddCommunicationToCase -> Request AddCommunicationToCase
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AddCommunicationToCase
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AddCommunicationToCase)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse AddCommunicationToCase))
-> Logger
-> Service
-> Proxy AddCommunicationToCase
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AddCommunicationToCase)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Bool -> Int -> AddCommunicationToCaseResponse
AddCommunicationToCaseResponse'
            (Maybe Bool -> Int -> AddCommunicationToCaseResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> AddCommunicationToCaseResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"result")
            Either String (Int -> AddCommunicationToCaseResponse)
-> Either String Int
-> Either String AddCommunicationToCaseResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable AddCommunicationToCase

instance Prelude.NFData AddCommunicationToCase

instance Core.ToHeaders AddCommunicationToCase where
  toHeaders :: AddCommunicationToCase -> ResponseHeaders
toHeaders =
    ResponseHeaders -> AddCommunicationToCase -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSSupport_20130415.AddCommunicationToCase" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON AddCommunicationToCase where
  toJSON :: AddCommunicationToCase -> Value
toJSON AddCommunicationToCase' {Maybe [Text]
Maybe Text
Text
communicationBody :: Text
attachmentSetId :: Maybe Text
ccEmailAddresses :: Maybe [Text]
caseId :: Maybe Text
$sel:communicationBody:AddCommunicationToCase' :: AddCommunicationToCase -> Text
$sel:attachmentSetId:AddCommunicationToCase' :: AddCommunicationToCase -> Maybe Text
$sel:ccEmailAddresses:AddCommunicationToCase' :: AddCommunicationToCase -> Maybe [Text]
$sel:caseId:AddCommunicationToCase' :: AddCommunicationToCase -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"caseId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
caseId,
            (Text
"ccEmailAddresses" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
ccEmailAddresses,
            (Text
"attachmentSetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
attachmentSetId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"communicationBody" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
communicationBody)
          ]
      )

instance Core.ToPath AddCommunicationToCase where
  toPath :: AddCommunicationToCase -> ByteString
toPath = ByteString -> AddCommunicationToCase -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery AddCommunicationToCase where
  toQuery :: AddCommunicationToCase -> QueryString
toQuery = QueryString -> AddCommunicationToCase -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | The result of the AddCommunicationToCase operation.
--
-- /See:/ 'newAddCommunicationToCaseResponse' smart constructor.
data AddCommunicationToCaseResponse = AddCommunicationToCaseResponse'
  { -- | True if AddCommunicationToCase succeeds. Otherwise, returns an error.
    AddCommunicationToCaseResponse -> Maybe Bool
result :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    AddCommunicationToCaseResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AddCommunicationToCaseResponse
-> AddCommunicationToCaseResponse -> Bool
(AddCommunicationToCaseResponse
 -> AddCommunicationToCaseResponse -> Bool)
-> (AddCommunicationToCaseResponse
    -> AddCommunicationToCaseResponse -> Bool)
-> Eq AddCommunicationToCaseResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddCommunicationToCaseResponse
-> AddCommunicationToCaseResponse -> Bool
$c/= :: AddCommunicationToCaseResponse
-> AddCommunicationToCaseResponse -> Bool
== :: AddCommunicationToCaseResponse
-> AddCommunicationToCaseResponse -> Bool
$c== :: AddCommunicationToCaseResponse
-> AddCommunicationToCaseResponse -> Bool
Prelude.Eq, ReadPrec [AddCommunicationToCaseResponse]
ReadPrec AddCommunicationToCaseResponse
Int -> ReadS AddCommunicationToCaseResponse
ReadS [AddCommunicationToCaseResponse]
(Int -> ReadS AddCommunicationToCaseResponse)
-> ReadS [AddCommunicationToCaseResponse]
-> ReadPrec AddCommunicationToCaseResponse
-> ReadPrec [AddCommunicationToCaseResponse]
-> Read AddCommunicationToCaseResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddCommunicationToCaseResponse]
$creadListPrec :: ReadPrec [AddCommunicationToCaseResponse]
readPrec :: ReadPrec AddCommunicationToCaseResponse
$creadPrec :: ReadPrec AddCommunicationToCaseResponse
readList :: ReadS [AddCommunicationToCaseResponse]
$creadList :: ReadS [AddCommunicationToCaseResponse]
readsPrec :: Int -> ReadS AddCommunicationToCaseResponse
$creadsPrec :: Int -> ReadS AddCommunicationToCaseResponse
Prelude.Read, Int -> AddCommunicationToCaseResponse -> ShowS
[AddCommunicationToCaseResponse] -> ShowS
AddCommunicationToCaseResponse -> String
(Int -> AddCommunicationToCaseResponse -> ShowS)
-> (AddCommunicationToCaseResponse -> String)
-> ([AddCommunicationToCaseResponse] -> ShowS)
-> Show AddCommunicationToCaseResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddCommunicationToCaseResponse] -> ShowS
$cshowList :: [AddCommunicationToCaseResponse] -> ShowS
show :: AddCommunicationToCaseResponse -> String
$cshow :: AddCommunicationToCaseResponse -> String
showsPrec :: Int -> AddCommunicationToCaseResponse -> ShowS
$cshowsPrec :: Int -> AddCommunicationToCaseResponse -> ShowS
Prelude.Show, (forall x.
 AddCommunicationToCaseResponse
 -> Rep AddCommunicationToCaseResponse x)
-> (forall x.
    Rep AddCommunicationToCaseResponse x
    -> AddCommunicationToCaseResponse)
-> Generic AddCommunicationToCaseResponse
forall x.
Rep AddCommunicationToCaseResponse x
-> AddCommunicationToCaseResponse
forall x.
AddCommunicationToCaseResponse
-> Rep AddCommunicationToCaseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddCommunicationToCaseResponse x
-> AddCommunicationToCaseResponse
$cfrom :: forall x.
AddCommunicationToCaseResponse
-> Rep AddCommunicationToCaseResponse x
Prelude.Generic)

-- |
-- Create a value of 'AddCommunicationToCaseResponse' 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:
--
-- 'result', 'addCommunicationToCaseResponse_result' - True if AddCommunicationToCase succeeds. Otherwise, returns an error.
--
-- 'httpStatus', 'addCommunicationToCaseResponse_httpStatus' - The response's http status code.
newAddCommunicationToCaseResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AddCommunicationToCaseResponse
newAddCommunicationToCaseResponse :: Int -> AddCommunicationToCaseResponse
newAddCommunicationToCaseResponse Int
pHttpStatus_ =
  AddCommunicationToCaseResponse' :: Maybe Bool -> Int -> AddCommunicationToCaseResponse
AddCommunicationToCaseResponse'
    { $sel:result:AddCommunicationToCaseResponse' :: Maybe Bool
result =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AddCommunicationToCaseResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | True if AddCommunicationToCase succeeds. Otherwise, returns an error.
addCommunicationToCaseResponse_result :: Lens.Lens' AddCommunicationToCaseResponse (Prelude.Maybe Prelude.Bool)
addCommunicationToCaseResponse_result :: (Maybe Bool -> f (Maybe Bool))
-> AddCommunicationToCaseResponse
-> f AddCommunicationToCaseResponse
addCommunicationToCaseResponse_result = (AddCommunicationToCaseResponse -> Maybe Bool)
-> (AddCommunicationToCaseResponse
    -> Maybe Bool -> AddCommunicationToCaseResponse)
-> Lens
     AddCommunicationToCaseResponse
     AddCommunicationToCaseResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCommunicationToCaseResponse' {Maybe Bool
result :: Maybe Bool
$sel:result:AddCommunicationToCaseResponse' :: AddCommunicationToCaseResponse -> Maybe Bool
result} -> Maybe Bool
result) (\s :: AddCommunicationToCaseResponse
s@AddCommunicationToCaseResponse' {} Maybe Bool
a -> AddCommunicationToCaseResponse
s {$sel:result:AddCommunicationToCaseResponse' :: Maybe Bool
result = Maybe Bool
a} :: AddCommunicationToCaseResponse)

-- | The response's http status code.
addCommunicationToCaseResponse_httpStatus :: Lens.Lens' AddCommunicationToCaseResponse Prelude.Int
addCommunicationToCaseResponse_httpStatus :: (Int -> f Int)
-> AddCommunicationToCaseResponse
-> f AddCommunicationToCaseResponse
addCommunicationToCaseResponse_httpStatus = (AddCommunicationToCaseResponse -> Int)
-> (AddCommunicationToCaseResponse
    -> Int -> AddCommunicationToCaseResponse)
-> Lens
     AddCommunicationToCaseResponse
     AddCommunicationToCaseResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCommunicationToCaseResponse' {Int
httpStatus :: Int
$sel:httpStatus:AddCommunicationToCaseResponse' :: AddCommunicationToCaseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AddCommunicationToCaseResponse
s@AddCommunicationToCaseResponse' {} Int
a -> AddCommunicationToCaseResponse
s {$sel:httpStatus:AddCommunicationToCaseResponse' :: Int
httpStatus = Int
a} :: AddCommunicationToCaseResponse)

instance
  Prelude.NFData
    AddCommunicationToCaseResponse