{-# 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.LookoutVision.DescribeDataset
(
DescribeDataset (..),
newDescribeDataset,
describeDataset_projectName,
describeDataset_datasetType,
DescribeDatasetResponse (..),
newDescribeDatasetResponse,
describeDatasetResponse_datasetDescription,
describeDatasetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutVision.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeDataset = DescribeDataset'
{
DescribeDataset -> Text
projectName :: Prelude.Text,
DescribeDataset -> Text
datasetType :: Prelude.Text
}
deriving (DescribeDataset -> DescribeDataset -> Bool
(DescribeDataset -> DescribeDataset -> Bool)
-> (DescribeDataset -> DescribeDataset -> Bool)
-> Eq DescribeDataset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataset -> DescribeDataset -> Bool
$c/= :: DescribeDataset -> DescribeDataset -> Bool
== :: DescribeDataset -> DescribeDataset -> Bool
$c== :: DescribeDataset -> DescribeDataset -> Bool
Prelude.Eq, ReadPrec [DescribeDataset]
ReadPrec DescribeDataset
Int -> ReadS DescribeDataset
ReadS [DescribeDataset]
(Int -> ReadS DescribeDataset)
-> ReadS [DescribeDataset]
-> ReadPrec DescribeDataset
-> ReadPrec [DescribeDataset]
-> Read DescribeDataset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataset]
$creadListPrec :: ReadPrec [DescribeDataset]
readPrec :: ReadPrec DescribeDataset
$creadPrec :: ReadPrec DescribeDataset
readList :: ReadS [DescribeDataset]
$creadList :: ReadS [DescribeDataset]
readsPrec :: Int -> ReadS DescribeDataset
$creadsPrec :: Int -> ReadS DescribeDataset
Prelude.Read, Int -> DescribeDataset -> ShowS
[DescribeDataset] -> ShowS
DescribeDataset -> String
(Int -> DescribeDataset -> ShowS)
-> (DescribeDataset -> String)
-> ([DescribeDataset] -> ShowS)
-> Show DescribeDataset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataset] -> ShowS
$cshowList :: [DescribeDataset] -> ShowS
show :: DescribeDataset -> String
$cshow :: DescribeDataset -> String
showsPrec :: Int -> DescribeDataset -> ShowS
$cshowsPrec :: Int -> DescribeDataset -> ShowS
Prelude.Show, (forall x. DescribeDataset -> Rep DescribeDataset x)
-> (forall x. Rep DescribeDataset x -> DescribeDataset)
-> Generic DescribeDataset
forall x. Rep DescribeDataset x -> DescribeDataset
forall x. DescribeDataset -> Rep DescribeDataset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDataset x -> DescribeDataset
$cfrom :: forall x. DescribeDataset -> Rep DescribeDataset x
Prelude.Generic)
newDescribeDataset ::
Prelude.Text ->
Prelude.Text ->
DescribeDataset
newDescribeDataset :: Text -> Text -> DescribeDataset
newDescribeDataset Text
pProjectName_ Text
pDatasetType_ =
DescribeDataset' :: Text -> Text -> DescribeDataset
DescribeDataset'
{ $sel:projectName:DescribeDataset' :: Text
projectName = Text
pProjectName_,
$sel:datasetType:DescribeDataset' :: Text
datasetType = Text
pDatasetType_
}
describeDataset_projectName :: Lens.Lens' DescribeDataset Prelude.Text
describeDataset_projectName :: (Text -> f Text) -> DescribeDataset -> f DescribeDataset
describeDataset_projectName = (DescribeDataset -> Text)
-> (DescribeDataset -> Text -> DescribeDataset)
-> Lens DescribeDataset DescribeDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataset' {Text
projectName :: Text
$sel:projectName:DescribeDataset' :: DescribeDataset -> Text
projectName} -> Text
projectName) (\s :: DescribeDataset
s@DescribeDataset' {} Text
a -> DescribeDataset
s {$sel:projectName:DescribeDataset' :: Text
projectName = Text
a} :: DescribeDataset)
describeDataset_datasetType :: Lens.Lens' DescribeDataset Prelude.Text
describeDataset_datasetType :: (Text -> f Text) -> DescribeDataset -> f DescribeDataset
describeDataset_datasetType = (DescribeDataset -> Text)
-> (DescribeDataset -> Text -> DescribeDataset)
-> Lens DescribeDataset DescribeDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataset' {Text
datasetType :: Text
$sel:datasetType:DescribeDataset' :: DescribeDataset -> Text
datasetType} -> Text
datasetType) (\s :: DescribeDataset
s@DescribeDataset' {} Text
a -> DescribeDataset
s {$sel:datasetType:DescribeDataset' :: Text
datasetType = Text
a} :: DescribeDataset)
instance Core.AWSRequest DescribeDataset where
type
AWSResponse DescribeDataset =
DescribeDatasetResponse
request :: DescribeDataset -> Request DescribeDataset
request = Service -> DescribeDataset -> Request DescribeDataset
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeDataset)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeDataset))
-> Logger
-> Service
-> Proxy DescribeDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeDataset)))
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 DatasetDescription -> Int -> DescribeDatasetResponse
DescribeDatasetResponse'
(Maybe DatasetDescription -> Int -> DescribeDatasetResponse)
-> Either String (Maybe DatasetDescription)
-> Either String (Int -> DescribeDatasetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DatasetDescription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DatasetDescription")
Either String (Int -> DescribeDatasetResponse)
-> Either String Int -> Either String DescribeDatasetResponse
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 DescribeDataset
instance Prelude.NFData DescribeDataset
instance Core.ToHeaders DescribeDataset where
toHeaders :: DescribeDataset -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeDataset -> 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 DescribeDataset where
toPath :: DescribeDataset -> ByteString
toPath DescribeDataset' {Text
datasetType :: Text
projectName :: Text
$sel:datasetType:DescribeDataset' :: DescribeDataset -> Text
$sel:projectName:DescribeDataset' :: DescribeDataset -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-11-20/projects/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
projectName,
ByteString
"/datasets/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
datasetType
]
instance Core.ToQuery DescribeDataset where
toQuery :: DescribeDataset -> QueryString
toQuery = QueryString -> DescribeDataset -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeDatasetResponse = DescribeDatasetResponse'
{
DescribeDatasetResponse -> Maybe DatasetDescription
datasetDescription :: Prelude.Maybe DatasetDescription,
DescribeDatasetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
(DescribeDatasetResponse -> DescribeDatasetResponse -> Bool)
-> (DescribeDatasetResponse -> DescribeDatasetResponse -> Bool)
-> Eq DescribeDatasetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
$c/= :: DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
== :: DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
$c== :: DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDatasetResponse]
ReadPrec DescribeDatasetResponse
Int -> ReadS DescribeDatasetResponse
ReadS [DescribeDatasetResponse]
(Int -> ReadS DescribeDatasetResponse)
-> ReadS [DescribeDatasetResponse]
-> ReadPrec DescribeDatasetResponse
-> ReadPrec [DescribeDatasetResponse]
-> Read DescribeDatasetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDatasetResponse]
$creadListPrec :: ReadPrec [DescribeDatasetResponse]
readPrec :: ReadPrec DescribeDatasetResponse
$creadPrec :: ReadPrec DescribeDatasetResponse
readList :: ReadS [DescribeDatasetResponse]
$creadList :: ReadS [DescribeDatasetResponse]
readsPrec :: Int -> ReadS DescribeDatasetResponse
$creadsPrec :: Int -> ReadS DescribeDatasetResponse
Prelude.Read, Int -> DescribeDatasetResponse -> ShowS
[DescribeDatasetResponse] -> ShowS
DescribeDatasetResponse -> String
(Int -> DescribeDatasetResponse -> ShowS)
-> (DescribeDatasetResponse -> String)
-> ([DescribeDatasetResponse] -> ShowS)
-> Show DescribeDatasetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDatasetResponse] -> ShowS
$cshowList :: [DescribeDatasetResponse] -> ShowS
show :: DescribeDatasetResponse -> String
$cshow :: DescribeDatasetResponse -> String
showsPrec :: Int -> DescribeDatasetResponse -> ShowS
$cshowsPrec :: Int -> DescribeDatasetResponse -> ShowS
Prelude.Show, (forall x.
DescribeDatasetResponse -> Rep DescribeDatasetResponse x)
-> (forall x.
Rep DescribeDatasetResponse x -> DescribeDatasetResponse)
-> Generic DescribeDatasetResponse
forall x. Rep DescribeDatasetResponse x -> DescribeDatasetResponse
forall x. DescribeDatasetResponse -> Rep DescribeDatasetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDatasetResponse x -> DescribeDatasetResponse
$cfrom :: forall x. DescribeDatasetResponse -> Rep DescribeDatasetResponse x
Prelude.Generic)
newDescribeDatasetResponse ::
Prelude.Int ->
DescribeDatasetResponse
newDescribeDatasetResponse :: Int -> DescribeDatasetResponse
newDescribeDatasetResponse Int
pHttpStatus_ =
DescribeDatasetResponse' :: Maybe DatasetDescription -> Int -> DescribeDatasetResponse
DescribeDatasetResponse'
{ $sel:datasetDescription:DescribeDatasetResponse' :: Maybe DatasetDescription
datasetDescription =
Maybe DatasetDescription
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeDatasetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeDatasetResponse_datasetDescription :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe DatasetDescription)
describeDatasetResponse_datasetDescription :: (Maybe DatasetDescription -> f (Maybe DatasetDescription))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_datasetDescription = (DescribeDatasetResponse -> Maybe DatasetDescription)
-> (DescribeDatasetResponse
-> Maybe DatasetDescription -> DescribeDatasetResponse)
-> Lens
DescribeDatasetResponse
DescribeDatasetResponse
(Maybe DatasetDescription)
(Maybe DatasetDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe DatasetDescription
datasetDescription :: Maybe DatasetDescription
$sel:datasetDescription:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe DatasetDescription
datasetDescription} -> Maybe DatasetDescription
datasetDescription) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe DatasetDescription
a -> DescribeDatasetResponse
s {$sel:datasetDescription:DescribeDatasetResponse' :: Maybe DatasetDescription
datasetDescription = Maybe DatasetDescription
a} :: DescribeDatasetResponse)
describeDatasetResponse_httpStatus :: Lens.Lens' DescribeDatasetResponse Prelude.Int
describeDatasetResponse_httpStatus :: (Int -> f Int)
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_httpStatus = (DescribeDatasetResponse -> Int)
-> (DescribeDatasetResponse -> Int -> DescribeDatasetResponse)
-> Lens DescribeDatasetResponse DescribeDatasetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeDatasetResponse' :: DescribeDatasetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Int
a -> DescribeDatasetResponse
s {$sel:httpStatus:DescribeDatasetResponse' :: Int
httpStatus = Int
a} :: DescribeDatasetResponse)
instance Prelude.NFData DescribeDatasetResponse