{-# 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.DeleteSchema
(
DeleteSchema (..),
newDeleteSchema,
deleteSchema_schemaArn,
DeleteSchemaResponse (..),
newDeleteSchemaResponse,
deleteSchemaResponse_schemaArn,
deleteSchemaResponse_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 DeleteSchema = DeleteSchema'
{
DeleteSchema -> Text
schemaArn :: Prelude.Text
}
deriving (DeleteSchema -> DeleteSchema -> Bool
(DeleteSchema -> DeleteSchema -> Bool)
-> (DeleteSchema -> DeleteSchema -> Bool) -> Eq DeleteSchema
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSchema -> DeleteSchema -> Bool
$c/= :: DeleteSchema -> DeleteSchema -> Bool
== :: DeleteSchema -> DeleteSchema -> Bool
$c== :: DeleteSchema -> DeleteSchema -> Bool
Prelude.Eq, ReadPrec [DeleteSchema]
ReadPrec DeleteSchema
Int -> ReadS DeleteSchema
ReadS [DeleteSchema]
(Int -> ReadS DeleteSchema)
-> ReadS [DeleteSchema]
-> ReadPrec DeleteSchema
-> ReadPrec [DeleteSchema]
-> Read DeleteSchema
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSchema]
$creadListPrec :: ReadPrec [DeleteSchema]
readPrec :: ReadPrec DeleteSchema
$creadPrec :: ReadPrec DeleteSchema
readList :: ReadS [DeleteSchema]
$creadList :: ReadS [DeleteSchema]
readsPrec :: Int -> ReadS DeleteSchema
$creadsPrec :: Int -> ReadS DeleteSchema
Prelude.Read, Int -> DeleteSchema -> ShowS
[DeleteSchema] -> ShowS
DeleteSchema -> String
(Int -> DeleteSchema -> ShowS)
-> (DeleteSchema -> String)
-> ([DeleteSchema] -> ShowS)
-> Show DeleteSchema
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSchema] -> ShowS
$cshowList :: [DeleteSchema] -> ShowS
show :: DeleteSchema -> String
$cshow :: DeleteSchema -> String
showsPrec :: Int -> DeleteSchema -> ShowS
$cshowsPrec :: Int -> DeleteSchema -> ShowS
Prelude.Show, (forall x. DeleteSchema -> Rep DeleteSchema x)
-> (forall x. Rep DeleteSchema x -> DeleteSchema)
-> Generic DeleteSchema
forall x. Rep DeleteSchema x -> DeleteSchema
forall x. DeleteSchema -> Rep DeleteSchema x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSchema x -> DeleteSchema
$cfrom :: forall x. DeleteSchema -> Rep DeleteSchema x
Prelude.Generic)
newDeleteSchema ::
Prelude.Text ->
DeleteSchema
newDeleteSchema :: Text -> DeleteSchema
newDeleteSchema Text
pSchemaArn_ =
DeleteSchema' :: Text -> DeleteSchema
DeleteSchema' {$sel:schemaArn:DeleteSchema' :: Text
schemaArn = Text
pSchemaArn_}
deleteSchema_schemaArn :: Lens.Lens' DeleteSchema Prelude.Text
deleteSchema_schemaArn :: (Text -> f Text) -> DeleteSchema -> f DeleteSchema
deleteSchema_schemaArn = (DeleteSchema -> Text)
-> (DeleteSchema -> Text -> DeleteSchema)
-> Lens DeleteSchema DeleteSchema Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSchema' {Text
schemaArn :: Text
$sel:schemaArn:DeleteSchema' :: DeleteSchema -> Text
schemaArn} -> Text
schemaArn) (\s :: DeleteSchema
s@DeleteSchema' {} Text
a -> DeleteSchema
s {$sel:schemaArn:DeleteSchema' :: Text
schemaArn = Text
a} :: DeleteSchema)
instance Core.AWSRequest DeleteSchema where
type AWSResponse DeleteSchema = DeleteSchemaResponse
request :: DeleteSchema -> Request DeleteSchema
request = Service -> DeleteSchema -> Request DeleteSchema
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSchema
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSchema)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteSchema))
-> Logger
-> Service
-> Proxy DeleteSchema
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSchema)))
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 Text -> Int -> DeleteSchemaResponse
DeleteSchemaResponse'
(Maybe Text -> Int -> DeleteSchemaResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteSchemaResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SchemaArn")
Either String (Int -> DeleteSchemaResponse)
-> Either String Int -> Either String DeleteSchemaResponse
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 DeleteSchema
instance Prelude.NFData DeleteSchema
instance Core.ToHeaders DeleteSchema where
toHeaders :: DeleteSchema -> ResponseHeaders
toHeaders DeleteSchema' {Text
schemaArn :: Text
$sel:schemaArn:DeleteSchema' :: DeleteSchema -> 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 DeleteSchema where
toJSON :: DeleteSchema -> Value
toJSON = Value -> DeleteSchema -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DeleteSchema where
toPath :: DeleteSchema -> ByteString
toPath =
ByteString -> DeleteSchema -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/amazonclouddirectory/2017-01-11/schema"
instance Core.ToQuery DeleteSchema where
toQuery :: DeleteSchema -> QueryString
toQuery = QueryString -> DeleteSchema -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteSchemaResponse = DeleteSchemaResponse'
{
DeleteSchemaResponse -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
DeleteSchemaResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteSchemaResponse -> DeleteSchemaResponse -> Bool
(DeleteSchemaResponse -> DeleteSchemaResponse -> Bool)
-> (DeleteSchemaResponse -> DeleteSchemaResponse -> Bool)
-> Eq DeleteSchemaResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSchemaResponse -> DeleteSchemaResponse -> Bool
$c/= :: DeleteSchemaResponse -> DeleteSchemaResponse -> Bool
== :: DeleteSchemaResponse -> DeleteSchemaResponse -> Bool
$c== :: DeleteSchemaResponse -> DeleteSchemaResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSchemaResponse]
ReadPrec DeleteSchemaResponse
Int -> ReadS DeleteSchemaResponse
ReadS [DeleteSchemaResponse]
(Int -> ReadS DeleteSchemaResponse)
-> ReadS [DeleteSchemaResponse]
-> ReadPrec DeleteSchemaResponse
-> ReadPrec [DeleteSchemaResponse]
-> Read DeleteSchemaResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSchemaResponse]
$creadListPrec :: ReadPrec [DeleteSchemaResponse]
readPrec :: ReadPrec DeleteSchemaResponse
$creadPrec :: ReadPrec DeleteSchemaResponse
readList :: ReadS [DeleteSchemaResponse]
$creadList :: ReadS [DeleteSchemaResponse]
readsPrec :: Int -> ReadS DeleteSchemaResponse
$creadsPrec :: Int -> ReadS DeleteSchemaResponse
Prelude.Read, Int -> DeleteSchemaResponse -> ShowS
[DeleteSchemaResponse] -> ShowS
DeleteSchemaResponse -> String
(Int -> DeleteSchemaResponse -> ShowS)
-> (DeleteSchemaResponse -> String)
-> ([DeleteSchemaResponse] -> ShowS)
-> Show DeleteSchemaResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSchemaResponse] -> ShowS
$cshowList :: [DeleteSchemaResponse] -> ShowS
show :: DeleteSchemaResponse -> String
$cshow :: DeleteSchemaResponse -> String
showsPrec :: Int -> DeleteSchemaResponse -> ShowS
$cshowsPrec :: Int -> DeleteSchemaResponse -> ShowS
Prelude.Show, (forall x. DeleteSchemaResponse -> Rep DeleteSchemaResponse x)
-> (forall x. Rep DeleteSchemaResponse x -> DeleteSchemaResponse)
-> Generic DeleteSchemaResponse
forall x. Rep DeleteSchemaResponse x -> DeleteSchemaResponse
forall x. DeleteSchemaResponse -> Rep DeleteSchemaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSchemaResponse x -> DeleteSchemaResponse
$cfrom :: forall x. DeleteSchemaResponse -> Rep DeleteSchemaResponse x
Prelude.Generic)
newDeleteSchemaResponse ::
Prelude.Int ->
DeleteSchemaResponse
newDeleteSchemaResponse :: Int -> DeleteSchemaResponse
newDeleteSchemaResponse Int
pHttpStatus_ =
DeleteSchemaResponse' :: Maybe Text -> Int -> DeleteSchemaResponse
DeleteSchemaResponse'
{ $sel:schemaArn:DeleteSchemaResponse' :: Maybe Text
schemaArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteSchemaResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteSchemaResponse_schemaArn :: Lens.Lens' DeleteSchemaResponse (Prelude.Maybe Prelude.Text)
deleteSchemaResponse_schemaArn :: (Maybe Text -> f (Maybe Text))
-> DeleteSchemaResponse -> f DeleteSchemaResponse
deleteSchemaResponse_schemaArn = (DeleteSchemaResponse -> Maybe Text)
-> (DeleteSchemaResponse -> Maybe Text -> DeleteSchemaResponse)
-> Lens
DeleteSchemaResponse DeleteSchemaResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSchemaResponse' {Maybe Text
schemaArn :: Maybe Text
$sel:schemaArn:DeleteSchemaResponse' :: DeleteSchemaResponse -> Maybe Text
schemaArn} -> Maybe Text
schemaArn) (\s :: DeleteSchemaResponse
s@DeleteSchemaResponse' {} Maybe Text
a -> DeleteSchemaResponse
s {$sel:schemaArn:DeleteSchemaResponse' :: Maybe Text
schemaArn = Maybe Text
a} :: DeleteSchemaResponse)
deleteSchemaResponse_httpStatus :: Lens.Lens' DeleteSchemaResponse Prelude.Int
deleteSchemaResponse_httpStatus :: (Int -> f Int) -> DeleteSchemaResponse -> f DeleteSchemaResponse
deleteSchemaResponse_httpStatus = (DeleteSchemaResponse -> Int)
-> (DeleteSchemaResponse -> Int -> DeleteSchemaResponse)
-> Lens DeleteSchemaResponse DeleteSchemaResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSchemaResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSchemaResponse' :: DeleteSchemaResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSchemaResponse
s@DeleteSchemaResponse' {} Int
a -> DeleteSchemaResponse
s {$sel:httpStatus:DeleteSchemaResponse' :: Int
httpStatus = Int
a} :: DeleteSchemaResponse)
instance Prelude.NFData DeleteSchemaResponse