{-# 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.Lightsail.UpdateDomainEntry
(
UpdateDomainEntry (..),
newUpdateDomainEntry,
updateDomainEntry_domainName,
updateDomainEntry_domainEntry,
UpdateDomainEntryResponse (..),
newUpdateDomainEntryResponse,
updateDomainEntryResponse_operations,
updateDomainEntryResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateDomainEntry = UpdateDomainEntry'
{
UpdateDomainEntry -> Text
domainName :: Prelude.Text,
UpdateDomainEntry -> DomainEntry
domainEntry :: DomainEntry
}
deriving (UpdateDomainEntry -> UpdateDomainEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDomainEntry -> UpdateDomainEntry -> Bool
$c/= :: UpdateDomainEntry -> UpdateDomainEntry -> Bool
== :: UpdateDomainEntry -> UpdateDomainEntry -> Bool
$c== :: UpdateDomainEntry -> UpdateDomainEntry -> Bool
Prelude.Eq, ReadPrec [UpdateDomainEntry]
ReadPrec UpdateDomainEntry
Int -> ReadS UpdateDomainEntry
ReadS [UpdateDomainEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDomainEntry]
$creadListPrec :: ReadPrec [UpdateDomainEntry]
readPrec :: ReadPrec UpdateDomainEntry
$creadPrec :: ReadPrec UpdateDomainEntry
readList :: ReadS [UpdateDomainEntry]
$creadList :: ReadS [UpdateDomainEntry]
readsPrec :: Int -> ReadS UpdateDomainEntry
$creadsPrec :: Int -> ReadS UpdateDomainEntry
Prelude.Read, Int -> UpdateDomainEntry -> ShowS
[UpdateDomainEntry] -> ShowS
UpdateDomainEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDomainEntry] -> ShowS
$cshowList :: [UpdateDomainEntry] -> ShowS
show :: UpdateDomainEntry -> String
$cshow :: UpdateDomainEntry -> String
showsPrec :: Int -> UpdateDomainEntry -> ShowS
$cshowsPrec :: Int -> UpdateDomainEntry -> ShowS
Prelude.Show, forall x. Rep UpdateDomainEntry x -> UpdateDomainEntry
forall x. UpdateDomainEntry -> Rep UpdateDomainEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDomainEntry x -> UpdateDomainEntry
$cfrom :: forall x. UpdateDomainEntry -> Rep UpdateDomainEntry x
Prelude.Generic)
newUpdateDomainEntry ::
Prelude.Text ->
DomainEntry ->
UpdateDomainEntry
newUpdateDomainEntry :: Text -> DomainEntry -> UpdateDomainEntry
newUpdateDomainEntry Text
pDomainName_ DomainEntry
pDomainEntry_ =
UpdateDomainEntry'
{ $sel:domainName:UpdateDomainEntry' :: Text
domainName = Text
pDomainName_,
$sel:domainEntry:UpdateDomainEntry' :: DomainEntry
domainEntry = DomainEntry
pDomainEntry_
}
updateDomainEntry_domainName :: Lens.Lens' UpdateDomainEntry Prelude.Text
updateDomainEntry_domainName :: Lens' UpdateDomainEntry Text
updateDomainEntry_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainEntry' {Text
domainName :: Text
$sel:domainName:UpdateDomainEntry' :: UpdateDomainEntry -> Text
domainName} -> Text
domainName) (\s :: UpdateDomainEntry
s@UpdateDomainEntry' {} Text
a -> UpdateDomainEntry
s {$sel:domainName:UpdateDomainEntry' :: Text
domainName = Text
a} :: UpdateDomainEntry)
updateDomainEntry_domainEntry :: Lens.Lens' UpdateDomainEntry DomainEntry
updateDomainEntry_domainEntry :: Lens' UpdateDomainEntry DomainEntry
updateDomainEntry_domainEntry = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainEntry' {DomainEntry
domainEntry :: DomainEntry
$sel:domainEntry:UpdateDomainEntry' :: UpdateDomainEntry -> DomainEntry
domainEntry} -> DomainEntry
domainEntry) (\s :: UpdateDomainEntry
s@UpdateDomainEntry' {} DomainEntry
a -> UpdateDomainEntry
s {$sel:domainEntry:UpdateDomainEntry' :: DomainEntry
domainEntry = DomainEntry
a} :: UpdateDomainEntry)
instance Core.AWSRequest UpdateDomainEntry where
type
AWSResponse UpdateDomainEntry =
UpdateDomainEntryResponse
request :: (Service -> Service)
-> UpdateDomainEntry -> Request UpdateDomainEntry
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 UpdateDomainEntry
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDomainEntry)))
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 [Operation] -> Int -> UpdateDomainEntryResponse
UpdateDomainEntryResponse'
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
"operations" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 UpdateDomainEntry where
hashWithSalt :: Int -> UpdateDomainEntry -> Int
hashWithSalt Int
_salt UpdateDomainEntry' {Text
DomainEntry
domainEntry :: DomainEntry
domainName :: Text
$sel:domainEntry:UpdateDomainEntry' :: UpdateDomainEntry -> DomainEntry
$sel:domainName:UpdateDomainEntry' :: UpdateDomainEntry -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DomainEntry
domainEntry
instance Prelude.NFData UpdateDomainEntry where
rnf :: UpdateDomainEntry -> ()
rnf UpdateDomainEntry' {Text
DomainEntry
domainEntry :: DomainEntry
domainName :: Text
$sel:domainEntry:UpdateDomainEntry' :: UpdateDomainEntry -> DomainEntry
$sel:domainName:UpdateDomainEntry' :: UpdateDomainEntry -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
domainName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DomainEntry
domainEntry
instance Data.ToHeaders UpdateDomainEntry where
toHeaders :: UpdateDomainEntry -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Lightsail_20161128.UpdateDomainEntry" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateDomainEntry where
toJSON :: UpdateDomainEntry -> Value
toJSON UpdateDomainEntry' {Text
DomainEntry
domainEntry :: DomainEntry
domainName :: Text
$sel:domainEntry:UpdateDomainEntry' :: UpdateDomainEntry -> DomainEntry
$sel:domainName:UpdateDomainEntry' :: UpdateDomainEntry -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"domainName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domainName),
forall a. a -> Maybe a
Prelude.Just (Key
"domainEntry" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DomainEntry
domainEntry)
]
)
instance Data.ToPath UpdateDomainEntry where
toPath :: UpdateDomainEntry -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateDomainEntry where
toQuery :: UpdateDomainEntry -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateDomainEntryResponse = UpdateDomainEntryResponse'
{
UpdateDomainEntryResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
UpdateDomainEntryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDomainEntryResponse -> UpdateDomainEntryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDomainEntryResponse -> UpdateDomainEntryResponse -> Bool
$c/= :: UpdateDomainEntryResponse -> UpdateDomainEntryResponse -> Bool
== :: UpdateDomainEntryResponse -> UpdateDomainEntryResponse -> Bool
$c== :: UpdateDomainEntryResponse -> UpdateDomainEntryResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDomainEntryResponse]
ReadPrec UpdateDomainEntryResponse
Int -> ReadS UpdateDomainEntryResponse
ReadS [UpdateDomainEntryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDomainEntryResponse]
$creadListPrec :: ReadPrec [UpdateDomainEntryResponse]
readPrec :: ReadPrec UpdateDomainEntryResponse
$creadPrec :: ReadPrec UpdateDomainEntryResponse
readList :: ReadS [UpdateDomainEntryResponse]
$creadList :: ReadS [UpdateDomainEntryResponse]
readsPrec :: Int -> ReadS UpdateDomainEntryResponse
$creadsPrec :: Int -> ReadS UpdateDomainEntryResponse
Prelude.Read, Int -> UpdateDomainEntryResponse -> ShowS
[UpdateDomainEntryResponse] -> ShowS
UpdateDomainEntryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDomainEntryResponse] -> ShowS
$cshowList :: [UpdateDomainEntryResponse] -> ShowS
show :: UpdateDomainEntryResponse -> String
$cshow :: UpdateDomainEntryResponse -> String
showsPrec :: Int -> UpdateDomainEntryResponse -> ShowS
$cshowsPrec :: Int -> UpdateDomainEntryResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateDomainEntryResponse x -> UpdateDomainEntryResponse
forall x.
UpdateDomainEntryResponse -> Rep UpdateDomainEntryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDomainEntryResponse x -> UpdateDomainEntryResponse
$cfrom :: forall x.
UpdateDomainEntryResponse -> Rep UpdateDomainEntryResponse x
Prelude.Generic)
newUpdateDomainEntryResponse ::
Prelude.Int ->
UpdateDomainEntryResponse
newUpdateDomainEntryResponse :: Int -> UpdateDomainEntryResponse
newUpdateDomainEntryResponse Int
pHttpStatus_ =
UpdateDomainEntryResponse'
{ $sel:operations:UpdateDomainEntryResponse' :: Maybe [Operation]
operations =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateDomainEntryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateDomainEntryResponse_operations :: Lens.Lens' UpdateDomainEntryResponse (Prelude.Maybe [Operation])
updateDomainEntryResponse_operations :: Lens' UpdateDomainEntryResponse (Maybe [Operation])
updateDomainEntryResponse_operations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainEntryResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:UpdateDomainEntryResponse' :: UpdateDomainEntryResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: UpdateDomainEntryResponse
s@UpdateDomainEntryResponse' {} Maybe [Operation]
a -> UpdateDomainEntryResponse
s {$sel:operations:UpdateDomainEntryResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: UpdateDomainEntryResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateDomainEntryResponse_httpStatus :: Lens.Lens' UpdateDomainEntryResponse Prelude.Int
updateDomainEntryResponse_httpStatus :: Lens' UpdateDomainEntryResponse Int
updateDomainEntryResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDomainEntryResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDomainEntryResponse' :: UpdateDomainEntryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDomainEntryResponse
s@UpdateDomainEntryResponse' {} Int
a -> UpdateDomainEntryResponse
s {$sel:httpStatus:UpdateDomainEntryResponse' :: Int
httpStatus = Int
a} :: UpdateDomainEntryResponse)
instance Prelude.NFData UpdateDomainEntryResponse where
rnf :: UpdateDomainEntryResponse -> ()
rnf UpdateDomainEntryResponse' {Int
Maybe [Operation]
httpStatus :: Int
operations :: Maybe [Operation]
$sel:httpStatus:UpdateDomainEntryResponse' :: UpdateDomainEntryResponse -> Int
$sel:operations:UpdateDomainEntryResponse' :: UpdateDomainEntryResponse -> Maybe [Operation]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Operation]
operations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus