{-# 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.AppSync.UpdateDomainName
(
UpdateDomainName (..),
newUpdateDomainName,
updateDomainName_description,
updateDomainName_domainName,
UpdateDomainNameResponse (..),
newUpdateDomainNameResponse,
updateDomainNameResponse_domainNameConfig,
updateDomainNameResponse_httpStatus,
)
where
import Amazonka.AppSync.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
data UpdateDomainName = UpdateDomainName'
{
UpdateDomainName -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateDomainName -> Text
domainName :: Prelude.Text
}
deriving (UpdateDomainName -> UpdateDomainName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDomainName -> UpdateDomainName -> Bool
$c/= :: UpdateDomainName -> UpdateDomainName -> Bool
== :: UpdateDomainName -> UpdateDomainName -> Bool
$c== :: UpdateDomainName -> UpdateDomainName -> Bool
Prelude.Eq, ReadPrec [UpdateDomainName]
ReadPrec UpdateDomainName
Int -> ReadS UpdateDomainName
ReadS [UpdateDomainName]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDomainName]
$creadListPrec :: ReadPrec [UpdateDomainName]
readPrec :: ReadPrec UpdateDomainName
$creadPrec :: ReadPrec UpdateDomainName
readList :: ReadS [UpdateDomainName]
$creadList :: ReadS [UpdateDomainName]
readsPrec :: Int -> ReadS UpdateDomainName
$creadsPrec :: Int -> ReadS UpdateDomainName
Prelude.Read, Int -> UpdateDomainName -> ShowS
[UpdateDomainName] -> ShowS
UpdateDomainName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDomainName] -> ShowS
$cshowList :: [UpdateDomainName] -> ShowS
show :: UpdateDomainName -> String
$cshow :: UpdateDomainName -> String
showsPrec :: Int -> UpdateDomainName -> ShowS
$cshowsPrec :: Int -> UpdateDomainName -> ShowS
Prelude.Show, forall x. Rep UpdateDomainName x -> UpdateDomainName
forall x. UpdateDomainName -> Rep UpdateDomainName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDomainName x -> UpdateDomainName
$cfrom :: forall x. UpdateDomainName -> Rep UpdateDomainName x
Prelude.Generic)
newUpdateDomainName ::
Prelude.Text ->
UpdateDomainName
newUpdateDomainName :: Text -> UpdateDomainName
newUpdateDomainName Text
pDomainName_ =
UpdateDomainName'
{ $sel:description:UpdateDomainName' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:domainName:UpdateDomainName' :: Text
domainName = Text
pDomainName_
}
updateDomainName_description :: Lens.Lens' UpdateDomainName (Prelude.Maybe Prelude.Text)
updateDomainName_description :: Lens' UpdateDomainName (Maybe Text)
updateDomainName_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainName' {Maybe Text
description :: Maybe Text
$sel:description:UpdateDomainName' :: UpdateDomainName -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateDomainName
s@UpdateDomainName' {} Maybe Text
a -> UpdateDomainName
s {$sel:description:UpdateDomainName' :: Maybe Text
description = Maybe Text
a} :: UpdateDomainName)
updateDomainName_domainName :: Lens.Lens' UpdateDomainName Prelude.Text
updateDomainName_domainName :: Lens' UpdateDomainName Text
updateDomainName_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainName' {Text
domainName :: Text
$sel:domainName:UpdateDomainName' :: UpdateDomainName -> Text
domainName} -> Text
domainName) (\s :: UpdateDomainName
s@UpdateDomainName' {} Text
a -> UpdateDomainName
s {$sel:domainName:UpdateDomainName' :: Text
domainName = Text
a} :: UpdateDomainName)
instance Core.AWSRequest UpdateDomainName where
type
AWSResponse UpdateDomainName =
UpdateDomainNameResponse
request :: (Service -> Service)
-> UpdateDomainName -> Request UpdateDomainName
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateDomainName
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDomainName)))
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 DomainNameConfig -> Int -> UpdateDomainNameResponse
UpdateDomainNameResponse'
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
"domainNameConfig")
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 UpdateDomainName where
hashWithSalt :: Int -> UpdateDomainName -> Int
hashWithSalt Int
_salt UpdateDomainName' {Maybe Text
Text
domainName :: Text
description :: Maybe Text
$sel:domainName:UpdateDomainName' :: UpdateDomainName -> Text
$sel:description:UpdateDomainName' :: UpdateDomainName -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainName
instance Prelude.NFData UpdateDomainName where
rnf :: UpdateDomainName -> ()
rnf UpdateDomainName' {Maybe Text
Text
domainName :: Text
description :: Maybe Text
$sel:domainName:UpdateDomainName' :: UpdateDomainName -> Text
$sel:description:UpdateDomainName' :: UpdateDomainName -> Maybe Text
..} =
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 Text
domainName
instance Data.ToHeaders UpdateDomainName where
toHeaders :: UpdateDomainName -> 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 UpdateDomainName where
toJSON :: UpdateDomainName -> Value
toJSON UpdateDomainName' {Maybe Text
Text
domainName :: Text
description :: Maybe Text
$sel:domainName:UpdateDomainName' :: UpdateDomainName -> Text
$sel:description:UpdateDomainName' :: UpdateDomainName -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(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]
)
instance Data.ToPath UpdateDomainName where
toPath :: UpdateDomainName -> ByteString
toPath UpdateDomainName' {Maybe Text
Text
domainName :: Text
description :: Maybe Text
$sel:domainName:UpdateDomainName' :: UpdateDomainName -> Text
$sel:description:UpdateDomainName' :: UpdateDomainName -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/domainnames/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
domainName]
instance Data.ToQuery UpdateDomainName where
toQuery :: UpdateDomainName -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateDomainNameResponse = UpdateDomainNameResponse'
{
UpdateDomainNameResponse -> Maybe DomainNameConfig
domainNameConfig :: Prelude.Maybe DomainNameConfig,
UpdateDomainNameResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDomainNameResponse -> UpdateDomainNameResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDomainNameResponse -> UpdateDomainNameResponse -> Bool
$c/= :: UpdateDomainNameResponse -> UpdateDomainNameResponse -> Bool
== :: UpdateDomainNameResponse -> UpdateDomainNameResponse -> Bool
$c== :: UpdateDomainNameResponse -> UpdateDomainNameResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDomainNameResponse]
ReadPrec UpdateDomainNameResponse
Int -> ReadS UpdateDomainNameResponse
ReadS [UpdateDomainNameResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDomainNameResponse]
$creadListPrec :: ReadPrec [UpdateDomainNameResponse]
readPrec :: ReadPrec UpdateDomainNameResponse
$creadPrec :: ReadPrec UpdateDomainNameResponse
readList :: ReadS [UpdateDomainNameResponse]
$creadList :: ReadS [UpdateDomainNameResponse]
readsPrec :: Int -> ReadS UpdateDomainNameResponse
$creadsPrec :: Int -> ReadS UpdateDomainNameResponse
Prelude.Read, Int -> UpdateDomainNameResponse -> ShowS
[UpdateDomainNameResponse] -> ShowS
UpdateDomainNameResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDomainNameResponse] -> ShowS
$cshowList :: [UpdateDomainNameResponse] -> ShowS
show :: UpdateDomainNameResponse -> String
$cshow :: UpdateDomainNameResponse -> String
showsPrec :: Int -> UpdateDomainNameResponse -> ShowS
$cshowsPrec :: Int -> UpdateDomainNameResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateDomainNameResponse x -> UpdateDomainNameResponse
forall x.
UpdateDomainNameResponse -> Rep UpdateDomainNameResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDomainNameResponse x -> UpdateDomainNameResponse
$cfrom :: forall x.
UpdateDomainNameResponse -> Rep UpdateDomainNameResponse x
Prelude.Generic)
newUpdateDomainNameResponse ::
Prelude.Int ->
UpdateDomainNameResponse
newUpdateDomainNameResponse :: Int -> UpdateDomainNameResponse
newUpdateDomainNameResponse Int
pHttpStatus_ =
UpdateDomainNameResponse'
{ $sel:domainNameConfig:UpdateDomainNameResponse' :: Maybe DomainNameConfig
domainNameConfig =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateDomainNameResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateDomainNameResponse_domainNameConfig :: Lens.Lens' UpdateDomainNameResponse (Prelude.Maybe DomainNameConfig)
updateDomainNameResponse_domainNameConfig :: Lens' UpdateDomainNameResponse (Maybe DomainNameConfig)
updateDomainNameResponse_domainNameConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainNameResponse' {Maybe DomainNameConfig
domainNameConfig :: Maybe DomainNameConfig
$sel:domainNameConfig:UpdateDomainNameResponse' :: UpdateDomainNameResponse -> Maybe DomainNameConfig
domainNameConfig} -> Maybe DomainNameConfig
domainNameConfig) (\s :: UpdateDomainNameResponse
s@UpdateDomainNameResponse' {} Maybe DomainNameConfig
a -> UpdateDomainNameResponse
s {$sel:domainNameConfig:UpdateDomainNameResponse' :: Maybe DomainNameConfig
domainNameConfig = Maybe DomainNameConfig
a} :: UpdateDomainNameResponse)
updateDomainNameResponse_httpStatus :: Lens.Lens' UpdateDomainNameResponse Prelude.Int
updateDomainNameResponse_httpStatus :: Lens' UpdateDomainNameResponse Int
updateDomainNameResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainNameResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDomainNameResponse' :: UpdateDomainNameResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDomainNameResponse
s@UpdateDomainNameResponse' {} Int
a -> UpdateDomainNameResponse
s {$sel:httpStatus:UpdateDomainNameResponse' :: Int
httpStatus = Int
a} :: UpdateDomainNameResponse)
instance Prelude.NFData UpdateDomainNameResponse where
rnf :: UpdateDomainNameResponse -> ()
rnf UpdateDomainNameResponse' {Int
Maybe DomainNameConfig
httpStatus :: Int
domainNameConfig :: Maybe DomainNameConfig
$sel:httpStatus:UpdateDomainNameResponse' :: UpdateDomainNameResponse -> Int
$sel:domainNameConfig:UpdateDomainNameResponse' :: UpdateDomainNameResponse -> Maybe DomainNameConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DomainNameConfig
domainNameConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus