{-# 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.GetCustomEntityType
(
GetCustomEntityType (..),
newGetCustomEntityType,
getCustomEntityType_name,
GetCustomEntityTypeResponse (..),
newGetCustomEntityTypeResponse,
getCustomEntityTypeResponse_contextWords,
getCustomEntityTypeResponse_name,
getCustomEntityTypeResponse_regexString,
getCustomEntityTypeResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetCustomEntityType = GetCustomEntityType'
{
GetCustomEntityType -> Text
name :: Prelude.Text
}
deriving (GetCustomEntityType -> GetCustomEntityType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCustomEntityType -> GetCustomEntityType -> Bool
$c/= :: GetCustomEntityType -> GetCustomEntityType -> Bool
== :: GetCustomEntityType -> GetCustomEntityType -> Bool
$c== :: GetCustomEntityType -> GetCustomEntityType -> Bool
Prelude.Eq, ReadPrec [GetCustomEntityType]
ReadPrec GetCustomEntityType
Int -> ReadS GetCustomEntityType
ReadS [GetCustomEntityType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCustomEntityType]
$creadListPrec :: ReadPrec [GetCustomEntityType]
readPrec :: ReadPrec GetCustomEntityType
$creadPrec :: ReadPrec GetCustomEntityType
readList :: ReadS [GetCustomEntityType]
$creadList :: ReadS [GetCustomEntityType]
readsPrec :: Int -> ReadS GetCustomEntityType
$creadsPrec :: Int -> ReadS GetCustomEntityType
Prelude.Read, Int -> GetCustomEntityType -> ShowS
[GetCustomEntityType] -> ShowS
GetCustomEntityType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCustomEntityType] -> ShowS
$cshowList :: [GetCustomEntityType] -> ShowS
show :: GetCustomEntityType -> String
$cshow :: GetCustomEntityType -> String
showsPrec :: Int -> GetCustomEntityType -> ShowS
$cshowsPrec :: Int -> GetCustomEntityType -> ShowS
Prelude.Show, forall x. Rep GetCustomEntityType x -> GetCustomEntityType
forall x. GetCustomEntityType -> Rep GetCustomEntityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCustomEntityType x -> GetCustomEntityType
$cfrom :: forall x. GetCustomEntityType -> Rep GetCustomEntityType x
Prelude.Generic)
newGetCustomEntityType ::
Prelude.Text ->
GetCustomEntityType
newGetCustomEntityType :: Text -> GetCustomEntityType
newGetCustomEntityType Text
pName_ =
GetCustomEntityType' {$sel:name:GetCustomEntityType' :: Text
name = Text
pName_}
getCustomEntityType_name :: Lens.Lens' GetCustomEntityType Prelude.Text
getCustomEntityType_name :: Lens' GetCustomEntityType Text
getCustomEntityType_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomEntityType' {Text
name :: Text
$sel:name:GetCustomEntityType' :: GetCustomEntityType -> Text
name} -> Text
name) (\s :: GetCustomEntityType
s@GetCustomEntityType' {} Text
a -> GetCustomEntityType
s {$sel:name:GetCustomEntityType' :: Text
name = Text
a} :: GetCustomEntityType)
instance Core.AWSRequest GetCustomEntityType where
type
AWSResponse GetCustomEntityType =
GetCustomEntityTypeResponse
request :: (Service -> Service)
-> GetCustomEntityType -> Request GetCustomEntityType
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetCustomEntityType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetCustomEntityType)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe (NonEmpty Text)
-> Maybe Text -> Maybe Text -> Int -> GetCustomEntityTypeResponse
GetCustomEntityTypeResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ContextWords")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RegexString")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetCustomEntityType where
hashWithSalt :: Int -> GetCustomEntityType -> Int
hashWithSalt Int
_salt GetCustomEntityType' {Text
name :: Text
$sel:name:GetCustomEntityType' :: GetCustomEntityType -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData GetCustomEntityType where
rnf :: GetCustomEntityType -> ()
rnf GetCustomEntityType' {Text
name :: Text
$sel:name:GetCustomEntityType' :: GetCustomEntityType -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders GetCustomEntityType where
toHeaders :: GetCustomEntityType -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSGlue.GetCustomEntityType" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetCustomEntityType where
toJSON :: GetCustomEntityType -> Value
toJSON GetCustomEntityType' {Text
name :: Text
$sel:name:GetCustomEntityType' :: GetCustomEntityType -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)]
)
instance Data.ToPath GetCustomEntityType where
toPath :: GetCustomEntityType -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetCustomEntityType where
toQuery :: GetCustomEntityType -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetCustomEntityTypeResponse = GetCustomEntityTypeResponse'
{
GetCustomEntityTypeResponse -> Maybe (NonEmpty Text)
contextWords :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
GetCustomEntityTypeResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
GetCustomEntityTypeResponse -> Maybe Text
regexString :: Prelude.Maybe Prelude.Text,
GetCustomEntityTypeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetCustomEntityTypeResponse -> GetCustomEntityTypeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCustomEntityTypeResponse -> GetCustomEntityTypeResponse -> Bool
$c/= :: GetCustomEntityTypeResponse -> GetCustomEntityTypeResponse -> Bool
== :: GetCustomEntityTypeResponse -> GetCustomEntityTypeResponse -> Bool
$c== :: GetCustomEntityTypeResponse -> GetCustomEntityTypeResponse -> Bool
Prelude.Eq, ReadPrec [GetCustomEntityTypeResponse]
ReadPrec GetCustomEntityTypeResponse
Int -> ReadS GetCustomEntityTypeResponse
ReadS [GetCustomEntityTypeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCustomEntityTypeResponse]
$creadListPrec :: ReadPrec [GetCustomEntityTypeResponse]
readPrec :: ReadPrec GetCustomEntityTypeResponse
$creadPrec :: ReadPrec GetCustomEntityTypeResponse
readList :: ReadS [GetCustomEntityTypeResponse]
$creadList :: ReadS [GetCustomEntityTypeResponse]
readsPrec :: Int -> ReadS GetCustomEntityTypeResponse
$creadsPrec :: Int -> ReadS GetCustomEntityTypeResponse
Prelude.Read, Int -> GetCustomEntityTypeResponse -> ShowS
[GetCustomEntityTypeResponse] -> ShowS
GetCustomEntityTypeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCustomEntityTypeResponse] -> ShowS
$cshowList :: [GetCustomEntityTypeResponse] -> ShowS
show :: GetCustomEntityTypeResponse -> String
$cshow :: GetCustomEntityTypeResponse -> String
showsPrec :: Int -> GetCustomEntityTypeResponse -> ShowS
$cshowsPrec :: Int -> GetCustomEntityTypeResponse -> ShowS
Prelude.Show, forall x.
Rep GetCustomEntityTypeResponse x -> GetCustomEntityTypeResponse
forall x.
GetCustomEntityTypeResponse -> Rep GetCustomEntityTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCustomEntityTypeResponse x -> GetCustomEntityTypeResponse
$cfrom :: forall x.
GetCustomEntityTypeResponse -> Rep GetCustomEntityTypeResponse x
Prelude.Generic)
newGetCustomEntityTypeResponse ::
Prelude.Int ->
GetCustomEntityTypeResponse
newGetCustomEntityTypeResponse :: Int -> GetCustomEntityTypeResponse
newGetCustomEntityTypeResponse Int
pHttpStatus_ =
GetCustomEntityTypeResponse'
{ $sel:contextWords:GetCustomEntityTypeResponse' :: Maybe (NonEmpty Text)
contextWords =
forall a. Maybe a
Prelude.Nothing,
$sel:name:GetCustomEntityTypeResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:regexString:GetCustomEntityTypeResponse' :: Maybe Text
regexString = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetCustomEntityTypeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getCustomEntityTypeResponse_contextWords :: Lens.Lens' GetCustomEntityTypeResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
getCustomEntityTypeResponse_contextWords :: Lens' GetCustomEntityTypeResponse (Maybe (NonEmpty Text))
getCustomEntityTypeResponse_contextWords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomEntityTypeResponse' {Maybe (NonEmpty Text)
contextWords :: Maybe (NonEmpty Text)
$sel:contextWords:GetCustomEntityTypeResponse' :: GetCustomEntityTypeResponse -> Maybe (NonEmpty Text)
contextWords} -> Maybe (NonEmpty Text)
contextWords) (\s :: GetCustomEntityTypeResponse
s@GetCustomEntityTypeResponse' {} Maybe (NonEmpty Text)
a -> GetCustomEntityTypeResponse
s {$sel:contextWords:GetCustomEntityTypeResponse' :: Maybe (NonEmpty Text)
contextWords = Maybe (NonEmpty Text)
a} :: GetCustomEntityTypeResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getCustomEntityTypeResponse_name :: Lens.Lens' GetCustomEntityTypeResponse (Prelude.Maybe Prelude.Text)
getCustomEntityTypeResponse_name :: Lens' GetCustomEntityTypeResponse (Maybe Text)
getCustomEntityTypeResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomEntityTypeResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetCustomEntityTypeResponse' :: GetCustomEntityTypeResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetCustomEntityTypeResponse
s@GetCustomEntityTypeResponse' {} Maybe Text
a -> GetCustomEntityTypeResponse
s {$sel:name:GetCustomEntityTypeResponse' :: Maybe Text
name = Maybe Text
a} :: GetCustomEntityTypeResponse)
getCustomEntityTypeResponse_regexString :: Lens.Lens' GetCustomEntityTypeResponse (Prelude.Maybe Prelude.Text)
getCustomEntityTypeResponse_regexString :: Lens' GetCustomEntityTypeResponse (Maybe Text)
getCustomEntityTypeResponse_regexString = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomEntityTypeResponse' {Maybe Text
regexString :: Maybe Text
$sel:regexString:GetCustomEntityTypeResponse' :: GetCustomEntityTypeResponse -> Maybe Text
regexString} -> Maybe Text
regexString) (\s :: GetCustomEntityTypeResponse
s@GetCustomEntityTypeResponse' {} Maybe Text
a -> GetCustomEntityTypeResponse
s {$sel:regexString:GetCustomEntityTypeResponse' :: Maybe Text
regexString = Maybe Text
a} :: GetCustomEntityTypeResponse)
getCustomEntityTypeResponse_httpStatus :: Lens.Lens' GetCustomEntityTypeResponse Prelude.Int
getCustomEntityTypeResponse_httpStatus :: Lens' GetCustomEntityTypeResponse Int
getCustomEntityTypeResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomEntityTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCustomEntityTypeResponse' :: GetCustomEntityTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCustomEntityTypeResponse
s@GetCustomEntityTypeResponse' {} Int
a -> GetCustomEntityTypeResponse
s {$sel:httpStatus:GetCustomEntityTypeResponse' :: Int
httpStatus = Int
a} :: GetCustomEntityTypeResponse)
instance Prelude.NFData GetCustomEntityTypeResponse where
rnf :: GetCustomEntityTypeResponse -> ()
rnf GetCustomEntityTypeResponse' {Int
Maybe (NonEmpty Text)
Maybe Text
httpStatus :: Int
regexString :: Maybe Text
name :: Maybe Text
contextWords :: Maybe (NonEmpty Text)
$sel:httpStatus:GetCustomEntityTypeResponse' :: GetCustomEntityTypeResponse -> Int
$sel:regexString:GetCustomEntityTypeResponse' :: GetCustomEntityTypeResponse -> Maybe Text
$sel:name:GetCustomEntityTypeResponse' :: GetCustomEntityTypeResponse -> Maybe Text
$sel:contextWords:GetCustomEntityTypeResponse' :: GetCustomEntityTypeResponse -> Maybe (NonEmpty Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
contextWords
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
regexString
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus