{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_grantPermissions,
    updateThemePermissions_revokePermissions,
    updateThemePermissions_awsAccountId,
    updateThemePermissions_themeId,

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

    -- * Response Lenses
    updateThemePermissionsResponse_permissions,
    updateThemePermissionsResponse_requestId,
    updateThemePermissionsResponse_themeArn,
    updateThemePermissionsResponse_themeId,
    updateThemePermissionsResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 granted for the theme.
    UpdateThemePermissions -> Maybe [ResourcePermission]
grantPermissions :: Prelude.Maybe [ResourcePermission],
    -- | A list of resource permissions to be revoked from the theme.
    UpdateThemePermissions -> Maybe [ResourcePermission]
revokePermissions :: 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
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]
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
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. 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:
--
-- 'grantPermissions', 'updateThemePermissions_grantPermissions' - A list of resource permissions to be granted for the theme.
--
-- 'revokePermissions', 'updateThemePermissions_revokePermissions' - A list of resource permissions to be revoked from 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'
    { $sel:grantPermissions:UpdateThemePermissions' :: Maybe [ResourcePermission]
grantPermissions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:revokePermissions:UpdateThemePermissions' :: Maybe [ResourcePermission]
revokePermissions = 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 granted for the theme.
updateThemePermissions_grantPermissions :: Lens.Lens' UpdateThemePermissions (Prelude.Maybe [ResourcePermission])
updateThemePermissions_grantPermissions :: Lens' UpdateThemePermissions (Maybe [ResourcePermission])
updateThemePermissions_grantPermissions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 revoked from the theme.
updateThemePermissions_revokePermissions :: Lens.Lens' UpdateThemePermissions (Prelude.Maybe [ResourcePermission])
updateThemePermissions_revokePermissions :: Lens' UpdateThemePermissions (Maybe [ResourcePermission])
updateThemePermissions_revokePermissions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' UpdateThemePermissions Text
updateThemePermissions_awsAccountId = 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 :: Lens' UpdateThemePermissions Text
updateThemePermissions_themeId = 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 :: (Service -> Service)
-> UpdateThemePermissions -> Request UpdateThemePermissions
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateThemePermissions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateThemePermissions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (NonEmpty ResourcePermission)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateThemePermissionsResponse
UpdateThemePermissionsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Permissions")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RequestId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ThemeArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ThemeId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateThemePermissions where
  hashWithSalt :: Int -> UpdateThemePermissions -> Int
hashWithSalt Int
_salt UpdateThemePermissions' {Maybe [ResourcePermission]
Text
themeId :: Text
awsAccountId :: Text
revokePermissions :: Maybe [ResourcePermission]
grantPermissions :: Maybe [ResourcePermission]
$sel:themeId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
$sel:awsAccountId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
$sel:revokePermissions:UpdateThemePermissions' :: UpdateThemePermissions -> Maybe [ResourcePermission]
$sel:grantPermissions:UpdateThemePermissions' :: UpdateThemePermissions -> Maybe [ResourcePermission]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ResourcePermission]
grantPermissions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ResourcePermission]
revokePermissions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
themeId

instance Prelude.NFData UpdateThemePermissions where
  rnf :: UpdateThemePermissions -> ()
rnf UpdateThemePermissions' {Maybe [ResourcePermission]
Text
themeId :: Text
awsAccountId :: Text
revokePermissions :: Maybe [ResourcePermission]
grantPermissions :: Maybe [ResourcePermission]
$sel:themeId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
$sel:awsAccountId:UpdateThemePermissions' :: UpdateThemePermissions -> Text
$sel:revokePermissions:UpdateThemePermissions' :: UpdateThemePermissions -> Maybe [ResourcePermission]
$sel:grantPermissions:UpdateThemePermissions' :: UpdateThemePermissions -> Maybe [ResourcePermission]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ResourcePermission]
grantPermissions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ResourcePermission]
revokePermissions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
themeId

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

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

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

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

-- | /See:/ 'newUpdateThemePermissionsResponse' smart constructor.
data UpdateThemePermissionsResponse = UpdateThemePermissionsResponse'
  { -- | The resulting list of resource permissions for the theme.
    UpdateThemePermissionsResponse
-> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
    -- | 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 HTTP status of the request.
    UpdateThemePermissionsResponse -> Int
status :: Prelude.Int
  }
  deriving (UpdateThemePermissionsResponse
-> UpdateThemePermissionsResponse -> Bool
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]
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
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.
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:
--
-- 'permissions', 'updateThemePermissionsResponse_permissions' - The resulting list of resource permissions for the theme.
--
-- '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.
--
-- 'status', 'updateThemePermissionsResponse_status' - The HTTP status of the request.
newUpdateThemePermissionsResponse ::
  -- | 'status'
  Prelude.Int ->
  UpdateThemePermissionsResponse
newUpdateThemePermissionsResponse :: Int -> UpdateThemePermissionsResponse
newUpdateThemePermissionsResponse Int
pStatus_ =
  UpdateThemePermissionsResponse'
    { $sel:permissions:UpdateThemePermissionsResponse' :: Maybe (NonEmpty ResourcePermission)
permissions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:requestId:UpdateThemePermissionsResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
      $sel:themeArn:UpdateThemePermissionsResponse' :: Maybe Text
themeArn = forall a. Maybe a
Prelude.Nothing,
      $sel:themeId:UpdateThemePermissionsResponse' :: Maybe Text
themeId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateThemePermissionsResponse' :: Int
status = Int
pStatus_
    }

-- | The resulting list of resource permissions for the theme.
updateThemePermissionsResponse_permissions :: Lens.Lens' UpdateThemePermissionsResponse (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
updateThemePermissionsResponse_permissions :: Lens'
  UpdateThemePermissionsResponse
  (Maybe (NonEmpty ResourcePermission))
updateThemePermissionsResponse_permissions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Web Services request ID for this operation.
updateThemePermissionsResponse_requestId :: Lens.Lens' UpdateThemePermissionsResponse (Prelude.Maybe Prelude.Text)
updateThemePermissionsResponse_requestId :: Lens' UpdateThemePermissionsResponse (Maybe Text)
updateThemePermissionsResponse_requestId = 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 :: Lens' UpdateThemePermissionsResponse (Maybe Text)
updateThemePermissionsResponse_themeArn = 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 :: Lens' UpdateThemePermissionsResponse (Maybe Text)
updateThemePermissionsResponse_themeId = 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 HTTP status of the request.
updateThemePermissionsResponse_status :: Lens.Lens' UpdateThemePermissionsResponse Prelude.Int
updateThemePermissionsResponse_status :: Lens' UpdateThemePermissionsResponse Int
updateThemePermissionsResponse_status = 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
  where
  rnf :: UpdateThemePermissionsResponse -> ()
rnf UpdateThemePermissionsResponse' {Int
Maybe (NonEmpty ResourcePermission)
Maybe Text
status :: Int
themeId :: Maybe Text
themeArn :: Maybe Text
requestId :: Maybe Text
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:status:UpdateThemePermissionsResponse' :: UpdateThemePermissionsResponse -> Int
$sel:themeId:UpdateThemePermissionsResponse' :: UpdateThemePermissionsResponse -> Maybe Text
$sel:themeArn:UpdateThemePermissionsResponse' :: UpdateThemePermissionsResponse -> Maybe Text
$sel:requestId:UpdateThemePermissionsResponse' :: UpdateThemePermissionsResponse -> Maybe Text
$sel:permissions:UpdateThemePermissionsResponse' :: UpdateThemePermissionsResponse
-> Maybe (NonEmpty ResourcePermission)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ResourcePermission)
permissions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
themeArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
themeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status