{-# 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.CloudDirectory.DeleteTypedLinkFacet
(
DeleteTypedLinkFacet (..),
newDeleteTypedLinkFacet,
deleteTypedLinkFacet_schemaArn,
deleteTypedLinkFacet_name,
DeleteTypedLinkFacetResponse (..),
newDeleteTypedLinkFacetResponse,
deleteTypedLinkFacetResponse_httpStatus,
)
where
import Amazonka.CloudDirectory.Types
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
data DeleteTypedLinkFacet = DeleteTypedLinkFacet'
{
DeleteTypedLinkFacet -> Text
schemaArn :: Prelude.Text,
DeleteTypedLinkFacet -> Text
name :: Prelude.Text
}
deriving (DeleteTypedLinkFacet -> DeleteTypedLinkFacet -> Bool
(DeleteTypedLinkFacet -> DeleteTypedLinkFacet -> Bool)
-> (DeleteTypedLinkFacet -> DeleteTypedLinkFacet -> Bool)
-> Eq DeleteTypedLinkFacet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTypedLinkFacet -> DeleteTypedLinkFacet -> Bool
$c/= :: DeleteTypedLinkFacet -> DeleteTypedLinkFacet -> Bool
== :: DeleteTypedLinkFacet -> DeleteTypedLinkFacet -> Bool
$c== :: DeleteTypedLinkFacet -> DeleteTypedLinkFacet -> Bool
Prelude.Eq, ReadPrec [DeleteTypedLinkFacet]
ReadPrec DeleteTypedLinkFacet
Int -> ReadS DeleteTypedLinkFacet
ReadS [DeleteTypedLinkFacet]
(Int -> ReadS DeleteTypedLinkFacet)
-> ReadS [DeleteTypedLinkFacet]
-> ReadPrec DeleteTypedLinkFacet
-> ReadPrec [DeleteTypedLinkFacet]
-> Read DeleteTypedLinkFacet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTypedLinkFacet]
$creadListPrec :: ReadPrec [DeleteTypedLinkFacet]
readPrec :: ReadPrec DeleteTypedLinkFacet
$creadPrec :: ReadPrec DeleteTypedLinkFacet
readList :: ReadS [DeleteTypedLinkFacet]
$creadList :: ReadS [DeleteTypedLinkFacet]
readsPrec :: Int -> ReadS DeleteTypedLinkFacet
$creadsPrec :: Int -> ReadS DeleteTypedLinkFacet
Prelude.Read, Int -> DeleteTypedLinkFacet -> ShowS
[DeleteTypedLinkFacet] -> ShowS
DeleteTypedLinkFacet -> String
(Int -> DeleteTypedLinkFacet -> ShowS)
-> (DeleteTypedLinkFacet -> String)
-> ([DeleteTypedLinkFacet] -> ShowS)
-> Show DeleteTypedLinkFacet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTypedLinkFacet] -> ShowS
$cshowList :: [DeleteTypedLinkFacet] -> ShowS
show :: DeleteTypedLinkFacet -> String
$cshow :: DeleteTypedLinkFacet -> String
showsPrec :: Int -> DeleteTypedLinkFacet -> ShowS
$cshowsPrec :: Int -> DeleteTypedLinkFacet -> ShowS
Prelude.Show, (forall x. DeleteTypedLinkFacet -> Rep DeleteTypedLinkFacet x)
-> (forall x. Rep DeleteTypedLinkFacet x -> DeleteTypedLinkFacet)
-> Generic DeleteTypedLinkFacet
forall x. Rep DeleteTypedLinkFacet x -> DeleteTypedLinkFacet
forall x. DeleteTypedLinkFacet -> Rep DeleteTypedLinkFacet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTypedLinkFacet x -> DeleteTypedLinkFacet
$cfrom :: forall x. DeleteTypedLinkFacet -> Rep DeleteTypedLinkFacet x
Prelude.Generic)
newDeleteTypedLinkFacet ::
Prelude.Text ->
Prelude.Text ->
DeleteTypedLinkFacet
newDeleteTypedLinkFacet :: Text -> Text -> DeleteTypedLinkFacet
newDeleteTypedLinkFacet Text
pSchemaArn_ Text
pName_ =
DeleteTypedLinkFacet' :: Text -> Text -> DeleteTypedLinkFacet
DeleteTypedLinkFacet'
{ $sel:schemaArn:DeleteTypedLinkFacet' :: Text
schemaArn = Text
pSchemaArn_,
$sel:name:DeleteTypedLinkFacet' :: Text
name = Text
pName_
}
deleteTypedLinkFacet_schemaArn :: Lens.Lens' DeleteTypedLinkFacet Prelude.Text
deleteTypedLinkFacet_schemaArn :: (Text -> f Text) -> DeleteTypedLinkFacet -> f DeleteTypedLinkFacet
deleteTypedLinkFacet_schemaArn = (DeleteTypedLinkFacet -> Text)
-> (DeleteTypedLinkFacet -> Text -> DeleteTypedLinkFacet)
-> Lens DeleteTypedLinkFacet DeleteTypedLinkFacet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTypedLinkFacet' {Text
schemaArn :: Text
$sel:schemaArn:DeleteTypedLinkFacet' :: DeleteTypedLinkFacet -> Text
schemaArn} -> Text
schemaArn) (\s :: DeleteTypedLinkFacet
s@DeleteTypedLinkFacet' {} Text
a -> DeleteTypedLinkFacet
s {$sel:schemaArn:DeleteTypedLinkFacet' :: Text
schemaArn = Text
a} :: DeleteTypedLinkFacet)
deleteTypedLinkFacet_name :: Lens.Lens' DeleteTypedLinkFacet Prelude.Text
deleteTypedLinkFacet_name :: (Text -> f Text) -> DeleteTypedLinkFacet -> f DeleteTypedLinkFacet
deleteTypedLinkFacet_name = (DeleteTypedLinkFacet -> Text)
-> (DeleteTypedLinkFacet -> Text -> DeleteTypedLinkFacet)
-> Lens DeleteTypedLinkFacet DeleteTypedLinkFacet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTypedLinkFacet' {Text
name :: Text
$sel:name:DeleteTypedLinkFacet' :: DeleteTypedLinkFacet -> Text
name} -> Text
name) (\s :: DeleteTypedLinkFacet
s@DeleteTypedLinkFacet' {} Text
a -> DeleteTypedLinkFacet
s {$sel:name:DeleteTypedLinkFacet' :: Text
name = Text
a} :: DeleteTypedLinkFacet)
instance Core.AWSRequest DeleteTypedLinkFacet where
type
AWSResponse DeleteTypedLinkFacet =
DeleteTypedLinkFacetResponse
request :: DeleteTypedLinkFacet -> Request DeleteTypedLinkFacet
request = Service -> DeleteTypedLinkFacet -> Request DeleteTypedLinkFacet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTypedLinkFacet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTypedLinkFacet)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteTypedLinkFacet))
-> Logger
-> Service
-> Proxy DeleteTypedLinkFacet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTypedLinkFacet)))
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 -> DeleteTypedLinkFacetResponse
DeleteTypedLinkFacetResponse'
(Int -> DeleteTypedLinkFacetResponse)
-> Either String Int -> Either String DeleteTypedLinkFacetResponse
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 DeleteTypedLinkFacet
instance Prelude.NFData DeleteTypedLinkFacet
instance Core.ToHeaders DeleteTypedLinkFacet where
toHeaders :: DeleteTypedLinkFacet -> ResponseHeaders
toHeaders DeleteTypedLinkFacet' {Text
name :: Text
schemaArn :: Text
$sel:name:DeleteTypedLinkFacet' :: DeleteTypedLinkFacet -> Text
$sel:schemaArn:DeleteTypedLinkFacet' :: DeleteTypedLinkFacet -> Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-data-partition" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
schemaArn]
instance Core.ToJSON DeleteTypedLinkFacet where
toJSON :: DeleteTypedLinkFacet -> Value
toJSON DeleteTypedLinkFacet' {Text
name :: Text
schemaArn :: Text
$sel:name:DeleteTypedLinkFacet' :: DeleteTypedLinkFacet -> Text
$sel:schemaArn:DeleteTypedLinkFacet' :: DeleteTypedLinkFacet -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
)
instance Core.ToPath DeleteTypedLinkFacet where
toPath :: DeleteTypedLinkFacet -> ByteString
toPath =
ByteString -> DeleteTypedLinkFacet -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/amazonclouddirectory/2017-01-11/typedlink/facet/delete"
instance Core.ToQuery DeleteTypedLinkFacet where
toQuery :: DeleteTypedLinkFacet -> QueryString
toQuery = QueryString -> DeleteTypedLinkFacet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTypedLinkFacetResponse = DeleteTypedLinkFacetResponse'
{
DeleteTypedLinkFacetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTypedLinkFacetResponse
-> DeleteTypedLinkFacetResponse -> Bool
(DeleteTypedLinkFacetResponse
-> DeleteTypedLinkFacetResponse -> Bool)
-> (DeleteTypedLinkFacetResponse
-> DeleteTypedLinkFacetResponse -> Bool)
-> Eq DeleteTypedLinkFacetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTypedLinkFacetResponse
-> DeleteTypedLinkFacetResponse -> Bool
$c/= :: DeleteTypedLinkFacetResponse
-> DeleteTypedLinkFacetResponse -> Bool
== :: DeleteTypedLinkFacetResponse
-> DeleteTypedLinkFacetResponse -> Bool
$c== :: DeleteTypedLinkFacetResponse
-> DeleteTypedLinkFacetResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTypedLinkFacetResponse]
ReadPrec DeleteTypedLinkFacetResponse
Int -> ReadS DeleteTypedLinkFacetResponse
ReadS [DeleteTypedLinkFacetResponse]
(Int -> ReadS DeleteTypedLinkFacetResponse)
-> ReadS [DeleteTypedLinkFacetResponse]
-> ReadPrec DeleteTypedLinkFacetResponse
-> ReadPrec [DeleteTypedLinkFacetResponse]
-> Read DeleteTypedLinkFacetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTypedLinkFacetResponse]
$creadListPrec :: ReadPrec [DeleteTypedLinkFacetResponse]
readPrec :: ReadPrec DeleteTypedLinkFacetResponse
$creadPrec :: ReadPrec DeleteTypedLinkFacetResponse
readList :: ReadS [DeleteTypedLinkFacetResponse]
$creadList :: ReadS [DeleteTypedLinkFacetResponse]
readsPrec :: Int -> ReadS DeleteTypedLinkFacetResponse
$creadsPrec :: Int -> ReadS DeleteTypedLinkFacetResponse
Prelude.Read, Int -> DeleteTypedLinkFacetResponse -> ShowS
[DeleteTypedLinkFacetResponse] -> ShowS
DeleteTypedLinkFacetResponse -> String
(Int -> DeleteTypedLinkFacetResponse -> ShowS)
-> (DeleteTypedLinkFacetResponse -> String)
-> ([DeleteTypedLinkFacetResponse] -> ShowS)
-> Show DeleteTypedLinkFacetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTypedLinkFacetResponse] -> ShowS
$cshowList :: [DeleteTypedLinkFacetResponse] -> ShowS
show :: DeleteTypedLinkFacetResponse -> String
$cshow :: DeleteTypedLinkFacetResponse -> String
showsPrec :: Int -> DeleteTypedLinkFacetResponse -> ShowS
$cshowsPrec :: Int -> DeleteTypedLinkFacetResponse -> ShowS
Prelude.Show, (forall x.
DeleteTypedLinkFacetResponse -> Rep DeleteTypedLinkFacetResponse x)
-> (forall x.
Rep DeleteTypedLinkFacetResponse x -> DeleteTypedLinkFacetResponse)
-> Generic DeleteTypedLinkFacetResponse
forall x.
Rep DeleteTypedLinkFacetResponse x -> DeleteTypedLinkFacetResponse
forall x.
DeleteTypedLinkFacetResponse -> Rep DeleteTypedLinkFacetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteTypedLinkFacetResponse x -> DeleteTypedLinkFacetResponse
$cfrom :: forall x.
DeleteTypedLinkFacetResponse -> Rep DeleteTypedLinkFacetResponse x
Prelude.Generic)
newDeleteTypedLinkFacetResponse ::
Prelude.Int ->
DeleteTypedLinkFacetResponse
newDeleteTypedLinkFacetResponse :: Int -> DeleteTypedLinkFacetResponse
newDeleteTypedLinkFacetResponse Int
pHttpStatus_ =
DeleteTypedLinkFacetResponse' :: Int -> DeleteTypedLinkFacetResponse
DeleteTypedLinkFacetResponse'
{ $sel:httpStatus:DeleteTypedLinkFacetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteTypedLinkFacetResponse_httpStatus :: Lens.Lens' DeleteTypedLinkFacetResponse Prelude.Int
deleteTypedLinkFacetResponse_httpStatus :: (Int -> f Int)
-> DeleteTypedLinkFacetResponse -> f DeleteTypedLinkFacetResponse
deleteTypedLinkFacetResponse_httpStatus = (DeleteTypedLinkFacetResponse -> Int)
-> (DeleteTypedLinkFacetResponse
-> Int -> DeleteTypedLinkFacetResponse)
-> Lens
DeleteTypedLinkFacetResponse DeleteTypedLinkFacetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTypedLinkFacetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTypedLinkFacetResponse' :: DeleteTypedLinkFacetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTypedLinkFacetResponse
s@DeleteTypedLinkFacetResponse' {} Int
a -> DeleteTypedLinkFacetResponse
s {$sel:httpStatus:DeleteTypedLinkFacetResponse' :: Int
httpStatus = Int
a} :: DeleteTypedLinkFacetResponse)
instance Prelude.NFData DeleteTypedLinkFacetResponse