{-# 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.SSM.ModifyDocumentPermission
-- 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)
--
-- Shares a Amazon Web Services Systems Manager document (SSM
-- document)publicly or privately. If you share a document privately, you
-- must specify the Amazon Web Services user account IDs for those people
-- who can use the document. If you share a document publicly, you must
-- specify /All/ as the account ID.
module Amazonka.SSM.ModifyDocumentPermission
  ( -- * Creating a Request
    ModifyDocumentPermission (..),
    newModifyDocumentPermission,

    -- * Request Lenses
    modifyDocumentPermission_sharedDocumentVersion,
    modifyDocumentPermission_accountIdsToAdd,
    modifyDocumentPermission_accountIdsToRemove,
    modifyDocumentPermission_name,
    modifyDocumentPermission_permissionType,

    -- * Destructuring the Response
    ModifyDocumentPermissionResponse (..),
    newModifyDocumentPermissionResponse,

    -- * Response Lenses
    modifyDocumentPermissionResponse_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.SSM.Types

-- | /See:/ 'newModifyDocumentPermission' smart constructor.
data ModifyDocumentPermission = ModifyDocumentPermission'
  { -- | (Optional) The version of the document to share. If it isn\'t specified,
    -- the system choose the @Default@ version to share.
    ModifyDocumentPermission -> Maybe Text
sharedDocumentVersion :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services user accounts that should have access to the
    -- document. The account IDs can either be a group of account IDs or /All/.
    ModifyDocumentPermission -> Maybe [Text]
accountIdsToAdd :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Web Services user accounts that should no longer have access
    -- to the document. The Amazon Web Services user account can either be a
    -- group of account IDs or /All/. This action has a higher priority than
    -- /AccountIdsToAdd/. If you specify an account ID to add and the same ID
    -- to remove, the system removes access to the document.
    ModifyDocumentPermission -> Maybe [Text]
accountIdsToRemove :: Prelude.Maybe [Prelude.Text],
    -- | The name of the document that you want to share.
    ModifyDocumentPermission -> Text
name :: Prelude.Text,
    -- | The permission type for the document. The permission type can be
    -- /Share/.
    ModifyDocumentPermission -> DocumentPermissionType
permissionType :: DocumentPermissionType
  }
  deriving (ModifyDocumentPermission -> ModifyDocumentPermission -> Bool
(ModifyDocumentPermission -> ModifyDocumentPermission -> Bool)
-> (ModifyDocumentPermission -> ModifyDocumentPermission -> Bool)
-> Eq ModifyDocumentPermission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyDocumentPermission -> ModifyDocumentPermission -> Bool
$c/= :: ModifyDocumentPermission -> ModifyDocumentPermission -> Bool
== :: ModifyDocumentPermission -> ModifyDocumentPermission -> Bool
$c== :: ModifyDocumentPermission -> ModifyDocumentPermission -> Bool
Prelude.Eq, ReadPrec [ModifyDocumentPermission]
ReadPrec ModifyDocumentPermission
Int -> ReadS ModifyDocumentPermission
ReadS [ModifyDocumentPermission]
(Int -> ReadS ModifyDocumentPermission)
-> ReadS [ModifyDocumentPermission]
-> ReadPrec ModifyDocumentPermission
-> ReadPrec [ModifyDocumentPermission]
-> Read ModifyDocumentPermission
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyDocumentPermission]
$creadListPrec :: ReadPrec [ModifyDocumentPermission]
readPrec :: ReadPrec ModifyDocumentPermission
$creadPrec :: ReadPrec ModifyDocumentPermission
readList :: ReadS [ModifyDocumentPermission]
$creadList :: ReadS [ModifyDocumentPermission]
readsPrec :: Int -> ReadS ModifyDocumentPermission
$creadsPrec :: Int -> ReadS ModifyDocumentPermission
Prelude.Read, Int -> ModifyDocumentPermission -> ShowS
[ModifyDocumentPermission] -> ShowS
ModifyDocumentPermission -> String
(Int -> ModifyDocumentPermission -> ShowS)
-> (ModifyDocumentPermission -> String)
-> ([ModifyDocumentPermission] -> ShowS)
-> Show ModifyDocumentPermission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyDocumentPermission] -> ShowS
$cshowList :: [ModifyDocumentPermission] -> ShowS
show :: ModifyDocumentPermission -> String
$cshow :: ModifyDocumentPermission -> String
showsPrec :: Int -> ModifyDocumentPermission -> ShowS
$cshowsPrec :: Int -> ModifyDocumentPermission -> ShowS
Prelude.Show, (forall x.
 ModifyDocumentPermission -> Rep ModifyDocumentPermission x)
-> (forall x.
    Rep ModifyDocumentPermission x -> ModifyDocumentPermission)
-> Generic ModifyDocumentPermission
forall x.
Rep ModifyDocumentPermission x -> ModifyDocumentPermission
forall x.
ModifyDocumentPermission -> Rep ModifyDocumentPermission x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyDocumentPermission x -> ModifyDocumentPermission
$cfrom :: forall x.
ModifyDocumentPermission -> Rep ModifyDocumentPermission x
Prelude.Generic)

-- |
-- Create a value of 'ModifyDocumentPermission' 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:
--
-- 'sharedDocumentVersion', 'modifyDocumentPermission_sharedDocumentVersion' - (Optional) The version of the document to share. If it isn\'t specified,
-- the system choose the @Default@ version to share.
--
-- 'accountIdsToAdd', 'modifyDocumentPermission_accountIdsToAdd' - The Amazon Web Services user accounts that should have access to the
-- document. The account IDs can either be a group of account IDs or /All/.
--
-- 'accountIdsToRemove', 'modifyDocumentPermission_accountIdsToRemove' - The Amazon Web Services user accounts that should no longer have access
-- to the document. The Amazon Web Services user account can either be a
-- group of account IDs or /All/. This action has a higher priority than
-- /AccountIdsToAdd/. If you specify an account ID to add and the same ID
-- to remove, the system removes access to the document.
--
-- 'name', 'modifyDocumentPermission_name' - The name of the document that you want to share.
--
-- 'permissionType', 'modifyDocumentPermission_permissionType' - The permission type for the document. The permission type can be
-- /Share/.
newModifyDocumentPermission ::
  -- | 'name'
  Prelude.Text ->
  -- | 'permissionType'
  DocumentPermissionType ->
  ModifyDocumentPermission
newModifyDocumentPermission :: Text -> DocumentPermissionType -> ModifyDocumentPermission
newModifyDocumentPermission Text
pName_ DocumentPermissionType
pPermissionType_ =
  ModifyDocumentPermission' :: Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Text
-> DocumentPermissionType
-> ModifyDocumentPermission
ModifyDocumentPermission'
    { $sel:sharedDocumentVersion:ModifyDocumentPermission' :: Maybe Text
sharedDocumentVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountIdsToAdd:ModifyDocumentPermission' :: Maybe [Text]
accountIdsToAdd = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:accountIdsToRemove:ModifyDocumentPermission' :: Maybe [Text]
accountIdsToRemove = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ModifyDocumentPermission' :: Text
name = Text
pName_,
      $sel:permissionType:ModifyDocumentPermission' :: DocumentPermissionType
permissionType = DocumentPermissionType
pPermissionType_
    }

-- | (Optional) The version of the document to share. If it isn\'t specified,
-- the system choose the @Default@ version to share.
modifyDocumentPermission_sharedDocumentVersion :: Lens.Lens' ModifyDocumentPermission (Prelude.Maybe Prelude.Text)
modifyDocumentPermission_sharedDocumentVersion :: (Maybe Text -> f (Maybe Text))
-> ModifyDocumentPermission -> f ModifyDocumentPermission
modifyDocumentPermission_sharedDocumentVersion = (ModifyDocumentPermission -> Maybe Text)
-> (ModifyDocumentPermission
    -> Maybe Text -> ModifyDocumentPermission)
-> Lens
     ModifyDocumentPermission
     ModifyDocumentPermission
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDocumentPermission' {Maybe Text
sharedDocumentVersion :: Maybe Text
$sel:sharedDocumentVersion:ModifyDocumentPermission' :: ModifyDocumentPermission -> Maybe Text
sharedDocumentVersion} -> Maybe Text
sharedDocumentVersion) (\s :: ModifyDocumentPermission
s@ModifyDocumentPermission' {} Maybe Text
a -> ModifyDocumentPermission
s {$sel:sharedDocumentVersion:ModifyDocumentPermission' :: Maybe Text
sharedDocumentVersion = Maybe Text
a} :: ModifyDocumentPermission)

-- | The Amazon Web Services user accounts that should have access to the
-- document. The account IDs can either be a group of account IDs or /All/.
modifyDocumentPermission_accountIdsToAdd :: Lens.Lens' ModifyDocumentPermission (Prelude.Maybe [Prelude.Text])
modifyDocumentPermission_accountIdsToAdd :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDocumentPermission -> f ModifyDocumentPermission
modifyDocumentPermission_accountIdsToAdd = (ModifyDocumentPermission -> Maybe [Text])
-> (ModifyDocumentPermission
    -> Maybe [Text] -> ModifyDocumentPermission)
-> Lens
     ModifyDocumentPermission
     ModifyDocumentPermission
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDocumentPermission' {Maybe [Text]
accountIdsToAdd :: Maybe [Text]
$sel:accountIdsToAdd:ModifyDocumentPermission' :: ModifyDocumentPermission -> Maybe [Text]
accountIdsToAdd} -> Maybe [Text]
accountIdsToAdd) (\s :: ModifyDocumentPermission
s@ModifyDocumentPermission' {} Maybe [Text]
a -> ModifyDocumentPermission
s {$sel:accountIdsToAdd:ModifyDocumentPermission' :: Maybe [Text]
accountIdsToAdd = Maybe [Text]
a} :: ModifyDocumentPermission) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyDocumentPermission -> f ModifyDocumentPermission)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDocumentPermission
-> f ModifyDocumentPermission
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Web Services user accounts that should no longer have access
-- to the document. The Amazon Web Services user account can either be a
-- group of account IDs or /All/. This action has a higher priority than
-- /AccountIdsToAdd/. If you specify an account ID to add and the same ID
-- to remove, the system removes access to the document.
modifyDocumentPermission_accountIdsToRemove :: Lens.Lens' ModifyDocumentPermission (Prelude.Maybe [Prelude.Text])
modifyDocumentPermission_accountIdsToRemove :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDocumentPermission -> f ModifyDocumentPermission
modifyDocumentPermission_accountIdsToRemove = (ModifyDocumentPermission -> Maybe [Text])
-> (ModifyDocumentPermission
    -> Maybe [Text] -> ModifyDocumentPermission)
-> Lens
     ModifyDocumentPermission
     ModifyDocumentPermission
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDocumentPermission' {Maybe [Text]
accountIdsToRemove :: Maybe [Text]
$sel:accountIdsToRemove:ModifyDocumentPermission' :: ModifyDocumentPermission -> Maybe [Text]
accountIdsToRemove} -> Maybe [Text]
accountIdsToRemove) (\s :: ModifyDocumentPermission
s@ModifyDocumentPermission' {} Maybe [Text]
a -> ModifyDocumentPermission
s {$sel:accountIdsToRemove:ModifyDocumentPermission' :: Maybe [Text]
accountIdsToRemove = Maybe [Text]
a} :: ModifyDocumentPermission) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyDocumentPermission -> f ModifyDocumentPermission)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDocumentPermission
-> f ModifyDocumentPermission
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the document that you want to share.
modifyDocumentPermission_name :: Lens.Lens' ModifyDocumentPermission Prelude.Text
modifyDocumentPermission_name :: (Text -> f Text)
-> ModifyDocumentPermission -> f ModifyDocumentPermission
modifyDocumentPermission_name = (ModifyDocumentPermission -> Text)
-> (ModifyDocumentPermission -> Text -> ModifyDocumentPermission)
-> Lens ModifyDocumentPermission ModifyDocumentPermission Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDocumentPermission' {Text
name :: Text
$sel:name:ModifyDocumentPermission' :: ModifyDocumentPermission -> Text
name} -> Text
name) (\s :: ModifyDocumentPermission
s@ModifyDocumentPermission' {} Text
a -> ModifyDocumentPermission
s {$sel:name:ModifyDocumentPermission' :: Text
name = Text
a} :: ModifyDocumentPermission)

-- | The permission type for the document. The permission type can be
-- /Share/.
modifyDocumentPermission_permissionType :: Lens.Lens' ModifyDocumentPermission DocumentPermissionType
modifyDocumentPermission_permissionType :: (DocumentPermissionType -> f DocumentPermissionType)
-> ModifyDocumentPermission -> f ModifyDocumentPermission
modifyDocumentPermission_permissionType = (ModifyDocumentPermission -> DocumentPermissionType)
-> (ModifyDocumentPermission
    -> DocumentPermissionType -> ModifyDocumentPermission)
-> Lens
     ModifyDocumentPermission
     ModifyDocumentPermission
     DocumentPermissionType
     DocumentPermissionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDocumentPermission' {DocumentPermissionType
permissionType :: DocumentPermissionType
$sel:permissionType:ModifyDocumentPermission' :: ModifyDocumentPermission -> DocumentPermissionType
permissionType} -> DocumentPermissionType
permissionType) (\s :: ModifyDocumentPermission
s@ModifyDocumentPermission' {} DocumentPermissionType
a -> ModifyDocumentPermission
s {$sel:permissionType:ModifyDocumentPermission' :: DocumentPermissionType
permissionType = DocumentPermissionType
a} :: ModifyDocumentPermission)

instance Core.AWSRequest ModifyDocumentPermission where
  type
    AWSResponse ModifyDocumentPermission =
      ModifyDocumentPermissionResponse
  request :: ModifyDocumentPermission -> Request ModifyDocumentPermission
request = Service
-> ModifyDocumentPermission -> Request ModifyDocumentPermission
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyDocumentPermission
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyDocumentPermission)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse ModifyDocumentPermission))
-> Logger
-> Service
-> Proxy ModifyDocumentPermission
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyDocumentPermission)))
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 -> ModifyDocumentPermissionResponse
ModifyDocumentPermissionResponse'
            (Int -> ModifyDocumentPermissionResponse)
-> Either String Int
-> Either String ModifyDocumentPermissionResponse
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 ModifyDocumentPermission

instance Prelude.NFData ModifyDocumentPermission

instance Core.ToHeaders ModifyDocumentPermission where
  toHeaders :: ModifyDocumentPermission -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ModifyDocumentPermission -> 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
"AmazonSSM.ModifyDocumentPermission" ::
                          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 ModifyDocumentPermission where
  toJSON :: ModifyDocumentPermission -> Value
toJSON ModifyDocumentPermission' {Maybe [Text]
Maybe Text
Text
DocumentPermissionType
permissionType :: DocumentPermissionType
name :: Text
accountIdsToRemove :: Maybe [Text]
accountIdsToAdd :: Maybe [Text]
sharedDocumentVersion :: Maybe Text
$sel:permissionType:ModifyDocumentPermission' :: ModifyDocumentPermission -> DocumentPermissionType
$sel:name:ModifyDocumentPermission' :: ModifyDocumentPermission -> Text
$sel:accountIdsToRemove:ModifyDocumentPermission' :: ModifyDocumentPermission -> Maybe [Text]
$sel:accountIdsToAdd:ModifyDocumentPermission' :: ModifyDocumentPermission -> Maybe [Text]
$sel:sharedDocumentVersion:ModifyDocumentPermission' :: ModifyDocumentPermission -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SharedDocumentVersion" 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
sharedDocumentVersion,
            (Text
"AccountIdsToAdd" 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]
accountIdsToAdd,
            (Text
"AccountIdsToRemove" 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]
accountIdsToRemove,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PermissionType" Text -> DocumentPermissionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DocumentPermissionType
permissionType)
          ]
      )

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

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

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

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

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

instance
  Prelude.NFData
    ModifyDocumentPermissionResponse