{-# 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.QuickSight.UpdateDashboardPermissions
-- 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)
--
-- Updates read and write permissions on a dashboard.
module Amazonka.QuickSight.UpdateDashboardPermissions
  ( -- * Creating a Request
    UpdateDashboardPermissions (..),
    newUpdateDashboardPermissions,

    -- * Request Lenses
    updateDashboardPermissions_revokePermissions,
    updateDashboardPermissions_grantPermissions,
    updateDashboardPermissions_awsAccountId,
    updateDashboardPermissions_dashboardId,

    -- * Destructuring the Response
    UpdateDashboardPermissionsResponse (..),
    newUpdateDashboardPermissionsResponse,

    -- * Response Lenses
    updateDashboardPermissionsResponse_requestId,
    updateDashboardPermissionsResponse_dashboardId,
    updateDashboardPermissionsResponse_permissions,
    updateDashboardPermissionsResponse_dashboardArn,
    updateDashboardPermissionsResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateDashboardPermissions' smart constructor.
data UpdateDashboardPermissions = UpdateDashboardPermissions'
  { -- | The permissions that you want to revoke from this resource.
    UpdateDashboardPermissions -> Maybe [ResourcePermission]
revokePermissions :: Prelude.Maybe [ResourcePermission],
    -- | The permissions that you want to grant on this resource.
    UpdateDashboardPermissions -> Maybe [ResourcePermission]
grantPermissions :: Prelude.Maybe [ResourcePermission],
    -- | The ID of the Amazon Web Services account that contains the dashboard
    -- whose permissions you\'re updating.
    UpdateDashboardPermissions -> Text
awsAccountId :: Prelude.Text,
    -- | The ID for the dashboard.
    UpdateDashboardPermissions -> Text
dashboardId :: Prelude.Text
  }
  deriving (UpdateDashboardPermissions -> UpdateDashboardPermissions -> Bool
(UpdateDashboardPermissions -> UpdateDashboardPermissions -> Bool)
-> (UpdateDashboardPermissions
    -> UpdateDashboardPermissions -> Bool)
-> Eq UpdateDashboardPermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDashboardPermissions -> UpdateDashboardPermissions -> Bool
$c/= :: UpdateDashboardPermissions -> UpdateDashboardPermissions -> Bool
== :: UpdateDashboardPermissions -> UpdateDashboardPermissions -> Bool
$c== :: UpdateDashboardPermissions -> UpdateDashboardPermissions -> Bool
Prelude.Eq, ReadPrec [UpdateDashboardPermissions]
ReadPrec UpdateDashboardPermissions
Int -> ReadS UpdateDashboardPermissions
ReadS [UpdateDashboardPermissions]
(Int -> ReadS UpdateDashboardPermissions)
-> ReadS [UpdateDashboardPermissions]
-> ReadPrec UpdateDashboardPermissions
-> ReadPrec [UpdateDashboardPermissions]
-> Read UpdateDashboardPermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDashboardPermissions]
$creadListPrec :: ReadPrec [UpdateDashboardPermissions]
readPrec :: ReadPrec UpdateDashboardPermissions
$creadPrec :: ReadPrec UpdateDashboardPermissions
readList :: ReadS [UpdateDashboardPermissions]
$creadList :: ReadS [UpdateDashboardPermissions]
readsPrec :: Int -> ReadS UpdateDashboardPermissions
$creadsPrec :: Int -> ReadS UpdateDashboardPermissions
Prelude.Read, Int -> UpdateDashboardPermissions -> ShowS
[UpdateDashboardPermissions] -> ShowS
UpdateDashboardPermissions -> String
(Int -> UpdateDashboardPermissions -> ShowS)
-> (UpdateDashboardPermissions -> String)
-> ([UpdateDashboardPermissions] -> ShowS)
-> Show UpdateDashboardPermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDashboardPermissions] -> ShowS
$cshowList :: [UpdateDashboardPermissions] -> ShowS
show :: UpdateDashboardPermissions -> String
$cshow :: UpdateDashboardPermissions -> String
showsPrec :: Int -> UpdateDashboardPermissions -> ShowS
$cshowsPrec :: Int -> UpdateDashboardPermissions -> ShowS
Prelude.Show, (forall x.
 UpdateDashboardPermissions -> Rep UpdateDashboardPermissions x)
-> (forall x.
    Rep UpdateDashboardPermissions x -> UpdateDashboardPermissions)
-> Generic UpdateDashboardPermissions
forall x.
Rep UpdateDashboardPermissions x -> UpdateDashboardPermissions
forall x.
UpdateDashboardPermissions -> Rep UpdateDashboardPermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDashboardPermissions x -> UpdateDashboardPermissions
$cfrom :: forall x.
UpdateDashboardPermissions -> Rep UpdateDashboardPermissions x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDashboardPermissions' 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:
--
-- 'revokePermissions', 'updateDashboardPermissions_revokePermissions' - The permissions that you want to revoke from this resource.
--
-- 'grantPermissions', 'updateDashboardPermissions_grantPermissions' - The permissions that you want to grant on this resource.
--
-- 'awsAccountId', 'updateDashboardPermissions_awsAccountId' - The ID of the Amazon Web Services account that contains the dashboard
-- whose permissions you\'re updating.
--
-- 'dashboardId', 'updateDashboardPermissions_dashboardId' - The ID for the dashboard.
newUpdateDashboardPermissions ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'dashboardId'
  Prelude.Text ->
  UpdateDashboardPermissions
newUpdateDashboardPermissions :: Text -> Text -> UpdateDashboardPermissions
newUpdateDashboardPermissions
  Text
pAwsAccountId_
  Text
pDashboardId_ =
    UpdateDashboardPermissions' :: Maybe [ResourcePermission]
-> Maybe [ResourcePermission]
-> Text
-> Text
-> UpdateDashboardPermissions
UpdateDashboardPermissions'
      { $sel:revokePermissions:UpdateDashboardPermissions' :: Maybe [ResourcePermission]
revokePermissions =
          Maybe [ResourcePermission]
forall a. Maybe a
Prelude.Nothing,
        $sel:grantPermissions:UpdateDashboardPermissions' :: Maybe [ResourcePermission]
grantPermissions = Maybe [ResourcePermission]
forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:UpdateDashboardPermissions' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:dashboardId:UpdateDashboardPermissions' :: Text
dashboardId = Text
pDashboardId_
      }

-- | The permissions that you want to revoke from this resource.
updateDashboardPermissions_revokePermissions :: Lens.Lens' UpdateDashboardPermissions (Prelude.Maybe [ResourcePermission])
updateDashboardPermissions_revokePermissions :: (Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> UpdateDashboardPermissions -> f UpdateDashboardPermissions
updateDashboardPermissions_revokePermissions = (UpdateDashboardPermissions -> Maybe [ResourcePermission])
-> (UpdateDashboardPermissions
    -> Maybe [ResourcePermission] -> UpdateDashboardPermissions)
-> Lens
     UpdateDashboardPermissions
     UpdateDashboardPermissions
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissions' {Maybe [ResourcePermission]
revokePermissions :: Maybe [ResourcePermission]
$sel:revokePermissions:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Maybe [ResourcePermission]
revokePermissions} -> Maybe [ResourcePermission]
revokePermissions) (\s :: UpdateDashboardPermissions
s@UpdateDashboardPermissions' {} Maybe [ResourcePermission]
a -> UpdateDashboardPermissions
s {$sel:revokePermissions:UpdateDashboardPermissions' :: Maybe [ResourcePermission]
revokePermissions = Maybe [ResourcePermission]
a} :: UpdateDashboardPermissions) ((Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
 -> UpdateDashboardPermissions -> f UpdateDashboardPermissions)
-> ((Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
    -> Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> (Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> UpdateDashboardPermissions
-> f UpdateDashboardPermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourcePermission]
  [ResourcePermission]
  [ResourcePermission]
  [ResourcePermission]
-> Iso
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
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
  [ResourcePermission]
  [ResourcePermission]
  [ResourcePermission]
  [ResourcePermission]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The permissions that you want to grant on this resource.
updateDashboardPermissions_grantPermissions :: Lens.Lens' UpdateDashboardPermissions (Prelude.Maybe [ResourcePermission])
updateDashboardPermissions_grantPermissions :: (Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> UpdateDashboardPermissions -> f UpdateDashboardPermissions
updateDashboardPermissions_grantPermissions = (UpdateDashboardPermissions -> Maybe [ResourcePermission])
-> (UpdateDashboardPermissions
    -> Maybe [ResourcePermission] -> UpdateDashboardPermissions)
-> Lens
     UpdateDashboardPermissions
     UpdateDashboardPermissions
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissions' {Maybe [ResourcePermission]
grantPermissions :: Maybe [ResourcePermission]
$sel:grantPermissions:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Maybe [ResourcePermission]
grantPermissions} -> Maybe [ResourcePermission]
grantPermissions) (\s :: UpdateDashboardPermissions
s@UpdateDashboardPermissions' {} Maybe [ResourcePermission]
a -> UpdateDashboardPermissions
s {$sel:grantPermissions:UpdateDashboardPermissions' :: Maybe [ResourcePermission]
grantPermissions = Maybe [ResourcePermission]
a} :: UpdateDashboardPermissions) ((Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
 -> UpdateDashboardPermissions -> f UpdateDashboardPermissions)
-> ((Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
    -> Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> (Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> UpdateDashboardPermissions
-> f UpdateDashboardPermissions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourcePermission]
  [ResourcePermission]
  [ResourcePermission]
  [ResourcePermission]
-> Iso
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
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
  [ResourcePermission]
  [ResourcePermission]
  [ResourcePermission]
  [ResourcePermission]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the Amazon Web Services account that contains the dashboard
-- whose permissions you\'re updating.
updateDashboardPermissions_awsAccountId :: Lens.Lens' UpdateDashboardPermissions Prelude.Text
updateDashboardPermissions_awsAccountId :: (Text -> f Text)
-> UpdateDashboardPermissions -> f UpdateDashboardPermissions
updateDashboardPermissions_awsAccountId = (UpdateDashboardPermissions -> Text)
-> (UpdateDashboardPermissions
    -> Text -> UpdateDashboardPermissions)
-> Lens
     UpdateDashboardPermissions UpdateDashboardPermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissions' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdateDashboardPermissions
s@UpdateDashboardPermissions' {} Text
a -> UpdateDashboardPermissions
s {$sel:awsAccountId:UpdateDashboardPermissions' :: Text
awsAccountId = Text
a} :: UpdateDashboardPermissions)

-- | The ID for the dashboard.
updateDashboardPermissions_dashboardId :: Lens.Lens' UpdateDashboardPermissions Prelude.Text
updateDashboardPermissions_dashboardId :: (Text -> f Text)
-> UpdateDashboardPermissions -> f UpdateDashboardPermissions
updateDashboardPermissions_dashboardId = (UpdateDashboardPermissions -> Text)
-> (UpdateDashboardPermissions
    -> Text -> UpdateDashboardPermissions)
-> Lens
     UpdateDashboardPermissions UpdateDashboardPermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissions' {Text
dashboardId :: Text
$sel:dashboardId:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Text
dashboardId} -> Text
dashboardId) (\s :: UpdateDashboardPermissions
s@UpdateDashboardPermissions' {} Text
a -> UpdateDashboardPermissions
s {$sel:dashboardId:UpdateDashboardPermissions' :: Text
dashboardId = Text
a} :: UpdateDashboardPermissions)

instance Core.AWSRequest UpdateDashboardPermissions where
  type
    AWSResponse UpdateDashboardPermissions =
      UpdateDashboardPermissionsResponse
  request :: UpdateDashboardPermissions -> Request UpdateDashboardPermissions
request = Service
-> UpdateDashboardPermissions -> Request UpdateDashboardPermissions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateDashboardPermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateDashboardPermissions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateDashboardPermissions))
-> Logger
-> Service
-> Proxy UpdateDashboardPermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateDashboardPermissions)))
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 Text
-> Maybe Text
-> Maybe (NonEmpty ResourcePermission)
-> Maybe Text
-> Int
-> UpdateDashboardPermissionsResponse
UpdateDashboardPermissionsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty ResourcePermission)
 -> Maybe Text
 -> Int
 -> UpdateDashboardPermissionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (NonEmpty ResourcePermission)
      -> Maybe Text
      -> Int
      -> UpdateDashboardPermissionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
            Either
  String
  (Maybe Text
   -> Maybe (NonEmpty ResourcePermission)
   -> Maybe Text
   -> Int
   -> UpdateDashboardPermissionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (NonEmpty ResourcePermission)
      -> Maybe Text -> Int -> UpdateDashboardPermissionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DashboardId")
            Either
  String
  (Maybe (NonEmpty ResourcePermission)
   -> Maybe Text -> Int -> UpdateDashboardPermissionsResponse)
-> Either String (Maybe (NonEmpty ResourcePermission))
-> Either
     String (Maybe Text -> Int -> UpdateDashboardPermissionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (NonEmpty ResourcePermission))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Permissions")
            Either
  String (Maybe Text -> Int -> UpdateDashboardPermissionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateDashboardPermissionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DashboardArn")
            Either String (Int -> UpdateDashboardPermissionsResponse)
-> Either String Int
-> Either String UpdateDashboardPermissionsResponse
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 UpdateDashboardPermissions

instance Prelude.NFData UpdateDashboardPermissions

instance Core.ToHeaders UpdateDashboardPermissions where
  toHeaders :: UpdateDashboardPermissions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateDashboardPermissions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateDashboardPermissions where
  toJSON :: UpdateDashboardPermissions -> Value
toJSON UpdateDashboardPermissions' {Maybe [ResourcePermission]
Text
dashboardId :: Text
awsAccountId :: Text
grantPermissions :: Maybe [ResourcePermission]
revokePermissions :: Maybe [ResourcePermission]
$sel:dashboardId:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Text
$sel:awsAccountId:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Text
$sel:grantPermissions:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Maybe [ResourcePermission]
$sel:revokePermissions:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Maybe [ResourcePermission]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RevokePermissions" Text -> [ResourcePermission] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ResourcePermission] -> Pair)
-> Maybe [ResourcePermission] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResourcePermission]
revokePermissions,
            (Text
"GrantPermissions" Text -> [ResourcePermission] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ResourcePermission] -> Pair)
-> Maybe [ResourcePermission] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResourcePermission]
grantPermissions
          ]
      )

instance Core.ToPath UpdateDashboardPermissions where
  toPath :: UpdateDashboardPermissions -> ByteString
toPath UpdateDashboardPermissions' {Maybe [ResourcePermission]
Text
dashboardId :: Text
awsAccountId :: Text
grantPermissions :: Maybe [ResourcePermission]
revokePermissions :: Maybe [ResourcePermission]
$sel:dashboardId:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Text
$sel:awsAccountId:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Text
$sel:grantPermissions:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Maybe [ResourcePermission]
$sel:revokePermissions:UpdateDashboardPermissions' :: UpdateDashboardPermissions -> Maybe [ResourcePermission]
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/dashboards/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dashboardId,
        ByteString
"/permissions"
      ]

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

-- | /See:/ 'newUpdateDashboardPermissionsResponse' smart constructor.
data UpdateDashboardPermissionsResponse = UpdateDashboardPermissionsResponse'
  { -- | The Amazon Web Services request ID for this operation.
    UpdateDashboardPermissionsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The ID for the dashboard.
    UpdateDashboardPermissionsResponse -> Maybe Text
dashboardId :: Prelude.Maybe Prelude.Text,
    -- | Information about the permissions on the dashboard.
    UpdateDashboardPermissionsResponse
-> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
    -- | The Amazon Resource Name (ARN) of the dashboard.
    UpdateDashboardPermissionsResponse -> Maybe Text
dashboardArn :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    UpdateDashboardPermissionsResponse -> Int
status :: Prelude.Int
  }
  deriving (UpdateDashboardPermissionsResponse
-> UpdateDashboardPermissionsResponse -> Bool
(UpdateDashboardPermissionsResponse
 -> UpdateDashboardPermissionsResponse -> Bool)
-> (UpdateDashboardPermissionsResponse
    -> UpdateDashboardPermissionsResponse -> Bool)
-> Eq UpdateDashboardPermissionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDashboardPermissionsResponse
-> UpdateDashboardPermissionsResponse -> Bool
$c/= :: UpdateDashboardPermissionsResponse
-> UpdateDashboardPermissionsResponse -> Bool
== :: UpdateDashboardPermissionsResponse
-> UpdateDashboardPermissionsResponse -> Bool
$c== :: UpdateDashboardPermissionsResponse
-> UpdateDashboardPermissionsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDashboardPermissionsResponse]
ReadPrec UpdateDashboardPermissionsResponse
Int -> ReadS UpdateDashboardPermissionsResponse
ReadS [UpdateDashboardPermissionsResponse]
(Int -> ReadS UpdateDashboardPermissionsResponse)
-> ReadS [UpdateDashboardPermissionsResponse]
-> ReadPrec UpdateDashboardPermissionsResponse
-> ReadPrec [UpdateDashboardPermissionsResponse]
-> Read UpdateDashboardPermissionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDashboardPermissionsResponse]
$creadListPrec :: ReadPrec [UpdateDashboardPermissionsResponse]
readPrec :: ReadPrec UpdateDashboardPermissionsResponse
$creadPrec :: ReadPrec UpdateDashboardPermissionsResponse
readList :: ReadS [UpdateDashboardPermissionsResponse]
$creadList :: ReadS [UpdateDashboardPermissionsResponse]
readsPrec :: Int -> ReadS UpdateDashboardPermissionsResponse
$creadsPrec :: Int -> ReadS UpdateDashboardPermissionsResponse
Prelude.Read, Int -> UpdateDashboardPermissionsResponse -> ShowS
[UpdateDashboardPermissionsResponse] -> ShowS
UpdateDashboardPermissionsResponse -> String
(Int -> UpdateDashboardPermissionsResponse -> ShowS)
-> (UpdateDashboardPermissionsResponse -> String)
-> ([UpdateDashboardPermissionsResponse] -> ShowS)
-> Show UpdateDashboardPermissionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDashboardPermissionsResponse] -> ShowS
$cshowList :: [UpdateDashboardPermissionsResponse] -> ShowS
show :: UpdateDashboardPermissionsResponse -> String
$cshow :: UpdateDashboardPermissionsResponse -> String
showsPrec :: Int -> UpdateDashboardPermissionsResponse -> ShowS
$cshowsPrec :: Int -> UpdateDashboardPermissionsResponse -> ShowS
Prelude.Show, (forall x.
 UpdateDashboardPermissionsResponse
 -> Rep UpdateDashboardPermissionsResponse x)
-> (forall x.
    Rep UpdateDashboardPermissionsResponse x
    -> UpdateDashboardPermissionsResponse)
-> Generic UpdateDashboardPermissionsResponse
forall x.
Rep UpdateDashboardPermissionsResponse x
-> UpdateDashboardPermissionsResponse
forall x.
UpdateDashboardPermissionsResponse
-> Rep UpdateDashboardPermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDashboardPermissionsResponse x
-> UpdateDashboardPermissionsResponse
$cfrom :: forall x.
UpdateDashboardPermissionsResponse
-> Rep UpdateDashboardPermissionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDashboardPermissionsResponse' 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:
--
-- 'requestId', 'updateDashboardPermissionsResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'dashboardId', 'updateDashboardPermissionsResponse_dashboardId' - The ID for the dashboard.
--
-- 'permissions', 'updateDashboardPermissionsResponse_permissions' - Information about the permissions on the dashboard.
--
-- 'dashboardArn', 'updateDashboardPermissionsResponse_dashboardArn' - The Amazon Resource Name (ARN) of the dashboard.
--
-- 'status', 'updateDashboardPermissionsResponse_status' - The HTTP status of the request.
newUpdateDashboardPermissionsResponse ::
  -- | 'status'
  Prelude.Int ->
  UpdateDashboardPermissionsResponse
newUpdateDashboardPermissionsResponse :: Int -> UpdateDashboardPermissionsResponse
newUpdateDashboardPermissionsResponse Int
pStatus_ =
  UpdateDashboardPermissionsResponse' :: Maybe Text
-> Maybe Text
-> Maybe (NonEmpty ResourcePermission)
-> Maybe Text
-> Int
-> UpdateDashboardPermissionsResponse
UpdateDashboardPermissionsResponse'
    { $sel:requestId:UpdateDashboardPermissionsResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dashboardId:UpdateDashboardPermissionsResponse' :: Maybe Text
dashboardId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissions:UpdateDashboardPermissionsResponse' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
forall a. Maybe a
Prelude.Nothing,
      $sel:dashboardArn:UpdateDashboardPermissionsResponse' :: Maybe Text
dashboardArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateDashboardPermissionsResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
updateDashboardPermissionsResponse_requestId :: Lens.Lens' UpdateDashboardPermissionsResponse (Prelude.Maybe Prelude.Text)
updateDashboardPermissionsResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> UpdateDashboardPermissionsResponse
-> f UpdateDashboardPermissionsResponse
updateDashboardPermissionsResponse_requestId = (UpdateDashboardPermissionsResponse -> Maybe Text)
-> (UpdateDashboardPermissionsResponse
    -> Maybe Text -> UpdateDashboardPermissionsResponse)
-> Lens
     UpdateDashboardPermissionsResponse
     UpdateDashboardPermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissionsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:UpdateDashboardPermissionsResponse' :: UpdateDashboardPermissionsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: UpdateDashboardPermissionsResponse
s@UpdateDashboardPermissionsResponse' {} Maybe Text
a -> UpdateDashboardPermissionsResponse
s {$sel:requestId:UpdateDashboardPermissionsResponse' :: Maybe Text
requestId = Maybe Text
a} :: UpdateDashboardPermissionsResponse)

-- | The ID for the dashboard.
updateDashboardPermissionsResponse_dashboardId :: Lens.Lens' UpdateDashboardPermissionsResponse (Prelude.Maybe Prelude.Text)
updateDashboardPermissionsResponse_dashboardId :: (Maybe Text -> f (Maybe Text))
-> UpdateDashboardPermissionsResponse
-> f UpdateDashboardPermissionsResponse
updateDashboardPermissionsResponse_dashboardId = (UpdateDashboardPermissionsResponse -> Maybe Text)
-> (UpdateDashboardPermissionsResponse
    -> Maybe Text -> UpdateDashboardPermissionsResponse)
-> Lens
     UpdateDashboardPermissionsResponse
     UpdateDashboardPermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissionsResponse' {Maybe Text
dashboardId :: Maybe Text
$sel:dashboardId:UpdateDashboardPermissionsResponse' :: UpdateDashboardPermissionsResponse -> Maybe Text
dashboardId} -> Maybe Text
dashboardId) (\s :: UpdateDashboardPermissionsResponse
s@UpdateDashboardPermissionsResponse' {} Maybe Text
a -> UpdateDashboardPermissionsResponse
s {$sel:dashboardId:UpdateDashboardPermissionsResponse' :: Maybe Text
dashboardId = Maybe Text
a} :: UpdateDashboardPermissionsResponse)

-- | Information about the permissions on the dashboard.
updateDashboardPermissionsResponse_permissions :: Lens.Lens' UpdateDashboardPermissionsResponse (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
updateDashboardPermissionsResponse_permissions :: (Maybe (NonEmpty ResourcePermission)
 -> f (Maybe (NonEmpty ResourcePermission)))
-> UpdateDashboardPermissionsResponse
-> f UpdateDashboardPermissionsResponse
updateDashboardPermissionsResponse_permissions = (UpdateDashboardPermissionsResponse
 -> Maybe (NonEmpty ResourcePermission))
-> (UpdateDashboardPermissionsResponse
    -> Maybe (NonEmpty ResourcePermission)
    -> UpdateDashboardPermissionsResponse)
-> Lens
     UpdateDashboardPermissionsResponse
     UpdateDashboardPermissionsResponse
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissionsResponse' {Maybe (NonEmpty ResourcePermission)
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:permissions:UpdateDashboardPermissionsResponse' :: UpdateDashboardPermissionsResponse
-> Maybe (NonEmpty ResourcePermission)
permissions} -> Maybe (NonEmpty ResourcePermission)
permissions) (\s :: UpdateDashboardPermissionsResponse
s@UpdateDashboardPermissionsResponse' {} Maybe (NonEmpty ResourcePermission)
a -> UpdateDashboardPermissionsResponse
s {$sel:permissions:UpdateDashboardPermissionsResponse' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
a} :: UpdateDashboardPermissionsResponse) ((Maybe (NonEmpty ResourcePermission)
  -> f (Maybe (NonEmpty ResourcePermission)))
 -> UpdateDashboardPermissionsResponse
 -> f UpdateDashboardPermissionsResponse)
-> ((Maybe (NonEmpty ResourcePermission)
     -> f (Maybe (NonEmpty ResourcePermission)))
    -> Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> (Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> UpdateDashboardPermissionsResponse
-> f UpdateDashboardPermissionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
-> Iso
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
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
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the dashboard.
updateDashboardPermissionsResponse_dashboardArn :: Lens.Lens' UpdateDashboardPermissionsResponse (Prelude.Maybe Prelude.Text)
updateDashboardPermissionsResponse_dashboardArn :: (Maybe Text -> f (Maybe Text))
-> UpdateDashboardPermissionsResponse
-> f UpdateDashboardPermissionsResponse
updateDashboardPermissionsResponse_dashboardArn = (UpdateDashboardPermissionsResponse -> Maybe Text)
-> (UpdateDashboardPermissionsResponse
    -> Maybe Text -> UpdateDashboardPermissionsResponse)
-> Lens
     UpdateDashboardPermissionsResponse
     UpdateDashboardPermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissionsResponse' {Maybe Text
dashboardArn :: Maybe Text
$sel:dashboardArn:UpdateDashboardPermissionsResponse' :: UpdateDashboardPermissionsResponse -> Maybe Text
dashboardArn} -> Maybe Text
dashboardArn) (\s :: UpdateDashboardPermissionsResponse
s@UpdateDashboardPermissionsResponse' {} Maybe Text
a -> UpdateDashboardPermissionsResponse
s {$sel:dashboardArn:UpdateDashboardPermissionsResponse' :: Maybe Text
dashboardArn = Maybe Text
a} :: UpdateDashboardPermissionsResponse)

-- | The HTTP status of the request.
updateDashboardPermissionsResponse_status :: Lens.Lens' UpdateDashboardPermissionsResponse Prelude.Int
updateDashboardPermissionsResponse_status :: (Int -> f Int)
-> UpdateDashboardPermissionsResponse
-> f UpdateDashboardPermissionsResponse
updateDashboardPermissionsResponse_status = (UpdateDashboardPermissionsResponse -> Int)
-> (UpdateDashboardPermissionsResponse
    -> Int -> UpdateDashboardPermissionsResponse)
-> Lens
     UpdateDashboardPermissionsResponse
     UpdateDashboardPermissionsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDashboardPermissionsResponse' {Int
status :: Int
$sel:status:UpdateDashboardPermissionsResponse' :: UpdateDashboardPermissionsResponse -> Int
status} -> Int
status) (\s :: UpdateDashboardPermissionsResponse
s@UpdateDashboardPermissionsResponse' {} Int
a -> UpdateDashboardPermissionsResponse
s {$sel:status:UpdateDashboardPermissionsResponse' :: Int
status = Int
a} :: UpdateDashboardPermissionsResponse)

instance
  Prelude.NFData
    UpdateDashboardPermissionsResponse