{-# 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.WorkDocs.AddResourcePermissions
-- 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)
--
-- Creates a set of permissions for the specified folder or document. The
-- resource permissions are overwritten if the principals already have
-- different permissions.
module Amazonka.WorkDocs.AddResourcePermissions
  ( -- * Creating a Request
    AddResourcePermissions (..),
    newAddResourcePermissions,

    -- * Request Lenses
    addResourcePermissions_notificationOptions,
    addResourcePermissions_authenticationToken,
    addResourcePermissions_resourceId,
    addResourcePermissions_principals,

    -- * Destructuring the Response
    AddResourcePermissionsResponse (..),
    newAddResourcePermissionsResponse,

    -- * Response Lenses
    addResourcePermissionsResponse_shareResults,
    addResourcePermissionsResponse_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.WorkDocs.Types

-- | /See:/ 'newAddResourcePermissions' smart constructor.
data AddResourcePermissions = AddResourcePermissions'
  { -- | The notification options.
    AddResourcePermissions -> Maybe NotificationOptions
notificationOptions :: Prelude.Maybe NotificationOptions,
    -- | Amazon WorkDocs authentication token. Not required when using AWS
    -- administrator credentials to access the API.
    AddResourcePermissions -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The ID of the resource.
    AddResourcePermissions -> Text
resourceId :: Prelude.Text,
    -- | The users, groups, or organization being granted permission.
    AddResourcePermissions -> [SharePrincipal]
principals :: [SharePrincipal]
  }
  deriving (AddResourcePermissions -> AddResourcePermissions -> Bool
(AddResourcePermissions -> AddResourcePermissions -> Bool)
-> (AddResourcePermissions -> AddResourcePermissions -> Bool)
-> Eq AddResourcePermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddResourcePermissions -> AddResourcePermissions -> Bool
$c/= :: AddResourcePermissions -> AddResourcePermissions -> Bool
== :: AddResourcePermissions -> AddResourcePermissions -> Bool
$c== :: AddResourcePermissions -> AddResourcePermissions -> Bool
Prelude.Eq, Int -> AddResourcePermissions -> ShowS
[AddResourcePermissions] -> ShowS
AddResourcePermissions -> String
(Int -> AddResourcePermissions -> ShowS)
-> (AddResourcePermissions -> String)
-> ([AddResourcePermissions] -> ShowS)
-> Show AddResourcePermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddResourcePermissions] -> ShowS
$cshowList :: [AddResourcePermissions] -> ShowS
show :: AddResourcePermissions -> String
$cshow :: AddResourcePermissions -> String
showsPrec :: Int -> AddResourcePermissions -> ShowS
$cshowsPrec :: Int -> AddResourcePermissions -> ShowS
Prelude.Show, (forall x. AddResourcePermissions -> Rep AddResourcePermissions x)
-> (forall x.
    Rep AddResourcePermissions x -> AddResourcePermissions)
-> Generic AddResourcePermissions
forall x. Rep AddResourcePermissions x -> AddResourcePermissions
forall x. AddResourcePermissions -> Rep AddResourcePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddResourcePermissions x -> AddResourcePermissions
$cfrom :: forall x. AddResourcePermissions -> Rep AddResourcePermissions x
Prelude.Generic)

-- |
-- Create a value of 'AddResourcePermissions' 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:
--
-- 'notificationOptions', 'addResourcePermissions_notificationOptions' - The notification options.
--
-- 'authenticationToken', 'addResourcePermissions_authenticationToken' - Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
--
-- 'resourceId', 'addResourcePermissions_resourceId' - The ID of the resource.
--
-- 'principals', 'addResourcePermissions_principals' - The users, groups, or organization being granted permission.
newAddResourcePermissions ::
  -- | 'resourceId'
  Prelude.Text ->
  AddResourcePermissions
newAddResourcePermissions :: Text -> AddResourcePermissions
newAddResourcePermissions Text
pResourceId_ =
  AddResourcePermissions' :: Maybe NotificationOptions
-> Maybe (Sensitive Text)
-> Text
-> [SharePrincipal]
-> AddResourcePermissions
AddResourcePermissions'
    { $sel:notificationOptions:AddResourcePermissions' :: Maybe NotificationOptions
notificationOptions =
        Maybe NotificationOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:authenticationToken:AddResourcePermissions' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:AddResourcePermissions' :: Text
resourceId = Text
pResourceId_,
      $sel:principals:AddResourcePermissions' :: [SharePrincipal]
principals = [SharePrincipal]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The notification options.
addResourcePermissions_notificationOptions :: Lens.Lens' AddResourcePermissions (Prelude.Maybe NotificationOptions)
addResourcePermissions_notificationOptions :: (Maybe NotificationOptions -> f (Maybe NotificationOptions))
-> AddResourcePermissions -> f AddResourcePermissions
addResourcePermissions_notificationOptions = (AddResourcePermissions -> Maybe NotificationOptions)
-> (AddResourcePermissions
    -> Maybe NotificationOptions -> AddResourcePermissions)
-> Lens
     AddResourcePermissions
     AddResourcePermissions
     (Maybe NotificationOptions)
     (Maybe NotificationOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddResourcePermissions' {Maybe NotificationOptions
notificationOptions :: Maybe NotificationOptions
$sel:notificationOptions:AddResourcePermissions' :: AddResourcePermissions -> Maybe NotificationOptions
notificationOptions} -> Maybe NotificationOptions
notificationOptions) (\s :: AddResourcePermissions
s@AddResourcePermissions' {} Maybe NotificationOptions
a -> AddResourcePermissions
s {$sel:notificationOptions:AddResourcePermissions' :: Maybe NotificationOptions
notificationOptions = Maybe NotificationOptions
a} :: AddResourcePermissions)

-- | Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
addResourcePermissions_authenticationToken :: Lens.Lens' AddResourcePermissions (Prelude.Maybe Prelude.Text)
addResourcePermissions_authenticationToken :: (Maybe Text -> f (Maybe Text))
-> AddResourcePermissions -> f AddResourcePermissions
addResourcePermissions_authenticationToken = (AddResourcePermissions -> Maybe (Sensitive Text))
-> (AddResourcePermissions
    -> Maybe (Sensitive Text) -> AddResourcePermissions)
-> Lens
     AddResourcePermissions
     AddResourcePermissions
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddResourcePermissions' {Maybe (Sensitive Text)
authenticationToken :: Maybe (Sensitive Text)
$sel:authenticationToken:AddResourcePermissions' :: AddResourcePermissions -> Maybe (Sensitive Text)
authenticationToken} -> Maybe (Sensitive Text)
authenticationToken) (\s :: AddResourcePermissions
s@AddResourcePermissions' {} Maybe (Sensitive Text)
a -> AddResourcePermissions
s {$sel:authenticationToken:AddResourcePermissions' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
a} :: AddResourcePermissions) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> AddResourcePermissions -> f AddResourcePermissions)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AddResourcePermissions
-> f AddResourcePermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The ID of the resource.
addResourcePermissions_resourceId :: Lens.Lens' AddResourcePermissions Prelude.Text
addResourcePermissions_resourceId :: (Text -> f Text)
-> AddResourcePermissions -> f AddResourcePermissions
addResourcePermissions_resourceId = (AddResourcePermissions -> Text)
-> (AddResourcePermissions -> Text -> AddResourcePermissions)
-> Lens AddResourcePermissions AddResourcePermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddResourcePermissions' {Text
resourceId :: Text
$sel:resourceId:AddResourcePermissions' :: AddResourcePermissions -> Text
resourceId} -> Text
resourceId) (\s :: AddResourcePermissions
s@AddResourcePermissions' {} Text
a -> AddResourcePermissions
s {$sel:resourceId:AddResourcePermissions' :: Text
resourceId = Text
a} :: AddResourcePermissions)

-- | The users, groups, or organization being granted permission.
addResourcePermissions_principals :: Lens.Lens' AddResourcePermissions [SharePrincipal]
addResourcePermissions_principals :: ([SharePrincipal] -> f [SharePrincipal])
-> AddResourcePermissions -> f AddResourcePermissions
addResourcePermissions_principals = (AddResourcePermissions -> [SharePrincipal])
-> (AddResourcePermissions
    -> [SharePrincipal] -> AddResourcePermissions)
-> Lens
     AddResourcePermissions
     AddResourcePermissions
     [SharePrincipal]
     [SharePrincipal]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddResourcePermissions' {[SharePrincipal]
principals :: [SharePrincipal]
$sel:principals:AddResourcePermissions' :: AddResourcePermissions -> [SharePrincipal]
principals} -> [SharePrincipal]
principals) (\s :: AddResourcePermissions
s@AddResourcePermissions' {} [SharePrincipal]
a -> AddResourcePermissions
s {$sel:principals:AddResourcePermissions' :: [SharePrincipal]
principals = [SharePrincipal]
a} :: AddResourcePermissions) (([SharePrincipal] -> f [SharePrincipal])
 -> AddResourcePermissions -> f AddResourcePermissions)
-> (([SharePrincipal] -> f [SharePrincipal])
    -> [SharePrincipal] -> f [SharePrincipal])
-> ([SharePrincipal] -> f [SharePrincipal])
-> AddResourcePermissions
-> f AddResourcePermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SharePrincipal] -> f [SharePrincipal])
-> [SharePrincipal] -> f [SharePrincipal]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest AddResourcePermissions where
  type
    AWSResponse AddResourcePermissions =
      AddResourcePermissionsResponse
  request :: AddResourcePermissions -> Request AddResourcePermissions
request = Service -> AddResourcePermissions -> Request AddResourcePermissions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AddResourcePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AddResourcePermissions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse AddResourcePermissions))
-> Logger
-> Service
-> Proxy AddResourcePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AddResourcePermissions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [ShareResult] -> Int -> AddResourcePermissionsResponse
AddResourcePermissionsResponse'
            (Maybe [ShareResult] -> Int -> AddResourcePermissionsResponse)
-> Either String (Maybe [ShareResult])
-> Either String (Int -> AddResourcePermissionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ShareResult]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ShareResults" Either String (Maybe (Maybe [ShareResult]))
-> Maybe [ShareResult] -> Either String (Maybe [ShareResult])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ShareResult]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> AddResourcePermissionsResponse)
-> Either String Int
-> Either String AddResourcePermissionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable AddResourcePermissions

instance Prelude.NFData AddResourcePermissions

instance Core.ToHeaders AddResourcePermissions where
  toHeaders :: AddResourcePermissions -> ResponseHeaders
toHeaders AddResourcePermissions' {[SharePrincipal]
Maybe (Sensitive Text)
Maybe NotificationOptions
Text
principals :: [SharePrincipal]
resourceId :: Text
authenticationToken :: Maybe (Sensitive Text)
notificationOptions :: Maybe NotificationOptions
$sel:principals:AddResourcePermissions' :: AddResourcePermissions -> [SharePrincipal]
$sel:resourceId:AddResourcePermissions' :: AddResourcePermissions -> Text
$sel:authenticationToken:AddResourcePermissions' :: AddResourcePermissions -> Maybe (Sensitive Text)
$sel:notificationOptions:AddResourcePermissions' :: AddResourcePermissions -> Maybe NotificationOptions
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"Authentication" HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
authenticationToken,
        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 AddResourcePermissions where
  toJSON :: AddResourcePermissions -> Value
toJSON AddResourcePermissions' {[SharePrincipal]
Maybe (Sensitive Text)
Maybe NotificationOptions
Text
principals :: [SharePrincipal]
resourceId :: Text
authenticationToken :: Maybe (Sensitive Text)
notificationOptions :: Maybe NotificationOptions
$sel:principals:AddResourcePermissions' :: AddResourcePermissions -> [SharePrincipal]
$sel:resourceId:AddResourcePermissions' :: AddResourcePermissions -> Text
$sel:authenticationToken:AddResourcePermissions' :: AddResourcePermissions -> Maybe (Sensitive Text)
$sel:notificationOptions:AddResourcePermissions' :: AddResourcePermissions -> Maybe NotificationOptions
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NotificationOptions" Text -> NotificationOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NotificationOptions -> Pair)
-> Maybe NotificationOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationOptions
notificationOptions,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Principals" Text -> [SharePrincipal] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [SharePrincipal]
principals)
          ]
      )

instance Core.ToPath AddResourcePermissions where
  toPath :: AddResourcePermissions -> ByteString
toPath AddResourcePermissions' {[SharePrincipal]
Maybe (Sensitive Text)
Maybe NotificationOptions
Text
principals :: [SharePrincipal]
resourceId :: Text
authenticationToken :: Maybe (Sensitive Text)
notificationOptions :: Maybe NotificationOptions
$sel:principals:AddResourcePermissions' :: AddResourcePermissions -> [SharePrincipal]
$sel:resourceId:AddResourcePermissions' :: AddResourcePermissions -> Text
$sel:authenticationToken:AddResourcePermissions' :: AddResourcePermissions -> Maybe (Sensitive Text)
$sel:notificationOptions:AddResourcePermissions' :: AddResourcePermissions -> Maybe NotificationOptions
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/api/v1/resources/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceId,
        ByteString
"/permissions"
      ]

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

-- | /See:/ 'newAddResourcePermissionsResponse' smart constructor.
data AddResourcePermissionsResponse = AddResourcePermissionsResponse'
  { -- | The share results.
    AddResourcePermissionsResponse -> Maybe [ShareResult]
shareResults :: Prelude.Maybe [ShareResult],
    -- | The response's http status code.
    AddResourcePermissionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AddResourcePermissionsResponse
-> AddResourcePermissionsResponse -> Bool
(AddResourcePermissionsResponse
 -> AddResourcePermissionsResponse -> Bool)
-> (AddResourcePermissionsResponse
    -> AddResourcePermissionsResponse -> Bool)
-> Eq AddResourcePermissionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddResourcePermissionsResponse
-> AddResourcePermissionsResponse -> Bool
$c/= :: AddResourcePermissionsResponse
-> AddResourcePermissionsResponse -> Bool
== :: AddResourcePermissionsResponse
-> AddResourcePermissionsResponse -> Bool
$c== :: AddResourcePermissionsResponse
-> AddResourcePermissionsResponse -> Bool
Prelude.Eq, Int -> AddResourcePermissionsResponse -> ShowS
[AddResourcePermissionsResponse] -> ShowS
AddResourcePermissionsResponse -> String
(Int -> AddResourcePermissionsResponse -> ShowS)
-> (AddResourcePermissionsResponse -> String)
-> ([AddResourcePermissionsResponse] -> ShowS)
-> Show AddResourcePermissionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddResourcePermissionsResponse] -> ShowS
$cshowList :: [AddResourcePermissionsResponse] -> ShowS
show :: AddResourcePermissionsResponse -> String
$cshow :: AddResourcePermissionsResponse -> String
showsPrec :: Int -> AddResourcePermissionsResponse -> ShowS
$cshowsPrec :: Int -> AddResourcePermissionsResponse -> ShowS
Prelude.Show, (forall x.
 AddResourcePermissionsResponse
 -> Rep AddResourcePermissionsResponse x)
-> (forall x.
    Rep AddResourcePermissionsResponse x
    -> AddResourcePermissionsResponse)
-> Generic AddResourcePermissionsResponse
forall x.
Rep AddResourcePermissionsResponse x
-> AddResourcePermissionsResponse
forall x.
AddResourcePermissionsResponse
-> Rep AddResourcePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddResourcePermissionsResponse x
-> AddResourcePermissionsResponse
$cfrom :: forall x.
AddResourcePermissionsResponse
-> Rep AddResourcePermissionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'AddResourcePermissionsResponse' 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:
--
-- 'shareResults', 'addResourcePermissionsResponse_shareResults' - The share results.
--
-- 'httpStatus', 'addResourcePermissionsResponse_httpStatus' - The response's http status code.
newAddResourcePermissionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AddResourcePermissionsResponse
newAddResourcePermissionsResponse :: Int -> AddResourcePermissionsResponse
newAddResourcePermissionsResponse Int
pHttpStatus_ =
  AddResourcePermissionsResponse' :: Maybe [ShareResult] -> Int -> AddResourcePermissionsResponse
AddResourcePermissionsResponse'
    { $sel:shareResults:AddResourcePermissionsResponse' :: Maybe [ShareResult]
shareResults =
        Maybe [ShareResult]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AddResourcePermissionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The share results.
addResourcePermissionsResponse_shareResults :: Lens.Lens' AddResourcePermissionsResponse (Prelude.Maybe [ShareResult])
addResourcePermissionsResponse_shareResults :: (Maybe [ShareResult] -> f (Maybe [ShareResult]))
-> AddResourcePermissionsResponse
-> f AddResourcePermissionsResponse
addResourcePermissionsResponse_shareResults = (AddResourcePermissionsResponse -> Maybe [ShareResult])
-> (AddResourcePermissionsResponse
    -> Maybe [ShareResult] -> AddResourcePermissionsResponse)
-> Lens
     AddResourcePermissionsResponse
     AddResourcePermissionsResponse
     (Maybe [ShareResult])
     (Maybe [ShareResult])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddResourcePermissionsResponse' {Maybe [ShareResult]
shareResults :: Maybe [ShareResult]
$sel:shareResults:AddResourcePermissionsResponse' :: AddResourcePermissionsResponse -> Maybe [ShareResult]
shareResults} -> Maybe [ShareResult]
shareResults) (\s :: AddResourcePermissionsResponse
s@AddResourcePermissionsResponse' {} Maybe [ShareResult]
a -> AddResourcePermissionsResponse
s {$sel:shareResults:AddResourcePermissionsResponse' :: Maybe [ShareResult]
shareResults = Maybe [ShareResult]
a} :: AddResourcePermissionsResponse) ((Maybe [ShareResult] -> f (Maybe [ShareResult]))
 -> AddResourcePermissionsResponse
 -> f AddResourcePermissionsResponse)
-> ((Maybe [ShareResult] -> f (Maybe [ShareResult]))
    -> Maybe [ShareResult] -> f (Maybe [ShareResult]))
-> (Maybe [ShareResult] -> f (Maybe [ShareResult]))
-> AddResourcePermissionsResponse
-> f AddResourcePermissionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ShareResult] [ShareResult] [ShareResult] [ShareResult]
-> Iso
     (Maybe [ShareResult])
     (Maybe [ShareResult])
     (Maybe [ShareResult])
     (Maybe [ShareResult])
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 [ShareResult] [ShareResult] [ShareResult] [ShareResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    AddResourcePermissionsResponse