{-# 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.Inspector2.GetConfiguration
(
GetConfiguration (..),
newGetConfiguration,
GetConfigurationResponse (..),
newGetConfigurationResponse,
getConfigurationResponse_ecrConfiguration,
getConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetConfiguration = GetConfiguration'
{
}
deriving (GetConfiguration -> GetConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetConfiguration -> GetConfiguration -> Bool
$c/= :: GetConfiguration -> GetConfiguration -> Bool
== :: GetConfiguration -> GetConfiguration -> Bool
$c== :: GetConfiguration -> GetConfiguration -> Bool
Prelude.Eq, ReadPrec [GetConfiguration]
ReadPrec GetConfiguration
Int -> ReadS GetConfiguration
ReadS [GetConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetConfiguration]
$creadListPrec :: ReadPrec [GetConfiguration]
readPrec :: ReadPrec GetConfiguration
$creadPrec :: ReadPrec GetConfiguration
readList :: ReadS [GetConfiguration]
$creadList :: ReadS [GetConfiguration]
readsPrec :: Int -> ReadS GetConfiguration
$creadsPrec :: Int -> ReadS GetConfiguration
Prelude.Read, Int -> GetConfiguration -> ShowS
[GetConfiguration] -> ShowS
GetConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetConfiguration] -> ShowS
$cshowList :: [GetConfiguration] -> ShowS
show :: GetConfiguration -> String
$cshow :: GetConfiguration -> String
showsPrec :: Int -> GetConfiguration -> ShowS
$cshowsPrec :: Int -> GetConfiguration -> ShowS
Prelude.Show, forall x. Rep GetConfiguration x -> GetConfiguration
forall x. GetConfiguration -> Rep GetConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetConfiguration x -> GetConfiguration
$cfrom :: forall x. GetConfiguration -> Rep GetConfiguration x
Prelude.Generic)
newGetConfiguration ::
GetConfiguration
newGetConfiguration :: GetConfiguration
newGetConfiguration = GetConfiguration
GetConfiguration'
instance Core.AWSRequest GetConfiguration where
type
AWSResponse GetConfiguration =
GetConfigurationResponse
request :: (Service -> Service)
-> GetConfiguration -> Request GetConfiguration
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 GetConfiguration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetConfiguration)))
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 EcrConfigurationState -> Int -> GetConfigurationResponse
GetConfigurationResponse'
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
"ecrConfiguration")
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 GetConfiguration where
hashWithSalt :: Int -> GetConfiguration -> Int
hashWithSalt Int
_salt GetConfiguration
_ =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()
instance Prelude.NFData GetConfiguration where
rnf :: GetConfiguration -> ()
rnf GetConfiguration
_ = ()
instance Data.ToHeaders GetConfiguration where
toHeaders :: GetConfiguration -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetConfiguration where
toJSON :: GetConfiguration -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath GetConfiguration where
toPath :: GetConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/configuration/get"
instance Data.ToQuery GetConfiguration where
toQuery :: GetConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetConfigurationResponse = GetConfigurationResponse'
{
GetConfigurationResponse -> Maybe EcrConfigurationState
ecrConfiguration :: Prelude.Maybe EcrConfigurationState,
GetConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetConfigurationResponse -> GetConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetConfigurationResponse -> GetConfigurationResponse -> Bool
$c/= :: GetConfigurationResponse -> GetConfigurationResponse -> Bool
== :: GetConfigurationResponse -> GetConfigurationResponse -> Bool
$c== :: GetConfigurationResponse -> GetConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetConfigurationResponse]
ReadPrec GetConfigurationResponse
Int -> ReadS GetConfigurationResponse
ReadS [GetConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetConfigurationResponse]
$creadListPrec :: ReadPrec [GetConfigurationResponse]
readPrec :: ReadPrec GetConfigurationResponse
$creadPrec :: ReadPrec GetConfigurationResponse
readList :: ReadS [GetConfigurationResponse]
$creadList :: ReadS [GetConfigurationResponse]
readsPrec :: Int -> ReadS GetConfigurationResponse
$creadsPrec :: Int -> ReadS GetConfigurationResponse
Prelude.Read, Int -> GetConfigurationResponse -> ShowS
[GetConfigurationResponse] -> ShowS
GetConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetConfigurationResponse] -> ShowS
$cshowList :: [GetConfigurationResponse] -> ShowS
show :: GetConfigurationResponse -> String
$cshow :: GetConfigurationResponse -> String
showsPrec :: Int -> GetConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep GetConfigurationResponse x -> GetConfigurationResponse
forall x.
GetConfigurationResponse -> Rep GetConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetConfigurationResponse x -> GetConfigurationResponse
$cfrom :: forall x.
GetConfigurationResponse -> Rep GetConfigurationResponse x
Prelude.Generic)
newGetConfigurationResponse ::
Prelude.Int ->
GetConfigurationResponse
newGetConfigurationResponse :: Int -> GetConfigurationResponse
newGetConfigurationResponse Int
pHttpStatus_ =
GetConfigurationResponse'
{ $sel:ecrConfiguration:GetConfigurationResponse' :: Maybe EcrConfigurationState
ecrConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getConfigurationResponse_ecrConfiguration :: Lens.Lens' GetConfigurationResponse (Prelude.Maybe EcrConfigurationState)
getConfigurationResponse_ecrConfiguration :: Lens' GetConfigurationResponse (Maybe EcrConfigurationState)
getConfigurationResponse_ecrConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfigurationResponse' {Maybe EcrConfigurationState
ecrConfiguration :: Maybe EcrConfigurationState
$sel:ecrConfiguration:GetConfigurationResponse' :: GetConfigurationResponse -> Maybe EcrConfigurationState
ecrConfiguration} -> Maybe EcrConfigurationState
ecrConfiguration) (\s :: GetConfigurationResponse
s@GetConfigurationResponse' {} Maybe EcrConfigurationState
a -> GetConfigurationResponse
s {$sel:ecrConfiguration:GetConfigurationResponse' :: Maybe EcrConfigurationState
ecrConfiguration = Maybe EcrConfigurationState
a} :: GetConfigurationResponse)
getConfigurationResponse_httpStatus :: Lens.Lens' GetConfigurationResponse Prelude.Int
getConfigurationResponse_httpStatus :: Lens' GetConfigurationResponse Int
getConfigurationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetConfigurationResponse' :: GetConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetConfigurationResponse
s@GetConfigurationResponse' {} Int
a -> GetConfigurationResponse
s {$sel:httpStatus:GetConfigurationResponse' :: Int
httpStatus = Int
a} :: GetConfigurationResponse)
instance Prelude.NFData GetConfigurationResponse where
rnf :: GetConfigurationResponse -> ()
rnf GetConfigurationResponse' {Int
Maybe EcrConfigurationState
httpStatus :: Int
ecrConfiguration :: Maybe EcrConfigurationState
$sel:httpStatus:GetConfigurationResponse' :: GetConfigurationResponse -> Int
$sel:ecrConfiguration:GetConfigurationResponse' :: GetConfigurationResponse -> Maybe EcrConfigurationState
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe EcrConfigurationState
ecrConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus