{-# 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.LakeFormation.RevokePermissions
-- 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)
--
-- Revokes permissions to the principal to access metadata in the Data
-- Catalog and data organized in underlying data storage such as Amazon S3.
module Amazonka.LakeFormation.RevokePermissions
  ( -- * Creating a Request
    RevokePermissions (..),
    newRevokePermissions,

    -- * Request Lenses
    revokePermissions_catalogId,
    revokePermissions_permissionsWithGrantOption,
    revokePermissions_principal,
    revokePermissions_resource,
    revokePermissions_permissions,

    -- * Destructuring the Response
    RevokePermissionsResponse (..),
    newRevokePermissionsResponse,

    -- * Response Lenses
    revokePermissionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.LakeFormation.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:/ 'newRevokePermissions' smart constructor.
data RevokePermissions = RevokePermissions'
  { -- | The identifier for the Data Catalog. By default, the account ID. The
    -- Data Catalog is the persistent metadata store. It contains database
    -- definitions, table definitions, and other control information to manage
    -- your AWS Lake Formation environment.
    RevokePermissions -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | Indicates a list of permissions for which to revoke the grant option
    -- allowing the principal to pass permissions to other principals.
    RevokePermissions -> Maybe [Permission]
permissionsWithGrantOption :: Prelude.Maybe [Permission],
    -- | The principal to be revoked permissions on the resource.
    RevokePermissions -> DataLakePrincipal
principal :: DataLakePrincipal,
    -- | The resource to which permissions are to be revoked.
    RevokePermissions -> Resource
resource :: Resource,
    -- | The permissions revoked to the principal on the resource. For
    -- information about permissions, see
    -- <https://docs-aws.amazon.com/lake-formation/latest/dg/security-data-access.html Security and Access Control to Metadata and Data>.
    RevokePermissions -> [Permission]
permissions :: [Permission]
  }
  deriving (RevokePermissions -> RevokePermissions -> Bool
(RevokePermissions -> RevokePermissions -> Bool)
-> (RevokePermissions -> RevokePermissions -> Bool)
-> Eq RevokePermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RevokePermissions -> RevokePermissions -> Bool
$c/= :: RevokePermissions -> RevokePermissions -> Bool
== :: RevokePermissions -> RevokePermissions -> Bool
$c== :: RevokePermissions -> RevokePermissions -> Bool
Prelude.Eq, ReadPrec [RevokePermissions]
ReadPrec RevokePermissions
Int -> ReadS RevokePermissions
ReadS [RevokePermissions]
(Int -> ReadS RevokePermissions)
-> ReadS [RevokePermissions]
-> ReadPrec RevokePermissions
-> ReadPrec [RevokePermissions]
-> Read RevokePermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RevokePermissions]
$creadListPrec :: ReadPrec [RevokePermissions]
readPrec :: ReadPrec RevokePermissions
$creadPrec :: ReadPrec RevokePermissions
readList :: ReadS [RevokePermissions]
$creadList :: ReadS [RevokePermissions]
readsPrec :: Int -> ReadS RevokePermissions
$creadsPrec :: Int -> ReadS RevokePermissions
Prelude.Read, Int -> RevokePermissions -> ShowS
[RevokePermissions] -> ShowS
RevokePermissions -> String
(Int -> RevokePermissions -> ShowS)
-> (RevokePermissions -> String)
-> ([RevokePermissions] -> ShowS)
-> Show RevokePermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevokePermissions] -> ShowS
$cshowList :: [RevokePermissions] -> ShowS
show :: RevokePermissions -> String
$cshow :: RevokePermissions -> String
showsPrec :: Int -> RevokePermissions -> ShowS
$cshowsPrec :: Int -> RevokePermissions -> ShowS
Prelude.Show, (forall x. RevokePermissions -> Rep RevokePermissions x)
-> (forall x. Rep RevokePermissions x -> RevokePermissions)
-> Generic RevokePermissions
forall x. Rep RevokePermissions x -> RevokePermissions
forall x. RevokePermissions -> Rep RevokePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RevokePermissions x -> RevokePermissions
$cfrom :: forall x. RevokePermissions -> Rep RevokePermissions x
Prelude.Generic)

-- |
-- Create a value of 'RevokePermissions' 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:
--
-- 'catalogId', 'revokePermissions_catalogId' - The identifier for the Data Catalog. By default, the account ID. The
-- Data Catalog is the persistent metadata store. It contains database
-- definitions, table definitions, and other control information to manage
-- your AWS Lake Formation environment.
--
-- 'permissionsWithGrantOption', 'revokePermissions_permissionsWithGrantOption' - Indicates a list of permissions for which to revoke the grant option
-- allowing the principal to pass permissions to other principals.
--
-- 'principal', 'revokePermissions_principal' - The principal to be revoked permissions on the resource.
--
-- 'resource', 'revokePermissions_resource' - The resource to which permissions are to be revoked.
--
-- 'permissions', 'revokePermissions_permissions' - The permissions revoked to the principal on the resource. For
-- information about permissions, see
-- <https://docs-aws.amazon.com/lake-formation/latest/dg/security-data-access.html Security and Access Control to Metadata and Data>.
newRevokePermissions ::
  -- | 'principal'
  DataLakePrincipal ->
  -- | 'resource'
  Resource ->
  RevokePermissions
newRevokePermissions :: DataLakePrincipal -> Resource -> RevokePermissions
newRevokePermissions DataLakePrincipal
pPrincipal_ Resource
pResource_ =
  RevokePermissions' :: Maybe Text
-> Maybe [Permission]
-> DataLakePrincipal
-> Resource
-> [Permission]
-> RevokePermissions
RevokePermissions'
    { $sel:catalogId:RevokePermissions' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionsWithGrantOption:RevokePermissions' :: Maybe [Permission]
permissionsWithGrantOption = Maybe [Permission]
forall a. Maybe a
Prelude.Nothing,
      $sel:principal:RevokePermissions' :: DataLakePrincipal
principal = DataLakePrincipal
pPrincipal_,
      $sel:resource:RevokePermissions' :: Resource
resource = Resource
pResource_,
      $sel:permissions:RevokePermissions' :: [Permission]
permissions = [Permission]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The identifier for the Data Catalog. By default, the account ID. The
-- Data Catalog is the persistent metadata store. It contains database
-- definitions, table definitions, and other control information to manage
-- your AWS Lake Formation environment.
revokePermissions_catalogId :: Lens.Lens' RevokePermissions (Prelude.Maybe Prelude.Text)
revokePermissions_catalogId :: (Maybe Text -> f (Maybe Text))
-> RevokePermissions -> f RevokePermissions
revokePermissions_catalogId = (RevokePermissions -> Maybe Text)
-> (RevokePermissions -> Maybe Text -> RevokePermissions)
-> Lens
     RevokePermissions RevokePermissions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokePermissions' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:RevokePermissions' :: RevokePermissions -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: RevokePermissions
s@RevokePermissions' {} Maybe Text
a -> RevokePermissions
s {$sel:catalogId:RevokePermissions' :: Maybe Text
catalogId = Maybe Text
a} :: RevokePermissions)

-- | Indicates a list of permissions for which to revoke the grant option
-- allowing the principal to pass permissions to other principals.
revokePermissions_permissionsWithGrantOption :: Lens.Lens' RevokePermissions (Prelude.Maybe [Permission])
revokePermissions_permissionsWithGrantOption :: (Maybe [Permission] -> f (Maybe [Permission]))
-> RevokePermissions -> f RevokePermissions
revokePermissions_permissionsWithGrantOption = (RevokePermissions -> Maybe [Permission])
-> (RevokePermissions -> Maybe [Permission] -> RevokePermissions)
-> Lens
     RevokePermissions
     RevokePermissions
     (Maybe [Permission])
     (Maybe [Permission])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokePermissions' {Maybe [Permission]
permissionsWithGrantOption :: Maybe [Permission]
$sel:permissionsWithGrantOption:RevokePermissions' :: RevokePermissions -> Maybe [Permission]
permissionsWithGrantOption} -> Maybe [Permission]
permissionsWithGrantOption) (\s :: RevokePermissions
s@RevokePermissions' {} Maybe [Permission]
a -> RevokePermissions
s {$sel:permissionsWithGrantOption:RevokePermissions' :: Maybe [Permission]
permissionsWithGrantOption = Maybe [Permission]
a} :: RevokePermissions) ((Maybe [Permission] -> f (Maybe [Permission]))
 -> RevokePermissions -> f RevokePermissions)
-> ((Maybe [Permission] -> f (Maybe [Permission]))
    -> Maybe [Permission] -> f (Maybe [Permission]))
-> (Maybe [Permission] -> f (Maybe [Permission]))
-> RevokePermissions
-> f RevokePermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Permission] [Permission] [Permission] [Permission]
-> Iso
     (Maybe [Permission])
     (Maybe [Permission])
     (Maybe [Permission])
     (Maybe [Permission])
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 [Permission] [Permission] [Permission] [Permission]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The principal to be revoked permissions on the resource.
revokePermissions_principal :: Lens.Lens' RevokePermissions DataLakePrincipal
revokePermissions_principal :: (DataLakePrincipal -> f DataLakePrincipal)
-> RevokePermissions -> f RevokePermissions
revokePermissions_principal = (RevokePermissions -> DataLakePrincipal)
-> (RevokePermissions -> DataLakePrincipal -> RevokePermissions)
-> Lens
     RevokePermissions
     RevokePermissions
     DataLakePrincipal
     DataLakePrincipal
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokePermissions' {DataLakePrincipal
principal :: DataLakePrincipal
$sel:principal:RevokePermissions' :: RevokePermissions -> DataLakePrincipal
principal} -> DataLakePrincipal
principal) (\s :: RevokePermissions
s@RevokePermissions' {} DataLakePrincipal
a -> RevokePermissions
s {$sel:principal:RevokePermissions' :: DataLakePrincipal
principal = DataLakePrincipal
a} :: RevokePermissions)

-- | The resource to which permissions are to be revoked.
revokePermissions_resource :: Lens.Lens' RevokePermissions Resource
revokePermissions_resource :: (Resource -> f Resource)
-> RevokePermissions -> f RevokePermissions
revokePermissions_resource = (RevokePermissions -> Resource)
-> (RevokePermissions -> Resource -> RevokePermissions)
-> Lens RevokePermissions RevokePermissions Resource Resource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokePermissions' {Resource
resource :: Resource
$sel:resource:RevokePermissions' :: RevokePermissions -> Resource
resource} -> Resource
resource) (\s :: RevokePermissions
s@RevokePermissions' {} Resource
a -> RevokePermissions
s {$sel:resource:RevokePermissions' :: Resource
resource = Resource
a} :: RevokePermissions)

-- | The permissions revoked to the principal on the resource. For
-- information about permissions, see
-- <https://docs-aws.amazon.com/lake-formation/latest/dg/security-data-access.html Security and Access Control to Metadata and Data>.
revokePermissions_permissions :: Lens.Lens' RevokePermissions [Permission]
revokePermissions_permissions :: ([Permission] -> f [Permission])
-> RevokePermissions -> f RevokePermissions
revokePermissions_permissions = (RevokePermissions -> [Permission])
-> (RevokePermissions -> [Permission] -> RevokePermissions)
-> Lens
     RevokePermissions RevokePermissions [Permission] [Permission]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokePermissions' {[Permission]
permissions :: [Permission]
$sel:permissions:RevokePermissions' :: RevokePermissions -> [Permission]
permissions} -> [Permission]
permissions) (\s :: RevokePermissions
s@RevokePermissions' {} [Permission]
a -> RevokePermissions
s {$sel:permissions:RevokePermissions' :: [Permission]
permissions = [Permission]
a} :: RevokePermissions) (([Permission] -> f [Permission])
 -> RevokePermissions -> f RevokePermissions)
-> (([Permission] -> f [Permission])
    -> [Permission] -> f [Permission])
-> ([Permission] -> f [Permission])
-> RevokePermissions
-> f RevokePermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Permission] -> f [Permission]) -> [Permission] -> f [Permission]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest RevokePermissions where
  type
    AWSResponse RevokePermissions =
      RevokePermissionsResponse
  request :: RevokePermissions -> Request RevokePermissions
request = Service -> RevokePermissions -> Request RevokePermissions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy RevokePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RevokePermissions)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse RevokePermissions))
-> Logger
-> Service
-> Proxy RevokePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RevokePermissions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> RevokePermissionsResponse
RevokePermissionsResponse'
            (Int -> RevokePermissionsResponse)
-> Either String Int -> Either String RevokePermissionsResponse
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))
      )

instance Prelude.Hashable RevokePermissions

instance Prelude.NFData RevokePermissions

instance Core.ToHeaders RevokePermissions where
  toHeaders :: RevokePermissions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> RevokePermissions -> 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
"AWSLakeFormation.RevokePermissions" ::
                          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 RevokePermissions where
  toJSON :: RevokePermissions -> Value
toJSON RevokePermissions' {[Permission]
Maybe [Permission]
Maybe Text
DataLakePrincipal
Resource
permissions :: [Permission]
resource :: Resource
principal :: DataLakePrincipal
permissionsWithGrantOption :: Maybe [Permission]
catalogId :: Maybe Text
$sel:permissions:RevokePermissions' :: RevokePermissions -> [Permission]
$sel:resource:RevokePermissions' :: RevokePermissions -> Resource
$sel:principal:RevokePermissions' :: RevokePermissions -> DataLakePrincipal
$sel:permissionsWithGrantOption:RevokePermissions' :: RevokePermissions -> Maybe [Permission]
$sel:catalogId:RevokePermissions' :: RevokePermissions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CatalogId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
catalogId,
            (Text
"PermissionsWithGrantOption" Text -> [Permission] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Permission] -> Pair) -> Maybe [Permission] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Permission]
permissionsWithGrantOption,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Principal" Text -> DataLakePrincipal -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataLakePrincipal
principal),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Resource" Text -> Resource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Resource
resource),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Permissions" Text -> [Permission] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Permission]
permissions)
          ]
      )

instance Core.ToPath RevokePermissions where
  toPath :: RevokePermissions -> ByteString
toPath = ByteString -> RevokePermissions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newRevokePermissionsResponse' smart constructor.
data RevokePermissionsResponse = RevokePermissionsResponse'
  { -- | The response's http status code.
    RevokePermissionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RevokePermissionsResponse -> RevokePermissionsResponse -> Bool
(RevokePermissionsResponse -> RevokePermissionsResponse -> Bool)
-> (RevokePermissionsResponse -> RevokePermissionsResponse -> Bool)
-> Eq RevokePermissionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RevokePermissionsResponse -> RevokePermissionsResponse -> Bool
$c/= :: RevokePermissionsResponse -> RevokePermissionsResponse -> Bool
== :: RevokePermissionsResponse -> RevokePermissionsResponse -> Bool
$c== :: RevokePermissionsResponse -> RevokePermissionsResponse -> Bool
Prelude.Eq, ReadPrec [RevokePermissionsResponse]
ReadPrec RevokePermissionsResponse
Int -> ReadS RevokePermissionsResponse
ReadS [RevokePermissionsResponse]
(Int -> ReadS RevokePermissionsResponse)
-> ReadS [RevokePermissionsResponse]
-> ReadPrec RevokePermissionsResponse
-> ReadPrec [RevokePermissionsResponse]
-> Read RevokePermissionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RevokePermissionsResponse]
$creadListPrec :: ReadPrec [RevokePermissionsResponse]
readPrec :: ReadPrec RevokePermissionsResponse
$creadPrec :: ReadPrec RevokePermissionsResponse
readList :: ReadS [RevokePermissionsResponse]
$creadList :: ReadS [RevokePermissionsResponse]
readsPrec :: Int -> ReadS RevokePermissionsResponse
$creadsPrec :: Int -> ReadS RevokePermissionsResponse
Prelude.Read, Int -> RevokePermissionsResponse -> ShowS
[RevokePermissionsResponse] -> ShowS
RevokePermissionsResponse -> String
(Int -> RevokePermissionsResponse -> ShowS)
-> (RevokePermissionsResponse -> String)
-> ([RevokePermissionsResponse] -> ShowS)
-> Show RevokePermissionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevokePermissionsResponse] -> ShowS
$cshowList :: [RevokePermissionsResponse] -> ShowS
show :: RevokePermissionsResponse -> String
$cshow :: RevokePermissionsResponse -> String
showsPrec :: Int -> RevokePermissionsResponse -> ShowS
$cshowsPrec :: Int -> RevokePermissionsResponse -> ShowS
Prelude.Show, (forall x.
 RevokePermissionsResponse -> Rep RevokePermissionsResponse x)
-> (forall x.
    Rep RevokePermissionsResponse x -> RevokePermissionsResponse)
-> Generic RevokePermissionsResponse
forall x.
Rep RevokePermissionsResponse x -> RevokePermissionsResponse
forall x.
RevokePermissionsResponse -> Rep RevokePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RevokePermissionsResponse x -> RevokePermissionsResponse
$cfrom :: forall x.
RevokePermissionsResponse -> Rep RevokePermissionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'RevokePermissionsResponse' 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', 'revokePermissionsResponse_httpStatus' - The response's http status code.
newRevokePermissionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RevokePermissionsResponse
newRevokePermissionsResponse :: Int -> RevokePermissionsResponse
newRevokePermissionsResponse Int
pHttpStatus_ =
  RevokePermissionsResponse' :: Int -> RevokePermissionsResponse
RevokePermissionsResponse'
    { $sel:httpStatus:RevokePermissionsResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData RevokePermissionsResponse