{-# 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.SageMaker.DescribeWorkforce
(
DescribeWorkforce (..),
newDescribeWorkforce,
describeWorkforce_workforceName,
DescribeWorkforceResponse (..),
newDescribeWorkforceResponse,
describeWorkforceResponse_httpStatus,
describeWorkforceResponse_workforce,
)
where
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
import Amazonka.SageMaker.Types
data DescribeWorkforce = DescribeWorkforce'
{
DescribeWorkforce -> Text
workforceName :: Prelude.Text
}
deriving (DescribeWorkforce -> DescribeWorkforce -> Bool
(DescribeWorkforce -> DescribeWorkforce -> Bool)
-> (DescribeWorkforce -> DescribeWorkforce -> Bool)
-> Eq DescribeWorkforce
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeWorkforce -> DescribeWorkforce -> Bool
$c/= :: DescribeWorkforce -> DescribeWorkforce -> Bool
== :: DescribeWorkforce -> DescribeWorkforce -> Bool
$c== :: DescribeWorkforce -> DescribeWorkforce -> Bool
Prelude.Eq, ReadPrec [DescribeWorkforce]
ReadPrec DescribeWorkforce
Int -> ReadS DescribeWorkforce
ReadS [DescribeWorkforce]
(Int -> ReadS DescribeWorkforce)
-> ReadS [DescribeWorkforce]
-> ReadPrec DescribeWorkforce
-> ReadPrec [DescribeWorkforce]
-> Read DescribeWorkforce
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeWorkforce]
$creadListPrec :: ReadPrec [DescribeWorkforce]
readPrec :: ReadPrec DescribeWorkforce
$creadPrec :: ReadPrec DescribeWorkforce
readList :: ReadS [DescribeWorkforce]
$creadList :: ReadS [DescribeWorkforce]
readsPrec :: Int -> ReadS DescribeWorkforce
$creadsPrec :: Int -> ReadS DescribeWorkforce
Prelude.Read, Int -> DescribeWorkforce -> ShowS
[DescribeWorkforce] -> ShowS
DescribeWorkforce -> String
(Int -> DescribeWorkforce -> ShowS)
-> (DescribeWorkforce -> String)
-> ([DescribeWorkforce] -> ShowS)
-> Show DescribeWorkforce
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeWorkforce] -> ShowS
$cshowList :: [DescribeWorkforce] -> ShowS
show :: DescribeWorkforce -> String
$cshow :: DescribeWorkforce -> String
showsPrec :: Int -> DescribeWorkforce -> ShowS
$cshowsPrec :: Int -> DescribeWorkforce -> ShowS
Prelude.Show, (forall x. DescribeWorkforce -> Rep DescribeWorkforce x)
-> (forall x. Rep DescribeWorkforce x -> DescribeWorkforce)
-> Generic DescribeWorkforce
forall x. Rep DescribeWorkforce x -> DescribeWorkforce
forall x. DescribeWorkforce -> Rep DescribeWorkforce x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeWorkforce x -> DescribeWorkforce
$cfrom :: forall x. DescribeWorkforce -> Rep DescribeWorkforce x
Prelude.Generic)
newDescribeWorkforce ::
Prelude.Text ->
DescribeWorkforce
newDescribeWorkforce :: Text -> DescribeWorkforce
newDescribeWorkforce Text
pWorkforceName_ =
DescribeWorkforce' :: Text -> DescribeWorkforce
DescribeWorkforce' {$sel:workforceName:DescribeWorkforce' :: Text
workforceName = Text
pWorkforceName_}
describeWorkforce_workforceName :: Lens.Lens' DescribeWorkforce Prelude.Text
describeWorkforce_workforceName :: (Text -> f Text) -> DescribeWorkforce -> f DescribeWorkforce
describeWorkforce_workforceName = (DescribeWorkforce -> Text)
-> (DescribeWorkforce -> Text -> DescribeWorkforce)
-> Lens DescribeWorkforce DescribeWorkforce Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWorkforce' {Text
workforceName :: Text
$sel:workforceName:DescribeWorkforce' :: DescribeWorkforce -> Text
workforceName} -> Text
workforceName) (\s :: DescribeWorkforce
s@DescribeWorkforce' {} Text
a -> DescribeWorkforce
s {$sel:workforceName:DescribeWorkforce' :: Text
workforceName = Text
a} :: DescribeWorkforce)
instance Core.AWSRequest DescribeWorkforce where
type
AWSResponse DescribeWorkforce =
DescribeWorkforceResponse
request :: DescribeWorkforce -> Request DescribeWorkforce
request = Service -> DescribeWorkforce -> Request DescribeWorkforce
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeWorkforce
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeWorkforce)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeWorkforce))
-> Logger
-> Service
-> Proxy DescribeWorkforce
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeWorkforce)))
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 ->
Int -> Workforce -> DescribeWorkforceResponse
DescribeWorkforceResponse'
(Int -> Workforce -> DescribeWorkforceResponse)
-> Either String Int
-> Either String (Workforce -> DescribeWorkforceResponse)
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))
Either String (Workforce -> DescribeWorkforceResponse)
-> Either String Workforce
-> Either String DescribeWorkforceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Workforce
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Workforce")
)
instance Prelude.Hashable DescribeWorkforce
instance Prelude.NFData DescribeWorkforce
instance Core.ToHeaders DescribeWorkforce where
toHeaders :: DescribeWorkforce -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeWorkforce -> 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
"SageMaker.DescribeWorkforce" ::
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 DescribeWorkforce where
toJSON :: DescribeWorkforce -> Value
toJSON DescribeWorkforce' {Text
workforceName :: Text
$sel:workforceName:DescribeWorkforce' :: DescribeWorkforce -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"WorkforceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workforceName)
]
)
instance Core.ToPath DescribeWorkforce where
toPath :: DescribeWorkforce -> ByteString
toPath = ByteString -> DescribeWorkforce -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeWorkforce where
toQuery :: DescribeWorkforce -> QueryString
toQuery = QueryString -> DescribeWorkforce -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeWorkforceResponse = DescribeWorkforceResponse'
{
DescribeWorkforceResponse -> Int
httpStatus :: Prelude.Int,
DescribeWorkforceResponse -> Workforce
workforce :: Workforce
}
deriving (DescribeWorkforceResponse -> DescribeWorkforceResponse -> Bool
(DescribeWorkforceResponse -> DescribeWorkforceResponse -> Bool)
-> (DescribeWorkforceResponse -> DescribeWorkforceResponse -> Bool)
-> Eq DescribeWorkforceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeWorkforceResponse -> DescribeWorkforceResponse -> Bool
$c/= :: DescribeWorkforceResponse -> DescribeWorkforceResponse -> Bool
== :: DescribeWorkforceResponse -> DescribeWorkforceResponse -> Bool
$c== :: DescribeWorkforceResponse -> DescribeWorkforceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeWorkforceResponse]
ReadPrec DescribeWorkforceResponse
Int -> ReadS DescribeWorkforceResponse
ReadS [DescribeWorkforceResponse]
(Int -> ReadS DescribeWorkforceResponse)
-> ReadS [DescribeWorkforceResponse]
-> ReadPrec DescribeWorkforceResponse
-> ReadPrec [DescribeWorkforceResponse]
-> Read DescribeWorkforceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeWorkforceResponse]
$creadListPrec :: ReadPrec [DescribeWorkforceResponse]
readPrec :: ReadPrec DescribeWorkforceResponse
$creadPrec :: ReadPrec DescribeWorkforceResponse
readList :: ReadS [DescribeWorkforceResponse]
$creadList :: ReadS [DescribeWorkforceResponse]
readsPrec :: Int -> ReadS DescribeWorkforceResponse
$creadsPrec :: Int -> ReadS DescribeWorkforceResponse
Prelude.Read, Int -> DescribeWorkforceResponse -> ShowS
[DescribeWorkforceResponse] -> ShowS
DescribeWorkforceResponse -> String
(Int -> DescribeWorkforceResponse -> ShowS)
-> (DescribeWorkforceResponse -> String)
-> ([DescribeWorkforceResponse] -> ShowS)
-> Show DescribeWorkforceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeWorkforceResponse] -> ShowS
$cshowList :: [DescribeWorkforceResponse] -> ShowS
show :: DescribeWorkforceResponse -> String
$cshow :: DescribeWorkforceResponse -> String
showsPrec :: Int -> DescribeWorkforceResponse -> ShowS
$cshowsPrec :: Int -> DescribeWorkforceResponse -> ShowS
Prelude.Show, (forall x.
DescribeWorkforceResponse -> Rep DescribeWorkforceResponse x)
-> (forall x.
Rep DescribeWorkforceResponse x -> DescribeWorkforceResponse)
-> Generic DescribeWorkforceResponse
forall x.
Rep DescribeWorkforceResponse x -> DescribeWorkforceResponse
forall x.
DescribeWorkforceResponse -> Rep DescribeWorkforceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeWorkforceResponse x -> DescribeWorkforceResponse
$cfrom :: forall x.
DescribeWorkforceResponse -> Rep DescribeWorkforceResponse x
Prelude.Generic)
newDescribeWorkforceResponse ::
Prelude.Int ->
Workforce ->
DescribeWorkforceResponse
newDescribeWorkforceResponse :: Int -> Workforce -> DescribeWorkforceResponse
newDescribeWorkforceResponse Int
pHttpStatus_ Workforce
pWorkforce_ =
DescribeWorkforceResponse' :: Int -> Workforce -> DescribeWorkforceResponse
DescribeWorkforceResponse'
{ $sel:httpStatus:DescribeWorkforceResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:workforce:DescribeWorkforceResponse' :: Workforce
workforce = Workforce
pWorkforce_
}
describeWorkforceResponse_httpStatus :: Lens.Lens' DescribeWorkforceResponse Prelude.Int
describeWorkforceResponse_httpStatus :: (Int -> f Int)
-> DescribeWorkforceResponse -> f DescribeWorkforceResponse
describeWorkforceResponse_httpStatus = (DescribeWorkforceResponse -> Int)
-> (DescribeWorkforceResponse -> Int -> DescribeWorkforceResponse)
-> Lens DescribeWorkforceResponse DescribeWorkforceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWorkforceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeWorkforceResponse' :: DescribeWorkforceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeWorkforceResponse
s@DescribeWorkforceResponse' {} Int
a -> DescribeWorkforceResponse
s {$sel:httpStatus:DescribeWorkforceResponse' :: Int
httpStatus = Int
a} :: DescribeWorkforceResponse)
describeWorkforceResponse_workforce :: Lens.Lens' DescribeWorkforceResponse Workforce
describeWorkforceResponse_workforce :: (Workforce -> f Workforce)
-> DescribeWorkforceResponse -> f DescribeWorkforceResponse
describeWorkforceResponse_workforce = (DescribeWorkforceResponse -> Workforce)
-> (DescribeWorkforceResponse
-> Workforce -> DescribeWorkforceResponse)
-> Lens
DescribeWorkforceResponse
DescribeWorkforceResponse
Workforce
Workforce
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWorkforceResponse' {Workforce
workforce :: Workforce
$sel:workforce:DescribeWorkforceResponse' :: DescribeWorkforceResponse -> Workforce
workforce} -> Workforce
workforce) (\s :: DescribeWorkforceResponse
s@DescribeWorkforceResponse' {} Workforce
a -> DescribeWorkforceResponse
s {$sel:workforce:DescribeWorkforceResponse' :: Workforce
workforce = Workforce
a} :: DescribeWorkforceResponse)
instance Prelude.NFData DescribeWorkforceResponse