{-# 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.AppSync.GetSchemaCreationStatus
(
GetSchemaCreationStatus (..),
newGetSchemaCreationStatus,
getSchemaCreationStatus_apiId,
GetSchemaCreationStatusResponse (..),
newGetSchemaCreationStatusResponse,
getSchemaCreationStatusResponse_status,
getSchemaCreationStatusResponse_details,
getSchemaCreationStatusResponse_httpStatus,
)
where
import Amazonka.AppSync.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 GetSchemaCreationStatus = GetSchemaCreationStatus'
{
GetSchemaCreationStatus -> Text
apiId :: Prelude.Text
}
deriving (GetSchemaCreationStatus -> GetSchemaCreationStatus -> Bool
(GetSchemaCreationStatus -> GetSchemaCreationStatus -> Bool)
-> (GetSchemaCreationStatus -> GetSchemaCreationStatus -> Bool)
-> Eq GetSchemaCreationStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSchemaCreationStatus -> GetSchemaCreationStatus -> Bool
$c/= :: GetSchemaCreationStatus -> GetSchemaCreationStatus -> Bool
== :: GetSchemaCreationStatus -> GetSchemaCreationStatus -> Bool
$c== :: GetSchemaCreationStatus -> GetSchemaCreationStatus -> Bool
Prelude.Eq, ReadPrec [GetSchemaCreationStatus]
ReadPrec GetSchemaCreationStatus
Int -> ReadS GetSchemaCreationStatus
ReadS [GetSchemaCreationStatus]
(Int -> ReadS GetSchemaCreationStatus)
-> ReadS [GetSchemaCreationStatus]
-> ReadPrec GetSchemaCreationStatus
-> ReadPrec [GetSchemaCreationStatus]
-> Read GetSchemaCreationStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSchemaCreationStatus]
$creadListPrec :: ReadPrec [GetSchemaCreationStatus]
readPrec :: ReadPrec GetSchemaCreationStatus
$creadPrec :: ReadPrec GetSchemaCreationStatus
readList :: ReadS [GetSchemaCreationStatus]
$creadList :: ReadS [GetSchemaCreationStatus]
readsPrec :: Int -> ReadS GetSchemaCreationStatus
$creadsPrec :: Int -> ReadS GetSchemaCreationStatus
Prelude.Read, Int -> GetSchemaCreationStatus -> ShowS
[GetSchemaCreationStatus] -> ShowS
GetSchemaCreationStatus -> String
(Int -> GetSchemaCreationStatus -> ShowS)
-> (GetSchemaCreationStatus -> String)
-> ([GetSchemaCreationStatus] -> ShowS)
-> Show GetSchemaCreationStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSchemaCreationStatus] -> ShowS
$cshowList :: [GetSchemaCreationStatus] -> ShowS
show :: GetSchemaCreationStatus -> String
$cshow :: GetSchemaCreationStatus -> String
showsPrec :: Int -> GetSchemaCreationStatus -> ShowS
$cshowsPrec :: Int -> GetSchemaCreationStatus -> ShowS
Prelude.Show, (forall x.
GetSchemaCreationStatus -> Rep GetSchemaCreationStatus x)
-> (forall x.
Rep GetSchemaCreationStatus x -> GetSchemaCreationStatus)
-> Generic GetSchemaCreationStatus
forall x. Rep GetSchemaCreationStatus x -> GetSchemaCreationStatus
forall x. GetSchemaCreationStatus -> Rep GetSchemaCreationStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSchemaCreationStatus x -> GetSchemaCreationStatus
$cfrom :: forall x. GetSchemaCreationStatus -> Rep GetSchemaCreationStatus x
Prelude.Generic)
newGetSchemaCreationStatus ::
Prelude.Text ->
GetSchemaCreationStatus
newGetSchemaCreationStatus :: Text -> GetSchemaCreationStatus
newGetSchemaCreationStatus Text
pApiId_ =
GetSchemaCreationStatus' :: Text -> GetSchemaCreationStatus
GetSchemaCreationStatus' {$sel:apiId:GetSchemaCreationStatus' :: Text
apiId = Text
pApiId_}
getSchemaCreationStatus_apiId :: Lens.Lens' GetSchemaCreationStatus Prelude.Text
getSchemaCreationStatus_apiId :: (Text -> f Text)
-> GetSchemaCreationStatus -> f GetSchemaCreationStatus
getSchemaCreationStatus_apiId = (GetSchemaCreationStatus -> Text)
-> (GetSchemaCreationStatus -> Text -> GetSchemaCreationStatus)
-> Lens GetSchemaCreationStatus GetSchemaCreationStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaCreationStatus' {Text
apiId :: Text
$sel:apiId:GetSchemaCreationStatus' :: GetSchemaCreationStatus -> Text
apiId} -> Text
apiId) (\s :: GetSchemaCreationStatus
s@GetSchemaCreationStatus' {} Text
a -> GetSchemaCreationStatus
s {$sel:apiId:GetSchemaCreationStatus' :: Text
apiId = Text
a} :: GetSchemaCreationStatus)
instance Core.AWSRequest GetSchemaCreationStatus where
type
AWSResponse GetSchemaCreationStatus =
GetSchemaCreationStatusResponse
request :: GetSchemaCreationStatus -> Request GetSchemaCreationStatus
request = Service
-> GetSchemaCreationStatus -> Request GetSchemaCreationStatus
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetSchemaCreationStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSchemaCreationStatus)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetSchemaCreationStatus))
-> Logger
-> Service
-> Proxy GetSchemaCreationStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSchemaCreationStatus)))
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 SchemaStatus
-> Maybe Text -> Int -> GetSchemaCreationStatusResponse
GetSchemaCreationStatusResponse'
(Maybe SchemaStatus
-> Maybe Text -> Int -> GetSchemaCreationStatusResponse)
-> Either String (Maybe SchemaStatus)
-> Either
String (Maybe Text -> Int -> GetSchemaCreationStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe SchemaStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
Either
String (Maybe Text -> Int -> GetSchemaCreationStatusResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetSchemaCreationStatusResponse)
forall (f :: * -> *) a b. Applicative f => 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
"details")
Either String (Int -> GetSchemaCreationStatusResponse)
-> Either String Int
-> Either String GetSchemaCreationStatusResponse
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 GetSchemaCreationStatus
instance Prelude.NFData GetSchemaCreationStatus
instance Core.ToHeaders GetSchemaCreationStatus where
toHeaders :: GetSchemaCreationStatus -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetSchemaCreationStatus -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath GetSchemaCreationStatus where
toPath :: GetSchemaCreationStatus -> ByteString
toPath GetSchemaCreationStatus' {Text
apiId :: Text
$sel:apiId:GetSchemaCreationStatus' :: GetSchemaCreationStatus -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, ByteString
"/schemacreation"]
instance Core.ToQuery GetSchemaCreationStatus where
toQuery :: GetSchemaCreationStatus -> QueryString
toQuery = QueryString -> GetSchemaCreationStatus -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetSchemaCreationStatusResponse = GetSchemaCreationStatusResponse'
{
GetSchemaCreationStatusResponse -> Maybe SchemaStatus
status :: Prelude.Maybe SchemaStatus,
GetSchemaCreationStatusResponse -> Maybe Text
details :: Prelude.Maybe Prelude.Text,
GetSchemaCreationStatusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetSchemaCreationStatusResponse
-> GetSchemaCreationStatusResponse -> Bool
(GetSchemaCreationStatusResponse
-> GetSchemaCreationStatusResponse -> Bool)
-> (GetSchemaCreationStatusResponse
-> GetSchemaCreationStatusResponse -> Bool)
-> Eq GetSchemaCreationStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSchemaCreationStatusResponse
-> GetSchemaCreationStatusResponse -> Bool
$c/= :: GetSchemaCreationStatusResponse
-> GetSchemaCreationStatusResponse -> Bool
== :: GetSchemaCreationStatusResponse
-> GetSchemaCreationStatusResponse -> Bool
$c== :: GetSchemaCreationStatusResponse
-> GetSchemaCreationStatusResponse -> Bool
Prelude.Eq, ReadPrec [GetSchemaCreationStatusResponse]
ReadPrec GetSchemaCreationStatusResponse
Int -> ReadS GetSchemaCreationStatusResponse
ReadS [GetSchemaCreationStatusResponse]
(Int -> ReadS GetSchemaCreationStatusResponse)
-> ReadS [GetSchemaCreationStatusResponse]
-> ReadPrec GetSchemaCreationStatusResponse
-> ReadPrec [GetSchemaCreationStatusResponse]
-> Read GetSchemaCreationStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSchemaCreationStatusResponse]
$creadListPrec :: ReadPrec [GetSchemaCreationStatusResponse]
readPrec :: ReadPrec GetSchemaCreationStatusResponse
$creadPrec :: ReadPrec GetSchemaCreationStatusResponse
readList :: ReadS [GetSchemaCreationStatusResponse]
$creadList :: ReadS [GetSchemaCreationStatusResponse]
readsPrec :: Int -> ReadS GetSchemaCreationStatusResponse
$creadsPrec :: Int -> ReadS GetSchemaCreationStatusResponse
Prelude.Read, Int -> GetSchemaCreationStatusResponse -> ShowS
[GetSchemaCreationStatusResponse] -> ShowS
GetSchemaCreationStatusResponse -> String
(Int -> GetSchemaCreationStatusResponse -> ShowS)
-> (GetSchemaCreationStatusResponse -> String)
-> ([GetSchemaCreationStatusResponse] -> ShowS)
-> Show GetSchemaCreationStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSchemaCreationStatusResponse] -> ShowS
$cshowList :: [GetSchemaCreationStatusResponse] -> ShowS
show :: GetSchemaCreationStatusResponse -> String
$cshow :: GetSchemaCreationStatusResponse -> String
showsPrec :: Int -> GetSchemaCreationStatusResponse -> ShowS
$cshowsPrec :: Int -> GetSchemaCreationStatusResponse -> ShowS
Prelude.Show, (forall x.
GetSchemaCreationStatusResponse
-> Rep GetSchemaCreationStatusResponse x)
-> (forall x.
Rep GetSchemaCreationStatusResponse x
-> GetSchemaCreationStatusResponse)
-> Generic GetSchemaCreationStatusResponse
forall x.
Rep GetSchemaCreationStatusResponse x
-> GetSchemaCreationStatusResponse
forall x.
GetSchemaCreationStatusResponse
-> Rep GetSchemaCreationStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSchemaCreationStatusResponse x
-> GetSchemaCreationStatusResponse
$cfrom :: forall x.
GetSchemaCreationStatusResponse
-> Rep GetSchemaCreationStatusResponse x
Prelude.Generic)
newGetSchemaCreationStatusResponse ::
Prelude.Int ->
GetSchemaCreationStatusResponse
newGetSchemaCreationStatusResponse :: Int -> GetSchemaCreationStatusResponse
newGetSchemaCreationStatusResponse Int
pHttpStatus_ =
GetSchemaCreationStatusResponse' :: Maybe SchemaStatus
-> Maybe Text -> Int -> GetSchemaCreationStatusResponse
GetSchemaCreationStatusResponse'
{ $sel:status:GetSchemaCreationStatusResponse' :: Maybe SchemaStatus
status =
Maybe SchemaStatus
forall a. Maybe a
Prelude.Nothing,
$sel:details:GetSchemaCreationStatusResponse' :: Maybe Text
details = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSchemaCreationStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSchemaCreationStatusResponse_status :: Lens.Lens' GetSchemaCreationStatusResponse (Prelude.Maybe SchemaStatus)
getSchemaCreationStatusResponse_status :: (Maybe SchemaStatus -> f (Maybe SchemaStatus))
-> GetSchemaCreationStatusResponse
-> f GetSchemaCreationStatusResponse
getSchemaCreationStatusResponse_status = (GetSchemaCreationStatusResponse -> Maybe SchemaStatus)
-> (GetSchemaCreationStatusResponse
-> Maybe SchemaStatus -> GetSchemaCreationStatusResponse)
-> Lens
GetSchemaCreationStatusResponse
GetSchemaCreationStatusResponse
(Maybe SchemaStatus)
(Maybe SchemaStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaCreationStatusResponse' {Maybe SchemaStatus
status :: Maybe SchemaStatus
$sel:status:GetSchemaCreationStatusResponse' :: GetSchemaCreationStatusResponse -> Maybe SchemaStatus
status} -> Maybe SchemaStatus
status) (\s :: GetSchemaCreationStatusResponse
s@GetSchemaCreationStatusResponse' {} Maybe SchemaStatus
a -> GetSchemaCreationStatusResponse
s {$sel:status:GetSchemaCreationStatusResponse' :: Maybe SchemaStatus
status = Maybe SchemaStatus
a} :: GetSchemaCreationStatusResponse)
getSchemaCreationStatusResponse_details :: Lens.Lens' GetSchemaCreationStatusResponse (Prelude.Maybe Prelude.Text)
getSchemaCreationStatusResponse_details :: (Maybe Text -> f (Maybe Text))
-> GetSchemaCreationStatusResponse
-> f GetSchemaCreationStatusResponse
getSchemaCreationStatusResponse_details = (GetSchemaCreationStatusResponse -> Maybe Text)
-> (GetSchemaCreationStatusResponse
-> Maybe Text -> GetSchemaCreationStatusResponse)
-> Lens
GetSchemaCreationStatusResponse
GetSchemaCreationStatusResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaCreationStatusResponse' {Maybe Text
details :: Maybe Text
$sel:details:GetSchemaCreationStatusResponse' :: GetSchemaCreationStatusResponse -> Maybe Text
details} -> Maybe Text
details) (\s :: GetSchemaCreationStatusResponse
s@GetSchemaCreationStatusResponse' {} Maybe Text
a -> GetSchemaCreationStatusResponse
s {$sel:details:GetSchemaCreationStatusResponse' :: Maybe Text
details = Maybe Text
a} :: GetSchemaCreationStatusResponse)
getSchemaCreationStatusResponse_httpStatus :: Lens.Lens' GetSchemaCreationStatusResponse Prelude.Int
getSchemaCreationStatusResponse_httpStatus :: (Int -> f Int)
-> GetSchemaCreationStatusResponse
-> f GetSchemaCreationStatusResponse
getSchemaCreationStatusResponse_httpStatus = (GetSchemaCreationStatusResponse -> Int)
-> (GetSchemaCreationStatusResponse
-> Int -> GetSchemaCreationStatusResponse)
-> Lens
GetSchemaCreationStatusResponse
GetSchemaCreationStatusResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaCreationStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSchemaCreationStatusResponse' :: GetSchemaCreationStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSchemaCreationStatusResponse
s@GetSchemaCreationStatusResponse' {} Int
a -> GetSchemaCreationStatusResponse
s {$sel:httpStatus:GetSchemaCreationStatusResponse' :: Int
httpStatus = Int
a} :: GetSchemaCreationStatusResponse)
instance
Prelude.NFData
GetSchemaCreationStatusResponse