{-# 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.WorkLink.DescribeDevicePolicyConfiguration
(
DescribeDevicePolicyConfiguration (..),
newDescribeDevicePolicyConfiguration,
describeDevicePolicyConfiguration_fleetArn,
DescribeDevicePolicyConfigurationResponse (..),
newDescribeDevicePolicyConfigurationResponse,
describeDevicePolicyConfigurationResponse_deviceCaCertificate,
describeDevicePolicyConfigurationResponse_httpStatus,
)
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.WorkLink.Types
data DescribeDevicePolicyConfiguration = DescribeDevicePolicyConfiguration'
{
DescribeDevicePolicyConfiguration -> Text
fleetArn :: Prelude.Text
}
deriving (DescribeDevicePolicyConfiguration
-> DescribeDevicePolicyConfiguration -> Bool
(DescribeDevicePolicyConfiguration
-> DescribeDevicePolicyConfiguration -> Bool)
-> (DescribeDevicePolicyConfiguration
-> DescribeDevicePolicyConfiguration -> Bool)
-> Eq DescribeDevicePolicyConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDevicePolicyConfiguration
-> DescribeDevicePolicyConfiguration -> Bool
$c/= :: DescribeDevicePolicyConfiguration
-> DescribeDevicePolicyConfiguration -> Bool
== :: DescribeDevicePolicyConfiguration
-> DescribeDevicePolicyConfiguration -> Bool
$c== :: DescribeDevicePolicyConfiguration
-> DescribeDevicePolicyConfiguration -> Bool
Prelude.Eq, ReadPrec [DescribeDevicePolicyConfiguration]
ReadPrec DescribeDevicePolicyConfiguration
Int -> ReadS DescribeDevicePolicyConfiguration
ReadS [DescribeDevicePolicyConfiguration]
(Int -> ReadS DescribeDevicePolicyConfiguration)
-> ReadS [DescribeDevicePolicyConfiguration]
-> ReadPrec DescribeDevicePolicyConfiguration
-> ReadPrec [DescribeDevicePolicyConfiguration]
-> Read DescribeDevicePolicyConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDevicePolicyConfiguration]
$creadListPrec :: ReadPrec [DescribeDevicePolicyConfiguration]
readPrec :: ReadPrec DescribeDevicePolicyConfiguration
$creadPrec :: ReadPrec DescribeDevicePolicyConfiguration
readList :: ReadS [DescribeDevicePolicyConfiguration]
$creadList :: ReadS [DescribeDevicePolicyConfiguration]
readsPrec :: Int -> ReadS DescribeDevicePolicyConfiguration
$creadsPrec :: Int -> ReadS DescribeDevicePolicyConfiguration
Prelude.Read, Int -> DescribeDevicePolicyConfiguration -> ShowS
[DescribeDevicePolicyConfiguration] -> ShowS
DescribeDevicePolicyConfiguration -> String
(Int -> DescribeDevicePolicyConfiguration -> ShowS)
-> (DescribeDevicePolicyConfiguration -> String)
-> ([DescribeDevicePolicyConfiguration] -> ShowS)
-> Show DescribeDevicePolicyConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDevicePolicyConfiguration] -> ShowS
$cshowList :: [DescribeDevicePolicyConfiguration] -> ShowS
show :: DescribeDevicePolicyConfiguration -> String
$cshow :: DescribeDevicePolicyConfiguration -> String
showsPrec :: Int -> DescribeDevicePolicyConfiguration -> ShowS
$cshowsPrec :: Int -> DescribeDevicePolicyConfiguration -> ShowS
Prelude.Show, (forall x.
DescribeDevicePolicyConfiguration
-> Rep DescribeDevicePolicyConfiguration x)
-> (forall x.
Rep DescribeDevicePolicyConfiguration x
-> DescribeDevicePolicyConfiguration)
-> Generic DescribeDevicePolicyConfiguration
forall x.
Rep DescribeDevicePolicyConfiguration x
-> DescribeDevicePolicyConfiguration
forall x.
DescribeDevicePolicyConfiguration
-> Rep DescribeDevicePolicyConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDevicePolicyConfiguration x
-> DescribeDevicePolicyConfiguration
$cfrom :: forall x.
DescribeDevicePolicyConfiguration
-> Rep DescribeDevicePolicyConfiguration x
Prelude.Generic)
newDescribeDevicePolicyConfiguration ::
Prelude.Text ->
DescribeDevicePolicyConfiguration
newDescribeDevicePolicyConfiguration :: Text -> DescribeDevicePolicyConfiguration
newDescribeDevicePolicyConfiguration Text
pFleetArn_ =
DescribeDevicePolicyConfiguration' :: Text -> DescribeDevicePolicyConfiguration
DescribeDevicePolicyConfiguration'
{ $sel:fleetArn:DescribeDevicePolicyConfiguration' :: Text
fleetArn =
Text
pFleetArn_
}
describeDevicePolicyConfiguration_fleetArn :: Lens.Lens' DescribeDevicePolicyConfiguration Prelude.Text
describeDevicePolicyConfiguration_fleetArn :: (Text -> f Text)
-> DescribeDevicePolicyConfiguration
-> f DescribeDevicePolicyConfiguration
describeDevicePolicyConfiguration_fleetArn = (DescribeDevicePolicyConfiguration -> Text)
-> (DescribeDevicePolicyConfiguration
-> Text -> DescribeDevicePolicyConfiguration)
-> Lens
DescribeDevicePolicyConfiguration
DescribeDevicePolicyConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDevicePolicyConfiguration' {Text
fleetArn :: Text
$sel:fleetArn:DescribeDevicePolicyConfiguration' :: DescribeDevicePolicyConfiguration -> Text
fleetArn} -> Text
fleetArn) (\s :: DescribeDevicePolicyConfiguration
s@DescribeDevicePolicyConfiguration' {} Text
a -> DescribeDevicePolicyConfiguration
s {$sel:fleetArn:DescribeDevicePolicyConfiguration' :: Text
fleetArn = Text
a} :: DescribeDevicePolicyConfiguration)
instance
Core.AWSRequest
DescribeDevicePolicyConfiguration
where
type
AWSResponse DescribeDevicePolicyConfiguration =
DescribeDevicePolicyConfigurationResponse
request :: DescribeDevicePolicyConfiguration
-> Request DescribeDevicePolicyConfiguration
request = Service
-> DescribeDevicePolicyConfiguration
-> Request DescribeDevicePolicyConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeDevicePolicyConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeDevicePolicyConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeDevicePolicyConfiguration))
-> Logger
-> Service
-> Proxy DescribeDevicePolicyConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeDevicePolicyConfiguration)))
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 Text -> Int -> DescribeDevicePolicyConfigurationResponse
DescribeDevicePolicyConfigurationResponse'
(Maybe Text -> Int -> DescribeDevicePolicyConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeDevicePolicyConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeviceCaCertificate")
Either String (Int -> DescribeDevicePolicyConfigurationResponse)
-> Either String Int
-> Either String DescribeDevicePolicyConfigurationResponse
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
DescribeDevicePolicyConfiguration
instance
Prelude.NFData
DescribeDevicePolicyConfiguration
instance
Core.ToHeaders
DescribeDevicePolicyConfiguration
where
toHeaders :: DescribeDevicePolicyConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeDevicePolicyConfiguration -> 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.ToJSON
DescribeDevicePolicyConfiguration
where
toJSON :: DescribeDevicePolicyConfiguration -> Value
toJSON DescribeDevicePolicyConfiguration' {Text
fleetArn :: Text
$sel:fleetArn:DescribeDevicePolicyConfiguration' :: DescribeDevicePolicyConfiguration -> 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
"FleetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetArn)]
)
instance
Core.ToPath
DescribeDevicePolicyConfiguration
where
toPath :: DescribeDevicePolicyConfiguration -> ByteString
toPath =
ByteString -> DescribeDevicePolicyConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/describeDevicePolicyConfiguration"
instance
Core.ToQuery
DescribeDevicePolicyConfiguration
where
toQuery :: DescribeDevicePolicyConfiguration -> QueryString
toQuery = QueryString -> DescribeDevicePolicyConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeDevicePolicyConfigurationResponse = DescribeDevicePolicyConfigurationResponse'
{
DescribeDevicePolicyConfigurationResponse -> Maybe Text
deviceCaCertificate :: Prelude.Maybe Prelude.Text,
DescribeDevicePolicyConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeDevicePolicyConfigurationResponse
-> DescribeDevicePolicyConfigurationResponse -> Bool
(DescribeDevicePolicyConfigurationResponse
-> DescribeDevicePolicyConfigurationResponse -> Bool)
-> (DescribeDevicePolicyConfigurationResponse
-> DescribeDevicePolicyConfigurationResponse -> Bool)
-> Eq DescribeDevicePolicyConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDevicePolicyConfigurationResponse
-> DescribeDevicePolicyConfigurationResponse -> Bool
$c/= :: DescribeDevicePolicyConfigurationResponse
-> DescribeDevicePolicyConfigurationResponse -> Bool
== :: DescribeDevicePolicyConfigurationResponse
-> DescribeDevicePolicyConfigurationResponse -> Bool
$c== :: DescribeDevicePolicyConfigurationResponse
-> DescribeDevicePolicyConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDevicePolicyConfigurationResponse]
ReadPrec DescribeDevicePolicyConfigurationResponse
Int -> ReadS DescribeDevicePolicyConfigurationResponse
ReadS [DescribeDevicePolicyConfigurationResponse]
(Int -> ReadS DescribeDevicePolicyConfigurationResponse)
-> ReadS [DescribeDevicePolicyConfigurationResponse]
-> ReadPrec DescribeDevicePolicyConfigurationResponse
-> ReadPrec [DescribeDevicePolicyConfigurationResponse]
-> Read DescribeDevicePolicyConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDevicePolicyConfigurationResponse]
$creadListPrec :: ReadPrec [DescribeDevicePolicyConfigurationResponse]
readPrec :: ReadPrec DescribeDevicePolicyConfigurationResponse
$creadPrec :: ReadPrec DescribeDevicePolicyConfigurationResponse
readList :: ReadS [DescribeDevicePolicyConfigurationResponse]
$creadList :: ReadS [DescribeDevicePolicyConfigurationResponse]
readsPrec :: Int -> ReadS DescribeDevicePolicyConfigurationResponse
$creadsPrec :: Int -> ReadS DescribeDevicePolicyConfigurationResponse
Prelude.Read, Int -> DescribeDevicePolicyConfigurationResponse -> ShowS
[DescribeDevicePolicyConfigurationResponse] -> ShowS
DescribeDevicePolicyConfigurationResponse -> String
(Int -> DescribeDevicePolicyConfigurationResponse -> ShowS)
-> (DescribeDevicePolicyConfigurationResponse -> String)
-> ([DescribeDevicePolicyConfigurationResponse] -> ShowS)
-> Show DescribeDevicePolicyConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDevicePolicyConfigurationResponse] -> ShowS
$cshowList :: [DescribeDevicePolicyConfigurationResponse] -> ShowS
show :: DescribeDevicePolicyConfigurationResponse -> String
$cshow :: DescribeDevicePolicyConfigurationResponse -> String
showsPrec :: Int -> DescribeDevicePolicyConfigurationResponse -> ShowS
$cshowsPrec :: Int -> DescribeDevicePolicyConfigurationResponse -> ShowS
Prelude.Show, (forall x.
DescribeDevicePolicyConfigurationResponse
-> Rep DescribeDevicePolicyConfigurationResponse x)
-> (forall x.
Rep DescribeDevicePolicyConfigurationResponse x
-> DescribeDevicePolicyConfigurationResponse)
-> Generic DescribeDevicePolicyConfigurationResponse
forall x.
Rep DescribeDevicePolicyConfigurationResponse x
-> DescribeDevicePolicyConfigurationResponse
forall x.
DescribeDevicePolicyConfigurationResponse
-> Rep DescribeDevicePolicyConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDevicePolicyConfigurationResponse x
-> DescribeDevicePolicyConfigurationResponse
$cfrom :: forall x.
DescribeDevicePolicyConfigurationResponse
-> Rep DescribeDevicePolicyConfigurationResponse x
Prelude.Generic)
newDescribeDevicePolicyConfigurationResponse ::
Prelude.Int ->
DescribeDevicePolicyConfigurationResponse
newDescribeDevicePolicyConfigurationResponse :: Int -> DescribeDevicePolicyConfigurationResponse
newDescribeDevicePolicyConfigurationResponse
Int
pHttpStatus_ =
DescribeDevicePolicyConfigurationResponse' :: Maybe Text -> Int -> DescribeDevicePolicyConfigurationResponse
DescribeDevicePolicyConfigurationResponse'
{ $sel:deviceCaCertificate:DescribeDevicePolicyConfigurationResponse' :: Maybe Text
deviceCaCertificate =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeDevicePolicyConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeDevicePolicyConfigurationResponse_deviceCaCertificate :: Lens.Lens' DescribeDevicePolicyConfigurationResponse (Prelude.Maybe Prelude.Text)
describeDevicePolicyConfigurationResponse_deviceCaCertificate :: (Maybe Text -> f (Maybe Text))
-> DescribeDevicePolicyConfigurationResponse
-> f DescribeDevicePolicyConfigurationResponse
describeDevicePolicyConfigurationResponse_deviceCaCertificate = (DescribeDevicePolicyConfigurationResponse -> Maybe Text)
-> (DescribeDevicePolicyConfigurationResponse
-> Maybe Text -> DescribeDevicePolicyConfigurationResponse)
-> Lens
DescribeDevicePolicyConfigurationResponse
DescribeDevicePolicyConfigurationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDevicePolicyConfigurationResponse' {Maybe Text
deviceCaCertificate :: Maybe Text
$sel:deviceCaCertificate:DescribeDevicePolicyConfigurationResponse' :: DescribeDevicePolicyConfigurationResponse -> Maybe Text
deviceCaCertificate} -> Maybe Text
deviceCaCertificate) (\s :: DescribeDevicePolicyConfigurationResponse
s@DescribeDevicePolicyConfigurationResponse' {} Maybe Text
a -> DescribeDevicePolicyConfigurationResponse
s {$sel:deviceCaCertificate:DescribeDevicePolicyConfigurationResponse' :: Maybe Text
deviceCaCertificate = Maybe Text
a} :: DescribeDevicePolicyConfigurationResponse)
describeDevicePolicyConfigurationResponse_httpStatus :: Lens.Lens' DescribeDevicePolicyConfigurationResponse Prelude.Int
describeDevicePolicyConfigurationResponse_httpStatus :: (Int -> f Int)
-> DescribeDevicePolicyConfigurationResponse
-> f DescribeDevicePolicyConfigurationResponse
describeDevicePolicyConfigurationResponse_httpStatus = (DescribeDevicePolicyConfigurationResponse -> Int)
-> (DescribeDevicePolicyConfigurationResponse
-> Int -> DescribeDevicePolicyConfigurationResponse)
-> Lens
DescribeDevicePolicyConfigurationResponse
DescribeDevicePolicyConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDevicePolicyConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeDevicePolicyConfigurationResponse' :: DescribeDevicePolicyConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeDevicePolicyConfigurationResponse
s@DescribeDevicePolicyConfigurationResponse' {} Int
a -> DescribeDevicePolicyConfigurationResponse
s {$sel:httpStatus:DescribeDevicePolicyConfigurationResponse' :: Int
httpStatus = Int
a} :: DescribeDevicePolicyConfigurationResponse)
instance
Prelude.NFData
DescribeDevicePolicyConfigurationResponse