{-# 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.EKS.DescribeFargateProfile
(
DescribeFargateProfile (..),
newDescribeFargateProfile,
describeFargateProfile_clusterName,
describeFargateProfile_fargateProfileName,
DescribeFargateProfileResponse (..),
newDescribeFargateProfileResponse,
describeFargateProfileResponse_fargateProfile,
describeFargateProfileResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.EKS.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 DescribeFargateProfile = DescribeFargateProfile'
{
DescribeFargateProfile -> Text
clusterName :: Prelude.Text,
DescribeFargateProfile -> Text
fargateProfileName :: Prelude.Text
}
deriving (DescribeFargateProfile -> DescribeFargateProfile -> Bool
(DescribeFargateProfile -> DescribeFargateProfile -> Bool)
-> (DescribeFargateProfile -> DescribeFargateProfile -> Bool)
-> Eq DescribeFargateProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFargateProfile -> DescribeFargateProfile -> Bool
$c/= :: DescribeFargateProfile -> DescribeFargateProfile -> Bool
== :: DescribeFargateProfile -> DescribeFargateProfile -> Bool
$c== :: DescribeFargateProfile -> DescribeFargateProfile -> Bool
Prelude.Eq, ReadPrec [DescribeFargateProfile]
ReadPrec DescribeFargateProfile
Int -> ReadS DescribeFargateProfile
ReadS [DescribeFargateProfile]
(Int -> ReadS DescribeFargateProfile)
-> ReadS [DescribeFargateProfile]
-> ReadPrec DescribeFargateProfile
-> ReadPrec [DescribeFargateProfile]
-> Read DescribeFargateProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFargateProfile]
$creadListPrec :: ReadPrec [DescribeFargateProfile]
readPrec :: ReadPrec DescribeFargateProfile
$creadPrec :: ReadPrec DescribeFargateProfile
readList :: ReadS [DescribeFargateProfile]
$creadList :: ReadS [DescribeFargateProfile]
readsPrec :: Int -> ReadS DescribeFargateProfile
$creadsPrec :: Int -> ReadS DescribeFargateProfile
Prelude.Read, Int -> DescribeFargateProfile -> ShowS
[DescribeFargateProfile] -> ShowS
DescribeFargateProfile -> String
(Int -> DescribeFargateProfile -> ShowS)
-> (DescribeFargateProfile -> String)
-> ([DescribeFargateProfile] -> ShowS)
-> Show DescribeFargateProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFargateProfile] -> ShowS
$cshowList :: [DescribeFargateProfile] -> ShowS
show :: DescribeFargateProfile -> String
$cshow :: DescribeFargateProfile -> String
showsPrec :: Int -> DescribeFargateProfile -> ShowS
$cshowsPrec :: Int -> DescribeFargateProfile -> ShowS
Prelude.Show, (forall x. DescribeFargateProfile -> Rep DescribeFargateProfile x)
-> (forall x.
Rep DescribeFargateProfile x -> DescribeFargateProfile)
-> Generic DescribeFargateProfile
forall x. Rep DescribeFargateProfile x -> DescribeFargateProfile
forall x. DescribeFargateProfile -> Rep DescribeFargateProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFargateProfile x -> DescribeFargateProfile
$cfrom :: forall x. DescribeFargateProfile -> Rep DescribeFargateProfile x
Prelude.Generic)
newDescribeFargateProfile ::
Prelude.Text ->
Prelude.Text ->
DescribeFargateProfile
newDescribeFargateProfile :: Text -> Text -> DescribeFargateProfile
newDescribeFargateProfile
Text
pClusterName_
Text
pFargateProfileName_ =
DescribeFargateProfile' :: Text -> Text -> DescribeFargateProfile
DescribeFargateProfile'
{ $sel:clusterName:DescribeFargateProfile' :: Text
clusterName =
Text
pClusterName_,
$sel:fargateProfileName:DescribeFargateProfile' :: Text
fargateProfileName = Text
pFargateProfileName_
}
describeFargateProfile_clusterName :: Lens.Lens' DescribeFargateProfile Prelude.Text
describeFargateProfile_clusterName :: (Text -> f Text)
-> DescribeFargateProfile -> f DescribeFargateProfile
describeFargateProfile_clusterName = (DescribeFargateProfile -> Text)
-> (DescribeFargateProfile -> Text -> DescribeFargateProfile)
-> Lens DescribeFargateProfile DescribeFargateProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFargateProfile' {Text
clusterName :: Text
$sel:clusterName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
clusterName} -> Text
clusterName) (\s :: DescribeFargateProfile
s@DescribeFargateProfile' {} Text
a -> DescribeFargateProfile
s {$sel:clusterName:DescribeFargateProfile' :: Text
clusterName = Text
a} :: DescribeFargateProfile)
describeFargateProfile_fargateProfileName :: Lens.Lens' DescribeFargateProfile Prelude.Text
describeFargateProfile_fargateProfileName :: (Text -> f Text)
-> DescribeFargateProfile -> f DescribeFargateProfile
describeFargateProfile_fargateProfileName = (DescribeFargateProfile -> Text)
-> (DescribeFargateProfile -> Text -> DescribeFargateProfile)
-> Lens DescribeFargateProfile DescribeFargateProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFargateProfile' {Text
fargateProfileName :: Text
$sel:fargateProfileName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
fargateProfileName} -> Text
fargateProfileName) (\s :: DescribeFargateProfile
s@DescribeFargateProfile' {} Text
a -> DescribeFargateProfile
s {$sel:fargateProfileName:DescribeFargateProfile' :: Text
fargateProfileName = Text
a} :: DescribeFargateProfile)
instance Core.AWSRequest DescribeFargateProfile where
type
AWSResponse DescribeFargateProfile =
DescribeFargateProfileResponse
request :: DescribeFargateProfile -> Request DescribeFargateProfile
request = Service -> DescribeFargateProfile -> Request DescribeFargateProfile
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeFargateProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFargateProfile)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeFargateProfile))
-> Logger
-> Service
-> Proxy DescribeFargateProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFargateProfile)))
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 FargateProfile -> Int -> DescribeFargateProfileResponse
DescribeFargateProfileResponse'
(Maybe FargateProfile -> Int -> DescribeFargateProfileResponse)
-> Either String (Maybe FargateProfile)
-> Either String (Int -> DescribeFargateProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FargateProfile)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"fargateProfile")
Either String (Int -> DescribeFargateProfileResponse)
-> Either String Int
-> Either String DescribeFargateProfileResponse
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 DescribeFargateProfile
instance Prelude.NFData DescribeFargateProfile
instance Core.ToHeaders DescribeFargateProfile where
toHeaders :: DescribeFargateProfile -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeFargateProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DescribeFargateProfile where
toPath :: DescribeFargateProfile -> ByteString
toPath DescribeFargateProfile' {Text
fargateProfileName :: Text
clusterName :: Text
$sel:fargateProfileName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
$sel:clusterName:DescribeFargateProfile' :: DescribeFargateProfile -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/clusters/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
clusterName,
ByteString
"/fargate-profiles/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
fargateProfileName
]
instance Core.ToQuery DescribeFargateProfile where
toQuery :: DescribeFargateProfile -> QueryString
toQuery = QueryString -> DescribeFargateProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeFargateProfileResponse = DescribeFargateProfileResponse'
{
DescribeFargateProfileResponse -> Maybe FargateProfile
fargateProfile :: Prelude.Maybe FargateProfile,
DescribeFargateProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
(DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool)
-> (DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool)
-> Eq DescribeFargateProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
$c/= :: DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
== :: DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
$c== :: DescribeFargateProfileResponse
-> DescribeFargateProfileResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFargateProfileResponse]
ReadPrec DescribeFargateProfileResponse
Int -> ReadS DescribeFargateProfileResponse
ReadS [DescribeFargateProfileResponse]
(Int -> ReadS DescribeFargateProfileResponse)
-> ReadS [DescribeFargateProfileResponse]
-> ReadPrec DescribeFargateProfileResponse
-> ReadPrec [DescribeFargateProfileResponse]
-> Read DescribeFargateProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFargateProfileResponse]
$creadListPrec :: ReadPrec [DescribeFargateProfileResponse]
readPrec :: ReadPrec DescribeFargateProfileResponse
$creadPrec :: ReadPrec DescribeFargateProfileResponse
readList :: ReadS [DescribeFargateProfileResponse]
$creadList :: ReadS [DescribeFargateProfileResponse]
readsPrec :: Int -> ReadS DescribeFargateProfileResponse
$creadsPrec :: Int -> ReadS DescribeFargateProfileResponse
Prelude.Read, Int -> DescribeFargateProfileResponse -> ShowS
[DescribeFargateProfileResponse] -> ShowS
DescribeFargateProfileResponse -> String
(Int -> DescribeFargateProfileResponse -> ShowS)
-> (DescribeFargateProfileResponse -> String)
-> ([DescribeFargateProfileResponse] -> ShowS)
-> Show DescribeFargateProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFargateProfileResponse] -> ShowS
$cshowList :: [DescribeFargateProfileResponse] -> ShowS
show :: DescribeFargateProfileResponse -> String
$cshow :: DescribeFargateProfileResponse -> String
showsPrec :: Int -> DescribeFargateProfileResponse -> ShowS
$cshowsPrec :: Int -> DescribeFargateProfileResponse -> ShowS
Prelude.Show, (forall x.
DescribeFargateProfileResponse
-> Rep DescribeFargateProfileResponse x)
-> (forall x.
Rep DescribeFargateProfileResponse x
-> DescribeFargateProfileResponse)
-> Generic DescribeFargateProfileResponse
forall x.
Rep DescribeFargateProfileResponse x
-> DescribeFargateProfileResponse
forall x.
DescribeFargateProfileResponse
-> Rep DescribeFargateProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFargateProfileResponse x
-> DescribeFargateProfileResponse
$cfrom :: forall x.
DescribeFargateProfileResponse
-> Rep DescribeFargateProfileResponse x
Prelude.Generic)
newDescribeFargateProfileResponse ::
Prelude.Int ->
DescribeFargateProfileResponse
newDescribeFargateProfileResponse :: Int -> DescribeFargateProfileResponse
newDescribeFargateProfileResponse Int
pHttpStatus_ =
DescribeFargateProfileResponse' :: Maybe FargateProfile -> Int -> DescribeFargateProfileResponse
DescribeFargateProfileResponse'
{ $sel:fargateProfile:DescribeFargateProfileResponse' :: Maybe FargateProfile
fargateProfile =
Maybe FargateProfile
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeFargateProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeFargateProfileResponse_fargateProfile :: Lens.Lens' DescribeFargateProfileResponse (Prelude.Maybe FargateProfile)
describeFargateProfileResponse_fargateProfile :: (Maybe FargateProfile -> f (Maybe FargateProfile))
-> DescribeFargateProfileResponse
-> f DescribeFargateProfileResponse
describeFargateProfileResponse_fargateProfile = (DescribeFargateProfileResponse -> Maybe FargateProfile)
-> (DescribeFargateProfileResponse
-> Maybe FargateProfile -> DescribeFargateProfileResponse)
-> Lens
DescribeFargateProfileResponse
DescribeFargateProfileResponse
(Maybe FargateProfile)
(Maybe FargateProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFargateProfileResponse' {Maybe FargateProfile
fargateProfile :: Maybe FargateProfile
$sel:fargateProfile:DescribeFargateProfileResponse' :: DescribeFargateProfileResponse -> Maybe FargateProfile
fargateProfile} -> Maybe FargateProfile
fargateProfile) (\s :: DescribeFargateProfileResponse
s@DescribeFargateProfileResponse' {} Maybe FargateProfile
a -> DescribeFargateProfileResponse
s {$sel:fargateProfile:DescribeFargateProfileResponse' :: Maybe FargateProfile
fargateProfile = Maybe FargateProfile
a} :: DescribeFargateProfileResponse)
describeFargateProfileResponse_httpStatus :: Lens.Lens' DescribeFargateProfileResponse Prelude.Int
describeFargateProfileResponse_httpStatus :: (Int -> f Int)
-> DescribeFargateProfileResponse
-> f DescribeFargateProfileResponse
describeFargateProfileResponse_httpStatus = (DescribeFargateProfileResponse -> Int)
-> (DescribeFargateProfileResponse
-> Int -> DescribeFargateProfileResponse)
-> Lens
DescribeFargateProfileResponse
DescribeFargateProfileResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFargateProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFargateProfileResponse' :: DescribeFargateProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFargateProfileResponse
s@DescribeFargateProfileResponse' {} Int
a -> DescribeFargateProfileResponse
s {$sel:httpStatus:DescribeFargateProfileResponse' :: Int
httpStatus = Int
a} :: DescribeFargateProfileResponse)
instance
Prelude.NFData
DescribeFargateProfileResponse