{-# 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.MachineLearning.DescribeDataSources
(
DescribeDataSources (..),
newDescribeDataSources,
describeDataSources_eq,
describeDataSources_ge,
describeDataSources_prefix,
describeDataSources_gt,
describeDataSources_ne,
describeDataSources_nextToken,
describeDataSources_sortOrder,
describeDataSources_limit,
describeDataSources_lt,
describeDataSources_filterVariable,
describeDataSources_le,
DescribeDataSourcesResponse (..),
newDescribeDataSourcesResponse,
describeDataSourcesResponse_results,
describeDataSourcesResponse_nextToken,
describeDataSourcesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MachineLearning.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeDataSources = DescribeDataSources'
{
DescribeDataSources -> Maybe Text
eq :: Prelude.Maybe Prelude.Text,
DescribeDataSources -> Maybe Text
ge :: Prelude.Maybe Prelude.Text,
DescribeDataSources -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
DescribeDataSources -> Maybe Text
gt :: Prelude.Maybe Prelude.Text,
DescribeDataSources -> Maybe Text
ne :: Prelude.Maybe Prelude.Text,
DescribeDataSources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeDataSources -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
DescribeDataSources -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
DescribeDataSources -> Maybe Text
lt :: Prelude.Maybe Prelude.Text,
DescribeDataSources -> Maybe DataSourceFilterVariable
filterVariable :: Prelude.Maybe DataSourceFilterVariable,
DescribeDataSources -> Maybe Text
le :: Prelude.Maybe Prelude.Text
}
deriving (DescribeDataSources -> DescribeDataSources -> Bool
(DescribeDataSources -> DescribeDataSources -> Bool)
-> (DescribeDataSources -> DescribeDataSources -> Bool)
-> Eq DescribeDataSources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataSources -> DescribeDataSources -> Bool
$c/= :: DescribeDataSources -> DescribeDataSources -> Bool
== :: DescribeDataSources -> DescribeDataSources -> Bool
$c== :: DescribeDataSources -> DescribeDataSources -> Bool
Prelude.Eq, ReadPrec [DescribeDataSources]
ReadPrec DescribeDataSources
Int -> ReadS DescribeDataSources
ReadS [DescribeDataSources]
(Int -> ReadS DescribeDataSources)
-> ReadS [DescribeDataSources]
-> ReadPrec DescribeDataSources
-> ReadPrec [DescribeDataSources]
-> Read DescribeDataSources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataSources]
$creadListPrec :: ReadPrec [DescribeDataSources]
readPrec :: ReadPrec DescribeDataSources
$creadPrec :: ReadPrec DescribeDataSources
readList :: ReadS [DescribeDataSources]
$creadList :: ReadS [DescribeDataSources]
readsPrec :: Int -> ReadS DescribeDataSources
$creadsPrec :: Int -> ReadS DescribeDataSources
Prelude.Read, Int -> DescribeDataSources -> ShowS
[DescribeDataSources] -> ShowS
DescribeDataSources -> String
(Int -> DescribeDataSources -> ShowS)
-> (DescribeDataSources -> String)
-> ([DescribeDataSources] -> ShowS)
-> Show DescribeDataSources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataSources] -> ShowS
$cshowList :: [DescribeDataSources] -> ShowS
show :: DescribeDataSources -> String
$cshow :: DescribeDataSources -> String
showsPrec :: Int -> DescribeDataSources -> ShowS
$cshowsPrec :: Int -> DescribeDataSources -> ShowS
Prelude.Show, (forall x. DescribeDataSources -> Rep DescribeDataSources x)
-> (forall x. Rep DescribeDataSources x -> DescribeDataSources)
-> Generic DescribeDataSources
forall x. Rep DescribeDataSources x -> DescribeDataSources
forall x. DescribeDataSources -> Rep DescribeDataSources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDataSources x -> DescribeDataSources
$cfrom :: forall x. DescribeDataSources -> Rep DescribeDataSources x
Prelude.Generic)
newDescribeDataSources ::
DescribeDataSources
newDescribeDataSources :: DescribeDataSources
newDescribeDataSources =
DescribeDataSources' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SortOrder
-> Maybe Natural
-> Maybe Text
-> Maybe DataSourceFilterVariable
-> Maybe Text
-> DescribeDataSources
DescribeDataSources'
{ $sel:eq:DescribeDataSources' :: Maybe Text
eq = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ge:DescribeDataSources' :: Maybe Text
ge = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:prefix:DescribeDataSources' :: Maybe Text
prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gt:DescribeDataSources' :: Maybe Text
gt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ne:DescribeDataSources' :: Maybe Text
ne = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeDataSources' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sortOrder:DescribeDataSources' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
$sel:limit:DescribeDataSources' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:lt:DescribeDataSources' :: Maybe Text
lt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filterVariable:DescribeDataSources' :: Maybe DataSourceFilterVariable
filterVariable = Maybe DataSourceFilterVariable
forall a. Maybe a
Prelude.Nothing,
$sel:le:DescribeDataSources' :: Maybe Text
le = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
describeDataSources_eq :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Text)
describeDataSources_eq :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_eq = (DescribeDataSources -> Maybe Text)
-> (DescribeDataSources -> Maybe Text -> DescribeDataSources)
-> Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Text
eq :: Maybe Text
$sel:eq:DescribeDataSources' :: DescribeDataSources -> Maybe Text
eq} -> Maybe Text
eq) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Text
a -> DescribeDataSources
s {$sel:eq:DescribeDataSources' :: Maybe Text
eq = Maybe Text
a} :: DescribeDataSources)
describeDataSources_ge :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Text)
describeDataSources_ge :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_ge = (DescribeDataSources -> Maybe Text)
-> (DescribeDataSources -> Maybe Text -> DescribeDataSources)
-> Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Text
ge :: Maybe Text
$sel:ge:DescribeDataSources' :: DescribeDataSources -> Maybe Text
ge} -> Maybe Text
ge) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Text
a -> DescribeDataSources
s {$sel:ge:DescribeDataSources' :: Maybe Text
ge = Maybe Text
a} :: DescribeDataSources)
describeDataSources_prefix :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Text)
describeDataSources_prefix :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_prefix = (DescribeDataSources -> Maybe Text)
-> (DescribeDataSources -> Maybe Text -> DescribeDataSources)
-> Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Text
prefix :: Maybe Text
$sel:prefix:DescribeDataSources' :: DescribeDataSources -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Text
a -> DescribeDataSources
s {$sel:prefix:DescribeDataSources' :: Maybe Text
prefix = Maybe Text
a} :: DescribeDataSources)
describeDataSources_gt :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Text)
describeDataSources_gt :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_gt = (DescribeDataSources -> Maybe Text)
-> (DescribeDataSources -> Maybe Text -> DescribeDataSources)
-> Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Text
gt :: Maybe Text
$sel:gt:DescribeDataSources' :: DescribeDataSources -> Maybe Text
gt} -> Maybe Text
gt) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Text
a -> DescribeDataSources
s {$sel:gt:DescribeDataSources' :: Maybe Text
gt = Maybe Text
a} :: DescribeDataSources)
describeDataSources_ne :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Text)
describeDataSources_ne :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_ne = (DescribeDataSources -> Maybe Text)
-> (DescribeDataSources -> Maybe Text -> DescribeDataSources)
-> Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Text
ne :: Maybe Text
$sel:ne:DescribeDataSources' :: DescribeDataSources -> Maybe Text
ne} -> Maybe Text
ne) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Text
a -> DescribeDataSources
s {$sel:ne:DescribeDataSources' :: Maybe Text
ne = Maybe Text
a} :: DescribeDataSources)
describeDataSources_nextToken :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Text)
describeDataSources_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_nextToken = (DescribeDataSources -> Maybe Text)
-> (DescribeDataSources -> Maybe Text -> DescribeDataSources)
-> Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDataSources' :: DescribeDataSources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Text
a -> DescribeDataSources
s {$sel:nextToken:DescribeDataSources' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDataSources)
describeDataSources_sortOrder :: Lens.Lens' DescribeDataSources (Prelude.Maybe SortOrder)
describeDataSources_sortOrder :: (Maybe SortOrder -> f (Maybe SortOrder))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_sortOrder = (DescribeDataSources -> Maybe SortOrder)
-> (DescribeDataSources -> Maybe SortOrder -> DescribeDataSources)
-> Lens
DescribeDataSources
DescribeDataSources
(Maybe SortOrder)
(Maybe SortOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:DescribeDataSources' :: DescribeDataSources -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe SortOrder
a -> DescribeDataSources
s {$sel:sortOrder:DescribeDataSources' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: DescribeDataSources)
describeDataSources_limit :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Natural)
describeDataSources_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_limit = (DescribeDataSources -> Maybe Natural)
-> (DescribeDataSources -> Maybe Natural -> DescribeDataSources)
-> Lens
DescribeDataSources
DescribeDataSources
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeDataSources' :: DescribeDataSources -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Natural
a -> DescribeDataSources
s {$sel:limit:DescribeDataSources' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeDataSources)
describeDataSources_lt :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Text)
describeDataSources_lt :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_lt = (DescribeDataSources -> Maybe Text)
-> (DescribeDataSources -> Maybe Text -> DescribeDataSources)
-> Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Text
lt :: Maybe Text
$sel:lt:DescribeDataSources' :: DescribeDataSources -> Maybe Text
lt} -> Maybe Text
lt) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Text
a -> DescribeDataSources
s {$sel:lt:DescribeDataSources' :: Maybe Text
lt = Maybe Text
a} :: DescribeDataSources)
describeDataSources_filterVariable :: Lens.Lens' DescribeDataSources (Prelude.Maybe DataSourceFilterVariable)
describeDataSources_filterVariable :: (Maybe DataSourceFilterVariable
-> f (Maybe DataSourceFilterVariable))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_filterVariable = (DescribeDataSources -> Maybe DataSourceFilterVariable)
-> (DescribeDataSources
-> Maybe DataSourceFilterVariable -> DescribeDataSources)
-> Lens
DescribeDataSources
DescribeDataSources
(Maybe DataSourceFilterVariable)
(Maybe DataSourceFilterVariable)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe DataSourceFilterVariable
filterVariable :: Maybe DataSourceFilterVariable
$sel:filterVariable:DescribeDataSources' :: DescribeDataSources -> Maybe DataSourceFilterVariable
filterVariable} -> Maybe DataSourceFilterVariable
filterVariable) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe DataSourceFilterVariable
a -> DescribeDataSources
s {$sel:filterVariable:DescribeDataSources' :: Maybe DataSourceFilterVariable
filterVariable = Maybe DataSourceFilterVariable
a} :: DescribeDataSources)
describeDataSources_le :: Lens.Lens' DescribeDataSources (Prelude.Maybe Prelude.Text)
describeDataSources_le :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSources -> f DescribeDataSources
describeDataSources_le = (DescribeDataSources -> Maybe Text)
-> (DescribeDataSources -> Maybe Text -> DescribeDataSources)
-> Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSources' {Maybe Text
le :: Maybe Text
$sel:le:DescribeDataSources' :: DescribeDataSources -> Maybe Text
le} -> Maybe Text
le) (\s :: DescribeDataSources
s@DescribeDataSources' {} Maybe Text
a -> DescribeDataSources
s {$sel:le:DescribeDataSources' :: Maybe Text
le = Maybe Text
a} :: DescribeDataSources)
instance Core.AWSPager DescribeDataSources where
page :: DescribeDataSources
-> AWSResponse DescribeDataSources -> Maybe DescribeDataSources
page DescribeDataSources
rq AWSResponse DescribeDataSources
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeDataSources
DescribeDataSourcesResponse
rs
DescribeDataSourcesResponse
-> Getting (First Text) DescribeDataSourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDataSourcesResponse
-> Const (First Text) DescribeDataSourcesResponse
Lens' DescribeDataSourcesResponse (Maybe Text)
describeDataSourcesResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDataSourcesResponse
-> Const (First Text) DescribeDataSourcesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDataSourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeDataSources
forall a. Maybe a
Prelude.Nothing
| Maybe [DataSource] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeDataSources
DescribeDataSourcesResponse
rs
DescribeDataSourcesResponse
-> Getting
(First [DataSource]) DescribeDataSourcesResponse [DataSource]
-> Maybe [DataSource]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DataSource]
-> Const (First [DataSource]) (Maybe [DataSource]))
-> DescribeDataSourcesResponse
-> Const (First [DataSource]) DescribeDataSourcesResponse
Lens' DescribeDataSourcesResponse (Maybe [DataSource])
describeDataSourcesResponse_results
((Maybe [DataSource]
-> Const (First [DataSource]) (Maybe [DataSource]))
-> DescribeDataSourcesResponse
-> Const (First [DataSource]) DescribeDataSourcesResponse)
-> (([DataSource] -> Const (First [DataSource]) [DataSource])
-> Maybe [DataSource]
-> Const (First [DataSource]) (Maybe [DataSource]))
-> Getting
(First [DataSource]) DescribeDataSourcesResponse [DataSource]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DataSource] -> Const (First [DataSource]) [DataSource])
-> Maybe [DataSource]
-> Const (First [DataSource]) (Maybe [DataSource])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeDataSources
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
DescribeDataSources -> Maybe DescribeDataSources
forall a. a -> Maybe a
Prelude.Just (DescribeDataSources -> Maybe DescribeDataSources)
-> DescribeDataSources -> Maybe DescribeDataSources
forall a b. (a -> b) -> a -> b
Prelude.$
DescribeDataSources
rq
DescribeDataSources
-> (DescribeDataSources -> DescribeDataSources)
-> DescribeDataSources
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeDataSources -> Identity DescribeDataSources
Lens
DescribeDataSources DescribeDataSources (Maybe Text) (Maybe Text)
describeDataSources_nextToken
((Maybe Text -> Identity (Maybe Text))
-> DescribeDataSources -> Identity DescribeDataSources)
-> Maybe Text -> DescribeDataSources -> DescribeDataSources
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDataSources
DescribeDataSourcesResponse
rs
DescribeDataSourcesResponse
-> Getting (First Text) DescribeDataSourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDataSourcesResponse
-> Const (First Text) DescribeDataSourcesResponse
Lens' DescribeDataSourcesResponse (Maybe Text)
describeDataSourcesResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDataSourcesResponse
-> Const (First Text) DescribeDataSourcesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDataSourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest DescribeDataSources where
type
AWSResponse DescribeDataSources =
DescribeDataSourcesResponse
request :: DescribeDataSources -> Request DescribeDataSources
request = Service -> DescribeDataSources -> Request DescribeDataSources
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeDataSources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDataSources)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeDataSources))
-> Logger
-> Service
-> Proxy DescribeDataSources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDataSources)))
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 [DataSource]
-> Maybe Text -> Int -> DescribeDataSourcesResponse
DescribeDataSourcesResponse'
(Maybe [DataSource]
-> Maybe Text -> Int -> DescribeDataSourcesResponse)
-> Either String (Maybe [DataSource])
-> Either String (Maybe Text -> Int -> DescribeDataSourcesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [DataSource]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Results" Either String (Maybe (Maybe [DataSource]))
-> Maybe [DataSource] -> Either String (Maybe [DataSource])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DataSource]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> DescribeDataSourcesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeDataSourcesResponse)
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
"NextToken")
Either String (Int -> DescribeDataSourcesResponse)
-> Either String Int -> Either String DescribeDataSourcesResponse
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 DescribeDataSources
instance Prelude.NFData DescribeDataSources
instance Core.ToHeaders DescribeDataSources where
toHeaders :: DescribeDataSources -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeDataSources -> 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
"AmazonML_20141212.DescribeDataSources" ::
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 DescribeDataSources where
toJSON :: DescribeDataSources -> Value
toJSON DescribeDataSources' {Maybe Natural
Maybe Text
Maybe DataSourceFilterVariable
Maybe SortOrder
le :: Maybe Text
filterVariable :: Maybe DataSourceFilterVariable
lt :: Maybe Text
limit :: Maybe Natural
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
ne :: Maybe Text
gt :: Maybe Text
prefix :: Maybe Text
ge :: Maybe Text
eq :: Maybe Text
$sel:le:DescribeDataSources' :: DescribeDataSources -> Maybe Text
$sel:filterVariable:DescribeDataSources' :: DescribeDataSources -> Maybe DataSourceFilterVariable
$sel:lt:DescribeDataSources' :: DescribeDataSources -> Maybe Text
$sel:limit:DescribeDataSources' :: DescribeDataSources -> Maybe Natural
$sel:sortOrder:DescribeDataSources' :: DescribeDataSources -> Maybe SortOrder
$sel:nextToken:DescribeDataSources' :: DescribeDataSources -> Maybe Text
$sel:ne:DescribeDataSources' :: DescribeDataSources -> Maybe Text
$sel:gt:DescribeDataSources' :: DescribeDataSources -> Maybe Text
$sel:prefix:DescribeDataSources' :: DescribeDataSources -> Maybe Text
$sel:ge:DescribeDataSources' :: DescribeDataSources -> Maybe Text
$sel:eq:DescribeDataSources' :: DescribeDataSources -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EQ" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
eq,
(Text
"GE" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ge,
(Text
"Prefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
prefix,
(Text
"GT" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
gt,
(Text
"NE" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ne,
(Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Text
"SortOrder" Text -> SortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortOrder -> Pair) -> Maybe SortOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sortOrder,
(Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
(Text
"LT" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
lt,
(Text
"FilterVariable" Text -> DataSourceFilterVariable -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DataSourceFilterVariable -> Pair)
-> Maybe DataSourceFilterVariable -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DataSourceFilterVariable
filterVariable,
(Text
"LE" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
le
]
)
instance Core.ToPath DescribeDataSources where
toPath :: DescribeDataSources -> ByteString
toPath = ByteString -> DescribeDataSources -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeDataSources where
toQuery :: DescribeDataSources -> QueryString
toQuery = QueryString -> DescribeDataSources -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeDataSourcesResponse = DescribeDataSourcesResponse'
{
DescribeDataSourcesResponse -> Maybe [DataSource]
results :: Prelude.Maybe [DataSource],
DescribeDataSourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeDataSourcesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeDataSourcesResponse -> DescribeDataSourcesResponse -> Bool
(DescribeDataSourcesResponse
-> DescribeDataSourcesResponse -> Bool)
-> (DescribeDataSourcesResponse
-> DescribeDataSourcesResponse -> Bool)
-> Eq DescribeDataSourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataSourcesResponse -> DescribeDataSourcesResponse -> Bool
$c/= :: DescribeDataSourcesResponse -> DescribeDataSourcesResponse -> Bool
== :: DescribeDataSourcesResponse -> DescribeDataSourcesResponse -> Bool
$c== :: DescribeDataSourcesResponse -> DescribeDataSourcesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDataSourcesResponse]
ReadPrec DescribeDataSourcesResponse
Int -> ReadS DescribeDataSourcesResponse
ReadS [DescribeDataSourcesResponse]
(Int -> ReadS DescribeDataSourcesResponse)
-> ReadS [DescribeDataSourcesResponse]
-> ReadPrec DescribeDataSourcesResponse
-> ReadPrec [DescribeDataSourcesResponse]
-> Read DescribeDataSourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataSourcesResponse]
$creadListPrec :: ReadPrec [DescribeDataSourcesResponse]
readPrec :: ReadPrec DescribeDataSourcesResponse
$creadPrec :: ReadPrec DescribeDataSourcesResponse
readList :: ReadS [DescribeDataSourcesResponse]
$creadList :: ReadS [DescribeDataSourcesResponse]
readsPrec :: Int -> ReadS DescribeDataSourcesResponse
$creadsPrec :: Int -> ReadS DescribeDataSourcesResponse
Prelude.Read, Int -> DescribeDataSourcesResponse -> ShowS
[DescribeDataSourcesResponse] -> ShowS
DescribeDataSourcesResponse -> String
(Int -> DescribeDataSourcesResponse -> ShowS)
-> (DescribeDataSourcesResponse -> String)
-> ([DescribeDataSourcesResponse] -> ShowS)
-> Show DescribeDataSourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataSourcesResponse] -> ShowS
$cshowList :: [DescribeDataSourcesResponse] -> ShowS
show :: DescribeDataSourcesResponse -> String
$cshow :: DescribeDataSourcesResponse -> String
showsPrec :: Int -> DescribeDataSourcesResponse -> ShowS
$cshowsPrec :: Int -> DescribeDataSourcesResponse -> ShowS
Prelude.Show, (forall x.
DescribeDataSourcesResponse -> Rep DescribeDataSourcesResponse x)
-> (forall x.
Rep DescribeDataSourcesResponse x -> DescribeDataSourcesResponse)
-> Generic DescribeDataSourcesResponse
forall x.
Rep DescribeDataSourcesResponse x -> DescribeDataSourcesResponse
forall x.
DescribeDataSourcesResponse -> Rep DescribeDataSourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDataSourcesResponse x -> DescribeDataSourcesResponse
$cfrom :: forall x.
DescribeDataSourcesResponse -> Rep DescribeDataSourcesResponse x
Prelude.Generic)
newDescribeDataSourcesResponse ::
Prelude.Int ->
DescribeDataSourcesResponse
newDescribeDataSourcesResponse :: Int -> DescribeDataSourcesResponse
newDescribeDataSourcesResponse Int
pHttpStatus_ =
DescribeDataSourcesResponse' :: Maybe [DataSource]
-> Maybe Text -> Int -> DescribeDataSourcesResponse
DescribeDataSourcesResponse'
{ $sel:results:DescribeDataSourcesResponse' :: Maybe [DataSource]
results =
Maybe [DataSource]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeDataSourcesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeDataSourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeDataSourcesResponse_results :: Lens.Lens' DescribeDataSourcesResponse (Prelude.Maybe [DataSource])
describeDataSourcesResponse_results :: (Maybe [DataSource] -> f (Maybe [DataSource]))
-> DescribeDataSourcesResponse -> f DescribeDataSourcesResponse
describeDataSourcesResponse_results = (DescribeDataSourcesResponse -> Maybe [DataSource])
-> (DescribeDataSourcesResponse
-> Maybe [DataSource] -> DescribeDataSourcesResponse)
-> Lens' DescribeDataSourcesResponse (Maybe [DataSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcesResponse' {Maybe [DataSource]
results :: Maybe [DataSource]
$sel:results:DescribeDataSourcesResponse' :: DescribeDataSourcesResponse -> Maybe [DataSource]
results} -> Maybe [DataSource]
results) (\s :: DescribeDataSourcesResponse
s@DescribeDataSourcesResponse' {} Maybe [DataSource]
a -> DescribeDataSourcesResponse
s {$sel:results:DescribeDataSourcesResponse' :: Maybe [DataSource]
results = Maybe [DataSource]
a} :: DescribeDataSourcesResponse) ((Maybe [DataSource] -> f (Maybe [DataSource]))
-> DescribeDataSourcesResponse -> f DescribeDataSourcesResponse)
-> ((Maybe [DataSource] -> f (Maybe [DataSource]))
-> Maybe [DataSource] -> f (Maybe [DataSource]))
-> (Maybe [DataSource] -> f (Maybe [DataSource]))
-> DescribeDataSourcesResponse
-> f DescribeDataSourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DataSource] [DataSource] [DataSource] [DataSource]
-> Iso
(Maybe [DataSource])
(Maybe [DataSource])
(Maybe [DataSource])
(Maybe [DataSource])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [DataSource] [DataSource] [DataSource] [DataSource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeDataSourcesResponse_nextToken :: Lens.Lens' DescribeDataSourcesResponse (Prelude.Maybe Prelude.Text)
describeDataSourcesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDataSourcesResponse -> f DescribeDataSourcesResponse
describeDataSourcesResponse_nextToken = (DescribeDataSourcesResponse -> Maybe Text)
-> (DescribeDataSourcesResponse
-> Maybe Text -> DescribeDataSourcesResponse)
-> Lens' DescribeDataSourcesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDataSourcesResponse' :: DescribeDataSourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDataSourcesResponse
s@DescribeDataSourcesResponse' {} Maybe Text
a -> DescribeDataSourcesResponse
s {$sel:nextToken:DescribeDataSourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDataSourcesResponse)
describeDataSourcesResponse_httpStatus :: Lens.Lens' DescribeDataSourcesResponse Prelude.Int
describeDataSourcesResponse_httpStatus :: (Int -> f Int)
-> DescribeDataSourcesResponse -> f DescribeDataSourcesResponse
describeDataSourcesResponse_httpStatus = (DescribeDataSourcesResponse -> Int)
-> (DescribeDataSourcesResponse
-> Int -> DescribeDataSourcesResponse)
-> Lens
DescribeDataSourcesResponse DescribeDataSourcesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDataSourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeDataSourcesResponse' :: DescribeDataSourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeDataSourcesResponse
s@DescribeDataSourcesResponse' {} Int
a -> DescribeDataSourcesResponse
s {$sel:httpStatus:DescribeDataSourcesResponse' :: Int
httpStatus = Int
a} :: DescribeDataSourcesResponse)
instance Prelude.NFData DescribeDataSourcesResponse