{-# 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.UpdateThemePermissions
-- 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 the resource permissions for a theme. Permissions apply to the
-- action to grant or revoke permissions on, for example
-- @\"quicksight:DescribeTheme\"@.
--
-- Theme permissions apply in groupings. Valid groupings include the
-- following for the three levels of permissions, which are user, owner, or
-- no permissions:
--
-- -   User
--
--     -   @\"quicksight:DescribeTheme\"@
--
--     -   @\"quicksight:DescribeThemeAlias\"@
--
--     -   @\"quicksight:ListThemeAliases\"@
--
--     -   @\"quicksight:ListThemeVersions\"@
--
-- -   Owner
--
--     -   @\"quicksight:DescribeTheme\"@
--
--     -   @\"quicksight:DescribeThemeAlias\"@
--
--     -   @\"quicksight:ListThemeAliases\"@
--
--     -   @\"quicksight:ListThemeVersions\"@
--
--     -   @\"quicksight:DeleteTheme\"@
--
--     -   @\"quicksight:UpdateTheme\"@
--
--     -   @\"quicksight:CreateThemeAlias\"@
--
--     -   @\"quicksight:DeleteThemeAlias\"@
--
--     -   @\"quicksight:UpdateThemeAlias\"@
--
--     -   @\"quicksight:UpdateThemePermissions\"@
--
--     -   @\"quicksight:DescribeThemePermissions\"@
--
-- -   To specify no permissions, omit the permissions list.
module Amazonka.QuickSight.UpdateThemePermissions
  ( -- * Creating a Request
    UpdateThemePermissions (..),
    newUpdateThemePermissions,

    -- * Request Lenses
    updateThemePermissions_revokePermissions,
    updateThemePermissions_grantPermissions,
    updateThemePermissions_awsAccountId,
    updateThemePermissions_themeId,

    -- * Destructuring the Response
    UpdateThemePermissionsResponse (..),
    newUpdateThemePermissionsResponse,

    -- * Response Lenses
    updateThemePermissionsResponse_requestId,
    updateThemePermissionsResponse_themeArn,
    updateThemePermissionsResponse_themeId,
    updateThemePermissionsResponse_permissions,
    updateThemePermissionsResponse_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:/ 'newUpdateThemePermissions' smart constructor.
data UpdateThemePermissions = UpdateThemePermissions'
  { -- | A list of resource permissions to be revoked from the theme.
    UpdateThemePermissions -> Maybe [ResourcePermission]
revokePermissions :: Prelude.Maybe [ResourcePermission],
    -- | A list of resource permissions to be granted for the theme.
    UpdateThemePermissions -> Maybe [ResourcePermission]
grantPermissions :: Prelude.Maybe [ResourcePermission],
    -- | The ID of the Amazon Web Services account that contains the theme.
    UpdateThemePermissions -> Text
awsAccountId :: Prelude.Text,
    -- | The ID for the theme.
    UpdateThemePermissions -> Text
themeId :: Prelude.Text
  }
  deriving (UpdateThemePermissions -> UpdateThemePermissions -> Bool
(UpdateThemePermissions -> UpdateThemePermissions -> Bool)
-> (UpdateThemePermissions -> UpdateThemePermissions -> Bool)
-> Eq UpdateThemePermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateThemePermissions -> UpdateThemePermissions -> Bool
$c/= :: UpdateThemePermissions -> UpdateThemePermissions -> Bool
== :: UpdateThemePermissions -> UpdateThemePermissions -> Bool
$c== :: UpdateThemePermissions -> UpdateThemePermissions -> Bool
Prelude.Eq, ReadPrec [UpdateThemePermissions]
ReadPrec UpdateThemePermissions
Int -> ReadS UpdateThemePermissions
ReadS [UpdateThemePermissions]
(Int -> ReadS UpdateThemePermissions)
-> ReadS [UpdateThemePermissions]
-> ReadPrec UpdateThemePermissions
-> ReadPrec [UpdateThemePermissions]
-> Read UpdateThemePermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateThemePermissions]
$creadListPrec :: ReadPrec [UpdateThemePermissions]
readPrec :: ReadPrec UpdateThemePermissions
$creadPrec :: ReadPrec UpdateThemePermissions
readList :: ReadS [UpdateThemePermissions]
$creadList :: ReadS [UpdateThemePermissions]
readsPrec :: Int -> ReadS UpdateThemePermissions
$creadsPrec :: Int -> ReadS UpdateThemePermissions
Prelude.Read, Int -> UpdateThemePermissions -> ShowS
[UpdateThemePermissions] -> ShowS
UpdateThemePermissions -> String
(Int -> UpdateThemePermissions -> ShowS)
-> (UpdateThemePermissions -> String)
-> ([UpdateThemePermissions] -> ShowS)
-> Show UpdateThemePermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateThemePermissions] -> ShowS
$cshowList :: [UpdateThemePermissions] -> ShowS
show :: UpdateThemePermissions -> String
$cshow :: UpdateThemePermissions -> String
showsPrec :: Int -> UpdateThemePermissions -> ShowS
$cshowsPrec :: Int -> UpdateThemePermissions -> ShowS
Prelude.Show, (forall x. UpdateThemePermissions -> Rep UpdateThemePermissions x)
-> (forall x.
    Rep UpdateThemePermissions x -> UpdateThemePermissions)
-> Generic UpdateThemePermissions
forall x. Rep UpdateThemePermissions x -> UpdateThemePermissions
forall x. UpdateThemePermissions -> Rep UpdateThemePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateThemePermissions x -> UpdateThemePermissions
$cfrom :: forall x. UpdateThemePermissions -> Rep UpdateThemePermissions x
Prelude.Generic)

-- |
-- Create a value of 'UpdateThemePermissions' 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', 'updateThemePermissions_revokePermissions' - A list of resource permissions to be revoked from the theme.
--
-- 'grantPermissions', 'updateThemePermissions_grantPermissions' - A list of resource permissions to be granted for the theme.
--
-- 'awsAccountId', 'updateThemePermissions_awsAccountId' - The ID of the Amazon Web Services account that contains the theme.
--
-- 'themeId', 'updateThemePermissions_themeId' - The ID for the theme.
newUpdateThemePermissions ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'themeId'
  Prelude.Text ->
  UpdateThemePermissions
newUpdateThemePermissions :: Text -> Text -> UpdateThemePermissions
newUpdateThemePermissions Text
pAwsAccountId_ Text
pThemeId_ =
  UpdateThemePermissions' :: Maybe [ResourcePermission]
-> Maybe [ResourcePermission]
-> Text
-> Text
-> UpdateThemePermissions
UpdateThemePermissions'
    { $sel:revokePermissions:UpdateThemePermissions' :: Maybe [ResourcePermission]
revokePermissions =
        Maybe [ResourcePermission]
forall a. Maybe a
Prelude.Nothing,
      $sel:grantPermissions:UpdateThemePermissions' :: Maybe [ResourcePermission]
grantPermissions = Maybe [ResourcePermission]
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:UpdateThemePermissions' :: Text
awsAccountId = Text
pAwsAccountId_,
      $sel:themeId:UpdateThemePermissions' :: Text
themeId = Text
pThemeId_
    }

-- | A list of resource permissions to be revoked from the theme.
updateThemePermissions_revokePermissions :: Lens.Lens' UpdateThemePermissions (Prelude.Maybe [ResourcePermission])
updateThemePermissions_revokePermissions :: (Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> UpdateThemePermissions -> f UpdateThemePermissions
updateThemePermissions_revokePermissions = (UpdateThemePermissions -> Maybe [ResourcePermission])
-> (UpdateThemePermissions
    -> Maybe [ResourcePermission] -> UpdateThemePermissions)
-> Lens
     UpdateThemePermissions
     UpdateThemePermissions
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemePermissions' {Maybe [ResourcePermission]
revokePermissions :: Maybe [ResourcePermission]
$sel:revokePermissions:UpdateThemePermissions' :: UpdateThemePermissions -> Maybe [ResourcePermission]
revokePermissions} -> Maybe [ResourcePermission]
revokePermissions) (\s :: UpdateThemePermissions
s@UpdateThemePermissions' {} Maybe [ResourcePermission]
a -> UpdateThemePermissions
s {$sel:revokePermissions:UpdateThemePermissions' :: Maybe [ResourcePermission]
revokePermissions = Maybe [ResourcePermission]
a} :: UpdateThemePermissions) ((Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
 -> UpdateThemePermissions -> f UpdateThemePermissions)
-> ((Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
    -> Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> (Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> UpdateThemePermissions
-> f UpdateThemePermissions
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

-- | A list of resource permissions to be granted for the theme.
updateThemePermissions_grantPermissions :: Lens.Lens' UpdateThemePermissions (Prelude.Maybe [ResourcePermission])
updateThemePermissions_grantPermissions :: (Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> UpdateThemePermissions -> f UpdateThemePermissions
updateThemePermissions_grantPermissions = (UpdateThemePermissions -> Maybe [ResourcePermission])
-> (UpdateThemePermissions
    -> Maybe [ResourcePermission] -> UpdateThemePermissions)
-> Lens
     UpdateThemePermissions
     UpdateThemePermissions
     (Maybe [ResourcePermission])
     (Maybe [ResourcePermission])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemePermissions' {Maybe [ResourcePermission]
grantPermissions :: Maybe [ResourcePermission]
$sel:grantPermissions:UpdateThemePermissions' :: UpdateThemePermissions -> Maybe [ResourcePermission]
grantPermissions} -> Maybe [ResourcePermission]
grantPermissions) (\s :: UpdateThemePermissions
s@UpdateThemePermissions' {} Maybe [ResourcePermission]
a -> UpdateThemePermissions
s {$sel:grantPermissions:UpdateThemePermissions' :: Maybe [ResourcePermission]
grantPermissions = Maybe [ResourcePermission]
a} :: UpdateThemePermissions) ((Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
 -> UpdateThemePermissions -> f UpdateThemePermissions)
-> ((Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
    -> Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> (Maybe [ResourcePermission] -> f (Maybe [ResourcePermission]))
-> UpdateThemePermissions
-> f UpdateThemePermissions
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 theme.
updateThemePermissions_awsAccountId :: Lens.Lens' UpdateThemePermissions Prelude.Text
updateThemePermissions_awsAccountId :: (Text -> f Text)
-> UpdateThemePermissions -> f UpdateThemePermissions
updateThemePermissions_awsAccountId = (UpdateThemePermissions -> Text)
-> (UpdateThemePermissions -> Text -> UpdateThemePermissions)
-> Lens UpdateThemePermissions UpdateThemePermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemePermissions' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdateThemePermissions
s@UpdateThemePermissions' {} Text
a -> UpdateThemePermissions
s {$sel:awsAccountId:UpdateThemePermissions' :: Text
awsAccountId = Text
a} :: UpdateThemePermissions)

-- | The ID for the theme.
updateThemePermissions_themeId :: Lens.Lens' UpdateThemePermissions Prelude.Text
updateThemePermissions_themeId :: (Text -> f Text)
-> UpdateThemePermissions -> f UpdateThemePermissions
updateThemePermissions_themeId = (UpdateThemePermissions -> Text)
-> (UpdateThemePermissions -> Text -> UpdateThemePermissions)
-> Lens UpdateThemePermissions UpdateThemePermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemePermissions' {Text
themeId :: Text
$sel:themeId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
themeId} -> Text
themeId) (\s :: UpdateThemePermissions
s@UpdateThemePermissions' {} Text
a -> UpdateThemePermissions
s {$sel:themeId:UpdateThemePermissions' :: Text
themeId = Text
a} :: UpdateThemePermissions)

instance Core.AWSRequest UpdateThemePermissions where
  type
    AWSResponse UpdateThemePermissions =
      UpdateThemePermissionsResponse
  request :: UpdateThemePermissions -> Request UpdateThemePermissions
request = Service -> UpdateThemePermissions -> Request UpdateThemePermissions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateThemePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateThemePermissions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateThemePermissions))
-> Logger
-> Service
-> Proxy UpdateThemePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateThemePermissions)))
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 Text
-> Maybe (NonEmpty ResourcePermission)
-> Int
-> UpdateThemePermissionsResponse
UpdateThemePermissionsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty ResourcePermission)
 -> Int
 -> UpdateThemePermissionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty ResourcePermission)
      -> Int
      -> UpdateThemePermissionsResponse)
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 Text
   -> Maybe (NonEmpty ResourcePermission)
   -> Int
   -> UpdateThemePermissionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (NonEmpty ResourcePermission)
      -> Int
      -> UpdateThemePermissionsResponse)
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
"ThemeArn")
            Either
  String
  (Maybe Text
   -> Maybe (NonEmpty ResourcePermission)
   -> Int
   -> UpdateThemePermissionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (NonEmpty ResourcePermission)
      -> Int -> UpdateThemePermissionsResponse)
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
"ThemeId")
            Either
  String
  (Maybe (NonEmpty ResourcePermission)
   -> Int -> UpdateThemePermissionsResponse)
-> Either String (Maybe (NonEmpty ResourcePermission))
-> Either String (Int -> UpdateThemePermissionsResponse)
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 (Int -> UpdateThemePermissionsResponse)
-> Either String Int
-> Either String UpdateThemePermissionsResponse
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 UpdateThemePermissions

instance Prelude.NFData UpdateThemePermissions

instance Core.ToHeaders UpdateThemePermissions where
  toHeaders :: UpdateThemePermissions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateThemePermissions -> 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 UpdateThemePermissions where
  toJSON :: UpdateThemePermissions -> Value
toJSON UpdateThemePermissions' {Maybe [ResourcePermission]
Text
themeId :: Text
awsAccountId :: Text
grantPermissions :: Maybe [ResourcePermission]
revokePermissions :: Maybe [ResourcePermission]
$sel:themeId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
$sel:awsAccountId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
$sel:grantPermissions:UpdateThemePermissions' :: UpdateThemePermissions -> Maybe [ResourcePermission]
$sel:revokePermissions:UpdateThemePermissions' :: UpdateThemePermissions -> 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 UpdateThemePermissions where
  toPath :: UpdateThemePermissions -> ByteString
toPath UpdateThemePermissions' {Maybe [ResourcePermission]
Text
themeId :: Text
awsAccountId :: Text
grantPermissions :: Maybe [ResourcePermission]
revokePermissions :: Maybe [ResourcePermission]
$sel:themeId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
$sel:awsAccountId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
$sel:grantPermissions:UpdateThemePermissions' :: UpdateThemePermissions -> Maybe [ResourcePermission]
$sel:revokePermissions:UpdateThemePermissions' :: UpdateThemePermissions -> 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
"/themes/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
themeId,
        ByteString
"/permissions"
      ]

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

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

-- |
-- Create a value of 'UpdateThemePermissionsResponse' 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', 'updateThemePermissionsResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'themeArn', 'updateThemePermissionsResponse_themeArn' - The Amazon Resource Name (ARN) of the theme.
--
-- 'themeId', 'updateThemePermissionsResponse_themeId' - The ID for the theme.
--
-- 'permissions', 'updateThemePermissionsResponse_permissions' - The resulting list of resource permissions for the theme.
--
-- 'status', 'updateThemePermissionsResponse_status' - The HTTP status of the request.
newUpdateThemePermissionsResponse ::
  -- | 'status'
  Prelude.Int ->
  UpdateThemePermissionsResponse
newUpdateThemePermissionsResponse :: Int -> UpdateThemePermissionsResponse
newUpdateThemePermissionsResponse Int
pStatus_ =
  UpdateThemePermissionsResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty ResourcePermission)
-> Int
-> UpdateThemePermissionsResponse
UpdateThemePermissionsResponse'
    { $sel:requestId:UpdateThemePermissionsResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:themeArn:UpdateThemePermissionsResponse' :: Maybe Text
themeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:themeId:UpdateThemePermissionsResponse' :: Maybe Text
themeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissions:UpdateThemePermissionsResponse' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateThemePermissionsResponse' :: Int
status = Int
pStatus_
    }

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

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

-- | The ID for the theme.
updateThemePermissionsResponse_themeId :: Lens.Lens' UpdateThemePermissionsResponse (Prelude.Maybe Prelude.Text)
updateThemePermissionsResponse_themeId :: (Maybe Text -> f (Maybe Text))
-> UpdateThemePermissionsResponse
-> f UpdateThemePermissionsResponse
updateThemePermissionsResponse_themeId = (UpdateThemePermissionsResponse -> Maybe Text)
-> (UpdateThemePermissionsResponse
    -> Maybe Text -> UpdateThemePermissionsResponse)
-> Lens
     UpdateThemePermissionsResponse
     UpdateThemePermissionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemePermissionsResponse' {Maybe Text
themeId :: Maybe Text
$sel:themeId:UpdateThemePermissionsResponse' :: UpdateThemePermissionsResponse -> Maybe Text
themeId} -> Maybe Text
themeId) (\s :: UpdateThemePermissionsResponse
s@UpdateThemePermissionsResponse' {} Maybe Text
a -> UpdateThemePermissionsResponse
s {$sel:themeId:UpdateThemePermissionsResponse' :: Maybe Text
themeId = Maybe Text
a} :: UpdateThemePermissionsResponse)

-- | The resulting list of resource permissions for the theme.
updateThemePermissionsResponse_permissions :: Lens.Lens' UpdateThemePermissionsResponse (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
updateThemePermissionsResponse_permissions :: (Maybe (NonEmpty ResourcePermission)
 -> f (Maybe (NonEmpty ResourcePermission)))
-> UpdateThemePermissionsResponse
-> f UpdateThemePermissionsResponse
updateThemePermissionsResponse_permissions = (UpdateThemePermissionsResponse
 -> Maybe (NonEmpty ResourcePermission))
-> (UpdateThemePermissionsResponse
    -> Maybe (NonEmpty ResourcePermission)
    -> UpdateThemePermissionsResponse)
-> Lens
     UpdateThemePermissionsResponse
     UpdateThemePermissionsResponse
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemePermissionsResponse' {Maybe (NonEmpty ResourcePermission)
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:permissions:UpdateThemePermissionsResponse' :: UpdateThemePermissionsResponse
-> Maybe (NonEmpty ResourcePermission)
permissions} -> Maybe (NonEmpty ResourcePermission)
permissions) (\s :: UpdateThemePermissionsResponse
s@UpdateThemePermissionsResponse' {} Maybe (NonEmpty ResourcePermission)
a -> UpdateThemePermissionsResponse
s {$sel:permissions:UpdateThemePermissionsResponse' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
a} :: UpdateThemePermissionsResponse) ((Maybe (NonEmpty ResourcePermission)
  -> f (Maybe (NonEmpty ResourcePermission)))
 -> UpdateThemePermissionsResponse
 -> f UpdateThemePermissionsResponse)
-> ((Maybe (NonEmpty ResourcePermission)
     -> f (Maybe (NonEmpty ResourcePermission)))
    -> Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> (Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> UpdateThemePermissionsResponse
-> f UpdateThemePermissionsResponse
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 HTTP status of the request.
updateThemePermissionsResponse_status :: Lens.Lens' UpdateThemePermissionsResponse Prelude.Int
updateThemePermissionsResponse_status :: (Int -> f Int)
-> UpdateThemePermissionsResponse
-> f UpdateThemePermissionsResponse
updateThemePermissionsResponse_status = (UpdateThemePermissionsResponse -> Int)
-> (UpdateThemePermissionsResponse
    -> Int -> UpdateThemePermissionsResponse)
-> Lens
     UpdateThemePermissionsResponse
     UpdateThemePermissionsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemePermissionsResponse' {Int
status :: Int
$sel:status:UpdateThemePermissionsResponse' :: UpdateThemePermissionsResponse -> Int
status} -> Int
status) (\s :: UpdateThemePermissionsResponse
s@UpdateThemePermissionsResponse' {} Int
a -> UpdateThemePermissionsResponse
s {$sel:status:UpdateThemePermissionsResponse' :: Int
status = Int
a} :: UpdateThemePermissionsResponse)

instance
  Prelude.NFData
    UpdateThemePermissionsResponse