{-# 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 #-}
module Amazonka.Transcribe.UpdateCallAnalyticsCategory
(
UpdateCallAnalyticsCategory (..),
newUpdateCallAnalyticsCategory,
updateCallAnalyticsCategory_categoryName,
updateCallAnalyticsCategory_rules,
UpdateCallAnalyticsCategoryResponse (..),
newUpdateCallAnalyticsCategoryResponse,
updateCallAnalyticsCategoryResponse_categoryProperties,
updateCallAnalyticsCategoryResponse_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.Transcribe.Types
data UpdateCallAnalyticsCategory = UpdateCallAnalyticsCategory'
{
UpdateCallAnalyticsCategory -> Text
categoryName :: Prelude.Text,
UpdateCallAnalyticsCategory -> NonEmpty Rule
rules :: Prelude.NonEmpty Rule
}
deriving (UpdateCallAnalyticsCategory -> UpdateCallAnalyticsCategory -> Bool
(UpdateCallAnalyticsCategory
-> UpdateCallAnalyticsCategory -> Bool)
-> (UpdateCallAnalyticsCategory
-> UpdateCallAnalyticsCategory -> Bool)
-> Eq UpdateCallAnalyticsCategory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCallAnalyticsCategory -> UpdateCallAnalyticsCategory -> Bool
$c/= :: UpdateCallAnalyticsCategory -> UpdateCallAnalyticsCategory -> Bool
== :: UpdateCallAnalyticsCategory -> UpdateCallAnalyticsCategory -> Bool
$c== :: UpdateCallAnalyticsCategory -> UpdateCallAnalyticsCategory -> Bool
Prelude.Eq, ReadPrec [UpdateCallAnalyticsCategory]
ReadPrec UpdateCallAnalyticsCategory
Int -> ReadS UpdateCallAnalyticsCategory
ReadS [UpdateCallAnalyticsCategory]
(Int -> ReadS UpdateCallAnalyticsCategory)
-> ReadS [UpdateCallAnalyticsCategory]
-> ReadPrec UpdateCallAnalyticsCategory
-> ReadPrec [UpdateCallAnalyticsCategory]
-> Read UpdateCallAnalyticsCategory
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCallAnalyticsCategory]
$creadListPrec :: ReadPrec [UpdateCallAnalyticsCategory]
readPrec :: ReadPrec UpdateCallAnalyticsCategory
$creadPrec :: ReadPrec UpdateCallAnalyticsCategory
readList :: ReadS [UpdateCallAnalyticsCategory]
$creadList :: ReadS [UpdateCallAnalyticsCategory]
readsPrec :: Int -> ReadS UpdateCallAnalyticsCategory
$creadsPrec :: Int -> ReadS UpdateCallAnalyticsCategory
Prelude.Read, Int -> UpdateCallAnalyticsCategory -> ShowS
[UpdateCallAnalyticsCategory] -> ShowS
UpdateCallAnalyticsCategory -> String
(Int -> UpdateCallAnalyticsCategory -> ShowS)
-> (UpdateCallAnalyticsCategory -> String)
-> ([UpdateCallAnalyticsCategory] -> ShowS)
-> Show UpdateCallAnalyticsCategory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCallAnalyticsCategory] -> ShowS
$cshowList :: [UpdateCallAnalyticsCategory] -> ShowS
show :: UpdateCallAnalyticsCategory -> String
$cshow :: UpdateCallAnalyticsCategory -> String
showsPrec :: Int -> UpdateCallAnalyticsCategory -> ShowS
$cshowsPrec :: Int -> UpdateCallAnalyticsCategory -> ShowS
Prelude.Show, (forall x.
UpdateCallAnalyticsCategory -> Rep UpdateCallAnalyticsCategory x)
-> (forall x.
Rep UpdateCallAnalyticsCategory x -> UpdateCallAnalyticsCategory)
-> Generic UpdateCallAnalyticsCategory
forall x.
Rep UpdateCallAnalyticsCategory x -> UpdateCallAnalyticsCategory
forall x.
UpdateCallAnalyticsCategory -> Rep UpdateCallAnalyticsCategory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCallAnalyticsCategory x -> UpdateCallAnalyticsCategory
$cfrom :: forall x.
UpdateCallAnalyticsCategory -> Rep UpdateCallAnalyticsCategory x
Prelude.Generic)
newUpdateCallAnalyticsCategory ::
Prelude.Text ->
Prelude.NonEmpty Rule ->
UpdateCallAnalyticsCategory
newUpdateCallAnalyticsCategory :: Text -> NonEmpty Rule -> UpdateCallAnalyticsCategory
newUpdateCallAnalyticsCategory Text
pCategoryName_ NonEmpty Rule
pRules_ =
UpdateCallAnalyticsCategory' :: Text -> NonEmpty Rule -> UpdateCallAnalyticsCategory
UpdateCallAnalyticsCategory'
{ $sel:categoryName:UpdateCallAnalyticsCategory' :: Text
categoryName =
Text
pCategoryName_,
$sel:rules:UpdateCallAnalyticsCategory' :: NonEmpty Rule
rules = Tagged (NonEmpty Rule) (Identity (NonEmpty Rule))
-> Tagged (NonEmpty Rule) (Identity (NonEmpty Rule))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Rule) (Identity (NonEmpty Rule))
-> Tagged (NonEmpty Rule) (Identity (NonEmpty Rule)))
-> NonEmpty Rule -> NonEmpty Rule
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Rule
pRules_
}
updateCallAnalyticsCategory_categoryName :: Lens.Lens' UpdateCallAnalyticsCategory Prelude.Text
updateCallAnalyticsCategory_categoryName :: (Text -> f Text)
-> UpdateCallAnalyticsCategory -> f UpdateCallAnalyticsCategory
updateCallAnalyticsCategory_categoryName = (UpdateCallAnalyticsCategory -> Text)
-> (UpdateCallAnalyticsCategory
-> Text -> UpdateCallAnalyticsCategory)
-> Lens
UpdateCallAnalyticsCategory UpdateCallAnalyticsCategory Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCallAnalyticsCategory' {Text
categoryName :: Text
$sel:categoryName:UpdateCallAnalyticsCategory' :: UpdateCallAnalyticsCategory -> Text
categoryName} -> Text
categoryName) (\s :: UpdateCallAnalyticsCategory
s@UpdateCallAnalyticsCategory' {} Text
a -> UpdateCallAnalyticsCategory
s {$sel:categoryName:UpdateCallAnalyticsCategory' :: Text
categoryName = Text
a} :: UpdateCallAnalyticsCategory)
updateCallAnalyticsCategory_rules :: Lens.Lens' UpdateCallAnalyticsCategory (Prelude.NonEmpty Rule)
updateCallAnalyticsCategory_rules :: (NonEmpty Rule -> f (NonEmpty Rule))
-> UpdateCallAnalyticsCategory -> f UpdateCallAnalyticsCategory
updateCallAnalyticsCategory_rules = (UpdateCallAnalyticsCategory -> NonEmpty Rule)
-> (UpdateCallAnalyticsCategory
-> NonEmpty Rule -> UpdateCallAnalyticsCategory)
-> Lens
UpdateCallAnalyticsCategory
UpdateCallAnalyticsCategory
(NonEmpty Rule)
(NonEmpty Rule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCallAnalyticsCategory' {NonEmpty Rule
rules :: NonEmpty Rule
$sel:rules:UpdateCallAnalyticsCategory' :: UpdateCallAnalyticsCategory -> NonEmpty Rule
rules} -> NonEmpty Rule
rules) (\s :: UpdateCallAnalyticsCategory
s@UpdateCallAnalyticsCategory' {} NonEmpty Rule
a -> UpdateCallAnalyticsCategory
s {$sel:rules:UpdateCallAnalyticsCategory' :: NonEmpty Rule
rules = NonEmpty Rule
a} :: UpdateCallAnalyticsCategory) ((NonEmpty Rule -> f (NonEmpty Rule))
-> UpdateCallAnalyticsCategory -> f UpdateCallAnalyticsCategory)
-> ((NonEmpty Rule -> f (NonEmpty Rule))
-> NonEmpty Rule -> f (NonEmpty Rule))
-> (NonEmpty Rule -> f (NonEmpty Rule))
-> UpdateCallAnalyticsCategory
-> f UpdateCallAnalyticsCategory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Rule -> f (NonEmpty Rule))
-> NonEmpty Rule -> f (NonEmpty Rule)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UpdateCallAnalyticsCategory where
type
AWSResponse UpdateCallAnalyticsCategory =
UpdateCallAnalyticsCategoryResponse
request :: UpdateCallAnalyticsCategory -> Request UpdateCallAnalyticsCategory
request = Service
-> UpdateCallAnalyticsCategory
-> Request UpdateCallAnalyticsCategory
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateCallAnalyticsCategory
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCallAnalyticsCategory)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateCallAnalyticsCategory))
-> Logger
-> Service
-> Proxy UpdateCallAnalyticsCategory
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCallAnalyticsCategory)))
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 CategoryProperties
-> Int -> UpdateCallAnalyticsCategoryResponse
UpdateCallAnalyticsCategoryResponse'
(Maybe CategoryProperties
-> Int -> UpdateCallAnalyticsCategoryResponse)
-> Either String (Maybe CategoryProperties)
-> Either String (Int -> UpdateCallAnalyticsCategoryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CategoryProperties)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CategoryProperties")
Either String (Int -> UpdateCallAnalyticsCategoryResponse)
-> Either String Int
-> Either String UpdateCallAnalyticsCategoryResponse
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 UpdateCallAnalyticsCategory
instance Prelude.NFData UpdateCallAnalyticsCategory
instance Core.ToHeaders UpdateCallAnalyticsCategory where
toHeaders :: UpdateCallAnalyticsCategory -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateCallAnalyticsCategory -> 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
"Transcribe.UpdateCallAnalyticsCategory" ::
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 UpdateCallAnalyticsCategory where
toJSON :: UpdateCallAnalyticsCategory -> Value
toJSON UpdateCallAnalyticsCategory' {NonEmpty Rule
Text
rules :: NonEmpty Rule
categoryName :: Text
$sel:rules:UpdateCallAnalyticsCategory' :: UpdateCallAnalyticsCategory -> NonEmpty Rule
$sel:categoryName:UpdateCallAnalyticsCategory' :: UpdateCallAnalyticsCategory -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"CategoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
categoryName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Rules" Text -> NonEmpty Rule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Rule
rules)
]
)
instance Core.ToPath UpdateCallAnalyticsCategory where
toPath :: UpdateCallAnalyticsCategory -> ByteString
toPath = ByteString -> UpdateCallAnalyticsCategory -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateCallAnalyticsCategory where
toQuery :: UpdateCallAnalyticsCategory -> QueryString
toQuery = QueryString -> UpdateCallAnalyticsCategory -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateCallAnalyticsCategoryResponse = UpdateCallAnalyticsCategoryResponse'
{
UpdateCallAnalyticsCategoryResponse -> Maybe CategoryProperties
categoryProperties :: Prelude.Maybe CategoryProperties,
UpdateCallAnalyticsCategoryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateCallAnalyticsCategoryResponse
-> UpdateCallAnalyticsCategoryResponse -> Bool
(UpdateCallAnalyticsCategoryResponse
-> UpdateCallAnalyticsCategoryResponse -> Bool)
-> (UpdateCallAnalyticsCategoryResponse
-> UpdateCallAnalyticsCategoryResponse -> Bool)
-> Eq UpdateCallAnalyticsCategoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCallAnalyticsCategoryResponse
-> UpdateCallAnalyticsCategoryResponse -> Bool
$c/= :: UpdateCallAnalyticsCategoryResponse
-> UpdateCallAnalyticsCategoryResponse -> Bool
== :: UpdateCallAnalyticsCategoryResponse
-> UpdateCallAnalyticsCategoryResponse -> Bool
$c== :: UpdateCallAnalyticsCategoryResponse
-> UpdateCallAnalyticsCategoryResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCallAnalyticsCategoryResponse]
ReadPrec UpdateCallAnalyticsCategoryResponse
Int -> ReadS UpdateCallAnalyticsCategoryResponse
ReadS [UpdateCallAnalyticsCategoryResponse]
(Int -> ReadS UpdateCallAnalyticsCategoryResponse)
-> ReadS [UpdateCallAnalyticsCategoryResponse]
-> ReadPrec UpdateCallAnalyticsCategoryResponse
-> ReadPrec [UpdateCallAnalyticsCategoryResponse]
-> Read UpdateCallAnalyticsCategoryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCallAnalyticsCategoryResponse]
$creadListPrec :: ReadPrec [UpdateCallAnalyticsCategoryResponse]
readPrec :: ReadPrec UpdateCallAnalyticsCategoryResponse
$creadPrec :: ReadPrec UpdateCallAnalyticsCategoryResponse
readList :: ReadS [UpdateCallAnalyticsCategoryResponse]
$creadList :: ReadS [UpdateCallAnalyticsCategoryResponse]
readsPrec :: Int -> ReadS UpdateCallAnalyticsCategoryResponse
$creadsPrec :: Int -> ReadS UpdateCallAnalyticsCategoryResponse
Prelude.Read, Int -> UpdateCallAnalyticsCategoryResponse -> ShowS
[UpdateCallAnalyticsCategoryResponse] -> ShowS
UpdateCallAnalyticsCategoryResponse -> String
(Int -> UpdateCallAnalyticsCategoryResponse -> ShowS)
-> (UpdateCallAnalyticsCategoryResponse -> String)
-> ([UpdateCallAnalyticsCategoryResponse] -> ShowS)
-> Show UpdateCallAnalyticsCategoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCallAnalyticsCategoryResponse] -> ShowS
$cshowList :: [UpdateCallAnalyticsCategoryResponse] -> ShowS
show :: UpdateCallAnalyticsCategoryResponse -> String
$cshow :: UpdateCallAnalyticsCategoryResponse -> String
showsPrec :: Int -> UpdateCallAnalyticsCategoryResponse -> ShowS
$cshowsPrec :: Int -> UpdateCallAnalyticsCategoryResponse -> ShowS
Prelude.Show, (forall x.
UpdateCallAnalyticsCategoryResponse
-> Rep UpdateCallAnalyticsCategoryResponse x)
-> (forall x.
Rep UpdateCallAnalyticsCategoryResponse x
-> UpdateCallAnalyticsCategoryResponse)
-> Generic UpdateCallAnalyticsCategoryResponse
forall x.
Rep UpdateCallAnalyticsCategoryResponse x
-> UpdateCallAnalyticsCategoryResponse
forall x.
UpdateCallAnalyticsCategoryResponse
-> Rep UpdateCallAnalyticsCategoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCallAnalyticsCategoryResponse x
-> UpdateCallAnalyticsCategoryResponse
$cfrom :: forall x.
UpdateCallAnalyticsCategoryResponse
-> Rep UpdateCallAnalyticsCategoryResponse x
Prelude.Generic)
newUpdateCallAnalyticsCategoryResponse ::
Prelude.Int ->
UpdateCallAnalyticsCategoryResponse
newUpdateCallAnalyticsCategoryResponse :: Int -> UpdateCallAnalyticsCategoryResponse
newUpdateCallAnalyticsCategoryResponse Int
pHttpStatus_ =
UpdateCallAnalyticsCategoryResponse' :: Maybe CategoryProperties
-> Int -> UpdateCallAnalyticsCategoryResponse
UpdateCallAnalyticsCategoryResponse'
{ $sel:categoryProperties:UpdateCallAnalyticsCategoryResponse' :: Maybe CategoryProperties
categoryProperties =
Maybe CategoryProperties
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateCallAnalyticsCategoryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateCallAnalyticsCategoryResponse_categoryProperties :: Lens.Lens' UpdateCallAnalyticsCategoryResponse (Prelude.Maybe CategoryProperties)
updateCallAnalyticsCategoryResponse_categoryProperties :: (Maybe CategoryProperties -> f (Maybe CategoryProperties))
-> UpdateCallAnalyticsCategoryResponse
-> f UpdateCallAnalyticsCategoryResponse
updateCallAnalyticsCategoryResponse_categoryProperties = (UpdateCallAnalyticsCategoryResponse -> Maybe CategoryProperties)
-> (UpdateCallAnalyticsCategoryResponse
-> Maybe CategoryProperties -> UpdateCallAnalyticsCategoryResponse)
-> Lens
UpdateCallAnalyticsCategoryResponse
UpdateCallAnalyticsCategoryResponse
(Maybe CategoryProperties)
(Maybe CategoryProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCallAnalyticsCategoryResponse' {Maybe CategoryProperties
categoryProperties :: Maybe CategoryProperties
$sel:categoryProperties:UpdateCallAnalyticsCategoryResponse' :: UpdateCallAnalyticsCategoryResponse -> Maybe CategoryProperties
categoryProperties} -> Maybe CategoryProperties
categoryProperties) (\s :: UpdateCallAnalyticsCategoryResponse
s@UpdateCallAnalyticsCategoryResponse' {} Maybe CategoryProperties
a -> UpdateCallAnalyticsCategoryResponse
s {$sel:categoryProperties:UpdateCallAnalyticsCategoryResponse' :: Maybe CategoryProperties
categoryProperties = Maybe CategoryProperties
a} :: UpdateCallAnalyticsCategoryResponse)
updateCallAnalyticsCategoryResponse_httpStatus :: Lens.Lens' UpdateCallAnalyticsCategoryResponse Prelude.Int
updateCallAnalyticsCategoryResponse_httpStatus :: (Int -> f Int)
-> UpdateCallAnalyticsCategoryResponse
-> f UpdateCallAnalyticsCategoryResponse
updateCallAnalyticsCategoryResponse_httpStatus = (UpdateCallAnalyticsCategoryResponse -> Int)
-> (UpdateCallAnalyticsCategoryResponse
-> Int -> UpdateCallAnalyticsCategoryResponse)
-> Lens
UpdateCallAnalyticsCategoryResponse
UpdateCallAnalyticsCategoryResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCallAnalyticsCategoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateCallAnalyticsCategoryResponse' :: UpdateCallAnalyticsCategoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateCallAnalyticsCategoryResponse
s@UpdateCallAnalyticsCategoryResponse' {} Int
a -> UpdateCallAnalyticsCategoryResponse
s {$sel:httpStatus:UpdateCallAnalyticsCategoryResponse' :: Int
httpStatus = Int
a} :: UpdateCallAnalyticsCategoryResponse)
instance
Prelude.NFData
UpdateCallAnalyticsCategoryResponse