{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:workforceName:DescribeWorkforce' :: Text
workforceName = Text
pWorkforceName_}
describeWorkforce_workforceName :: Lens.Lens' DescribeWorkforce Prelude.Text
describeWorkforce_workforceName :: Lens' DescribeWorkforce Text
describeWorkforce_workforceName = 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 :: (Service -> Service)
-> DescribeWorkforce -> Request DescribeWorkforce
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 DescribeWorkforce
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeWorkforce)))
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 ->
Int -> Workforce -> DescribeWorkforceResponse
DescribeWorkforceResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"Workforce")
)
instance Prelude.Hashable DescribeWorkforce where
hashWithSalt :: Int -> DescribeWorkforce -> Int
hashWithSalt Int
_salt DescribeWorkforce' {Text
workforceName :: Text
$sel:workforceName:DescribeWorkforce' :: DescribeWorkforce -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workforceName
instance Prelude.NFData DescribeWorkforce where
rnf :: DescribeWorkforce -> ()
rnf DescribeWorkforce' {Text
workforceName :: Text
$sel:workforceName:DescribeWorkforce' :: DescribeWorkforce -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
workforceName
instance Data.ToHeaders DescribeWorkforce where
toHeaders :: DescribeWorkforce -> 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
"SageMaker.DescribeWorkforce" ::
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 DescribeWorkforce where
toJSON :: DescribeWorkforce -> Value
toJSON DescribeWorkforce' {Text
workforceName :: Text
$sel:workforceName:DescribeWorkforce' :: DescribeWorkforce -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"WorkforceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
workforceName)
]
)
instance Data.ToPath DescribeWorkforce where
toPath :: DescribeWorkforce -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeWorkforce where
toQuery :: DescribeWorkforce -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeWorkforceResponse = DescribeWorkforceResponse'
{
DescribeWorkforceResponse -> Int
httpStatus :: Prelude.Int,
DescribeWorkforceResponse -> Workforce
workforce :: Workforce
}
deriving (DescribeWorkforceResponse -> DescribeWorkforceResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:DescribeWorkforceResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:workforce:DescribeWorkforceResponse' :: Workforce
workforce = Workforce
pWorkforce_
}
describeWorkforceResponse_httpStatus :: Lens.Lens' DescribeWorkforceResponse Prelude.Int
describeWorkforceResponse_httpStatus :: Lens' DescribeWorkforceResponse Int
describeWorkforceResponse_httpStatus = 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 :: Lens' DescribeWorkforceResponse Workforce
describeWorkforceResponse_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 where
rnf :: DescribeWorkforceResponse -> ()
rnf DescribeWorkforceResponse' {Int
Workforce
workforce :: Workforce
httpStatus :: Int
$sel:workforce:DescribeWorkforceResponse' :: DescribeWorkforceResponse -> Workforce
$sel:httpStatus:DescribeWorkforceResponse' :: DescribeWorkforceResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Workforce
workforce