{-# 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.VoiceId.UpdateDomain
(
UpdateDomain (..),
newUpdateDomain,
updateDomain_description,
updateDomain_domainId,
updateDomain_name,
updateDomain_serverSideEncryptionConfiguration,
UpdateDomainResponse (..),
newUpdateDomainResponse,
updateDomainResponse_domain,
updateDomainResponse_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.VoiceId.Types
data UpdateDomain = UpdateDomain'
{
UpdateDomain -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
UpdateDomain -> Text
domainId :: Prelude.Text,
UpdateDomain -> Sensitive Text
name :: Core.Sensitive Prelude.Text,
UpdateDomain -> ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: ServerSideEncryptionConfiguration
}
deriving (UpdateDomain -> UpdateDomain -> Bool
(UpdateDomain -> UpdateDomain -> Bool)
-> (UpdateDomain -> UpdateDomain -> Bool) -> Eq UpdateDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDomain -> UpdateDomain -> Bool
$c/= :: UpdateDomain -> UpdateDomain -> Bool
== :: UpdateDomain -> UpdateDomain -> Bool
$c== :: UpdateDomain -> UpdateDomain -> Bool
Prelude.Eq, Int -> UpdateDomain -> ShowS
[UpdateDomain] -> ShowS
UpdateDomain -> String
(Int -> UpdateDomain -> ShowS)
-> (UpdateDomain -> String)
-> ([UpdateDomain] -> ShowS)
-> Show UpdateDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDomain] -> ShowS
$cshowList :: [UpdateDomain] -> ShowS
show :: UpdateDomain -> String
$cshow :: UpdateDomain -> String
showsPrec :: Int -> UpdateDomain -> ShowS
$cshowsPrec :: Int -> UpdateDomain -> ShowS
Prelude.Show, (forall x. UpdateDomain -> Rep UpdateDomain x)
-> (forall x. Rep UpdateDomain x -> UpdateDomain)
-> Generic UpdateDomain
forall x. Rep UpdateDomain x -> UpdateDomain
forall x. UpdateDomain -> Rep UpdateDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDomain x -> UpdateDomain
$cfrom :: forall x. UpdateDomain -> Rep UpdateDomain x
Prelude.Generic)
newUpdateDomain ::
Prelude.Text ->
Prelude.Text ->
ServerSideEncryptionConfiguration ->
UpdateDomain
newUpdateDomain :: Text -> Text -> ServerSideEncryptionConfiguration -> UpdateDomain
newUpdateDomain
Text
pDomainId_
Text
pName_
ServerSideEncryptionConfiguration
pServerSideEncryptionConfiguration_ =
UpdateDomain' :: Maybe (Sensitive Text)
-> Text
-> Sensitive Text
-> ServerSideEncryptionConfiguration
-> UpdateDomain
UpdateDomain'
{ $sel:description:UpdateDomain' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:domainId:UpdateDomain' :: Text
domainId = Text
pDomainId_,
$sel:name:UpdateDomain' :: Sensitive Text
name = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pName_,
$sel:serverSideEncryptionConfiguration:UpdateDomain' :: ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration =
ServerSideEncryptionConfiguration
pServerSideEncryptionConfiguration_
}
updateDomain_description :: Lens.Lens' UpdateDomain (Prelude.Maybe Prelude.Text)
updateDomain_description :: (Maybe Text -> f (Maybe Text)) -> UpdateDomain -> f UpdateDomain
updateDomain_description = (UpdateDomain -> Maybe (Sensitive Text))
-> (UpdateDomain -> Maybe (Sensitive Text) -> UpdateDomain)
-> Lens
UpdateDomain
UpdateDomain
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomain' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateDomain' :: UpdateDomain -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateDomain
s@UpdateDomain' {} Maybe (Sensitive Text)
a -> UpdateDomain
s {$sel:description:UpdateDomain' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateDomain) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> UpdateDomain -> f UpdateDomain)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateDomain
-> f UpdateDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
updateDomain_domainId :: Lens.Lens' UpdateDomain Prelude.Text
updateDomain_domainId :: (Text -> f Text) -> UpdateDomain -> f UpdateDomain
updateDomain_domainId = (UpdateDomain -> Text)
-> (UpdateDomain -> Text -> UpdateDomain)
-> Lens UpdateDomain UpdateDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomain' {Text
domainId :: Text
$sel:domainId:UpdateDomain' :: UpdateDomain -> Text
domainId} -> Text
domainId) (\s :: UpdateDomain
s@UpdateDomain' {} Text
a -> UpdateDomain
s {$sel:domainId:UpdateDomain' :: Text
domainId = Text
a} :: UpdateDomain)
updateDomain_name :: Lens.Lens' UpdateDomain Prelude.Text
updateDomain_name :: (Text -> f Text) -> UpdateDomain -> f UpdateDomain
updateDomain_name = (UpdateDomain -> Sensitive Text)
-> (UpdateDomain -> Sensitive Text -> UpdateDomain)
-> Lens UpdateDomain UpdateDomain (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomain' {Sensitive Text
name :: Sensitive Text
$sel:name:UpdateDomain' :: UpdateDomain -> Sensitive Text
name} -> Sensitive Text
name) (\s :: UpdateDomain
s@UpdateDomain' {} Sensitive Text
a -> UpdateDomain
s {$sel:name:UpdateDomain' :: Sensitive Text
name = Sensitive Text
a} :: UpdateDomain) ((Sensitive Text -> f (Sensitive Text))
-> UpdateDomain -> f UpdateDomain)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> UpdateDomain
-> f UpdateDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
updateDomain_serverSideEncryptionConfiguration :: Lens.Lens' UpdateDomain ServerSideEncryptionConfiguration
updateDomain_serverSideEncryptionConfiguration :: (ServerSideEncryptionConfiguration
-> f ServerSideEncryptionConfiguration)
-> UpdateDomain -> f UpdateDomain
updateDomain_serverSideEncryptionConfiguration = (UpdateDomain -> ServerSideEncryptionConfiguration)
-> (UpdateDomain
-> ServerSideEncryptionConfiguration -> UpdateDomain)
-> Lens
UpdateDomain
UpdateDomain
ServerSideEncryptionConfiguration
ServerSideEncryptionConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomain' {ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: ServerSideEncryptionConfiguration
$sel:serverSideEncryptionConfiguration:UpdateDomain' :: UpdateDomain -> ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration} -> ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration) (\s :: UpdateDomain
s@UpdateDomain' {} ServerSideEncryptionConfiguration
a -> UpdateDomain
s {$sel:serverSideEncryptionConfiguration:UpdateDomain' :: ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration = ServerSideEncryptionConfiguration
a} :: UpdateDomain)
instance Core.AWSRequest UpdateDomain where
type AWSResponse UpdateDomain = UpdateDomainResponse
request :: UpdateDomain -> Request UpdateDomain
request = Service -> UpdateDomain -> Request UpdateDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDomain)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateDomain))
-> Logger
-> Service
-> Proxy UpdateDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDomain)))
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 Domain -> Int -> UpdateDomainResponse
UpdateDomainResponse'
(Maybe Domain -> Int -> UpdateDomainResponse)
-> Either String (Maybe Domain)
-> Either String (Int -> UpdateDomainResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Domain)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Domain")
Either String (Int -> UpdateDomainResponse)
-> Either String Int -> Either String UpdateDomainResponse
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 UpdateDomain
instance Prelude.NFData UpdateDomain
instance Core.ToHeaders UpdateDomain where
toHeaders :: UpdateDomain -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateDomain -> 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
"VoiceID.UpdateDomain" :: Prelude.ByteString),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateDomain where
toJSON :: UpdateDomain -> Value
toJSON UpdateDomain' {Maybe (Sensitive Text)
Text
Sensitive Text
ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: ServerSideEncryptionConfiguration
name :: Sensitive Text
domainId :: Text
description :: Maybe (Sensitive Text)
$sel:serverSideEncryptionConfiguration:UpdateDomain' :: UpdateDomain -> ServerSideEncryptionConfiguration
$sel:name:UpdateDomain' :: UpdateDomain -> Sensitive Text
$sel:domainId:UpdateDomain' :: UpdateDomain -> Text
$sel:description:UpdateDomain' :: UpdateDomain -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ServerSideEncryptionConfiguration"
Text -> ServerSideEncryptionConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration
)
]
)
instance Core.ToPath UpdateDomain where
toPath :: UpdateDomain -> ByteString
toPath = ByteString -> UpdateDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateDomain where
toQuery :: UpdateDomain -> QueryString
toQuery = QueryString -> UpdateDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateDomainResponse = UpdateDomainResponse'
{
UpdateDomainResponse -> Maybe Domain
domain :: Prelude.Maybe Domain,
UpdateDomainResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDomainResponse -> UpdateDomainResponse -> Bool
(UpdateDomainResponse -> UpdateDomainResponse -> Bool)
-> (UpdateDomainResponse -> UpdateDomainResponse -> Bool)
-> Eq UpdateDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDomainResponse -> UpdateDomainResponse -> Bool
$c/= :: UpdateDomainResponse -> UpdateDomainResponse -> Bool
== :: UpdateDomainResponse -> UpdateDomainResponse -> Bool
$c== :: UpdateDomainResponse -> UpdateDomainResponse -> Bool
Prelude.Eq, Int -> UpdateDomainResponse -> ShowS
[UpdateDomainResponse] -> ShowS
UpdateDomainResponse -> String
(Int -> UpdateDomainResponse -> ShowS)
-> (UpdateDomainResponse -> String)
-> ([UpdateDomainResponse] -> ShowS)
-> Show UpdateDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDomainResponse] -> ShowS
$cshowList :: [UpdateDomainResponse] -> ShowS
show :: UpdateDomainResponse -> String
$cshow :: UpdateDomainResponse -> String
showsPrec :: Int -> UpdateDomainResponse -> ShowS
$cshowsPrec :: Int -> UpdateDomainResponse -> ShowS
Prelude.Show, (forall x. UpdateDomainResponse -> Rep UpdateDomainResponse x)
-> (forall x. Rep UpdateDomainResponse x -> UpdateDomainResponse)
-> Generic UpdateDomainResponse
forall x. Rep UpdateDomainResponse x -> UpdateDomainResponse
forall x. UpdateDomainResponse -> Rep UpdateDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDomainResponse x -> UpdateDomainResponse
$cfrom :: forall x. UpdateDomainResponse -> Rep UpdateDomainResponse x
Prelude.Generic)
newUpdateDomainResponse ::
Prelude.Int ->
UpdateDomainResponse
newUpdateDomainResponse :: Int -> UpdateDomainResponse
newUpdateDomainResponse Int
pHttpStatus_ =
UpdateDomainResponse' :: Maybe Domain -> Int -> UpdateDomainResponse
UpdateDomainResponse'
{ $sel:domain:UpdateDomainResponse' :: Maybe Domain
domain = Maybe Domain
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateDomainResponse_domain :: Lens.Lens' UpdateDomainResponse (Prelude.Maybe Domain)
updateDomainResponse_domain :: (Maybe Domain -> f (Maybe Domain))
-> UpdateDomainResponse -> f UpdateDomainResponse
updateDomainResponse_domain = (UpdateDomainResponse -> Maybe Domain)
-> (UpdateDomainResponse -> Maybe Domain -> UpdateDomainResponse)
-> Lens
UpdateDomainResponse
UpdateDomainResponse
(Maybe Domain)
(Maybe Domain)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainResponse' {Maybe Domain
domain :: Maybe Domain
$sel:domain:UpdateDomainResponse' :: UpdateDomainResponse -> Maybe Domain
domain} -> Maybe Domain
domain) (\s :: UpdateDomainResponse
s@UpdateDomainResponse' {} Maybe Domain
a -> UpdateDomainResponse
s {$sel:domain:UpdateDomainResponse' :: Maybe Domain
domain = Maybe Domain
a} :: UpdateDomainResponse)
updateDomainResponse_httpStatus :: Lens.Lens' UpdateDomainResponse Prelude.Int
updateDomainResponse_httpStatus :: (Int -> f Int) -> UpdateDomainResponse -> f UpdateDomainResponse
updateDomainResponse_httpStatus = (UpdateDomainResponse -> Int)
-> (UpdateDomainResponse -> Int -> UpdateDomainResponse)
-> Lens UpdateDomainResponse UpdateDomainResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDomainResponse' :: UpdateDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDomainResponse
s@UpdateDomainResponse' {} Int
a -> UpdateDomainResponse
s {$sel:httpStatus:UpdateDomainResponse' :: Int
httpStatus = Int
a} :: UpdateDomainResponse)
instance Prelude.NFData UpdateDomainResponse