{-# 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.WorkMail.UpdateDefaultMailDomain
(
UpdateDefaultMailDomain (..),
newUpdateDefaultMailDomain,
updateDefaultMailDomain_organizationId,
updateDefaultMailDomain_domainName,
UpdateDefaultMailDomainResponse (..),
newUpdateDefaultMailDomainResponse,
updateDefaultMailDomainResponse_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.WorkMail.Types
data UpdateDefaultMailDomain = UpdateDefaultMailDomain'
{
UpdateDefaultMailDomain -> Text
organizationId :: Prelude.Text,
UpdateDefaultMailDomain -> Text
domainName :: Prelude.Text
}
deriving (UpdateDefaultMailDomain -> UpdateDefaultMailDomain -> Bool
(UpdateDefaultMailDomain -> UpdateDefaultMailDomain -> Bool)
-> (UpdateDefaultMailDomain -> UpdateDefaultMailDomain -> Bool)
-> Eq UpdateDefaultMailDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDefaultMailDomain -> UpdateDefaultMailDomain -> Bool
$c/= :: UpdateDefaultMailDomain -> UpdateDefaultMailDomain -> Bool
== :: UpdateDefaultMailDomain -> UpdateDefaultMailDomain -> Bool
$c== :: UpdateDefaultMailDomain -> UpdateDefaultMailDomain -> Bool
Prelude.Eq, ReadPrec [UpdateDefaultMailDomain]
ReadPrec UpdateDefaultMailDomain
Int -> ReadS UpdateDefaultMailDomain
ReadS [UpdateDefaultMailDomain]
(Int -> ReadS UpdateDefaultMailDomain)
-> ReadS [UpdateDefaultMailDomain]
-> ReadPrec UpdateDefaultMailDomain
-> ReadPrec [UpdateDefaultMailDomain]
-> Read UpdateDefaultMailDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDefaultMailDomain]
$creadListPrec :: ReadPrec [UpdateDefaultMailDomain]
readPrec :: ReadPrec UpdateDefaultMailDomain
$creadPrec :: ReadPrec UpdateDefaultMailDomain
readList :: ReadS [UpdateDefaultMailDomain]
$creadList :: ReadS [UpdateDefaultMailDomain]
readsPrec :: Int -> ReadS UpdateDefaultMailDomain
$creadsPrec :: Int -> ReadS UpdateDefaultMailDomain
Prelude.Read, Int -> UpdateDefaultMailDomain -> ShowS
[UpdateDefaultMailDomain] -> ShowS
UpdateDefaultMailDomain -> String
(Int -> UpdateDefaultMailDomain -> ShowS)
-> (UpdateDefaultMailDomain -> String)
-> ([UpdateDefaultMailDomain] -> ShowS)
-> Show UpdateDefaultMailDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDefaultMailDomain] -> ShowS
$cshowList :: [UpdateDefaultMailDomain] -> ShowS
show :: UpdateDefaultMailDomain -> String
$cshow :: UpdateDefaultMailDomain -> String
showsPrec :: Int -> UpdateDefaultMailDomain -> ShowS
$cshowsPrec :: Int -> UpdateDefaultMailDomain -> ShowS
Prelude.Show, (forall x.
UpdateDefaultMailDomain -> Rep UpdateDefaultMailDomain x)
-> (forall x.
Rep UpdateDefaultMailDomain x -> UpdateDefaultMailDomain)
-> Generic UpdateDefaultMailDomain
forall x. Rep UpdateDefaultMailDomain x -> UpdateDefaultMailDomain
forall x. UpdateDefaultMailDomain -> Rep UpdateDefaultMailDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDefaultMailDomain x -> UpdateDefaultMailDomain
$cfrom :: forall x. UpdateDefaultMailDomain -> Rep UpdateDefaultMailDomain x
Prelude.Generic)
newUpdateDefaultMailDomain ::
Prelude.Text ->
Prelude.Text ->
UpdateDefaultMailDomain
newUpdateDefaultMailDomain :: Text -> Text -> UpdateDefaultMailDomain
newUpdateDefaultMailDomain
Text
pOrganizationId_
Text
pDomainName_ =
UpdateDefaultMailDomain' :: Text -> Text -> UpdateDefaultMailDomain
UpdateDefaultMailDomain'
{ $sel:organizationId:UpdateDefaultMailDomain' :: Text
organizationId =
Text
pOrganizationId_,
$sel:domainName:UpdateDefaultMailDomain' :: Text
domainName = Text
pDomainName_
}
updateDefaultMailDomain_organizationId :: Lens.Lens' UpdateDefaultMailDomain Prelude.Text
updateDefaultMailDomain_organizationId :: (Text -> f Text)
-> UpdateDefaultMailDomain -> f UpdateDefaultMailDomain
updateDefaultMailDomain_organizationId = (UpdateDefaultMailDomain -> Text)
-> (UpdateDefaultMailDomain -> Text -> UpdateDefaultMailDomain)
-> Lens UpdateDefaultMailDomain UpdateDefaultMailDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDefaultMailDomain' {Text
organizationId :: Text
$sel:organizationId:UpdateDefaultMailDomain' :: UpdateDefaultMailDomain -> Text
organizationId} -> Text
organizationId) (\s :: UpdateDefaultMailDomain
s@UpdateDefaultMailDomain' {} Text
a -> UpdateDefaultMailDomain
s {$sel:organizationId:UpdateDefaultMailDomain' :: Text
organizationId = Text
a} :: UpdateDefaultMailDomain)
updateDefaultMailDomain_domainName :: Lens.Lens' UpdateDefaultMailDomain Prelude.Text
updateDefaultMailDomain_domainName :: (Text -> f Text)
-> UpdateDefaultMailDomain -> f UpdateDefaultMailDomain
updateDefaultMailDomain_domainName = (UpdateDefaultMailDomain -> Text)
-> (UpdateDefaultMailDomain -> Text -> UpdateDefaultMailDomain)
-> Lens UpdateDefaultMailDomain UpdateDefaultMailDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDefaultMailDomain' {Text
domainName :: Text
$sel:domainName:UpdateDefaultMailDomain' :: UpdateDefaultMailDomain -> Text
domainName} -> Text
domainName) (\s :: UpdateDefaultMailDomain
s@UpdateDefaultMailDomain' {} Text
a -> UpdateDefaultMailDomain
s {$sel:domainName:UpdateDefaultMailDomain' :: Text
domainName = Text
a} :: UpdateDefaultMailDomain)
instance Core.AWSRequest UpdateDefaultMailDomain where
type
AWSResponse UpdateDefaultMailDomain =
UpdateDefaultMailDomainResponse
request :: UpdateDefaultMailDomain -> Request UpdateDefaultMailDomain
request = Service
-> UpdateDefaultMailDomain -> Request UpdateDefaultMailDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDefaultMailDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDefaultMailDomain)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateDefaultMailDomain))
-> Logger
-> Service
-> Proxy UpdateDefaultMailDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDefaultMailDomain)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateDefaultMailDomainResponse
UpdateDefaultMailDomainResponse'
(Int -> UpdateDefaultMailDomainResponse)
-> Either String Int
-> Either String UpdateDefaultMailDomainResponse
forall (f :: * -> *) a b. Functor 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 UpdateDefaultMailDomain
instance Prelude.NFData UpdateDefaultMailDomain
instance Core.ToHeaders UpdateDefaultMailDomain where
toHeaders :: UpdateDefaultMailDomain -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateDefaultMailDomain -> 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
"WorkMailService.UpdateDefaultMailDomain" ::
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 UpdateDefaultMailDomain where
toJSON :: UpdateDefaultMailDomain -> Value
toJSON UpdateDefaultMailDomain' {Text
domainName :: Text
organizationId :: Text
$sel:domainName:UpdateDefaultMailDomain' :: UpdateDefaultMailDomain -> Text
$sel:organizationId:UpdateDefaultMailDomain' :: UpdateDefaultMailDomain -> 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
"OrganizationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
organizationId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName)
]
)
instance Core.ToPath UpdateDefaultMailDomain where
toPath :: UpdateDefaultMailDomain -> ByteString
toPath = ByteString -> UpdateDefaultMailDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateDefaultMailDomain where
toQuery :: UpdateDefaultMailDomain -> QueryString
toQuery = QueryString -> UpdateDefaultMailDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateDefaultMailDomainResponse = UpdateDefaultMailDomainResponse'
{
UpdateDefaultMailDomainResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDefaultMailDomainResponse
-> UpdateDefaultMailDomainResponse -> Bool
(UpdateDefaultMailDomainResponse
-> UpdateDefaultMailDomainResponse -> Bool)
-> (UpdateDefaultMailDomainResponse
-> UpdateDefaultMailDomainResponse -> Bool)
-> Eq UpdateDefaultMailDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDefaultMailDomainResponse
-> UpdateDefaultMailDomainResponse -> Bool
$c/= :: UpdateDefaultMailDomainResponse
-> UpdateDefaultMailDomainResponse -> Bool
== :: UpdateDefaultMailDomainResponse
-> UpdateDefaultMailDomainResponse -> Bool
$c== :: UpdateDefaultMailDomainResponse
-> UpdateDefaultMailDomainResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDefaultMailDomainResponse]
ReadPrec UpdateDefaultMailDomainResponse
Int -> ReadS UpdateDefaultMailDomainResponse
ReadS [UpdateDefaultMailDomainResponse]
(Int -> ReadS UpdateDefaultMailDomainResponse)
-> ReadS [UpdateDefaultMailDomainResponse]
-> ReadPrec UpdateDefaultMailDomainResponse
-> ReadPrec [UpdateDefaultMailDomainResponse]
-> Read UpdateDefaultMailDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDefaultMailDomainResponse]
$creadListPrec :: ReadPrec [UpdateDefaultMailDomainResponse]
readPrec :: ReadPrec UpdateDefaultMailDomainResponse
$creadPrec :: ReadPrec UpdateDefaultMailDomainResponse
readList :: ReadS [UpdateDefaultMailDomainResponse]
$creadList :: ReadS [UpdateDefaultMailDomainResponse]
readsPrec :: Int -> ReadS UpdateDefaultMailDomainResponse
$creadsPrec :: Int -> ReadS UpdateDefaultMailDomainResponse
Prelude.Read, Int -> UpdateDefaultMailDomainResponse -> ShowS
[UpdateDefaultMailDomainResponse] -> ShowS
UpdateDefaultMailDomainResponse -> String
(Int -> UpdateDefaultMailDomainResponse -> ShowS)
-> (UpdateDefaultMailDomainResponse -> String)
-> ([UpdateDefaultMailDomainResponse] -> ShowS)
-> Show UpdateDefaultMailDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDefaultMailDomainResponse] -> ShowS
$cshowList :: [UpdateDefaultMailDomainResponse] -> ShowS
show :: UpdateDefaultMailDomainResponse -> String
$cshow :: UpdateDefaultMailDomainResponse -> String
showsPrec :: Int -> UpdateDefaultMailDomainResponse -> ShowS
$cshowsPrec :: Int -> UpdateDefaultMailDomainResponse -> ShowS
Prelude.Show, (forall x.
UpdateDefaultMailDomainResponse
-> Rep UpdateDefaultMailDomainResponse x)
-> (forall x.
Rep UpdateDefaultMailDomainResponse x
-> UpdateDefaultMailDomainResponse)
-> Generic UpdateDefaultMailDomainResponse
forall x.
Rep UpdateDefaultMailDomainResponse x
-> UpdateDefaultMailDomainResponse
forall x.
UpdateDefaultMailDomainResponse
-> Rep UpdateDefaultMailDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDefaultMailDomainResponse x
-> UpdateDefaultMailDomainResponse
$cfrom :: forall x.
UpdateDefaultMailDomainResponse
-> Rep UpdateDefaultMailDomainResponse x
Prelude.Generic)
newUpdateDefaultMailDomainResponse ::
Prelude.Int ->
UpdateDefaultMailDomainResponse
newUpdateDefaultMailDomainResponse :: Int -> UpdateDefaultMailDomainResponse
newUpdateDefaultMailDomainResponse Int
pHttpStatus_ =
UpdateDefaultMailDomainResponse' :: Int -> UpdateDefaultMailDomainResponse
UpdateDefaultMailDomainResponse'
{ $sel:httpStatus:UpdateDefaultMailDomainResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateDefaultMailDomainResponse_httpStatus :: Lens.Lens' UpdateDefaultMailDomainResponse Prelude.Int
updateDefaultMailDomainResponse_httpStatus :: (Int -> f Int)
-> UpdateDefaultMailDomainResponse
-> f UpdateDefaultMailDomainResponse
updateDefaultMailDomainResponse_httpStatus = (UpdateDefaultMailDomainResponse -> Int)
-> (UpdateDefaultMailDomainResponse
-> Int -> UpdateDefaultMailDomainResponse)
-> Lens
UpdateDefaultMailDomainResponse
UpdateDefaultMailDomainResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDefaultMailDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDefaultMailDomainResponse' :: UpdateDefaultMailDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDefaultMailDomainResponse
s@UpdateDefaultMailDomainResponse' {} Int
a -> UpdateDefaultMailDomainResponse
s {$sel:httpStatus:UpdateDefaultMailDomainResponse' :: Int
httpStatus = Int
a} :: UpdateDefaultMailDomainResponse)
instance
Prelude.NFData
UpdateDefaultMailDomainResponse