{-# 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.ApplicationInsights.DescribeComponent
(
DescribeComponent (..),
newDescribeComponent,
describeComponent_resourceGroupName,
describeComponent_componentName,
DescribeComponentResponse (..),
newDescribeComponentResponse,
describeComponentResponse_applicationComponent,
describeComponentResponse_resourceList,
describeComponentResponse_httpStatus,
)
where
import Amazonka.ApplicationInsights.Types
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
data DescribeComponent = DescribeComponent'
{
DescribeComponent -> Text
resourceGroupName :: Prelude.Text,
DescribeComponent -> Text
componentName :: Prelude.Text
}
deriving (DescribeComponent -> DescribeComponent -> Bool
(DescribeComponent -> DescribeComponent -> Bool)
-> (DescribeComponent -> DescribeComponent -> Bool)
-> Eq DescribeComponent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeComponent -> DescribeComponent -> Bool
$c/= :: DescribeComponent -> DescribeComponent -> Bool
== :: DescribeComponent -> DescribeComponent -> Bool
$c== :: DescribeComponent -> DescribeComponent -> Bool
Prelude.Eq, ReadPrec [DescribeComponent]
ReadPrec DescribeComponent
Int -> ReadS DescribeComponent
ReadS [DescribeComponent]
(Int -> ReadS DescribeComponent)
-> ReadS [DescribeComponent]
-> ReadPrec DescribeComponent
-> ReadPrec [DescribeComponent]
-> Read DescribeComponent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeComponent]
$creadListPrec :: ReadPrec [DescribeComponent]
readPrec :: ReadPrec DescribeComponent
$creadPrec :: ReadPrec DescribeComponent
readList :: ReadS [DescribeComponent]
$creadList :: ReadS [DescribeComponent]
readsPrec :: Int -> ReadS DescribeComponent
$creadsPrec :: Int -> ReadS DescribeComponent
Prelude.Read, Int -> DescribeComponent -> ShowS
[DescribeComponent] -> ShowS
DescribeComponent -> String
(Int -> DescribeComponent -> ShowS)
-> (DescribeComponent -> String)
-> ([DescribeComponent] -> ShowS)
-> Show DescribeComponent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeComponent] -> ShowS
$cshowList :: [DescribeComponent] -> ShowS
show :: DescribeComponent -> String
$cshow :: DescribeComponent -> String
showsPrec :: Int -> DescribeComponent -> ShowS
$cshowsPrec :: Int -> DescribeComponent -> ShowS
Prelude.Show, (forall x. DescribeComponent -> Rep DescribeComponent x)
-> (forall x. Rep DescribeComponent x -> DescribeComponent)
-> Generic DescribeComponent
forall x. Rep DescribeComponent x -> DescribeComponent
forall x. DescribeComponent -> Rep DescribeComponent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeComponent x -> DescribeComponent
$cfrom :: forall x. DescribeComponent -> Rep DescribeComponent x
Prelude.Generic)
newDescribeComponent ::
Prelude.Text ->
Prelude.Text ->
DescribeComponent
newDescribeComponent :: Text -> Text -> DescribeComponent
newDescribeComponent
Text
pResourceGroupName_
Text
pComponentName_ =
DescribeComponent' :: Text -> Text -> DescribeComponent
DescribeComponent'
{ $sel:resourceGroupName:DescribeComponent' :: Text
resourceGroupName =
Text
pResourceGroupName_,
$sel:componentName:DescribeComponent' :: Text
componentName = Text
pComponentName_
}
describeComponent_resourceGroupName :: Lens.Lens' DescribeComponent Prelude.Text
describeComponent_resourceGroupName :: (Text -> f Text) -> DescribeComponent -> f DescribeComponent
describeComponent_resourceGroupName = (DescribeComponent -> Text)
-> (DescribeComponent -> Text -> DescribeComponent)
-> Lens DescribeComponent DescribeComponent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeComponent' {Text
resourceGroupName :: Text
$sel:resourceGroupName:DescribeComponent' :: DescribeComponent -> Text
resourceGroupName} -> Text
resourceGroupName) (\s :: DescribeComponent
s@DescribeComponent' {} Text
a -> DescribeComponent
s {$sel:resourceGroupName:DescribeComponent' :: Text
resourceGroupName = Text
a} :: DescribeComponent)
describeComponent_componentName :: Lens.Lens' DescribeComponent Prelude.Text
describeComponent_componentName :: (Text -> f Text) -> DescribeComponent -> f DescribeComponent
describeComponent_componentName = (DescribeComponent -> Text)
-> (DescribeComponent -> Text -> DescribeComponent)
-> Lens DescribeComponent DescribeComponent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeComponent' {Text
componentName :: Text
$sel:componentName:DescribeComponent' :: DescribeComponent -> Text
componentName} -> Text
componentName) (\s :: DescribeComponent
s@DescribeComponent' {} Text
a -> DescribeComponent
s {$sel:componentName:DescribeComponent' :: Text
componentName = Text
a} :: DescribeComponent)
instance Core.AWSRequest DescribeComponent where
type
AWSResponse DescribeComponent =
DescribeComponentResponse
request :: DescribeComponent -> Request DescribeComponent
request = Service -> DescribeComponent -> Request DescribeComponent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeComponent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeComponent)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeComponent))
-> Logger
-> Service
-> Proxy DescribeComponent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeComponent)))
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 ApplicationComponent
-> Maybe [Text] -> Int -> DescribeComponentResponse
DescribeComponentResponse'
(Maybe ApplicationComponent
-> Maybe [Text] -> Int -> DescribeComponentResponse)
-> Either String (Maybe ApplicationComponent)
-> Either String (Maybe [Text] -> Int -> DescribeComponentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ApplicationComponent)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ApplicationComponent")
Either String (Maybe [Text] -> Int -> DescribeComponentResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> DescribeComponentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResourceList" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DescribeComponentResponse)
-> Either String Int -> Either String DescribeComponentResponse
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 DescribeComponent
instance Prelude.NFData DescribeComponent
instance Core.ToHeaders DescribeComponent where
toHeaders :: DescribeComponent -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeComponent -> 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
"EC2WindowsBarleyService.DescribeComponent" ::
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 DescribeComponent where
toJSON :: DescribeComponent -> Value
toJSON DescribeComponent' {Text
componentName :: Text
resourceGroupName :: Text
$sel:componentName:DescribeComponent' :: DescribeComponent -> Text
$sel:resourceGroupName:DescribeComponent' :: DescribeComponent -> 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
"ResourceGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceGroupName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ComponentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
componentName)
]
)
instance Core.ToPath DescribeComponent where
toPath :: DescribeComponent -> ByteString
toPath = ByteString -> DescribeComponent -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeComponent where
toQuery :: DescribeComponent -> QueryString
toQuery = QueryString -> DescribeComponent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeComponentResponse = DescribeComponentResponse'
{ DescribeComponentResponse -> Maybe ApplicationComponent
applicationComponent :: Prelude.Maybe ApplicationComponent,
DescribeComponentResponse -> Maybe [Text]
resourceList :: Prelude.Maybe [Prelude.Text],
DescribeComponentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeComponentResponse -> DescribeComponentResponse -> Bool
(DescribeComponentResponse -> DescribeComponentResponse -> Bool)
-> (DescribeComponentResponse -> DescribeComponentResponse -> Bool)
-> Eq DescribeComponentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeComponentResponse -> DescribeComponentResponse -> Bool
$c/= :: DescribeComponentResponse -> DescribeComponentResponse -> Bool
== :: DescribeComponentResponse -> DescribeComponentResponse -> Bool
$c== :: DescribeComponentResponse -> DescribeComponentResponse -> Bool
Prelude.Eq, ReadPrec [DescribeComponentResponse]
ReadPrec DescribeComponentResponse
Int -> ReadS DescribeComponentResponse
ReadS [DescribeComponentResponse]
(Int -> ReadS DescribeComponentResponse)
-> ReadS [DescribeComponentResponse]
-> ReadPrec DescribeComponentResponse
-> ReadPrec [DescribeComponentResponse]
-> Read DescribeComponentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeComponentResponse]
$creadListPrec :: ReadPrec [DescribeComponentResponse]
readPrec :: ReadPrec DescribeComponentResponse
$creadPrec :: ReadPrec DescribeComponentResponse
readList :: ReadS [DescribeComponentResponse]
$creadList :: ReadS [DescribeComponentResponse]
readsPrec :: Int -> ReadS DescribeComponentResponse
$creadsPrec :: Int -> ReadS DescribeComponentResponse
Prelude.Read, Int -> DescribeComponentResponse -> ShowS
[DescribeComponentResponse] -> ShowS
DescribeComponentResponse -> String
(Int -> DescribeComponentResponse -> ShowS)
-> (DescribeComponentResponse -> String)
-> ([DescribeComponentResponse] -> ShowS)
-> Show DescribeComponentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeComponentResponse] -> ShowS
$cshowList :: [DescribeComponentResponse] -> ShowS
show :: DescribeComponentResponse -> String
$cshow :: DescribeComponentResponse -> String
showsPrec :: Int -> DescribeComponentResponse -> ShowS
$cshowsPrec :: Int -> DescribeComponentResponse -> ShowS
Prelude.Show, (forall x.
DescribeComponentResponse -> Rep DescribeComponentResponse x)
-> (forall x.
Rep DescribeComponentResponse x -> DescribeComponentResponse)
-> Generic DescribeComponentResponse
forall x.
Rep DescribeComponentResponse x -> DescribeComponentResponse
forall x.
DescribeComponentResponse -> Rep DescribeComponentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeComponentResponse x -> DescribeComponentResponse
$cfrom :: forall x.
DescribeComponentResponse -> Rep DescribeComponentResponse x
Prelude.Generic)
newDescribeComponentResponse ::
Prelude.Int ->
DescribeComponentResponse
newDescribeComponentResponse :: Int -> DescribeComponentResponse
newDescribeComponentResponse Int
pHttpStatus_ =
DescribeComponentResponse' :: Maybe ApplicationComponent
-> Maybe [Text] -> Int -> DescribeComponentResponse
DescribeComponentResponse'
{ $sel:applicationComponent:DescribeComponentResponse' :: Maybe ApplicationComponent
applicationComponent =
Maybe ApplicationComponent
forall a. Maybe a
Prelude.Nothing,
$sel:resourceList:DescribeComponentResponse' :: Maybe [Text]
resourceList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeComponentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeComponentResponse_applicationComponent :: Lens.Lens' DescribeComponentResponse (Prelude.Maybe ApplicationComponent)
describeComponentResponse_applicationComponent :: (Maybe ApplicationComponent -> f (Maybe ApplicationComponent))
-> DescribeComponentResponse -> f DescribeComponentResponse
describeComponentResponse_applicationComponent = (DescribeComponentResponse -> Maybe ApplicationComponent)
-> (DescribeComponentResponse
-> Maybe ApplicationComponent -> DescribeComponentResponse)
-> Lens
DescribeComponentResponse
DescribeComponentResponse
(Maybe ApplicationComponent)
(Maybe ApplicationComponent)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeComponentResponse' {Maybe ApplicationComponent
applicationComponent :: Maybe ApplicationComponent
$sel:applicationComponent:DescribeComponentResponse' :: DescribeComponentResponse -> Maybe ApplicationComponent
applicationComponent} -> Maybe ApplicationComponent
applicationComponent) (\s :: DescribeComponentResponse
s@DescribeComponentResponse' {} Maybe ApplicationComponent
a -> DescribeComponentResponse
s {$sel:applicationComponent:DescribeComponentResponse' :: Maybe ApplicationComponent
applicationComponent = Maybe ApplicationComponent
a} :: DescribeComponentResponse)
describeComponentResponse_resourceList :: Lens.Lens' DescribeComponentResponse (Prelude.Maybe [Prelude.Text])
describeComponentResponse_resourceList :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeComponentResponse -> f DescribeComponentResponse
describeComponentResponse_resourceList = (DescribeComponentResponse -> Maybe [Text])
-> (DescribeComponentResponse
-> Maybe [Text] -> DescribeComponentResponse)
-> Lens
DescribeComponentResponse
DescribeComponentResponse
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeComponentResponse' {Maybe [Text]
resourceList :: Maybe [Text]
$sel:resourceList:DescribeComponentResponse' :: DescribeComponentResponse -> Maybe [Text]
resourceList} -> Maybe [Text]
resourceList) (\s :: DescribeComponentResponse
s@DescribeComponentResponse' {} Maybe [Text]
a -> DescribeComponentResponse
s {$sel:resourceList:DescribeComponentResponse' :: Maybe [Text]
resourceList = Maybe [Text]
a} :: DescribeComponentResponse) ((Maybe [Text] -> f (Maybe [Text]))
-> DescribeComponentResponse -> f DescribeComponentResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeComponentResponse
-> f DescribeComponentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeComponentResponse_httpStatus :: Lens.Lens' DescribeComponentResponse Prelude.Int
describeComponentResponse_httpStatus :: (Int -> f Int)
-> DescribeComponentResponse -> f DescribeComponentResponse
describeComponentResponse_httpStatus = (DescribeComponentResponse -> Int)
-> (DescribeComponentResponse -> Int -> DescribeComponentResponse)
-> Lens DescribeComponentResponse DescribeComponentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeComponentResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeComponentResponse' :: DescribeComponentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeComponentResponse
s@DescribeComponentResponse' {} Int
a -> DescribeComponentResponse
s {$sel:httpStatus:DescribeComponentResponse' :: Int
httpStatus = Int
a} :: DescribeComponentResponse)
instance Prelude.NFData DescribeComponentResponse