{-# 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.UpdateRoutingProfileName
-- 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)
--
-- Updates the name and description of a routing profile. The request
-- accepts the following data in JSON format. At least @Name@ or
-- @Description@ must be provided.
module Amazonka.Connect.UpdateRoutingProfileName
  ( -- * Creating a Request
    UpdateRoutingProfileName (..),
    newUpdateRoutingProfileName,

    -- * Request Lenses
    updateRoutingProfileName_name,
    updateRoutingProfileName_description,
    updateRoutingProfileName_instanceId,
    updateRoutingProfileName_routingProfileId,

    -- * Destructuring the Response
    UpdateRoutingProfileNameResponse (..),
    newUpdateRoutingProfileNameResponse,
  )
where

import Amazonka.Connect.Types
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

-- | /See:/ 'newUpdateRoutingProfileName' smart constructor.
data UpdateRoutingProfileName = UpdateRoutingProfileName'
  { -- | The name of the routing profile. Must not be more than 127 characters.
    UpdateRoutingProfileName -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The description of the routing profile. Must not be more than 250
    -- characters.
    UpdateRoutingProfileName -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    UpdateRoutingProfileName -> Text
instanceId :: Prelude.Text,
    -- | The identifier of the routing profile.
    UpdateRoutingProfileName -> Text
routingProfileId :: Prelude.Text
  }
  deriving (UpdateRoutingProfileName -> UpdateRoutingProfileName -> Bool
(UpdateRoutingProfileName -> UpdateRoutingProfileName -> Bool)
-> (UpdateRoutingProfileName -> UpdateRoutingProfileName -> Bool)
-> Eq UpdateRoutingProfileName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoutingProfileName -> UpdateRoutingProfileName -> Bool
$c/= :: UpdateRoutingProfileName -> UpdateRoutingProfileName -> Bool
== :: UpdateRoutingProfileName -> UpdateRoutingProfileName -> Bool
$c== :: UpdateRoutingProfileName -> UpdateRoutingProfileName -> Bool
Prelude.Eq, ReadPrec [UpdateRoutingProfileName]
ReadPrec UpdateRoutingProfileName
Int -> ReadS UpdateRoutingProfileName
ReadS [UpdateRoutingProfileName]
(Int -> ReadS UpdateRoutingProfileName)
-> ReadS [UpdateRoutingProfileName]
-> ReadPrec UpdateRoutingProfileName
-> ReadPrec [UpdateRoutingProfileName]
-> Read UpdateRoutingProfileName
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoutingProfileName]
$creadListPrec :: ReadPrec [UpdateRoutingProfileName]
readPrec :: ReadPrec UpdateRoutingProfileName
$creadPrec :: ReadPrec UpdateRoutingProfileName
readList :: ReadS [UpdateRoutingProfileName]
$creadList :: ReadS [UpdateRoutingProfileName]
readsPrec :: Int -> ReadS UpdateRoutingProfileName
$creadsPrec :: Int -> ReadS UpdateRoutingProfileName
Prelude.Read, Int -> UpdateRoutingProfileName -> ShowS
[UpdateRoutingProfileName] -> ShowS
UpdateRoutingProfileName -> String
(Int -> UpdateRoutingProfileName -> ShowS)
-> (UpdateRoutingProfileName -> String)
-> ([UpdateRoutingProfileName] -> ShowS)
-> Show UpdateRoutingProfileName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoutingProfileName] -> ShowS
$cshowList :: [UpdateRoutingProfileName] -> ShowS
show :: UpdateRoutingProfileName -> String
$cshow :: UpdateRoutingProfileName -> String
showsPrec :: Int -> UpdateRoutingProfileName -> ShowS
$cshowsPrec :: Int -> UpdateRoutingProfileName -> ShowS
Prelude.Show, (forall x.
 UpdateRoutingProfileName -> Rep UpdateRoutingProfileName x)
-> (forall x.
    Rep UpdateRoutingProfileName x -> UpdateRoutingProfileName)
-> Generic UpdateRoutingProfileName
forall x.
Rep UpdateRoutingProfileName x -> UpdateRoutingProfileName
forall x.
UpdateRoutingProfileName -> Rep UpdateRoutingProfileName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRoutingProfileName x -> UpdateRoutingProfileName
$cfrom :: forall x.
UpdateRoutingProfileName -> Rep UpdateRoutingProfileName x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRoutingProfileName' 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:
--
-- 'name', 'updateRoutingProfileName_name' - The name of the routing profile. Must not be more than 127 characters.
--
-- 'description', 'updateRoutingProfileName_description' - The description of the routing profile. Must not be more than 250
-- characters.
--
-- 'instanceId', 'updateRoutingProfileName_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'routingProfileId', 'updateRoutingProfileName_routingProfileId' - The identifier of the routing profile.
newUpdateRoutingProfileName ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'routingProfileId'
  Prelude.Text ->
  UpdateRoutingProfileName
newUpdateRoutingProfileName :: Text -> Text -> UpdateRoutingProfileName
newUpdateRoutingProfileName
  Text
pInstanceId_
  Text
pRoutingProfileId_ =
    UpdateRoutingProfileName' :: Maybe Text
-> Maybe Text -> Text -> Text -> UpdateRoutingProfileName
UpdateRoutingProfileName'
      { $sel:name:UpdateRoutingProfileName' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateRoutingProfileName' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:UpdateRoutingProfileName' :: Text
instanceId = Text
pInstanceId_,
        $sel:routingProfileId:UpdateRoutingProfileName' :: Text
routingProfileId = Text
pRoutingProfileId_
      }

-- | The name of the routing profile. Must not be more than 127 characters.
updateRoutingProfileName_name :: Lens.Lens' UpdateRoutingProfileName (Prelude.Maybe Prelude.Text)
updateRoutingProfileName_name :: (Maybe Text -> f (Maybe Text))
-> UpdateRoutingProfileName -> f UpdateRoutingProfileName
updateRoutingProfileName_name = (UpdateRoutingProfileName -> Maybe Text)
-> (UpdateRoutingProfileName
    -> Maybe Text -> UpdateRoutingProfileName)
-> Lens
     UpdateRoutingProfileName
     UpdateRoutingProfileName
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingProfileName' {Maybe Text
name :: Maybe Text
$sel:name:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateRoutingProfileName
s@UpdateRoutingProfileName' {} Maybe Text
a -> UpdateRoutingProfileName
s {$sel:name:UpdateRoutingProfileName' :: Maybe Text
name = Maybe Text
a} :: UpdateRoutingProfileName)

-- | The description of the routing profile. Must not be more than 250
-- characters.
updateRoutingProfileName_description :: Lens.Lens' UpdateRoutingProfileName (Prelude.Maybe Prelude.Text)
updateRoutingProfileName_description :: (Maybe Text -> f (Maybe Text))
-> UpdateRoutingProfileName -> f UpdateRoutingProfileName
updateRoutingProfileName_description = (UpdateRoutingProfileName -> Maybe Text)
-> (UpdateRoutingProfileName
    -> Maybe Text -> UpdateRoutingProfileName)
-> Lens
     UpdateRoutingProfileName
     UpdateRoutingProfileName
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingProfileName' {Maybe Text
description :: Maybe Text
$sel:description:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateRoutingProfileName
s@UpdateRoutingProfileName' {} Maybe Text
a -> UpdateRoutingProfileName
s {$sel:description:UpdateRoutingProfileName' :: Maybe Text
description = Maybe Text
a} :: UpdateRoutingProfileName)

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

-- | The identifier of the routing profile.
updateRoutingProfileName_routingProfileId :: Lens.Lens' UpdateRoutingProfileName Prelude.Text
updateRoutingProfileName_routingProfileId :: (Text -> f Text)
-> UpdateRoutingProfileName -> f UpdateRoutingProfileName
updateRoutingProfileName_routingProfileId = (UpdateRoutingProfileName -> Text)
-> (UpdateRoutingProfileName -> Text -> UpdateRoutingProfileName)
-> Lens UpdateRoutingProfileName UpdateRoutingProfileName Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingProfileName' {Text
routingProfileId :: Text
$sel:routingProfileId:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Text
routingProfileId} -> Text
routingProfileId) (\s :: UpdateRoutingProfileName
s@UpdateRoutingProfileName' {} Text
a -> UpdateRoutingProfileName
s {$sel:routingProfileId:UpdateRoutingProfileName' :: Text
routingProfileId = Text
a} :: UpdateRoutingProfileName)

instance Core.AWSRequest UpdateRoutingProfileName where
  type
    AWSResponse UpdateRoutingProfileName =
      UpdateRoutingProfileNameResponse
  request :: UpdateRoutingProfileName -> Request UpdateRoutingProfileName
request = Service
-> UpdateRoutingProfileName -> Request UpdateRoutingProfileName
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateRoutingProfileName
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateRoutingProfileName)))
response =
    AWSResponse UpdateRoutingProfileName
-> Logger
-> Service
-> Proxy UpdateRoutingProfileName
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateRoutingProfileName)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse UpdateRoutingProfileName
UpdateRoutingProfileNameResponse
UpdateRoutingProfileNameResponse'

instance Prelude.Hashable UpdateRoutingProfileName

instance Prelude.NFData UpdateRoutingProfileName

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

instance Core.ToJSON UpdateRoutingProfileName where
  toJSON :: UpdateRoutingProfileName -> Value
toJSON UpdateRoutingProfileName' {Maybe Text
Text
routingProfileId :: Text
instanceId :: Text
description :: Maybe Text
name :: Maybe Text
$sel:routingProfileId:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Text
$sel:instanceId:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Text
$sel:description:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Maybe Text
$sel:name:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Name" 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
name,
            (Text
"Description" 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
description
          ]
      )

instance Core.ToPath UpdateRoutingProfileName where
  toPath :: UpdateRoutingProfileName -> ByteString
toPath UpdateRoutingProfileName' {Maybe Text
Text
routingProfileId :: Text
instanceId :: Text
description :: Maybe Text
name :: Maybe Text
$sel:routingProfileId:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Text
$sel:instanceId:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Text
$sel:description:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Maybe Text
$sel:name:UpdateRoutingProfileName' :: UpdateRoutingProfileName -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/routing-profiles/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
routingProfileId,
        ByteString
"/name"
      ]

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

-- | /See:/ 'newUpdateRoutingProfileNameResponse' smart constructor.
data UpdateRoutingProfileNameResponse = UpdateRoutingProfileNameResponse'
  {
  }
  deriving (UpdateRoutingProfileNameResponse
-> UpdateRoutingProfileNameResponse -> Bool
(UpdateRoutingProfileNameResponse
 -> UpdateRoutingProfileNameResponse -> Bool)
-> (UpdateRoutingProfileNameResponse
    -> UpdateRoutingProfileNameResponse -> Bool)
-> Eq UpdateRoutingProfileNameResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoutingProfileNameResponse
-> UpdateRoutingProfileNameResponse -> Bool
$c/= :: UpdateRoutingProfileNameResponse
-> UpdateRoutingProfileNameResponse -> Bool
== :: UpdateRoutingProfileNameResponse
-> UpdateRoutingProfileNameResponse -> Bool
$c== :: UpdateRoutingProfileNameResponse
-> UpdateRoutingProfileNameResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRoutingProfileNameResponse]
ReadPrec UpdateRoutingProfileNameResponse
Int -> ReadS UpdateRoutingProfileNameResponse
ReadS [UpdateRoutingProfileNameResponse]
(Int -> ReadS UpdateRoutingProfileNameResponse)
-> ReadS [UpdateRoutingProfileNameResponse]
-> ReadPrec UpdateRoutingProfileNameResponse
-> ReadPrec [UpdateRoutingProfileNameResponse]
-> Read UpdateRoutingProfileNameResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoutingProfileNameResponse]
$creadListPrec :: ReadPrec [UpdateRoutingProfileNameResponse]
readPrec :: ReadPrec UpdateRoutingProfileNameResponse
$creadPrec :: ReadPrec UpdateRoutingProfileNameResponse
readList :: ReadS [UpdateRoutingProfileNameResponse]
$creadList :: ReadS [UpdateRoutingProfileNameResponse]
readsPrec :: Int -> ReadS UpdateRoutingProfileNameResponse
$creadsPrec :: Int -> ReadS UpdateRoutingProfileNameResponse
Prelude.Read, Int -> UpdateRoutingProfileNameResponse -> ShowS
[UpdateRoutingProfileNameResponse] -> ShowS
UpdateRoutingProfileNameResponse -> String
(Int -> UpdateRoutingProfileNameResponse -> ShowS)
-> (UpdateRoutingProfileNameResponse -> String)
-> ([UpdateRoutingProfileNameResponse] -> ShowS)
-> Show UpdateRoutingProfileNameResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoutingProfileNameResponse] -> ShowS
$cshowList :: [UpdateRoutingProfileNameResponse] -> ShowS
show :: UpdateRoutingProfileNameResponse -> String
$cshow :: UpdateRoutingProfileNameResponse -> String
showsPrec :: Int -> UpdateRoutingProfileNameResponse -> ShowS
$cshowsPrec :: Int -> UpdateRoutingProfileNameResponse -> ShowS
Prelude.Show, (forall x.
 UpdateRoutingProfileNameResponse
 -> Rep UpdateRoutingProfileNameResponse x)
-> (forall x.
    Rep UpdateRoutingProfileNameResponse x
    -> UpdateRoutingProfileNameResponse)
-> Generic UpdateRoutingProfileNameResponse
forall x.
Rep UpdateRoutingProfileNameResponse x
-> UpdateRoutingProfileNameResponse
forall x.
UpdateRoutingProfileNameResponse
-> Rep UpdateRoutingProfileNameResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRoutingProfileNameResponse x
-> UpdateRoutingProfileNameResponse
$cfrom :: forall x.
UpdateRoutingProfileNameResponse
-> Rep UpdateRoutingProfileNameResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRoutingProfileNameResponse' 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.
newUpdateRoutingProfileNameResponse ::
  UpdateRoutingProfileNameResponse
newUpdateRoutingProfileNameResponse :: UpdateRoutingProfileNameResponse
newUpdateRoutingProfileNameResponse =
  UpdateRoutingProfileNameResponse
UpdateRoutingProfileNameResponse'

instance
  Prelude.NFData
    UpdateRoutingProfileNameResponse