{-# 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.Connect.StartTaskContact
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Initiates a flow to start a new task.
module Amazonka.Connect.StartTaskContact
  ( -- * Creating a Request
    StartTaskContact (..),
    newStartTaskContact,

    -- * Request Lenses
    startTaskContact_attributes,
    startTaskContact_clientToken,
    startTaskContact_contactFlowId,
    startTaskContact_description,
    startTaskContact_previousContactId,
    startTaskContact_quickConnectId,
    startTaskContact_references,
    startTaskContact_scheduledTime,
    startTaskContact_taskTemplateId,
    startTaskContact_instanceId,
    startTaskContact_name,

    -- * Destructuring the Response
    StartTaskContactResponse (..),
    newStartTaskContactResponse,

    -- * Response Lenses
    startTaskContactResponse_contactId,
    startTaskContactResponse_httpStatus,
  )
where

import Amazonka.Connect.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newStartTaskContact' smart constructor.
data StartTaskContact = StartTaskContact'
  { -- | A custom key-value pair using an attribute map. The attributes are
    -- standard Amazon Connect attributes, and can be accessed in flows just
    -- like any other contact attributes.
    --
    -- There can be up to 32,768 UTF-8 bytes across all key-value pairs per
    -- contact. Attribute keys can include only alphanumeric, dash, and
    -- underscore characters.
    StartTaskContact -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. If not provided, the Amazon Web Services SDK
    -- populates this field. For more information about idempotency, see
    -- <https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ Making retries safe with idempotent APIs>.
    StartTaskContact -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the flow for initiating the tasks. To see the
    -- ContactFlowId in the Amazon Connect console user interface, on the
    -- navigation menu go to __Routing__, __Contact Flows__. Choose the flow.
    -- On the flow page, under the name of the flow, choose __Show additional
    -- flow information__. The ContactFlowId is the last part of the ARN, shown
    -- here in bold:
    --
    -- arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/contact-flow\/__846ec553-a005-41c0-8341-xxxxxxxxxxxx__
    StartTaskContact -> Maybe Text
contactFlowId :: Prelude.Maybe Prelude.Text,
    -- | A description of the task that is shown to an agent in the Contact
    -- Control Panel (CCP).
    StartTaskContact -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the previous chat, voice, or task contact.
    StartTaskContact -> Maybe Text
previousContactId :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the quick connect.
    StartTaskContact -> Maybe Text
quickConnectId :: Prelude.Maybe Prelude.Text,
    -- | A formatted URL that is shown to an agent in the Contact Control Panel
    -- (CCP).
    StartTaskContact -> Maybe (HashMap Text Reference)
references :: Prelude.Maybe (Prelude.HashMap Prelude.Text Reference),
    -- | The timestamp, in Unix Epoch seconds format, at which to start running
    -- the inbound flow. The scheduled time cannot be in the past. It must be
    -- within up to 6 days in future.
    StartTaskContact -> Maybe POSIX
scheduledTime :: Prelude.Maybe Data.POSIX,
    -- | A unique identifier for the task template.
    StartTaskContact -> Maybe Text
taskTemplateId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    StartTaskContact -> Text
instanceId :: Prelude.Text,
    -- | The name of a task that is shown to an agent in the Contact Control
    -- Panel (CCP).
    StartTaskContact -> Text
name :: Prelude.Text
  }
  deriving (StartTaskContact -> StartTaskContact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTaskContact -> StartTaskContact -> Bool
$c/= :: StartTaskContact -> StartTaskContact -> Bool
== :: StartTaskContact -> StartTaskContact -> Bool
$c== :: StartTaskContact -> StartTaskContact -> Bool
Prelude.Eq, ReadPrec [StartTaskContact]
ReadPrec StartTaskContact
Int -> ReadS StartTaskContact
ReadS [StartTaskContact]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTaskContact]
$creadListPrec :: ReadPrec [StartTaskContact]
readPrec :: ReadPrec StartTaskContact
$creadPrec :: ReadPrec StartTaskContact
readList :: ReadS [StartTaskContact]
$creadList :: ReadS [StartTaskContact]
readsPrec :: Int -> ReadS StartTaskContact
$creadsPrec :: Int -> ReadS StartTaskContact
Prelude.Read, Int -> StartTaskContact -> ShowS
[StartTaskContact] -> ShowS
StartTaskContact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTaskContact] -> ShowS
$cshowList :: [StartTaskContact] -> ShowS
show :: StartTaskContact -> String
$cshow :: StartTaskContact -> String
showsPrec :: Int -> StartTaskContact -> ShowS
$cshowsPrec :: Int -> StartTaskContact -> ShowS
Prelude.Show, forall x. Rep StartTaskContact x -> StartTaskContact
forall x. StartTaskContact -> Rep StartTaskContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTaskContact x -> StartTaskContact
$cfrom :: forall x. StartTaskContact -> Rep StartTaskContact x
Prelude.Generic)

-- |
-- Create a value of 'StartTaskContact' 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:
--
-- 'attributes', 'startTaskContact_attributes' - A custom key-value pair using an attribute map. The attributes are
-- standard Amazon Connect attributes, and can be accessed in flows just
-- like any other contact attributes.
--
-- There can be up to 32,768 UTF-8 bytes across all key-value pairs per
-- contact. Attribute keys can include only alphanumeric, dash, and
-- underscore characters.
--
-- 'clientToken', 'startTaskContact_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. If not provided, the Amazon Web Services SDK
-- populates this field. For more information about idempotency, see
-- <https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ Making retries safe with idempotent APIs>.
--
-- 'contactFlowId', 'startTaskContact_contactFlowId' - The identifier of the flow for initiating the tasks. To see the
-- ContactFlowId in the Amazon Connect console user interface, on the
-- navigation menu go to __Routing__, __Contact Flows__. Choose the flow.
-- On the flow page, under the name of the flow, choose __Show additional
-- flow information__. The ContactFlowId is the last part of the ARN, shown
-- here in bold:
--
-- arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/contact-flow\/__846ec553-a005-41c0-8341-xxxxxxxxxxxx__
--
-- 'description', 'startTaskContact_description' - A description of the task that is shown to an agent in the Contact
-- Control Panel (CCP).
--
-- 'previousContactId', 'startTaskContact_previousContactId' - The identifier of the previous chat, voice, or task contact.
--
-- 'quickConnectId', 'startTaskContact_quickConnectId' - The identifier for the quick connect.
--
-- 'references', 'startTaskContact_references' - A formatted URL that is shown to an agent in the Contact Control Panel
-- (CCP).
--
-- 'scheduledTime', 'startTaskContact_scheduledTime' - The timestamp, in Unix Epoch seconds format, at which to start running
-- the inbound flow. The scheduled time cannot be in the past. It must be
-- within up to 6 days in future.
--
-- 'taskTemplateId', 'startTaskContact_taskTemplateId' - A unique identifier for the task template.
--
-- 'instanceId', 'startTaskContact_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'name', 'startTaskContact_name' - The name of a task that is shown to an agent in the Contact Control
-- Panel (CCP).
newStartTaskContact ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  StartTaskContact
newStartTaskContact :: Text -> Text -> StartTaskContact
newStartTaskContact Text
pInstanceId_ Text
pName_ =
  StartTaskContact'
    { $sel:attributes:StartTaskContact' :: Maybe (HashMap Text Text)
attributes = forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:StartTaskContact' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:contactFlowId:StartTaskContact' :: Maybe Text
contactFlowId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:StartTaskContact' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:previousContactId:StartTaskContact' :: Maybe Text
previousContactId = forall a. Maybe a
Prelude.Nothing,
      $sel:quickConnectId:StartTaskContact' :: Maybe Text
quickConnectId = forall a. Maybe a
Prelude.Nothing,
      $sel:references:StartTaskContact' :: Maybe (HashMap Text Reference)
references = forall a. Maybe a
Prelude.Nothing,
      $sel:scheduledTime:StartTaskContact' :: Maybe POSIX
scheduledTime = forall a. Maybe a
Prelude.Nothing,
      $sel:taskTemplateId:StartTaskContact' :: Maybe Text
taskTemplateId = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:StartTaskContact' :: Text
instanceId = Text
pInstanceId_,
      $sel:name:StartTaskContact' :: Text
name = Text
pName_
    }

-- | A custom key-value pair using an attribute map. The attributes are
-- standard Amazon Connect attributes, and can be accessed in flows just
-- like any other contact attributes.
--
-- There can be up to 32,768 UTF-8 bytes across all key-value pairs per
-- contact. Attribute keys can include only alphanumeric, dash, and
-- underscore characters.
startTaskContact_attributes :: Lens.Lens' StartTaskContact (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startTaskContact_attributes :: Lens' StartTaskContact (Maybe (HashMap Text Text))
startTaskContact_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:StartTaskContact' :: StartTaskContact -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe (HashMap Text Text)
a -> StartTaskContact
s {$sel:attributes:StartTaskContact' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: StartTaskContact) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. If not provided, the Amazon Web Services SDK
-- populates this field. For more information about idempotency, see
-- <https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/ Making retries safe with idempotent APIs>.
startTaskContact_clientToken :: Lens.Lens' StartTaskContact (Prelude.Maybe Prelude.Text)
startTaskContact_clientToken :: Lens' StartTaskContact (Maybe Text)
startTaskContact_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:StartTaskContact' :: StartTaskContact -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe Text
a -> StartTaskContact
s {$sel:clientToken:StartTaskContact' :: Maybe Text
clientToken = Maybe Text
a} :: StartTaskContact)

-- | The identifier of the flow for initiating the tasks. To see the
-- ContactFlowId in the Amazon Connect console user interface, on the
-- navigation menu go to __Routing__, __Contact Flows__. Choose the flow.
-- On the flow page, under the name of the flow, choose __Show additional
-- flow information__. The ContactFlowId is the last part of the ARN, shown
-- here in bold:
--
-- arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/contact-flow\/__846ec553-a005-41c0-8341-xxxxxxxxxxxx__
startTaskContact_contactFlowId :: Lens.Lens' StartTaskContact (Prelude.Maybe Prelude.Text)
startTaskContact_contactFlowId :: Lens' StartTaskContact (Maybe Text)
startTaskContact_contactFlowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe Text
contactFlowId :: Maybe Text
$sel:contactFlowId:StartTaskContact' :: StartTaskContact -> Maybe Text
contactFlowId} -> Maybe Text
contactFlowId) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe Text
a -> StartTaskContact
s {$sel:contactFlowId:StartTaskContact' :: Maybe Text
contactFlowId = Maybe Text
a} :: StartTaskContact)

-- | A description of the task that is shown to an agent in the Contact
-- Control Panel (CCP).
startTaskContact_description :: Lens.Lens' StartTaskContact (Prelude.Maybe Prelude.Text)
startTaskContact_description :: Lens' StartTaskContact (Maybe Text)
startTaskContact_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe Text
description :: Maybe Text
$sel:description:StartTaskContact' :: StartTaskContact -> Maybe Text
description} -> Maybe Text
description) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe Text
a -> StartTaskContact
s {$sel:description:StartTaskContact' :: Maybe Text
description = Maybe Text
a} :: StartTaskContact)

-- | The identifier of the previous chat, voice, or task contact.
startTaskContact_previousContactId :: Lens.Lens' StartTaskContact (Prelude.Maybe Prelude.Text)
startTaskContact_previousContactId :: Lens' StartTaskContact (Maybe Text)
startTaskContact_previousContactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe Text
previousContactId :: Maybe Text
$sel:previousContactId:StartTaskContact' :: StartTaskContact -> Maybe Text
previousContactId} -> Maybe Text
previousContactId) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe Text
a -> StartTaskContact
s {$sel:previousContactId:StartTaskContact' :: Maybe Text
previousContactId = Maybe Text
a} :: StartTaskContact)

-- | The identifier for the quick connect.
startTaskContact_quickConnectId :: Lens.Lens' StartTaskContact (Prelude.Maybe Prelude.Text)
startTaskContact_quickConnectId :: Lens' StartTaskContact (Maybe Text)
startTaskContact_quickConnectId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe Text
quickConnectId :: Maybe Text
$sel:quickConnectId:StartTaskContact' :: StartTaskContact -> Maybe Text
quickConnectId} -> Maybe Text
quickConnectId) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe Text
a -> StartTaskContact
s {$sel:quickConnectId:StartTaskContact' :: Maybe Text
quickConnectId = Maybe Text
a} :: StartTaskContact)

-- | A formatted URL that is shown to an agent in the Contact Control Panel
-- (CCP).
startTaskContact_references :: Lens.Lens' StartTaskContact (Prelude.Maybe (Prelude.HashMap Prelude.Text Reference))
startTaskContact_references :: Lens' StartTaskContact (Maybe (HashMap Text Reference))
startTaskContact_references = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe (HashMap Text Reference)
references :: Maybe (HashMap Text Reference)
$sel:references:StartTaskContact' :: StartTaskContact -> Maybe (HashMap Text Reference)
references} -> Maybe (HashMap Text Reference)
references) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe (HashMap Text Reference)
a -> StartTaskContact
s {$sel:references:StartTaskContact' :: Maybe (HashMap Text Reference)
references = Maybe (HashMap Text Reference)
a} :: StartTaskContact) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The timestamp, in Unix Epoch seconds format, at which to start running
-- the inbound flow. The scheduled time cannot be in the past. It must be
-- within up to 6 days in future.
startTaskContact_scheduledTime :: Lens.Lens' StartTaskContact (Prelude.Maybe Prelude.UTCTime)
startTaskContact_scheduledTime :: Lens' StartTaskContact (Maybe UTCTime)
startTaskContact_scheduledTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe POSIX
scheduledTime :: Maybe POSIX
$sel:scheduledTime:StartTaskContact' :: StartTaskContact -> Maybe POSIX
scheduledTime} -> Maybe POSIX
scheduledTime) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe POSIX
a -> StartTaskContact
s {$sel:scheduledTime:StartTaskContact' :: Maybe POSIX
scheduledTime = Maybe POSIX
a} :: StartTaskContact) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A unique identifier for the task template.
startTaskContact_taskTemplateId :: Lens.Lens' StartTaskContact (Prelude.Maybe Prelude.Text)
startTaskContact_taskTemplateId :: Lens' StartTaskContact (Maybe Text)
startTaskContact_taskTemplateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Maybe Text
taskTemplateId :: Maybe Text
$sel:taskTemplateId:StartTaskContact' :: StartTaskContact -> Maybe Text
taskTemplateId} -> Maybe Text
taskTemplateId) (\s :: StartTaskContact
s@StartTaskContact' {} Maybe Text
a -> StartTaskContact
s {$sel:taskTemplateId:StartTaskContact' :: Maybe Text
taskTemplateId = Maybe Text
a} :: StartTaskContact)

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
startTaskContact_instanceId :: Lens.Lens' StartTaskContact Prelude.Text
startTaskContact_instanceId :: Lens' StartTaskContact Text
startTaskContact_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Text
instanceId :: Text
$sel:instanceId:StartTaskContact' :: StartTaskContact -> Text
instanceId} -> Text
instanceId) (\s :: StartTaskContact
s@StartTaskContact' {} Text
a -> StartTaskContact
s {$sel:instanceId:StartTaskContact' :: Text
instanceId = Text
a} :: StartTaskContact)

-- | The name of a task that is shown to an agent in the Contact Control
-- Panel (CCP).
startTaskContact_name :: Lens.Lens' StartTaskContact Prelude.Text
startTaskContact_name :: Lens' StartTaskContact Text
startTaskContact_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContact' {Text
name :: Text
$sel:name:StartTaskContact' :: StartTaskContact -> Text
name} -> Text
name) (\s :: StartTaskContact
s@StartTaskContact' {} Text
a -> StartTaskContact
s {$sel:name:StartTaskContact' :: Text
name = Text
a} :: StartTaskContact)

instance Core.AWSRequest StartTaskContact where
  type
    AWSResponse StartTaskContact =
      StartTaskContactResponse
  request :: (Service -> Service)
-> StartTaskContact -> Request StartTaskContact
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartTaskContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartTaskContact)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> StartTaskContactResponse
StartTaskContactResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ContactId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable StartTaskContact where
  hashWithSalt :: Int -> StartTaskContact -> Int
hashWithSalt Int
_salt StartTaskContact' {Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text Reference)
Maybe POSIX
Text
name :: Text
instanceId :: Text
taskTemplateId :: Maybe Text
scheduledTime :: Maybe POSIX
references :: Maybe (HashMap Text Reference)
quickConnectId :: Maybe Text
previousContactId :: Maybe Text
description :: Maybe Text
contactFlowId :: Maybe Text
clientToken :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:name:StartTaskContact' :: StartTaskContact -> Text
$sel:instanceId:StartTaskContact' :: StartTaskContact -> Text
$sel:taskTemplateId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:scheduledTime:StartTaskContact' :: StartTaskContact -> Maybe POSIX
$sel:references:StartTaskContact' :: StartTaskContact -> Maybe (HashMap Text Reference)
$sel:quickConnectId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:previousContactId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:description:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:contactFlowId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:clientToken:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:attributes:StartTaskContact' :: StartTaskContact -> Maybe (HashMap Text Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
attributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contactFlowId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
previousContactId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
quickConnectId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Reference)
references
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
scheduledTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
taskTemplateId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData StartTaskContact where
  rnf :: StartTaskContact -> ()
rnf StartTaskContact' {Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text Reference)
Maybe POSIX
Text
name :: Text
instanceId :: Text
taskTemplateId :: Maybe Text
scheduledTime :: Maybe POSIX
references :: Maybe (HashMap Text Reference)
quickConnectId :: Maybe Text
previousContactId :: Maybe Text
description :: Maybe Text
contactFlowId :: Maybe Text
clientToken :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:name:StartTaskContact' :: StartTaskContact -> Text
$sel:instanceId:StartTaskContact' :: StartTaskContact -> Text
$sel:taskTemplateId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:scheduledTime:StartTaskContact' :: StartTaskContact -> Maybe POSIX
$sel:references:StartTaskContact' :: StartTaskContact -> Maybe (HashMap Text Reference)
$sel:quickConnectId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:previousContactId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:description:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:contactFlowId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:clientToken:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:attributes:StartTaskContact' :: StartTaskContact -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
attributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contactFlowId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
previousContactId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
quickConnectId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Reference)
references
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
scheduledTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
taskTemplateId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders StartTaskContact where
  toHeaders :: StartTaskContact -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON StartTaskContact where
  toJSON :: StartTaskContact -> Value
toJSON StartTaskContact' {Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text Reference)
Maybe POSIX
Text
name :: Text
instanceId :: Text
taskTemplateId :: Maybe Text
scheduledTime :: Maybe POSIX
references :: Maybe (HashMap Text Reference)
quickConnectId :: Maybe Text
previousContactId :: Maybe Text
description :: Maybe Text
contactFlowId :: Maybe Text
clientToken :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:name:StartTaskContact' :: StartTaskContact -> Text
$sel:instanceId:StartTaskContact' :: StartTaskContact -> Text
$sel:taskTemplateId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:scheduledTime:StartTaskContact' :: StartTaskContact -> Maybe POSIX
$sel:references:StartTaskContact' :: StartTaskContact -> Maybe (HashMap Text Reference)
$sel:quickConnectId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:previousContactId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:description:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:contactFlowId:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:clientToken:StartTaskContact' :: StartTaskContact -> Maybe Text
$sel:attributes:StartTaskContact' :: StartTaskContact -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Attributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
attributes,
            (Key
"ClientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"ContactFlowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
contactFlowId,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"PreviousContactId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
previousContactId,
            (Key
"QuickConnectId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
quickConnectId,
            (Key
"References" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Reference)
references,
            (Key
"ScheduledTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
scheduledTime,
            (Key
"TaskTemplateId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
taskTemplateId,
            forall a. a -> Maybe a
Prelude.Just (Key
"InstanceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceId),
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath StartTaskContact where
  toPath :: StartTaskContact -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/contact/task"

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

-- | /See:/ 'newStartTaskContactResponse' smart constructor.
data StartTaskContactResponse = StartTaskContactResponse'
  { -- | The identifier of this contact within the Amazon Connect instance.
    StartTaskContactResponse -> Maybe Text
contactId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartTaskContactResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartTaskContactResponse -> StartTaskContactResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTaskContactResponse -> StartTaskContactResponse -> Bool
$c/= :: StartTaskContactResponse -> StartTaskContactResponse -> Bool
== :: StartTaskContactResponse -> StartTaskContactResponse -> Bool
$c== :: StartTaskContactResponse -> StartTaskContactResponse -> Bool
Prelude.Eq, ReadPrec [StartTaskContactResponse]
ReadPrec StartTaskContactResponse
Int -> ReadS StartTaskContactResponse
ReadS [StartTaskContactResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTaskContactResponse]
$creadListPrec :: ReadPrec [StartTaskContactResponse]
readPrec :: ReadPrec StartTaskContactResponse
$creadPrec :: ReadPrec StartTaskContactResponse
readList :: ReadS [StartTaskContactResponse]
$creadList :: ReadS [StartTaskContactResponse]
readsPrec :: Int -> ReadS StartTaskContactResponse
$creadsPrec :: Int -> ReadS StartTaskContactResponse
Prelude.Read, Int -> StartTaskContactResponse -> ShowS
[StartTaskContactResponse] -> ShowS
StartTaskContactResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTaskContactResponse] -> ShowS
$cshowList :: [StartTaskContactResponse] -> ShowS
show :: StartTaskContactResponse -> String
$cshow :: StartTaskContactResponse -> String
showsPrec :: Int -> StartTaskContactResponse -> ShowS
$cshowsPrec :: Int -> StartTaskContactResponse -> ShowS
Prelude.Show, forall x.
Rep StartTaskContactResponse x -> StartTaskContactResponse
forall x.
StartTaskContactResponse -> Rep StartTaskContactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartTaskContactResponse x -> StartTaskContactResponse
$cfrom :: forall x.
StartTaskContactResponse -> Rep StartTaskContactResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartTaskContactResponse' 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:
--
-- 'contactId', 'startTaskContactResponse_contactId' - The identifier of this contact within the Amazon Connect instance.
--
-- 'httpStatus', 'startTaskContactResponse_httpStatus' - The response's http status code.
newStartTaskContactResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartTaskContactResponse
newStartTaskContactResponse :: Int -> StartTaskContactResponse
newStartTaskContactResponse Int
pHttpStatus_ =
  StartTaskContactResponse'
    { $sel:contactId:StartTaskContactResponse' :: Maybe Text
contactId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartTaskContactResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier of this contact within the Amazon Connect instance.
startTaskContactResponse_contactId :: Lens.Lens' StartTaskContactResponse (Prelude.Maybe Prelude.Text)
startTaskContactResponse_contactId :: Lens' StartTaskContactResponse (Maybe Text)
startTaskContactResponse_contactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskContactResponse' {Maybe Text
contactId :: Maybe Text
$sel:contactId:StartTaskContactResponse' :: StartTaskContactResponse -> Maybe Text
contactId} -> Maybe Text
contactId) (\s :: StartTaskContactResponse
s@StartTaskContactResponse' {} Maybe Text
a -> StartTaskContactResponse
s {$sel:contactId:StartTaskContactResponse' :: Maybe Text
contactId = Maybe Text
a} :: StartTaskContactResponse)

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

instance Prelude.NFData StartTaskContactResponse where
  rnf :: StartTaskContactResponse -> ()
rnf StartTaskContactResponse' {Int
Maybe Text
httpStatus :: Int
contactId :: Maybe Text
$sel:httpStatus:StartTaskContactResponse' :: StartTaskContactResponse -> Int
$sel:contactId:StartTaskContactResponse' :: StartTaskContactResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contactId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus