{-# 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.Glue.CreateClassifier
(
CreateClassifier (..),
newCreateClassifier,
createClassifier_grokClassifier,
createClassifier_xMLClassifier,
createClassifier_csvClassifier,
createClassifier_jsonClassifier,
CreateClassifierResponse (..),
newCreateClassifierResponse,
createClassifierResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types
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 CreateClassifier = CreateClassifier'
{
CreateClassifier -> Maybe CreateGrokClassifierRequest
grokClassifier :: Prelude.Maybe CreateGrokClassifierRequest,
CreateClassifier -> Maybe CreateXMLClassifierRequest
xMLClassifier :: Prelude.Maybe CreateXMLClassifierRequest,
CreateClassifier -> Maybe CreateCsvClassifierRequest
csvClassifier :: Prelude.Maybe CreateCsvClassifierRequest,
CreateClassifier -> Maybe CreateJsonClassifierRequest
jsonClassifier :: Prelude.Maybe CreateJsonClassifierRequest
}
deriving (CreateClassifier -> CreateClassifier -> Bool
(CreateClassifier -> CreateClassifier -> Bool)
-> (CreateClassifier -> CreateClassifier -> Bool)
-> Eq CreateClassifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClassifier -> CreateClassifier -> Bool
$c/= :: CreateClassifier -> CreateClassifier -> Bool
== :: CreateClassifier -> CreateClassifier -> Bool
$c== :: CreateClassifier -> CreateClassifier -> Bool
Prelude.Eq, ReadPrec [CreateClassifier]
ReadPrec CreateClassifier
Int -> ReadS CreateClassifier
ReadS [CreateClassifier]
(Int -> ReadS CreateClassifier)
-> ReadS [CreateClassifier]
-> ReadPrec CreateClassifier
-> ReadPrec [CreateClassifier]
-> Read CreateClassifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClassifier]
$creadListPrec :: ReadPrec [CreateClassifier]
readPrec :: ReadPrec CreateClassifier
$creadPrec :: ReadPrec CreateClassifier
readList :: ReadS [CreateClassifier]
$creadList :: ReadS [CreateClassifier]
readsPrec :: Int -> ReadS CreateClassifier
$creadsPrec :: Int -> ReadS CreateClassifier
Prelude.Read, Int -> CreateClassifier -> ShowS
[CreateClassifier] -> ShowS
CreateClassifier -> String
(Int -> CreateClassifier -> ShowS)
-> (CreateClassifier -> String)
-> ([CreateClassifier] -> ShowS)
-> Show CreateClassifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClassifier] -> ShowS
$cshowList :: [CreateClassifier] -> ShowS
show :: CreateClassifier -> String
$cshow :: CreateClassifier -> String
showsPrec :: Int -> CreateClassifier -> ShowS
$cshowsPrec :: Int -> CreateClassifier -> ShowS
Prelude.Show, (forall x. CreateClassifier -> Rep CreateClassifier x)
-> (forall x. Rep CreateClassifier x -> CreateClassifier)
-> Generic CreateClassifier
forall x. Rep CreateClassifier x -> CreateClassifier
forall x. CreateClassifier -> Rep CreateClassifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateClassifier x -> CreateClassifier
$cfrom :: forall x. CreateClassifier -> Rep CreateClassifier x
Prelude.Generic)
newCreateClassifier ::
CreateClassifier
newCreateClassifier :: CreateClassifier
newCreateClassifier =
CreateClassifier' :: Maybe CreateGrokClassifierRequest
-> Maybe CreateXMLClassifierRequest
-> Maybe CreateCsvClassifierRequest
-> Maybe CreateJsonClassifierRequest
-> CreateClassifier
CreateClassifier'
{ $sel:grokClassifier:CreateClassifier' :: Maybe CreateGrokClassifierRequest
grokClassifier = Maybe CreateGrokClassifierRequest
forall a. Maybe a
Prelude.Nothing,
$sel:xMLClassifier:CreateClassifier' :: Maybe CreateXMLClassifierRequest
xMLClassifier = Maybe CreateXMLClassifierRequest
forall a. Maybe a
Prelude.Nothing,
$sel:csvClassifier:CreateClassifier' :: Maybe CreateCsvClassifierRequest
csvClassifier = Maybe CreateCsvClassifierRequest
forall a. Maybe a
Prelude.Nothing,
$sel:jsonClassifier:CreateClassifier' :: Maybe CreateJsonClassifierRequest
jsonClassifier = Maybe CreateJsonClassifierRequest
forall a. Maybe a
Prelude.Nothing
}
createClassifier_grokClassifier :: Lens.Lens' CreateClassifier (Prelude.Maybe CreateGrokClassifierRequest)
createClassifier_grokClassifier :: (Maybe CreateGrokClassifierRequest
-> f (Maybe CreateGrokClassifierRequest))
-> CreateClassifier -> f CreateClassifier
createClassifier_grokClassifier = (CreateClassifier -> Maybe CreateGrokClassifierRequest)
-> (CreateClassifier
-> Maybe CreateGrokClassifierRequest -> CreateClassifier)
-> Lens
CreateClassifier
CreateClassifier
(Maybe CreateGrokClassifierRequest)
(Maybe CreateGrokClassifierRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClassifier' {Maybe CreateGrokClassifierRequest
grokClassifier :: Maybe CreateGrokClassifierRequest
$sel:grokClassifier:CreateClassifier' :: CreateClassifier -> Maybe CreateGrokClassifierRequest
grokClassifier} -> Maybe CreateGrokClassifierRequest
grokClassifier) (\s :: CreateClassifier
s@CreateClassifier' {} Maybe CreateGrokClassifierRequest
a -> CreateClassifier
s {$sel:grokClassifier:CreateClassifier' :: Maybe CreateGrokClassifierRequest
grokClassifier = Maybe CreateGrokClassifierRequest
a} :: CreateClassifier)
createClassifier_xMLClassifier :: Lens.Lens' CreateClassifier (Prelude.Maybe CreateXMLClassifierRequest)
createClassifier_xMLClassifier :: (Maybe CreateXMLClassifierRequest
-> f (Maybe CreateXMLClassifierRequest))
-> CreateClassifier -> f CreateClassifier
createClassifier_xMLClassifier = (CreateClassifier -> Maybe CreateXMLClassifierRequest)
-> (CreateClassifier
-> Maybe CreateXMLClassifierRequest -> CreateClassifier)
-> Lens
CreateClassifier
CreateClassifier
(Maybe CreateXMLClassifierRequest)
(Maybe CreateXMLClassifierRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClassifier' {Maybe CreateXMLClassifierRequest
xMLClassifier :: Maybe CreateXMLClassifierRequest
$sel:xMLClassifier:CreateClassifier' :: CreateClassifier -> Maybe CreateXMLClassifierRequest
xMLClassifier} -> Maybe CreateXMLClassifierRequest
xMLClassifier) (\s :: CreateClassifier
s@CreateClassifier' {} Maybe CreateXMLClassifierRequest
a -> CreateClassifier
s {$sel:xMLClassifier:CreateClassifier' :: Maybe CreateXMLClassifierRequest
xMLClassifier = Maybe CreateXMLClassifierRequest
a} :: CreateClassifier)
createClassifier_csvClassifier :: Lens.Lens' CreateClassifier (Prelude.Maybe CreateCsvClassifierRequest)
createClassifier_csvClassifier :: (Maybe CreateCsvClassifierRequest
-> f (Maybe CreateCsvClassifierRequest))
-> CreateClassifier -> f CreateClassifier
createClassifier_csvClassifier = (CreateClassifier -> Maybe CreateCsvClassifierRequest)
-> (CreateClassifier
-> Maybe CreateCsvClassifierRequest -> CreateClassifier)
-> Lens
CreateClassifier
CreateClassifier
(Maybe CreateCsvClassifierRequest)
(Maybe CreateCsvClassifierRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClassifier' {Maybe CreateCsvClassifierRequest
csvClassifier :: Maybe CreateCsvClassifierRequest
$sel:csvClassifier:CreateClassifier' :: CreateClassifier -> Maybe CreateCsvClassifierRequest
csvClassifier} -> Maybe CreateCsvClassifierRequest
csvClassifier) (\s :: CreateClassifier
s@CreateClassifier' {} Maybe CreateCsvClassifierRequest
a -> CreateClassifier
s {$sel:csvClassifier:CreateClassifier' :: Maybe CreateCsvClassifierRequest
csvClassifier = Maybe CreateCsvClassifierRequest
a} :: CreateClassifier)
createClassifier_jsonClassifier :: Lens.Lens' CreateClassifier (Prelude.Maybe CreateJsonClassifierRequest)
createClassifier_jsonClassifier :: (Maybe CreateJsonClassifierRequest
-> f (Maybe CreateJsonClassifierRequest))
-> CreateClassifier -> f CreateClassifier
createClassifier_jsonClassifier = (CreateClassifier -> Maybe CreateJsonClassifierRequest)
-> (CreateClassifier
-> Maybe CreateJsonClassifierRequest -> CreateClassifier)
-> Lens
CreateClassifier
CreateClassifier
(Maybe CreateJsonClassifierRequest)
(Maybe CreateJsonClassifierRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClassifier' {Maybe CreateJsonClassifierRequest
jsonClassifier :: Maybe CreateJsonClassifierRequest
$sel:jsonClassifier:CreateClassifier' :: CreateClassifier -> Maybe CreateJsonClassifierRequest
jsonClassifier} -> Maybe CreateJsonClassifierRequest
jsonClassifier) (\s :: CreateClassifier
s@CreateClassifier' {} Maybe CreateJsonClassifierRequest
a -> CreateClassifier
s {$sel:jsonClassifier:CreateClassifier' :: Maybe CreateJsonClassifierRequest
jsonClassifier = Maybe CreateJsonClassifierRequest
a} :: CreateClassifier)
instance Core.AWSRequest CreateClassifier where
type
AWSResponse CreateClassifier =
CreateClassifierResponse
request :: CreateClassifier -> Request CreateClassifier
request = Service -> CreateClassifier -> Request CreateClassifier
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateClassifier
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateClassifier)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CreateClassifier))
-> Logger
-> Service
-> Proxy CreateClassifier
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateClassifier)))
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 -> CreateClassifierResponse
CreateClassifierResponse'
(Int -> CreateClassifierResponse)
-> Either String Int -> Either String CreateClassifierResponse
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 CreateClassifier
instance Prelude.NFData CreateClassifier
instance Core.ToHeaders CreateClassifier where
toHeaders :: CreateClassifier -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateClassifier -> 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
"AWSGlue.CreateClassifier" :: 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 CreateClassifier where
toJSON :: CreateClassifier -> Value
toJSON CreateClassifier' {Maybe CreateGrokClassifierRequest
Maybe CreateJsonClassifierRequest
Maybe CreateXMLClassifierRequest
Maybe CreateCsvClassifierRequest
jsonClassifier :: Maybe CreateJsonClassifierRequest
csvClassifier :: Maybe CreateCsvClassifierRequest
xMLClassifier :: Maybe CreateXMLClassifierRequest
grokClassifier :: Maybe CreateGrokClassifierRequest
$sel:jsonClassifier:CreateClassifier' :: CreateClassifier -> Maybe CreateJsonClassifierRequest
$sel:csvClassifier:CreateClassifier' :: CreateClassifier -> Maybe CreateCsvClassifierRequest
$sel:xMLClassifier:CreateClassifier' :: CreateClassifier -> Maybe CreateXMLClassifierRequest
$sel:grokClassifier:CreateClassifier' :: CreateClassifier -> Maybe CreateGrokClassifierRequest
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"GrokClassifier" Text -> CreateGrokClassifierRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CreateGrokClassifierRequest -> Pair)
-> Maybe CreateGrokClassifierRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CreateGrokClassifierRequest
grokClassifier,
(Text
"XMLClassifier" Text -> CreateXMLClassifierRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CreateXMLClassifierRequest -> Pair)
-> Maybe CreateXMLClassifierRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CreateXMLClassifierRequest
xMLClassifier,
(Text
"CsvClassifier" Text -> CreateCsvClassifierRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CreateCsvClassifierRequest -> Pair)
-> Maybe CreateCsvClassifierRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CreateCsvClassifierRequest
csvClassifier,
(Text
"JsonClassifier" Text -> CreateJsonClassifierRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CreateJsonClassifierRequest -> Pair)
-> Maybe CreateJsonClassifierRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CreateJsonClassifierRequest
jsonClassifier
]
)
instance Core.ToPath CreateClassifier where
toPath :: CreateClassifier -> ByteString
toPath = ByteString -> CreateClassifier -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateClassifier where
toQuery :: CreateClassifier -> QueryString
toQuery = QueryString -> CreateClassifier -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateClassifierResponse = CreateClassifierResponse'
{
CreateClassifierResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateClassifierResponse -> CreateClassifierResponse -> Bool
(CreateClassifierResponse -> CreateClassifierResponse -> Bool)
-> (CreateClassifierResponse -> CreateClassifierResponse -> Bool)
-> Eq CreateClassifierResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClassifierResponse -> CreateClassifierResponse -> Bool
$c/= :: CreateClassifierResponse -> CreateClassifierResponse -> Bool
== :: CreateClassifierResponse -> CreateClassifierResponse -> Bool
$c== :: CreateClassifierResponse -> CreateClassifierResponse -> Bool
Prelude.Eq, ReadPrec [CreateClassifierResponse]
ReadPrec CreateClassifierResponse
Int -> ReadS CreateClassifierResponse
ReadS [CreateClassifierResponse]
(Int -> ReadS CreateClassifierResponse)
-> ReadS [CreateClassifierResponse]
-> ReadPrec CreateClassifierResponse
-> ReadPrec [CreateClassifierResponse]
-> Read CreateClassifierResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClassifierResponse]
$creadListPrec :: ReadPrec [CreateClassifierResponse]
readPrec :: ReadPrec CreateClassifierResponse
$creadPrec :: ReadPrec CreateClassifierResponse
readList :: ReadS [CreateClassifierResponse]
$creadList :: ReadS [CreateClassifierResponse]
readsPrec :: Int -> ReadS CreateClassifierResponse
$creadsPrec :: Int -> ReadS CreateClassifierResponse
Prelude.Read, Int -> CreateClassifierResponse -> ShowS
[CreateClassifierResponse] -> ShowS
CreateClassifierResponse -> String
(Int -> CreateClassifierResponse -> ShowS)
-> (CreateClassifierResponse -> String)
-> ([CreateClassifierResponse] -> ShowS)
-> Show CreateClassifierResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClassifierResponse] -> ShowS
$cshowList :: [CreateClassifierResponse] -> ShowS
show :: CreateClassifierResponse -> String
$cshow :: CreateClassifierResponse -> String
showsPrec :: Int -> CreateClassifierResponse -> ShowS
$cshowsPrec :: Int -> CreateClassifierResponse -> ShowS
Prelude.Show, (forall x.
CreateClassifierResponse -> Rep CreateClassifierResponse x)
-> (forall x.
Rep CreateClassifierResponse x -> CreateClassifierResponse)
-> Generic CreateClassifierResponse
forall x.
Rep CreateClassifierResponse x -> CreateClassifierResponse
forall x.
CreateClassifierResponse -> Rep CreateClassifierResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateClassifierResponse x -> CreateClassifierResponse
$cfrom :: forall x.
CreateClassifierResponse -> Rep CreateClassifierResponse x
Prelude.Generic)
newCreateClassifierResponse ::
Prelude.Int ->
CreateClassifierResponse
newCreateClassifierResponse :: Int -> CreateClassifierResponse
newCreateClassifierResponse Int
pHttpStatus_ =
CreateClassifierResponse' :: Int -> CreateClassifierResponse
CreateClassifierResponse'
{ $sel:httpStatus:CreateClassifierResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createClassifierResponse_httpStatus :: Lens.Lens' CreateClassifierResponse Prelude.Int
createClassifierResponse_httpStatus :: (Int -> f Int)
-> CreateClassifierResponse -> f CreateClassifierResponse
createClassifierResponse_httpStatus = (CreateClassifierResponse -> Int)
-> (CreateClassifierResponse -> Int -> CreateClassifierResponse)
-> Lens CreateClassifierResponse CreateClassifierResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClassifierResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateClassifierResponse' :: CreateClassifierResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateClassifierResponse
s@CreateClassifierResponse' {} Int
a -> CreateClassifierResponse
s {$sel:httpStatus:CreateClassifierResponse' :: Int
httpStatus = Int
a} :: CreateClassifierResponse)
instance Prelude.NFData CreateClassifierResponse