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

    -- * Request Lenses
    grantPermissions_catalogId,
    grantPermissions_permissionsWithGrantOption,
    grantPermissions_principal,
    grantPermissions_resource,
    grantPermissions_permissions,

    -- * Destructuring the Response
    GrantPermissionsResponse (..),
    newGrantPermissionsResponse,

    -- * Response Lenses
    grantPermissionsResponse_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:/ 'newGrantPermissions' smart constructor.
data GrantPermissions = GrantPermissions'
  { -- | 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.
    GrantPermissions -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | Indicates a list of the granted permissions that the principal may pass
    -- to other users. These permissions may only be a subset of the
    -- permissions granted in the @Privileges@.
    GrantPermissions -> Maybe [Permission]
permissionsWithGrantOption :: Prelude.Maybe [Permission],
    -- | The principal to be granted the permissions on the resource. Supported
    -- principals are IAM users or IAM roles, and they are defined by their
    -- principal type and their ARN.
    --
    -- Note that if you define a resource with a particular ARN, then later
    -- delete, and recreate a resource with that same ARN, the resource
    -- maintains the permissions already granted.
    GrantPermissions -> DataLakePrincipal
principal :: DataLakePrincipal,
    -- | The resource to which permissions are to be granted. Resources in AWS
    -- Lake Formation are the Data Catalog, databases, and tables.
    GrantPermissions -> Resource
resource :: Resource,
    -- | The permissions granted to the principal on the resource. AWS Lake
    -- Formation defines privileges to grant and revoke access to metadata in
    -- the Data Catalog and data organized in underlying data storage such as
    -- Amazon S3. AWS Lake Formation requires that each principal be authorized
    -- to perform a specific task on AWS Lake Formation resources.
    GrantPermissions -> [Permission]
permissions :: [Permission]
  }
  deriving (GrantPermissions -> GrantPermissions -> Bool
(GrantPermissions -> GrantPermissions -> Bool)
-> (GrantPermissions -> GrantPermissions -> Bool)
-> Eq GrantPermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GrantPermissions -> GrantPermissions -> Bool
$c/= :: GrantPermissions -> GrantPermissions -> Bool
== :: GrantPermissions -> GrantPermissions -> Bool
$c== :: GrantPermissions -> GrantPermissions -> Bool
Prelude.Eq, ReadPrec [GrantPermissions]
ReadPrec GrantPermissions
Int -> ReadS GrantPermissions
ReadS [GrantPermissions]
(Int -> ReadS GrantPermissions)
-> ReadS [GrantPermissions]
-> ReadPrec GrantPermissions
-> ReadPrec [GrantPermissions]
-> Read GrantPermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GrantPermissions]
$creadListPrec :: ReadPrec [GrantPermissions]
readPrec :: ReadPrec GrantPermissions
$creadPrec :: ReadPrec GrantPermissions
readList :: ReadS [GrantPermissions]
$creadList :: ReadS [GrantPermissions]
readsPrec :: Int -> ReadS GrantPermissions
$creadsPrec :: Int -> ReadS GrantPermissions
Prelude.Read, Int -> GrantPermissions -> ShowS
[GrantPermissions] -> ShowS
GrantPermissions -> String
(Int -> GrantPermissions -> ShowS)
-> (GrantPermissions -> String)
-> ([GrantPermissions] -> ShowS)
-> Show GrantPermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GrantPermissions] -> ShowS
$cshowList :: [GrantPermissions] -> ShowS
show :: GrantPermissions -> String
$cshow :: GrantPermissions -> String
showsPrec :: Int -> GrantPermissions -> ShowS
$cshowsPrec :: Int -> GrantPermissions -> ShowS
Prelude.Show, (forall x. GrantPermissions -> Rep GrantPermissions x)
-> (forall x. Rep GrantPermissions x -> GrantPermissions)
-> Generic GrantPermissions
forall x. Rep GrantPermissions x -> GrantPermissions
forall x. GrantPermissions -> Rep GrantPermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GrantPermissions x -> GrantPermissions
$cfrom :: forall x. GrantPermissions -> Rep GrantPermissions x
Prelude.Generic)

-- |
-- Create a value of 'GrantPermissions' 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', 'grantPermissions_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', 'grantPermissions_permissionsWithGrantOption' - Indicates a list of the granted permissions that the principal may pass
-- to other users. These permissions may only be a subset of the
-- permissions granted in the @Privileges@.
--
-- 'principal', 'grantPermissions_principal' - The principal to be granted the permissions on the resource. Supported
-- principals are IAM users or IAM roles, and they are defined by their
-- principal type and their ARN.
--
-- Note that if you define a resource with a particular ARN, then later
-- delete, and recreate a resource with that same ARN, the resource
-- maintains the permissions already granted.
--
-- 'resource', 'grantPermissions_resource' - The resource to which permissions are to be granted. Resources in AWS
-- Lake Formation are the Data Catalog, databases, and tables.
--
-- 'permissions', 'grantPermissions_permissions' - The permissions granted to the principal on the resource. AWS Lake
-- Formation defines privileges to grant and revoke access to metadata in
-- the Data Catalog and data organized in underlying data storage such as
-- Amazon S3. AWS Lake Formation requires that each principal be authorized
-- to perform a specific task on AWS Lake Formation resources.
newGrantPermissions ::
  -- | 'principal'
  DataLakePrincipal ->
  -- | 'resource'
  Resource ->
  GrantPermissions
newGrantPermissions :: DataLakePrincipal -> Resource -> GrantPermissions
newGrantPermissions DataLakePrincipal
pPrincipal_ Resource
pResource_ =
  GrantPermissions' :: Maybe Text
-> Maybe [Permission]
-> DataLakePrincipal
-> Resource
-> [Permission]
-> GrantPermissions
GrantPermissions'
    { $sel:catalogId:GrantPermissions' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionsWithGrantOption:GrantPermissions' :: Maybe [Permission]
permissionsWithGrantOption = Maybe [Permission]
forall a. Maybe a
Prelude.Nothing,
      $sel:principal:GrantPermissions' :: DataLakePrincipal
principal = DataLakePrincipal
pPrincipal_,
      $sel:resource:GrantPermissions' :: Resource
resource = Resource
pResource_,
      $sel:permissions:GrantPermissions' :: [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.
grantPermissions_catalogId :: Lens.Lens' GrantPermissions (Prelude.Maybe Prelude.Text)
grantPermissions_catalogId :: (Maybe Text -> f (Maybe Text))
-> GrantPermissions -> f GrantPermissions
grantPermissions_catalogId = (GrantPermissions -> Maybe Text)
-> (GrantPermissions -> Maybe Text -> GrantPermissions)
-> Lens GrantPermissions GrantPermissions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantPermissions' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:GrantPermissions' :: GrantPermissions -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: GrantPermissions
s@GrantPermissions' {} Maybe Text
a -> GrantPermissions
s {$sel:catalogId:GrantPermissions' :: Maybe Text
catalogId = Maybe Text
a} :: GrantPermissions)

-- | Indicates a list of the granted permissions that the principal may pass
-- to other users. These permissions may only be a subset of the
-- permissions granted in the @Privileges@.
grantPermissions_permissionsWithGrantOption :: Lens.Lens' GrantPermissions (Prelude.Maybe [Permission])
grantPermissions_permissionsWithGrantOption :: (Maybe [Permission] -> f (Maybe [Permission]))
-> GrantPermissions -> f GrantPermissions
grantPermissions_permissionsWithGrantOption = (GrantPermissions -> Maybe [Permission])
-> (GrantPermissions -> Maybe [Permission] -> GrantPermissions)
-> Lens
     GrantPermissions
     GrantPermissions
     (Maybe [Permission])
     (Maybe [Permission])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantPermissions' {Maybe [Permission]
permissionsWithGrantOption :: Maybe [Permission]
$sel:permissionsWithGrantOption:GrantPermissions' :: GrantPermissions -> Maybe [Permission]
permissionsWithGrantOption} -> Maybe [Permission]
permissionsWithGrantOption) (\s :: GrantPermissions
s@GrantPermissions' {} Maybe [Permission]
a -> GrantPermissions
s {$sel:permissionsWithGrantOption:GrantPermissions' :: Maybe [Permission]
permissionsWithGrantOption = Maybe [Permission]
a} :: GrantPermissions) ((Maybe [Permission] -> f (Maybe [Permission]))
 -> GrantPermissions -> f GrantPermissions)
-> ((Maybe [Permission] -> f (Maybe [Permission]))
    -> Maybe [Permission] -> f (Maybe [Permission]))
-> (Maybe [Permission] -> f (Maybe [Permission]))
-> GrantPermissions
-> f GrantPermissions
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 granted the permissions on the resource. Supported
-- principals are IAM users or IAM roles, and they are defined by their
-- principal type and their ARN.
--
-- Note that if you define a resource with a particular ARN, then later
-- delete, and recreate a resource with that same ARN, the resource
-- maintains the permissions already granted.
grantPermissions_principal :: Lens.Lens' GrantPermissions DataLakePrincipal
grantPermissions_principal :: (DataLakePrincipal -> f DataLakePrincipal)
-> GrantPermissions -> f GrantPermissions
grantPermissions_principal = (GrantPermissions -> DataLakePrincipal)
-> (GrantPermissions -> DataLakePrincipal -> GrantPermissions)
-> Lens
     GrantPermissions
     GrantPermissions
     DataLakePrincipal
     DataLakePrincipal
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantPermissions' {DataLakePrincipal
principal :: DataLakePrincipal
$sel:principal:GrantPermissions' :: GrantPermissions -> DataLakePrincipal
principal} -> DataLakePrincipal
principal) (\s :: GrantPermissions
s@GrantPermissions' {} DataLakePrincipal
a -> GrantPermissions
s {$sel:principal:GrantPermissions' :: DataLakePrincipal
principal = DataLakePrincipal
a} :: GrantPermissions)

-- | The resource to which permissions are to be granted. Resources in AWS
-- Lake Formation are the Data Catalog, databases, and tables.
grantPermissions_resource :: Lens.Lens' GrantPermissions Resource
grantPermissions_resource :: (Resource -> f Resource) -> GrantPermissions -> f GrantPermissions
grantPermissions_resource = (GrantPermissions -> Resource)
-> (GrantPermissions -> Resource -> GrantPermissions)
-> Lens GrantPermissions GrantPermissions Resource Resource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantPermissions' {Resource
resource :: Resource
$sel:resource:GrantPermissions' :: GrantPermissions -> Resource
resource} -> Resource
resource) (\s :: GrantPermissions
s@GrantPermissions' {} Resource
a -> GrantPermissions
s {$sel:resource:GrantPermissions' :: Resource
resource = Resource
a} :: GrantPermissions)

-- | The permissions granted to the principal on the resource. AWS Lake
-- Formation defines privileges to grant and revoke access to metadata in
-- the Data Catalog and data organized in underlying data storage such as
-- Amazon S3. AWS Lake Formation requires that each principal be authorized
-- to perform a specific task on AWS Lake Formation resources.
grantPermissions_permissions :: Lens.Lens' GrantPermissions [Permission]
grantPermissions_permissions :: ([Permission] -> f [Permission])
-> GrantPermissions -> f GrantPermissions
grantPermissions_permissions = (GrantPermissions -> [Permission])
-> (GrantPermissions -> [Permission] -> GrantPermissions)
-> Lens GrantPermissions GrantPermissions [Permission] [Permission]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantPermissions' {[Permission]
permissions :: [Permission]
$sel:permissions:GrantPermissions' :: GrantPermissions -> [Permission]
permissions} -> [Permission]
permissions) (\s :: GrantPermissions
s@GrantPermissions' {} [Permission]
a -> GrantPermissions
s {$sel:permissions:GrantPermissions' :: [Permission]
permissions = [Permission]
a} :: GrantPermissions) (([Permission] -> f [Permission])
 -> GrantPermissions -> f GrantPermissions)
-> (([Permission] -> f [Permission])
    -> [Permission] -> f [Permission])
-> ([Permission] -> f [Permission])
-> GrantPermissions
-> f GrantPermissions
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 GrantPermissions where
  type
    AWSResponse GrantPermissions =
      GrantPermissionsResponse
  request :: GrantPermissions -> Request GrantPermissions
request = Service -> GrantPermissions -> Request GrantPermissions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GrantPermissions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GrantPermissions)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse GrantPermissions))
-> Logger
-> Service
-> Proxy GrantPermissions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GrantPermissions)))
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 -> GrantPermissionsResponse
GrantPermissionsResponse'
            (Int -> GrantPermissionsResponse)
-> Either String Int -> Either String GrantPermissionsResponse
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 GrantPermissions

instance Prelude.NFData GrantPermissions

instance Core.ToHeaders GrantPermissions where
  toHeaders :: GrantPermissions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GrantPermissions -> 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.GrantPermissions" ::
                          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 GrantPermissions where
  toJSON :: GrantPermissions -> Value
toJSON GrantPermissions' {[Permission]
Maybe [Permission]
Maybe Text
DataLakePrincipal
Resource
permissions :: [Permission]
resource :: Resource
principal :: DataLakePrincipal
permissionsWithGrantOption :: Maybe [Permission]
catalogId :: Maybe Text
$sel:permissions:GrantPermissions' :: GrantPermissions -> [Permission]
$sel:resource:GrantPermissions' :: GrantPermissions -> Resource
$sel:principal:GrantPermissions' :: GrantPermissions -> DataLakePrincipal
$sel:permissionsWithGrantOption:GrantPermissions' :: GrantPermissions -> Maybe [Permission]
$sel:catalogId:GrantPermissions' :: GrantPermissions -> 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 GrantPermissions where
  toPath :: GrantPermissions -> ByteString
toPath = ByteString -> GrantPermissions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

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

instance Prelude.NFData GrantPermissionsResponse