{-# 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.DeleteDomainEntry
(
DeleteDomainEntry (..),
newDeleteDomainEntry,
deleteDomainEntry_domainName,
deleteDomainEntry_domainEntry,
DeleteDomainEntryResponse (..),
newDeleteDomainEntryResponse,
deleteDomainEntryResponse_operation,
deleteDomainEntryResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteDomainEntry = DeleteDomainEntry'
{
DeleteDomainEntry -> Text
domainName :: Prelude.Text,
DeleteDomainEntry -> DomainEntry
domainEntry :: DomainEntry
}
deriving (DeleteDomainEntry -> DeleteDomainEntry -> Bool
(DeleteDomainEntry -> DeleteDomainEntry -> Bool)
-> (DeleteDomainEntry -> DeleteDomainEntry -> Bool)
-> Eq DeleteDomainEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDomainEntry -> DeleteDomainEntry -> Bool
$c/= :: DeleteDomainEntry -> DeleteDomainEntry -> Bool
== :: DeleteDomainEntry -> DeleteDomainEntry -> Bool
$c== :: DeleteDomainEntry -> DeleteDomainEntry -> Bool
Prelude.Eq, ReadPrec [DeleteDomainEntry]
ReadPrec DeleteDomainEntry
Int -> ReadS DeleteDomainEntry
ReadS [DeleteDomainEntry]
(Int -> ReadS DeleteDomainEntry)
-> ReadS [DeleteDomainEntry]
-> ReadPrec DeleteDomainEntry
-> ReadPrec [DeleteDomainEntry]
-> Read DeleteDomainEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDomainEntry]
$creadListPrec :: ReadPrec [DeleteDomainEntry]
readPrec :: ReadPrec DeleteDomainEntry
$creadPrec :: ReadPrec DeleteDomainEntry
readList :: ReadS [DeleteDomainEntry]
$creadList :: ReadS [DeleteDomainEntry]
readsPrec :: Int -> ReadS DeleteDomainEntry
$creadsPrec :: Int -> ReadS DeleteDomainEntry
Prelude.Read, Int -> DeleteDomainEntry -> ShowS
[DeleteDomainEntry] -> ShowS
DeleteDomainEntry -> String
(Int -> DeleteDomainEntry -> ShowS)
-> (DeleteDomainEntry -> String)
-> ([DeleteDomainEntry] -> ShowS)
-> Show DeleteDomainEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDomainEntry] -> ShowS
$cshowList :: [DeleteDomainEntry] -> ShowS
show :: DeleteDomainEntry -> String
$cshow :: DeleteDomainEntry -> String
showsPrec :: Int -> DeleteDomainEntry -> ShowS
$cshowsPrec :: Int -> DeleteDomainEntry -> ShowS
Prelude.Show, (forall x. DeleteDomainEntry -> Rep DeleteDomainEntry x)
-> (forall x. Rep DeleteDomainEntry x -> DeleteDomainEntry)
-> Generic DeleteDomainEntry
forall x. Rep DeleteDomainEntry x -> DeleteDomainEntry
forall x. DeleteDomainEntry -> Rep DeleteDomainEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDomainEntry x -> DeleteDomainEntry
$cfrom :: forall x. DeleteDomainEntry -> Rep DeleteDomainEntry x
Prelude.Generic)
newDeleteDomainEntry ::
Prelude.Text ->
DomainEntry ->
DeleteDomainEntry
newDeleteDomainEntry :: Text -> DomainEntry -> DeleteDomainEntry
newDeleteDomainEntry Text
pDomainName_ DomainEntry
pDomainEntry_ =
DeleteDomainEntry' :: Text -> DomainEntry -> DeleteDomainEntry
DeleteDomainEntry'
{ $sel:domainName:DeleteDomainEntry' :: Text
domainName = Text
pDomainName_,
$sel:domainEntry:DeleteDomainEntry' :: DomainEntry
domainEntry = DomainEntry
pDomainEntry_
}
deleteDomainEntry_domainName :: Lens.Lens' DeleteDomainEntry Prelude.Text
deleteDomainEntry_domainName :: (Text -> f Text) -> DeleteDomainEntry -> f DeleteDomainEntry
deleteDomainEntry_domainName = (DeleteDomainEntry -> Text)
-> (DeleteDomainEntry -> Text -> DeleteDomainEntry)
-> Lens DeleteDomainEntry DeleteDomainEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDomainEntry' {Text
domainName :: Text
$sel:domainName:DeleteDomainEntry' :: DeleteDomainEntry -> Text
domainName} -> Text
domainName) (\s :: DeleteDomainEntry
s@DeleteDomainEntry' {} Text
a -> DeleteDomainEntry
s {$sel:domainName:DeleteDomainEntry' :: Text
domainName = Text
a} :: DeleteDomainEntry)
deleteDomainEntry_domainEntry :: Lens.Lens' DeleteDomainEntry DomainEntry
deleteDomainEntry_domainEntry :: (DomainEntry -> f DomainEntry)
-> DeleteDomainEntry -> f DeleteDomainEntry
deleteDomainEntry_domainEntry = (DeleteDomainEntry -> DomainEntry)
-> (DeleteDomainEntry -> DomainEntry -> DeleteDomainEntry)
-> Lens DeleteDomainEntry DeleteDomainEntry DomainEntry DomainEntry
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDomainEntry' {DomainEntry
domainEntry :: DomainEntry
$sel:domainEntry:DeleteDomainEntry' :: DeleteDomainEntry -> DomainEntry
domainEntry} -> DomainEntry
domainEntry) (\s :: DeleteDomainEntry
s@DeleteDomainEntry' {} DomainEntry
a -> DeleteDomainEntry
s {$sel:domainEntry:DeleteDomainEntry' :: DomainEntry
domainEntry = DomainEntry
a} :: DeleteDomainEntry)
instance Core.AWSRequest DeleteDomainEntry where
type
AWSResponse DeleteDomainEntry =
DeleteDomainEntryResponse
request :: DeleteDomainEntry -> Request DeleteDomainEntry
request = Service -> DeleteDomainEntry -> Request DeleteDomainEntry
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDomainEntry
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDomainEntry)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteDomainEntry))
-> Logger
-> Service
-> Proxy DeleteDomainEntry
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDomainEntry)))
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 Operation -> Int -> DeleteDomainEntryResponse
DeleteDomainEntryResponse'
(Maybe Operation -> Int -> DeleteDomainEntryResponse)
-> Either String (Maybe Operation)
-> Either String (Int -> DeleteDomainEntryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Operation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operation")
Either String (Int -> DeleteDomainEntryResponse)
-> Either String Int -> Either String DeleteDomainEntryResponse
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 DeleteDomainEntry
instance Prelude.NFData DeleteDomainEntry
instance Core.ToHeaders DeleteDomainEntry where
toHeaders :: DeleteDomainEntry -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteDomainEntry -> 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
"Lightsail_20161128.DeleteDomainEntry" ::
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 DeleteDomainEntry where
toJSON :: DeleteDomainEntry -> Value
toJSON DeleteDomainEntry' {Text
DomainEntry
domainEntry :: DomainEntry
domainName :: Text
$sel:domainEntry:DeleteDomainEntry' :: DeleteDomainEntry -> DomainEntry
$sel:domainName:DeleteDomainEntry' :: DeleteDomainEntry -> 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
"domainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"domainEntry" Text -> DomainEntry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DomainEntry
domainEntry)
]
)
instance Core.ToPath DeleteDomainEntry where
toPath :: DeleteDomainEntry -> ByteString
toPath = ByteString -> DeleteDomainEntry -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteDomainEntry where
toQuery :: DeleteDomainEntry -> QueryString
toQuery = QueryString -> DeleteDomainEntry -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteDomainEntryResponse = DeleteDomainEntryResponse'
{
DeleteDomainEntryResponse -> Maybe Operation
operation :: Prelude.Maybe Operation,
DeleteDomainEntryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDomainEntryResponse -> DeleteDomainEntryResponse -> Bool
(DeleteDomainEntryResponse -> DeleteDomainEntryResponse -> Bool)
-> (DeleteDomainEntryResponse -> DeleteDomainEntryResponse -> Bool)
-> Eq DeleteDomainEntryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDomainEntryResponse -> DeleteDomainEntryResponse -> Bool
$c/= :: DeleteDomainEntryResponse -> DeleteDomainEntryResponse -> Bool
== :: DeleteDomainEntryResponse -> DeleteDomainEntryResponse -> Bool
$c== :: DeleteDomainEntryResponse -> DeleteDomainEntryResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDomainEntryResponse]
ReadPrec DeleteDomainEntryResponse
Int -> ReadS DeleteDomainEntryResponse
ReadS [DeleteDomainEntryResponse]
(Int -> ReadS DeleteDomainEntryResponse)
-> ReadS [DeleteDomainEntryResponse]
-> ReadPrec DeleteDomainEntryResponse
-> ReadPrec [DeleteDomainEntryResponse]
-> Read DeleteDomainEntryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDomainEntryResponse]
$creadListPrec :: ReadPrec [DeleteDomainEntryResponse]
readPrec :: ReadPrec DeleteDomainEntryResponse
$creadPrec :: ReadPrec DeleteDomainEntryResponse
readList :: ReadS [DeleteDomainEntryResponse]
$creadList :: ReadS [DeleteDomainEntryResponse]
readsPrec :: Int -> ReadS DeleteDomainEntryResponse
$creadsPrec :: Int -> ReadS DeleteDomainEntryResponse
Prelude.Read, Int -> DeleteDomainEntryResponse -> ShowS
[DeleteDomainEntryResponse] -> ShowS
DeleteDomainEntryResponse -> String
(Int -> DeleteDomainEntryResponse -> ShowS)
-> (DeleteDomainEntryResponse -> String)
-> ([DeleteDomainEntryResponse] -> ShowS)
-> Show DeleteDomainEntryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDomainEntryResponse] -> ShowS
$cshowList :: [DeleteDomainEntryResponse] -> ShowS
show :: DeleteDomainEntryResponse -> String
$cshow :: DeleteDomainEntryResponse -> String
showsPrec :: Int -> DeleteDomainEntryResponse -> ShowS
$cshowsPrec :: Int -> DeleteDomainEntryResponse -> ShowS
Prelude.Show, (forall x.
DeleteDomainEntryResponse -> Rep DeleteDomainEntryResponse x)
-> (forall x.
Rep DeleteDomainEntryResponse x -> DeleteDomainEntryResponse)
-> Generic DeleteDomainEntryResponse
forall x.
Rep DeleteDomainEntryResponse x -> DeleteDomainEntryResponse
forall x.
DeleteDomainEntryResponse -> Rep DeleteDomainEntryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDomainEntryResponse x -> DeleteDomainEntryResponse
$cfrom :: forall x.
DeleteDomainEntryResponse -> Rep DeleteDomainEntryResponse x
Prelude.Generic)
newDeleteDomainEntryResponse ::
Prelude.Int ->
DeleteDomainEntryResponse
newDeleteDomainEntryResponse :: Int -> DeleteDomainEntryResponse
newDeleteDomainEntryResponse Int
pHttpStatus_ =
DeleteDomainEntryResponse' :: Maybe Operation -> Int -> DeleteDomainEntryResponse
DeleteDomainEntryResponse'
{ $sel:operation:DeleteDomainEntryResponse' :: Maybe Operation
operation =
Maybe Operation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteDomainEntryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteDomainEntryResponse_operation :: Lens.Lens' DeleteDomainEntryResponse (Prelude.Maybe Operation)
deleteDomainEntryResponse_operation :: (Maybe Operation -> f (Maybe Operation))
-> DeleteDomainEntryResponse -> f DeleteDomainEntryResponse
deleteDomainEntryResponse_operation = (DeleteDomainEntryResponse -> Maybe Operation)
-> (DeleteDomainEntryResponse
-> Maybe Operation -> DeleteDomainEntryResponse)
-> Lens
DeleteDomainEntryResponse
DeleteDomainEntryResponse
(Maybe Operation)
(Maybe Operation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDomainEntryResponse' {Maybe Operation
operation :: Maybe Operation
$sel:operation:DeleteDomainEntryResponse' :: DeleteDomainEntryResponse -> Maybe Operation
operation} -> Maybe Operation
operation) (\s :: DeleteDomainEntryResponse
s@DeleteDomainEntryResponse' {} Maybe Operation
a -> DeleteDomainEntryResponse
s {$sel:operation:DeleteDomainEntryResponse' :: Maybe Operation
operation = Maybe Operation
a} :: DeleteDomainEntryResponse)
deleteDomainEntryResponse_httpStatus :: Lens.Lens' DeleteDomainEntryResponse Prelude.Int
deleteDomainEntryResponse_httpStatus :: (Int -> f Int)
-> DeleteDomainEntryResponse -> f DeleteDomainEntryResponse
deleteDomainEntryResponse_httpStatus = (DeleteDomainEntryResponse -> Int)
-> (DeleteDomainEntryResponse -> Int -> DeleteDomainEntryResponse)
-> Lens DeleteDomainEntryResponse DeleteDomainEntryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDomainEntryResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDomainEntryResponse' :: DeleteDomainEntryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDomainEntryResponse
s@DeleteDomainEntryResponse' {} Int
a -> DeleteDomainEntryResponse
s {$sel:httpStatus:DeleteDomainEntryResponse' :: Int
httpStatus = Int
a} :: DeleteDomainEntryResponse)
instance Prelude.NFData DeleteDomainEntryResponse