{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTSiteWise.DescribeAccessPolicy
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes an access policy, which specifies an identity\'s access to an
-- IoT SiteWise Monitor portal or project.
module Amazonka.IoTSiteWise.DescribeAccessPolicy
  ( -- * Creating a Request
    DescribeAccessPolicy (..),
    newDescribeAccessPolicy,

    -- * Request Lenses
    describeAccessPolicy_accessPolicyId,

    -- * Destructuring the Response
    DescribeAccessPolicyResponse (..),
    newDescribeAccessPolicyResponse,

    -- * Response Lenses
    describeAccessPolicyResponse_httpStatus,
    describeAccessPolicyResponse_accessPolicyId,
    describeAccessPolicyResponse_accessPolicyArn,
    describeAccessPolicyResponse_accessPolicyIdentity,
    describeAccessPolicyResponse_accessPolicyResource,
    describeAccessPolicyResponse_accessPolicyPermission,
    describeAccessPolicyResponse_accessPolicyCreationDate,
    describeAccessPolicyResponse_accessPolicyLastUpdateDate,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.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

-- | /See:/ 'newDescribeAccessPolicy' smart constructor.
data DescribeAccessPolicy = DescribeAccessPolicy'
  { -- | The ID of the access policy.
    DescribeAccessPolicy -> Text
accessPolicyId :: Prelude.Text
  }
  deriving (DescribeAccessPolicy -> DescribeAccessPolicy -> Bool
(DescribeAccessPolicy -> DescribeAccessPolicy -> Bool)
-> (DescribeAccessPolicy -> DescribeAccessPolicy -> Bool)
-> Eq DescribeAccessPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAccessPolicy -> DescribeAccessPolicy -> Bool
$c/= :: DescribeAccessPolicy -> DescribeAccessPolicy -> Bool
== :: DescribeAccessPolicy -> DescribeAccessPolicy -> Bool
$c== :: DescribeAccessPolicy -> DescribeAccessPolicy -> Bool
Prelude.Eq, ReadPrec [DescribeAccessPolicy]
ReadPrec DescribeAccessPolicy
Int -> ReadS DescribeAccessPolicy
ReadS [DescribeAccessPolicy]
(Int -> ReadS DescribeAccessPolicy)
-> ReadS [DescribeAccessPolicy]
-> ReadPrec DescribeAccessPolicy
-> ReadPrec [DescribeAccessPolicy]
-> Read DescribeAccessPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAccessPolicy]
$creadListPrec :: ReadPrec [DescribeAccessPolicy]
readPrec :: ReadPrec DescribeAccessPolicy
$creadPrec :: ReadPrec DescribeAccessPolicy
readList :: ReadS [DescribeAccessPolicy]
$creadList :: ReadS [DescribeAccessPolicy]
readsPrec :: Int -> ReadS DescribeAccessPolicy
$creadsPrec :: Int -> ReadS DescribeAccessPolicy
Prelude.Read, Int -> DescribeAccessPolicy -> ShowS
[DescribeAccessPolicy] -> ShowS
DescribeAccessPolicy -> String
(Int -> DescribeAccessPolicy -> ShowS)
-> (DescribeAccessPolicy -> String)
-> ([DescribeAccessPolicy] -> ShowS)
-> Show DescribeAccessPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAccessPolicy] -> ShowS
$cshowList :: [DescribeAccessPolicy] -> ShowS
show :: DescribeAccessPolicy -> String
$cshow :: DescribeAccessPolicy -> String
showsPrec :: Int -> DescribeAccessPolicy -> ShowS
$cshowsPrec :: Int -> DescribeAccessPolicy -> ShowS
Prelude.Show, (forall x. DescribeAccessPolicy -> Rep DescribeAccessPolicy x)
-> (forall x. Rep DescribeAccessPolicy x -> DescribeAccessPolicy)
-> Generic DescribeAccessPolicy
forall x. Rep DescribeAccessPolicy x -> DescribeAccessPolicy
forall x. DescribeAccessPolicy -> Rep DescribeAccessPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAccessPolicy x -> DescribeAccessPolicy
$cfrom :: forall x. DescribeAccessPolicy -> Rep DescribeAccessPolicy x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAccessPolicy' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'accessPolicyId', 'describeAccessPolicy_accessPolicyId' - The ID of the access policy.
newDescribeAccessPolicy ::
  -- | 'accessPolicyId'
  Prelude.Text ->
  DescribeAccessPolicy
newDescribeAccessPolicy :: Text -> DescribeAccessPolicy
newDescribeAccessPolicy Text
pAccessPolicyId_ =
  DescribeAccessPolicy' :: Text -> DescribeAccessPolicy
DescribeAccessPolicy'
    { $sel:accessPolicyId:DescribeAccessPolicy' :: Text
accessPolicyId =
        Text
pAccessPolicyId_
    }

-- | The ID of the access policy.
describeAccessPolicy_accessPolicyId :: Lens.Lens' DescribeAccessPolicy Prelude.Text
describeAccessPolicy_accessPolicyId :: (Text -> f Text) -> DescribeAccessPolicy -> f DescribeAccessPolicy
describeAccessPolicy_accessPolicyId = (DescribeAccessPolicy -> Text)
-> (DescribeAccessPolicy -> Text -> DescribeAccessPolicy)
-> Lens DescribeAccessPolicy DescribeAccessPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicy' {Text
accessPolicyId :: Text
$sel:accessPolicyId:DescribeAccessPolicy' :: DescribeAccessPolicy -> Text
accessPolicyId} -> Text
accessPolicyId) (\s :: DescribeAccessPolicy
s@DescribeAccessPolicy' {} Text
a -> DescribeAccessPolicy
s {$sel:accessPolicyId:DescribeAccessPolicy' :: Text
accessPolicyId = Text
a} :: DescribeAccessPolicy)

instance Core.AWSRequest DescribeAccessPolicy where
  type
    AWSResponse DescribeAccessPolicy =
      DescribeAccessPolicyResponse
  request :: DescribeAccessPolicy -> Request DescribeAccessPolicy
request = Service -> DescribeAccessPolicy -> Request DescribeAccessPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAccessPolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAccessPolicy)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeAccessPolicy))
-> Logger
-> Service
-> Proxy DescribeAccessPolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAccessPolicy)))
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 ->
          Int
-> Text
-> Text
-> Identity
-> Resource
-> Permission
-> POSIX
-> POSIX
-> DescribeAccessPolicyResponse
DescribeAccessPolicyResponse'
            (Int
 -> Text
 -> Text
 -> Identity
 -> Resource
 -> Permission
 -> POSIX
 -> POSIX
 -> DescribeAccessPolicyResponse)
-> Either String Int
-> Either
     String
     (Text
      -> Text
      -> Identity
      -> Resource
      -> Permission
      -> POSIX
      -> POSIX
      -> DescribeAccessPolicyResponse)
forall (f :: * -> *) a b. Functor 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))
            Either
  String
  (Text
   -> Text
   -> Identity
   -> Resource
   -> Permission
   -> POSIX
   -> POSIX
   -> DescribeAccessPolicyResponse)
-> Either String Text
-> Either
     String
     (Text
      -> Identity
      -> Resource
      -> Permission
      -> POSIX
      -> POSIX
      -> DescribeAccessPolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"accessPolicyId")
            Either
  String
  (Text
   -> Identity
   -> Resource
   -> Permission
   -> POSIX
   -> POSIX
   -> DescribeAccessPolicyResponse)
-> Either String Text
-> Either
     String
     (Identity
      -> Resource
      -> Permission
      -> POSIX
      -> POSIX
      -> DescribeAccessPolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"accessPolicyArn")
            Either
  String
  (Identity
   -> Resource
   -> Permission
   -> POSIX
   -> POSIX
   -> DescribeAccessPolicyResponse)
-> Either String Identity
-> Either
     String
     (Resource
      -> Permission -> POSIX -> POSIX -> DescribeAccessPolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Identity
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"accessPolicyIdentity")
            Either
  String
  (Resource
   -> Permission -> POSIX -> POSIX -> DescribeAccessPolicyResponse)
-> Either String Resource
-> Either
     String
     (Permission -> POSIX -> POSIX -> DescribeAccessPolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Resource
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"accessPolicyResource")
            Either
  String
  (Permission -> POSIX -> POSIX -> DescribeAccessPolicyResponse)
-> Either String Permission
-> Either String (POSIX -> POSIX -> DescribeAccessPolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Permission
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"accessPolicyPermission")
            Either String (POSIX -> POSIX -> DescribeAccessPolicyResponse)
-> Either String POSIX
-> Either String (POSIX -> DescribeAccessPolicyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"accessPolicyCreationDate")
            Either String (POSIX -> DescribeAccessPolicyResponse)
-> Either String POSIX
-> Either String DescribeAccessPolicyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"accessPolicyLastUpdateDate")
      )

instance Prelude.Hashable DescribeAccessPolicy

instance Prelude.NFData DescribeAccessPolicy

instance Core.ToHeaders DescribeAccessPolicy where
  toHeaders :: DescribeAccessPolicy -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeAccessPolicy -> 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 DescribeAccessPolicy where
  toPath :: DescribeAccessPolicy -> ByteString
toPath DescribeAccessPolicy' {Text
accessPolicyId :: Text
$sel:accessPolicyId:DescribeAccessPolicy' :: DescribeAccessPolicy -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/access-policies/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accessPolicyId]

instance Core.ToQuery DescribeAccessPolicy where
  toQuery :: DescribeAccessPolicy -> QueryString
toQuery = QueryString -> DescribeAccessPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeAccessPolicyResponse' smart constructor.
data DescribeAccessPolicyResponse = DescribeAccessPolicyResponse'
  { -- | The response's http status code.
    DescribeAccessPolicyResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the access policy.
    DescribeAccessPolicyResponse -> Text
accessPolicyId :: Prelude.Text,
    -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of the access policy, which has the following format.
    --
    -- @arn:${Partition}:iotsitewise:${Region}:${Account}:access-policy\/${AccessPolicyId}@
    DescribeAccessPolicyResponse -> Text
accessPolicyArn :: Prelude.Text,
    -- | The identity (Amazon Web Services SSO user, Amazon Web Services SSO
    -- group, or IAM user) to which this access policy applies.
    DescribeAccessPolicyResponse -> Identity
accessPolicyIdentity :: Identity,
    -- | The IoT SiteWise Monitor resource (portal or project) to which this
    -- access policy provides access.
    DescribeAccessPolicyResponse -> Resource
accessPolicyResource :: Resource,
    -- | The access policy permission. Note that a project @ADMINISTRATOR@ is
    -- also known as a project owner.
    DescribeAccessPolicyResponse -> Permission
accessPolicyPermission :: Permission,
    -- | The date the access policy was created, in Unix epoch time.
    DescribeAccessPolicyResponse -> POSIX
accessPolicyCreationDate :: Core.POSIX,
    -- | The date the access policy was last updated, in Unix epoch time.
    DescribeAccessPolicyResponse -> POSIX
accessPolicyLastUpdateDate :: Core.POSIX
  }
  deriving (DescribeAccessPolicyResponse
-> DescribeAccessPolicyResponse -> Bool
(DescribeAccessPolicyResponse
 -> DescribeAccessPolicyResponse -> Bool)
-> (DescribeAccessPolicyResponse
    -> DescribeAccessPolicyResponse -> Bool)
-> Eq DescribeAccessPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAccessPolicyResponse
-> DescribeAccessPolicyResponse -> Bool
$c/= :: DescribeAccessPolicyResponse
-> DescribeAccessPolicyResponse -> Bool
== :: DescribeAccessPolicyResponse
-> DescribeAccessPolicyResponse -> Bool
$c== :: DescribeAccessPolicyResponse
-> DescribeAccessPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAccessPolicyResponse]
ReadPrec DescribeAccessPolicyResponse
Int -> ReadS DescribeAccessPolicyResponse
ReadS [DescribeAccessPolicyResponse]
(Int -> ReadS DescribeAccessPolicyResponse)
-> ReadS [DescribeAccessPolicyResponse]
-> ReadPrec DescribeAccessPolicyResponse
-> ReadPrec [DescribeAccessPolicyResponse]
-> Read DescribeAccessPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAccessPolicyResponse]
$creadListPrec :: ReadPrec [DescribeAccessPolicyResponse]
readPrec :: ReadPrec DescribeAccessPolicyResponse
$creadPrec :: ReadPrec DescribeAccessPolicyResponse
readList :: ReadS [DescribeAccessPolicyResponse]
$creadList :: ReadS [DescribeAccessPolicyResponse]
readsPrec :: Int -> ReadS DescribeAccessPolicyResponse
$creadsPrec :: Int -> ReadS DescribeAccessPolicyResponse
Prelude.Read, Int -> DescribeAccessPolicyResponse -> ShowS
[DescribeAccessPolicyResponse] -> ShowS
DescribeAccessPolicyResponse -> String
(Int -> DescribeAccessPolicyResponse -> ShowS)
-> (DescribeAccessPolicyResponse -> String)
-> ([DescribeAccessPolicyResponse] -> ShowS)
-> Show DescribeAccessPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAccessPolicyResponse] -> ShowS
$cshowList :: [DescribeAccessPolicyResponse] -> ShowS
show :: DescribeAccessPolicyResponse -> String
$cshow :: DescribeAccessPolicyResponse -> String
showsPrec :: Int -> DescribeAccessPolicyResponse -> ShowS
$cshowsPrec :: Int -> DescribeAccessPolicyResponse -> ShowS
Prelude.Show, (forall x.
 DescribeAccessPolicyResponse -> Rep DescribeAccessPolicyResponse x)
-> (forall x.
    Rep DescribeAccessPolicyResponse x -> DescribeAccessPolicyResponse)
-> Generic DescribeAccessPolicyResponse
forall x.
Rep DescribeAccessPolicyResponse x -> DescribeAccessPolicyResponse
forall x.
DescribeAccessPolicyResponse -> Rep DescribeAccessPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAccessPolicyResponse x -> DescribeAccessPolicyResponse
$cfrom :: forall x.
DescribeAccessPolicyResponse -> Rep DescribeAccessPolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAccessPolicyResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'describeAccessPolicyResponse_httpStatus' - The response's http status code.
--
-- 'accessPolicyId', 'describeAccessPolicyResponse_accessPolicyId' - The ID of the access policy.
--
-- 'accessPolicyArn', 'describeAccessPolicyResponse_accessPolicyArn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the access policy, which has the following format.
--
-- @arn:${Partition}:iotsitewise:${Region}:${Account}:access-policy\/${AccessPolicyId}@
--
-- 'accessPolicyIdentity', 'describeAccessPolicyResponse_accessPolicyIdentity' - The identity (Amazon Web Services SSO user, Amazon Web Services SSO
-- group, or IAM user) to which this access policy applies.
--
-- 'accessPolicyResource', 'describeAccessPolicyResponse_accessPolicyResource' - The IoT SiteWise Monitor resource (portal or project) to which this
-- access policy provides access.
--
-- 'accessPolicyPermission', 'describeAccessPolicyResponse_accessPolicyPermission' - The access policy permission. Note that a project @ADMINISTRATOR@ is
-- also known as a project owner.
--
-- 'accessPolicyCreationDate', 'describeAccessPolicyResponse_accessPolicyCreationDate' - The date the access policy was created, in Unix epoch time.
--
-- 'accessPolicyLastUpdateDate', 'describeAccessPolicyResponse_accessPolicyLastUpdateDate' - The date the access policy was last updated, in Unix epoch time.
newDescribeAccessPolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'accessPolicyId'
  Prelude.Text ->
  -- | 'accessPolicyArn'
  Prelude.Text ->
  -- | 'accessPolicyIdentity'
  Identity ->
  -- | 'accessPolicyResource'
  Resource ->
  -- | 'accessPolicyPermission'
  Permission ->
  -- | 'accessPolicyCreationDate'
  Prelude.UTCTime ->
  -- | 'accessPolicyLastUpdateDate'
  Prelude.UTCTime ->
  DescribeAccessPolicyResponse
newDescribeAccessPolicyResponse :: Int
-> Text
-> Text
-> Identity
-> Resource
-> Permission
-> UTCTime
-> UTCTime
-> DescribeAccessPolicyResponse
newDescribeAccessPolicyResponse
  Int
pHttpStatus_
  Text
pAccessPolicyId_
  Text
pAccessPolicyArn_
  Identity
pAccessPolicyIdentity_
  Resource
pAccessPolicyResource_
  Permission
pAccessPolicyPermission_
  UTCTime
pAccessPolicyCreationDate_
  UTCTime
pAccessPolicyLastUpdateDate_ =
    DescribeAccessPolicyResponse' :: Int
-> Text
-> Text
-> Identity
-> Resource
-> Permission
-> POSIX
-> POSIX
-> DescribeAccessPolicyResponse
DescribeAccessPolicyResponse'
      { $sel:httpStatus:DescribeAccessPolicyResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:accessPolicyId:DescribeAccessPolicyResponse' :: Text
accessPolicyId = Text
pAccessPolicyId_,
        $sel:accessPolicyArn:DescribeAccessPolicyResponse' :: Text
accessPolicyArn = Text
pAccessPolicyArn_,
        $sel:accessPolicyIdentity:DescribeAccessPolicyResponse' :: Identity
accessPolicyIdentity = Identity
pAccessPolicyIdentity_,
        $sel:accessPolicyResource:DescribeAccessPolicyResponse' :: Resource
accessPolicyResource = Resource
pAccessPolicyResource_,
        $sel:accessPolicyPermission:DescribeAccessPolicyResponse' :: Permission
accessPolicyPermission =
          Permission
pAccessPolicyPermission_,
        $sel:accessPolicyCreationDate:DescribeAccessPolicyResponse' :: POSIX
accessPolicyCreationDate =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
            (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pAccessPolicyCreationDate_,
        $sel:accessPolicyLastUpdateDate:DescribeAccessPolicyResponse' :: POSIX
accessPolicyLastUpdateDate =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
            (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pAccessPolicyLastUpdateDate_
      }

-- | The response's http status code.
describeAccessPolicyResponse_httpStatus :: Lens.Lens' DescribeAccessPolicyResponse Prelude.Int
describeAccessPolicyResponse_httpStatus :: (Int -> f Int)
-> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse
describeAccessPolicyResponse_httpStatus = (DescribeAccessPolicyResponse -> Int)
-> (DescribeAccessPolicyResponse
    -> Int -> DescribeAccessPolicyResponse)
-> Lens
     DescribeAccessPolicyResponse DescribeAccessPolicyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAccessPolicyResponse' :: DescribeAccessPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAccessPolicyResponse
s@DescribeAccessPolicyResponse' {} Int
a -> DescribeAccessPolicyResponse
s {$sel:httpStatus:DescribeAccessPolicyResponse' :: Int
httpStatus = Int
a} :: DescribeAccessPolicyResponse)

-- | The ID of the access policy.
describeAccessPolicyResponse_accessPolicyId :: Lens.Lens' DescribeAccessPolicyResponse Prelude.Text
describeAccessPolicyResponse_accessPolicyId :: (Text -> f Text)
-> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse
describeAccessPolicyResponse_accessPolicyId = (DescribeAccessPolicyResponse -> Text)
-> (DescribeAccessPolicyResponse
    -> Text -> DescribeAccessPolicyResponse)
-> Lens
     DescribeAccessPolicyResponse DescribeAccessPolicyResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicyResponse' {Text
accessPolicyId :: Text
$sel:accessPolicyId:DescribeAccessPolicyResponse' :: DescribeAccessPolicyResponse -> Text
accessPolicyId} -> Text
accessPolicyId) (\s :: DescribeAccessPolicyResponse
s@DescribeAccessPolicyResponse' {} Text
a -> DescribeAccessPolicyResponse
s {$sel:accessPolicyId:DescribeAccessPolicyResponse' :: Text
accessPolicyId = Text
a} :: DescribeAccessPolicyResponse)

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the access policy, which has the following format.
--
-- @arn:${Partition}:iotsitewise:${Region}:${Account}:access-policy\/${AccessPolicyId}@
describeAccessPolicyResponse_accessPolicyArn :: Lens.Lens' DescribeAccessPolicyResponse Prelude.Text
describeAccessPolicyResponse_accessPolicyArn :: (Text -> f Text)
-> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse
describeAccessPolicyResponse_accessPolicyArn = (DescribeAccessPolicyResponse -> Text)
-> (DescribeAccessPolicyResponse
    -> Text -> DescribeAccessPolicyResponse)
-> Lens
     DescribeAccessPolicyResponse DescribeAccessPolicyResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicyResponse' {Text
accessPolicyArn :: Text
$sel:accessPolicyArn:DescribeAccessPolicyResponse' :: DescribeAccessPolicyResponse -> Text
accessPolicyArn} -> Text
accessPolicyArn) (\s :: DescribeAccessPolicyResponse
s@DescribeAccessPolicyResponse' {} Text
a -> DescribeAccessPolicyResponse
s {$sel:accessPolicyArn:DescribeAccessPolicyResponse' :: Text
accessPolicyArn = Text
a} :: DescribeAccessPolicyResponse)

-- | The identity (Amazon Web Services SSO user, Amazon Web Services SSO
-- group, or IAM user) to which this access policy applies.
describeAccessPolicyResponse_accessPolicyIdentity :: Lens.Lens' DescribeAccessPolicyResponse Identity
describeAccessPolicyResponse_accessPolicyIdentity :: (Identity -> f Identity)
-> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse
describeAccessPolicyResponse_accessPolicyIdentity = (DescribeAccessPolicyResponse -> Identity)
-> (DescribeAccessPolicyResponse
    -> Identity -> DescribeAccessPolicyResponse)
-> Lens
     DescribeAccessPolicyResponse
     DescribeAccessPolicyResponse
     Identity
     Identity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicyResponse' {Identity
accessPolicyIdentity :: Identity
$sel:accessPolicyIdentity:DescribeAccessPolicyResponse' :: DescribeAccessPolicyResponse -> Identity
accessPolicyIdentity} -> Identity
accessPolicyIdentity) (\s :: DescribeAccessPolicyResponse
s@DescribeAccessPolicyResponse' {} Identity
a -> DescribeAccessPolicyResponse
s {$sel:accessPolicyIdentity:DescribeAccessPolicyResponse' :: Identity
accessPolicyIdentity = Identity
a} :: DescribeAccessPolicyResponse)

-- | The IoT SiteWise Monitor resource (portal or project) to which this
-- access policy provides access.
describeAccessPolicyResponse_accessPolicyResource :: Lens.Lens' DescribeAccessPolicyResponse Resource
describeAccessPolicyResponse_accessPolicyResource :: (Resource -> f Resource)
-> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse
describeAccessPolicyResponse_accessPolicyResource = (DescribeAccessPolicyResponse -> Resource)
-> (DescribeAccessPolicyResponse
    -> Resource -> DescribeAccessPolicyResponse)
-> Lens
     DescribeAccessPolicyResponse
     DescribeAccessPolicyResponse
     Resource
     Resource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicyResponse' {Resource
accessPolicyResource :: Resource
$sel:accessPolicyResource:DescribeAccessPolicyResponse' :: DescribeAccessPolicyResponse -> Resource
accessPolicyResource} -> Resource
accessPolicyResource) (\s :: DescribeAccessPolicyResponse
s@DescribeAccessPolicyResponse' {} Resource
a -> DescribeAccessPolicyResponse
s {$sel:accessPolicyResource:DescribeAccessPolicyResponse' :: Resource
accessPolicyResource = Resource
a} :: DescribeAccessPolicyResponse)

-- | The access policy permission. Note that a project @ADMINISTRATOR@ is
-- also known as a project owner.
describeAccessPolicyResponse_accessPolicyPermission :: Lens.Lens' DescribeAccessPolicyResponse Permission
describeAccessPolicyResponse_accessPolicyPermission :: (Permission -> f Permission)
-> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse
describeAccessPolicyResponse_accessPolicyPermission = (DescribeAccessPolicyResponse -> Permission)
-> (DescribeAccessPolicyResponse
    -> Permission -> DescribeAccessPolicyResponse)
-> Lens
     DescribeAccessPolicyResponse
     DescribeAccessPolicyResponse
     Permission
     Permission
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicyResponse' {Permission
accessPolicyPermission :: Permission
$sel:accessPolicyPermission:DescribeAccessPolicyResponse' :: DescribeAccessPolicyResponse -> Permission
accessPolicyPermission} -> Permission
accessPolicyPermission) (\s :: DescribeAccessPolicyResponse
s@DescribeAccessPolicyResponse' {} Permission
a -> DescribeAccessPolicyResponse
s {$sel:accessPolicyPermission:DescribeAccessPolicyResponse' :: Permission
accessPolicyPermission = Permission
a} :: DescribeAccessPolicyResponse)

-- | The date the access policy was created, in Unix epoch time.
describeAccessPolicyResponse_accessPolicyCreationDate :: Lens.Lens' DescribeAccessPolicyResponse Prelude.UTCTime
describeAccessPolicyResponse_accessPolicyCreationDate :: (UTCTime -> f UTCTime)
-> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse
describeAccessPolicyResponse_accessPolicyCreationDate = (DescribeAccessPolicyResponse -> POSIX)
-> (DescribeAccessPolicyResponse
    -> POSIX -> DescribeAccessPolicyResponse)
-> Lens
     DescribeAccessPolicyResponse
     DescribeAccessPolicyResponse
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicyResponse' {POSIX
accessPolicyCreationDate :: POSIX
$sel:accessPolicyCreationDate:DescribeAccessPolicyResponse' :: DescribeAccessPolicyResponse -> POSIX
accessPolicyCreationDate} -> POSIX
accessPolicyCreationDate) (\s :: DescribeAccessPolicyResponse
s@DescribeAccessPolicyResponse' {} POSIX
a -> DescribeAccessPolicyResponse
s {$sel:accessPolicyCreationDate:DescribeAccessPolicyResponse' :: POSIX
accessPolicyCreationDate = POSIX
a} :: DescribeAccessPolicyResponse) ((POSIX -> f POSIX)
 -> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeAccessPolicyResponse
-> f DescribeAccessPolicyResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The date the access policy was last updated, in Unix epoch time.
describeAccessPolicyResponse_accessPolicyLastUpdateDate :: Lens.Lens' DescribeAccessPolicyResponse Prelude.UTCTime
describeAccessPolicyResponse_accessPolicyLastUpdateDate :: (UTCTime -> f UTCTime)
-> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse
describeAccessPolicyResponse_accessPolicyLastUpdateDate = (DescribeAccessPolicyResponse -> POSIX)
-> (DescribeAccessPolicyResponse
    -> POSIX -> DescribeAccessPolicyResponse)
-> Lens
     DescribeAccessPolicyResponse
     DescribeAccessPolicyResponse
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccessPolicyResponse' {POSIX
accessPolicyLastUpdateDate :: POSIX
$sel:accessPolicyLastUpdateDate:DescribeAccessPolicyResponse' :: DescribeAccessPolicyResponse -> POSIX
accessPolicyLastUpdateDate} -> POSIX
accessPolicyLastUpdateDate) (\s :: DescribeAccessPolicyResponse
s@DescribeAccessPolicyResponse' {} POSIX
a -> DescribeAccessPolicyResponse
s {$sel:accessPolicyLastUpdateDate:DescribeAccessPolicyResponse' :: POSIX
accessPolicyLastUpdateDate = POSIX
a} :: DescribeAccessPolicyResponse) ((POSIX -> f POSIX)
 -> DescribeAccessPolicyResponse -> f DescribeAccessPolicyResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeAccessPolicyResponse
-> f DescribeAccessPolicyResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Prelude.NFData DescribeAccessPolicyResponse