{-# 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.Grafana.UpdateWorkspace
-- 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)
--
-- Modifies an existing Amazon Managed Grafana workspace. If you use this
-- operation and omit any optional parameters, the existing values of those
-- parameters are not changed.
--
-- To modify the user authentication methods that the workspace uses, such
-- as SAML or Amazon Web Services SSO, use
-- <https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspaceAuthentication.html UpdateWorkspaceAuthentication>.
--
-- To modify which users in the workspace have the @Admin@ and @Editor@
-- Grafana roles, use
-- <https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdatePermissions.html UpdatePermissions>.
module Amazonka.Grafana.UpdateWorkspace
  ( -- * Creating a Request
    UpdateWorkspace (..),
    newUpdateWorkspace,

    -- * Request Lenses
    updateWorkspace_workspaceRoleArn,
    updateWorkspace_workspaceDataSources,
    updateWorkspace_permissionType,
    updateWorkspace_workspaceNotificationDestinations,
    updateWorkspace_workspaceName,
    updateWorkspace_accountAccessType,
    updateWorkspace_organizationRoleName,
    updateWorkspace_workspaceDescription,
    updateWorkspace_stackSetName,
    updateWorkspace_workspaceOrganizationalUnits,
    updateWorkspace_workspaceId,

    -- * Destructuring the Response
    UpdateWorkspaceResponse (..),
    newUpdateWorkspaceResponse,

    -- * Response Lenses
    updateWorkspaceResponse_httpStatus,
    updateWorkspaceResponse_workspace,
  )
where

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

-- | /See:/ 'newUpdateWorkspace' smart constructor.
data UpdateWorkspace = UpdateWorkspace'
  { -- | The workspace needs an IAM role that grants permissions to the Amazon
    -- Web Services resources that the workspace will view data from. If you
    -- already have a role that you want to use, specify it here. If you omit
    -- this field and you specify some Amazon Web Services resources in
    -- @workspaceDataSources@ or @workspaceNotificationDestinations@, a new IAM
    -- role with the necessary permissions is automatically created.
    UpdateWorkspace -> Maybe (Sensitive Text)
workspaceRoleArn :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Specify the Amazon Web Services data sources that you want to be queried
    -- in this workspace. Specifying these data sources here enables Amazon
    -- Managed Grafana to create IAM roles and permissions that allow Amazon
    -- Managed Grafana to read data from these sources. You must still add them
    -- as data sources in the Grafana console in the workspace.
    --
    -- If you don\'t specify a data source here, you can still add it as a data
    -- source later in the workspace console. However, you will then have to
    -- manually configure permissions for it.
    UpdateWorkspace -> Maybe [DataSourceType]
workspaceDataSources :: Prelude.Maybe [DataSourceType],
    -- | If you specify @Service Managed@, Amazon Managed Grafana automatically
    -- creates the IAM roles and provisions the permissions that the workspace
    -- needs to use Amazon Web Services data sources and notification channels.
    --
    -- If you specify @CUSTOMER_MANAGED@, you will manage those roles and
    -- permissions yourself. If you are creating this workspace in a member
    -- account of an organization and that account is not a delegated
    -- administrator account, and you want the workspace to access data sources
    -- in other Amazon Web Services accounts in the organization, you must
    -- choose @CUSTOMER_MANAGED@.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/grafana/latest/userguide/AMG-manage-permissions.html Amazon Managed Grafana permissions and policies for Amazon Web Services data sources and notification channels>
    UpdateWorkspace -> Maybe PermissionType
permissionType :: Prelude.Maybe PermissionType,
    -- | Specify the Amazon Web Services notification channels that you plan to
    -- use in this workspace. Specifying these data sources here enables Amazon
    -- Managed Grafana to create IAM roles and permissions that allow Amazon
    -- Managed Grafana to use these channels.
    UpdateWorkspace -> Maybe [NotificationDestinationType]
workspaceNotificationDestinations :: Prelude.Maybe [NotificationDestinationType],
    -- | A new name for the workspace to update.
    UpdateWorkspace -> Maybe (Sensitive Text)
workspaceName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Specifies whether the workspace can access Amazon Web Services resources
    -- in this Amazon Web Services account only, or whether it can also access
    -- Amazon Web Services resources in other accounts in the same
    -- organization. If you specify @ORGANIZATION@, you must specify which
    -- organizational units the workspace can access in the
    -- @workspaceOrganizationalUnits@ parameter.
    UpdateWorkspace -> Maybe AccountAccessType
accountAccessType :: Prelude.Maybe AccountAccessType,
    -- | The name of an IAM role that already exists to use to access resources
    -- through Organizations.
    UpdateWorkspace -> Maybe (Sensitive Text)
organizationRoleName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | A description for the workspace. This is used only to help you identify
    -- this workspace.
    UpdateWorkspace -> Maybe (Sensitive Text)
workspaceDescription :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The name of the CloudFormation stack set to use to generate IAM roles to
    -- be used for this workspace.
    UpdateWorkspace -> Maybe Text
stackSetName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the organizational units that this workspace is allowed to use
    -- data sources from, if this workspace is in an account that is part of an
    -- organization.
    UpdateWorkspace -> Maybe (Sensitive [Text])
workspaceOrganizationalUnits :: Prelude.Maybe (Core.Sensitive [Prelude.Text]),
    -- | The ID of the workspace to update.
    UpdateWorkspace -> Text
workspaceId :: Prelude.Text
  }
  deriving (UpdateWorkspace -> UpdateWorkspace -> Bool
(UpdateWorkspace -> UpdateWorkspace -> Bool)
-> (UpdateWorkspace -> UpdateWorkspace -> Bool)
-> Eq UpdateWorkspace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWorkspace -> UpdateWorkspace -> Bool
$c/= :: UpdateWorkspace -> UpdateWorkspace -> Bool
== :: UpdateWorkspace -> UpdateWorkspace -> Bool
$c== :: UpdateWorkspace -> UpdateWorkspace -> Bool
Prelude.Eq, Int -> UpdateWorkspace -> ShowS
[UpdateWorkspace] -> ShowS
UpdateWorkspace -> String
(Int -> UpdateWorkspace -> ShowS)
-> (UpdateWorkspace -> String)
-> ([UpdateWorkspace] -> ShowS)
-> Show UpdateWorkspace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWorkspace] -> ShowS
$cshowList :: [UpdateWorkspace] -> ShowS
show :: UpdateWorkspace -> String
$cshow :: UpdateWorkspace -> String
showsPrec :: Int -> UpdateWorkspace -> ShowS
$cshowsPrec :: Int -> UpdateWorkspace -> ShowS
Prelude.Show, (forall x. UpdateWorkspace -> Rep UpdateWorkspace x)
-> (forall x. Rep UpdateWorkspace x -> UpdateWorkspace)
-> Generic UpdateWorkspace
forall x. Rep UpdateWorkspace x -> UpdateWorkspace
forall x. UpdateWorkspace -> Rep UpdateWorkspace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateWorkspace x -> UpdateWorkspace
$cfrom :: forall x. UpdateWorkspace -> Rep UpdateWorkspace x
Prelude.Generic)

-- |
-- Create a value of 'UpdateWorkspace' 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:
--
-- 'workspaceRoleArn', 'updateWorkspace_workspaceRoleArn' - The workspace needs an IAM role that grants permissions to the Amazon
-- Web Services resources that the workspace will view data from. If you
-- already have a role that you want to use, specify it here. If you omit
-- this field and you specify some Amazon Web Services resources in
-- @workspaceDataSources@ or @workspaceNotificationDestinations@, a new IAM
-- role with the necessary permissions is automatically created.
--
-- 'workspaceDataSources', 'updateWorkspace_workspaceDataSources' - Specify the Amazon Web Services data sources that you want to be queried
-- in this workspace. Specifying these data sources here enables Amazon
-- Managed Grafana to create IAM roles and permissions that allow Amazon
-- Managed Grafana to read data from these sources. You must still add them
-- as data sources in the Grafana console in the workspace.
--
-- If you don\'t specify a data source here, you can still add it as a data
-- source later in the workspace console. However, you will then have to
-- manually configure permissions for it.
--
-- 'permissionType', 'updateWorkspace_permissionType' - If you specify @Service Managed@, Amazon Managed Grafana automatically
-- creates the IAM roles and provisions the permissions that the workspace
-- needs to use Amazon Web Services data sources and notification channels.
--
-- If you specify @CUSTOMER_MANAGED@, you will manage those roles and
-- permissions yourself. If you are creating this workspace in a member
-- account of an organization and that account is not a delegated
-- administrator account, and you want the workspace to access data sources
-- in other Amazon Web Services accounts in the organization, you must
-- choose @CUSTOMER_MANAGED@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/grafana/latest/userguide/AMG-manage-permissions.html Amazon Managed Grafana permissions and policies for Amazon Web Services data sources and notification channels>
--
-- 'workspaceNotificationDestinations', 'updateWorkspace_workspaceNotificationDestinations' - Specify the Amazon Web Services notification channels that you plan to
-- use in this workspace. Specifying these data sources here enables Amazon
-- Managed Grafana to create IAM roles and permissions that allow Amazon
-- Managed Grafana to use these channels.
--
-- 'workspaceName', 'updateWorkspace_workspaceName' - A new name for the workspace to update.
--
-- 'accountAccessType', 'updateWorkspace_accountAccessType' - Specifies whether the workspace can access Amazon Web Services resources
-- in this Amazon Web Services account only, or whether it can also access
-- Amazon Web Services resources in other accounts in the same
-- organization. If you specify @ORGANIZATION@, you must specify which
-- organizational units the workspace can access in the
-- @workspaceOrganizationalUnits@ parameter.
--
-- 'organizationRoleName', 'updateWorkspace_organizationRoleName' - The name of an IAM role that already exists to use to access resources
-- through Organizations.
--
-- 'workspaceDescription', 'updateWorkspace_workspaceDescription' - A description for the workspace. This is used only to help you identify
-- this workspace.
--
-- 'stackSetName', 'updateWorkspace_stackSetName' - The name of the CloudFormation stack set to use to generate IAM roles to
-- be used for this workspace.
--
-- 'workspaceOrganizationalUnits', 'updateWorkspace_workspaceOrganizationalUnits' - Specifies the organizational units that this workspace is allowed to use
-- data sources from, if this workspace is in an account that is part of an
-- organization.
--
-- 'workspaceId', 'updateWorkspace_workspaceId' - The ID of the workspace to update.
newUpdateWorkspace ::
  -- | 'workspaceId'
  Prelude.Text ->
  UpdateWorkspace
newUpdateWorkspace :: Text -> UpdateWorkspace
newUpdateWorkspace Text
pWorkspaceId_ =
  UpdateWorkspace' :: Maybe (Sensitive Text)
-> Maybe [DataSourceType]
-> Maybe PermissionType
-> Maybe [NotificationDestinationType]
-> Maybe (Sensitive Text)
-> Maybe AccountAccessType
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (Sensitive [Text])
-> Text
-> UpdateWorkspace
UpdateWorkspace'
    { $sel:workspaceRoleArn:UpdateWorkspace' :: Maybe (Sensitive Text)
workspaceRoleArn =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceDataSources:UpdateWorkspace' :: Maybe [DataSourceType]
workspaceDataSources = Maybe [DataSourceType]
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionType:UpdateWorkspace' :: Maybe PermissionType
permissionType = Maybe PermissionType
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceNotificationDestinations:UpdateWorkspace' :: Maybe [NotificationDestinationType]
workspaceNotificationDestinations = Maybe [NotificationDestinationType]
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceName:UpdateWorkspace' :: Maybe (Sensitive Text)
workspaceName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:accountAccessType:UpdateWorkspace' :: Maybe AccountAccessType
accountAccessType = Maybe AccountAccessType
forall a. Maybe a
Prelude.Nothing,
      $sel:organizationRoleName:UpdateWorkspace' :: Maybe (Sensitive Text)
organizationRoleName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceDescription:UpdateWorkspace' :: Maybe (Sensitive Text)
workspaceDescription = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetName:UpdateWorkspace' :: Maybe Text
stackSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceOrganizationalUnits:UpdateWorkspace' :: Maybe (Sensitive [Text])
workspaceOrganizationalUnits = Maybe (Sensitive [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceId:UpdateWorkspace' :: Text
workspaceId = Text
pWorkspaceId_
    }

-- | The workspace needs an IAM role that grants permissions to the Amazon
-- Web Services resources that the workspace will view data from. If you
-- already have a role that you want to use, specify it here. If you omit
-- this field and you specify some Amazon Web Services resources in
-- @workspaceDataSources@ or @workspaceNotificationDestinations@, a new IAM
-- role with the necessary permissions is automatically created.
updateWorkspace_workspaceRoleArn :: Lens.Lens' UpdateWorkspace (Prelude.Maybe Prelude.Text)
updateWorkspace_workspaceRoleArn :: (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_workspaceRoleArn = (UpdateWorkspace -> Maybe (Sensitive Text))
-> (UpdateWorkspace -> Maybe (Sensitive Text) -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe (Sensitive Text)
workspaceRoleArn :: Maybe (Sensitive Text)
$sel:workspaceRoleArn:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
workspaceRoleArn} -> Maybe (Sensitive Text)
workspaceRoleArn) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe (Sensitive Text)
a -> UpdateWorkspace
s {$sel:workspaceRoleArn:UpdateWorkspace' :: Maybe (Sensitive Text)
workspaceRoleArn = Maybe (Sensitive Text)
a} :: UpdateWorkspace) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateWorkspace -> f UpdateWorkspace)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace
-> f UpdateWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Specify the Amazon Web Services data sources that you want to be queried
-- in this workspace. Specifying these data sources here enables Amazon
-- Managed Grafana to create IAM roles and permissions that allow Amazon
-- Managed Grafana to read data from these sources. You must still add them
-- as data sources in the Grafana console in the workspace.
--
-- If you don\'t specify a data source here, you can still add it as a data
-- source later in the workspace console. However, you will then have to
-- manually configure permissions for it.
updateWorkspace_workspaceDataSources :: Lens.Lens' UpdateWorkspace (Prelude.Maybe [DataSourceType])
updateWorkspace_workspaceDataSources :: (Maybe [DataSourceType] -> f (Maybe [DataSourceType]))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_workspaceDataSources = (UpdateWorkspace -> Maybe [DataSourceType])
-> (UpdateWorkspace -> Maybe [DataSourceType] -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe [DataSourceType])
     (Maybe [DataSourceType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe [DataSourceType]
workspaceDataSources :: Maybe [DataSourceType]
$sel:workspaceDataSources:UpdateWorkspace' :: UpdateWorkspace -> Maybe [DataSourceType]
workspaceDataSources} -> Maybe [DataSourceType]
workspaceDataSources) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe [DataSourceType]
a -> UpdateWorkspace
s {$sel:workspaceDataSources:UpdateWorkspace' :: Maybe [DataSourceType]
workspaceDataSources = Maybe [DataSourceType]
a} :: UpdateWorkspace) ((Maybe [DataSourceType] -> f (Maybe [DataSourceType]))
 -> UpdateWorkspace -> f UpdateWorkspace)
-> ((Maybe [DataSourceType] -> f (Maybe [DataSourceType]))
    -> Maybe [DataSourceType] -> f (Maybe [DataSourceType]))
-> (Maybe [DataSourceType] -> f (Maybe [DataSourceType]))
-> UpdateWorkspace
-> f UpdateWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DataSourceType] [DataSourceType] [DataSourceType] [DataSourceType]
-> Iso
     (Maybe [DataSourceType])
     (Maybe [DataSourceType])
     (Maybe [DataSourceType])
     (Maybe [DataSourceType])
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
  [DataSourceType] [DataSourceType] [DataSourceType] [DataSourceType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If you specify @Service Managed@, Amazon Managed Grafana automatically
-- creates the IAM roles and provisions the permissions that the workspace
-- needs to use Amazon Web Services data sources and notification channels.
--
-- If you specify @CUSTOMER_MANAGED@, you will manage those roles and
-- permissions yourself. If you are creating this workspace in a member
-- account of an organization and that account is not a delegated
-- administrator account, and you want the workspace to access data sources
-- in other Amazon Web Services accounts in the organization, you must
-- choose @CUSTOMER_MANAGED@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/grafana/latest/userguide/AMG-manage-permissions.html Amazon Managed Grafana permissions and policies for Amazon Web Services data sources and notification channels>
updateWorkspace_permissionType :: Lens.Lens' UpdateWorkspace (Prelude.Maybe PermissionType)
updateWorkspace_permissionType :: (Maybe PermissionType -> f (Maybe PermissionType))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_permissionType = (UpdateWorkspace -> Maybe PermissionType)
-> (UpdateWorkspace -> Maybe PermissionType -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe PermissionType)
     (Maybe PermissionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe PermissionType
permissionType :: Maybe PermissionType
$sel:permissionType:UpdateWorkspace' :: UpdateWorkspace -> Maybe PermissionType
permissionType} -> Maybe PermissionType
permissionType) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe PermissionType
a -> UpdateWorkspace
s {$sel:permissionType:UpdateWorkspace' :: Maybe PermissionType
permissionType = Maybe PermissionType
a} :: UpdateWorkspace)

-- | Specify the Amazon Web Services notification channels that you plan to
-- use in this workspace. Specifying these data sources here enables Amazon
-- Managed Grafana to create IAM roles and permissions that allow Amazon
-- Managed Grafana to use these channels.
updateWorkspace_workspaceNotificationDestinations :: Lens.Lens' UpdateWorkspace (Prelude.Maybe [NotificationDestinationType])
updateWorkspace_workspaceNotificationDestinations :: (Maybe [NotificationDestinationType]
 -> f (Maybe [NotificationDestinationType]))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_workspaceNotificationDestinations = (UpdateWorkspace -> Maybe [NotificationDestinationType])
-> (UpdateWorkspace
    -> Maybe [NotificationDestinationType] -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe [NotificationDestinationType])
     (Maybe [NotificationDestinationType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe [NotificationDestinationType]
workspaceNotificationDestinations :: Maybe [NotificationDestinationType]
$sel:workspaceNotificationDestinations:UpdateWorkspace' :: UpdateWorkspace -> Maybe [NotificationDestinationType]
workspaceNotificationDestinations} -> Maybe [NotificationDestinationType]
workspaceNotificationDestinations) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe [NotificationDestinationType]
a -> UpdateWorkspace
s {$sel:workspaceNotificationDestinations:UpdateWorkspace' :: Maybe [NotificationDestinationType]
workspaceNotificationDestinations = Maybe [NotificationDestinationType]
a} :: UpdateWorkspace) ((Maybe [NotificationDestinationType]
  -> f (Maybe [NotificationDestinationType]))
 -> UpdateWorkspace -> f UpdateWorkspace)
-> ((Maybe [NotificationDestinationType]
     -> f (Maybe [NotificationDestinationType]))
    -> Maybe [NotificationDestinationType]
    -> f (Maybe [NotificationDestinationType]))
-> (Maybe [NotificationDestinationType]
    -> f (Maybe [NotificationDestinationType]))
-> UpdateWorkspace
-> f UpdateWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NotificationDestinationType]
  [NotificationDestinationType]
  [NotificationDestinationType]
  [NotificationDestinationType]
-> Iso
     (Maybe [NotificationDestinationType])
     (Maybe [NotificationDestinationType])
     (Maybe [NotificationDestinationType])
     (Maybe [NotificationDestinationType])
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
  [NotificationDestinationType]
  [NotificationDestinationType]
  [NotificationDestinationType]
  [NotificationDestinationType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A new name for the workspace to update.
updateWorkspace_workspaceName :: Lens.Lens' UpdateWorkspace (Prelude.Maybe Prelude.Text)
updateWorkspace_workspaceName :: (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_workspaceName = (UpdateWorkspace -> Maybe (Sensitive Text))
-> (UpdateWorkspace -> Maybe (Sensitive Text) -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe (Sensitive Text)
workspaceName :: Maybe (Sensitive Text)
$sel:workspaceName:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
workspaceName} -> Maybe (Sensitive Text)
workspaceName) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe (Sensitive Text)
a -> UpdateWorkspace
s {$sel:workspaceName:UpdateWorkspace' :: Maybe (Sensitive Text)
workspaceName = Maybe (Sensitive Text)
a} :: UpdateWorkspace) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateWorkspace -> f UpdateWorkspace)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace
-> f UpdateWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Specifies whether the workspace can access Amazon Web Services resources
-- in this Amazon Web Services account only, or whether it can also access
-- Amazon Web Services resources in other accounts in the same
-- organization. If you specify @ORGANIZATION@, you must specify which
-- organizational units the workspace can access in the
-- @workspaceOrganizationalUnits@ parameter.
updateWorkspace_accountAccessType :: Lens.Lens' UpdateWorkspace (Prelude.Maybe AccountAccessType)
updateWorkspace_accountAccessType :: (Maybe AccountAccessType -> f (Maybe AccountAccessType))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_accountAccessType = (UpdateWorkspace -> Maybe AccountAccessType)
-> (UpdateWorkspace -> Maybe AccountAccessType -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe AccountAccessType)
     (Maybe AccountAccessType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe AccountAccessType
accountAccessType :: Maybe AccountAccessType
$sel:accountAccessType:UpdateWorkspace' :: UpdateWorkspace -> Maybe AccountAccessType
accountAccessType} -> Maybe AccountAccessType
accountAccessType) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe AccountAccessType
a -> UpdateWorkspace
s {$sel:accountAccessType:UpdateWorkspace' :: Maybe AccountAccessType
accountAccessType = Maybe AccountAccessType
a} :: UpdateWorkspace)

-- | The name of an IAM role that already exists to use to access resources
-- through Organizations.
updateWorkspace_organizationRoleName :: Lens.Lens' UpdateWorkspace (Prelude.Maybe Prelude.Text)
updateWorkspace_organizationRoleName :: (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_organizationRoleName = (UpdateWorkspace -> Maybe (Sensitive Text))
-> (UpdateWorkspace -> Maybe (Sensitive Text) -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe (Sensitive Text)
organizationRoleName :: Maybe (Sensitive Text)
$sel:organizationRoleName:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
organizationRoleName} -> Maybe (Sensitive Text)
organizationRoleName) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe (Sensitive Text)
a -> UpdateWorkspace
s {$sel:organizationRoleName:UpdateWorkspace' :: Maybe (Sensitive Text)
organizationRoleName = Maybe (Sensitive Text)
a} :: UpdateWorkspace) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateWorkspace -> f UpdateWorkspace)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace
-> f UpdateWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | A description for the workspace. This is used only to help you identify
-- this workspace.
updateWorkspace_workspaceDescription :: Lens.Lens' UpdateWorkspace (Prelude.Maybe Prelude.Text)
updateWorkspace_workspaceDescription :: (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_workspaceDescription = (UpdateWorkspace -> Maybe (Sensitive Text))
-> (UpdateWorkspace -> Maybe (Sensitive Text) -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe (Sensitive Text)
workspaceDescription :: Maybe (Sensitive Text)
$sel:workspaceDescription:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
workspaceDescription} -> Maybe (Sensitive Text)
workspaceDescription) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe (Sensitive Text)
a -> UpdateWorkspace
s {$sel:workspaceDescription:UpdateWorkspace' :: Maybe (Sensitive Text)
workspaceDescription = Maybe (Sensitive Text)
a} :: UpdateWorkspace) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateWorkspace -> f UpdateWorkspace)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace
-> f UpdateWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The name of the CloudFormation stack set to use to generate IAM roles to
-- be used for this workspace.
updateWorkspace_stackSetName :: Lens.Lens' UpdateWorkspace (Prelude.Maybe Prelude.Text)
updateWorkspace_stackSetName :: (Maybe Text -> f (Maybe Text))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_stackSetName = (UpdateWorkspace -> Maybe Text)
-> (UpdateWorkspace -> Maybe Text -> UpdateWorkspace)
-> Lens UpdateWorkspace UpdateWorkspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe Text
stackSetName :: Maybe Text
$sel:stackSetName:UpdateWorkspace' :: UpdateWorkspace -> Maybe Text
stackSetName} -> Maybe Text
stackSetName) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe Text
a -> UpdateWorkspace
s {$sel:stackSetName:UpdateWorkspace' :: Maybe Text
stackSetName = Maybe Text
a} :: UpdateWorkspace)

-- | Specifies the organizational units that this workspace is allowed to use
-- data sources from, if this workspace is in an account that is part of an
-- organization.
updateWorkspace_workspaceOrganizationalUnits :: Lens.Lens' UpdateWorkspace (Prelude.Maybe [Prelude.Text])
updateWorkspace_workspaceOrganizationalUnits :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_workspaceOrganizationalUnits = (UpdateWorkspace -> Maybe (Sensitive [Text]))
-> (UpdateWorkspace -> Maybe (Sensitive [Text]) -> UpdateWorkspace)
-> Lens
     UpdateWorkspace
     UpdateWorkspace
     (Maybe (Sensitive [Text]))
     (Maybe (Sensitive [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Maybe (Sensitive [Text])
workspaceOrganizationalUnits :: Maybe (Sensitive [Text])
$sel:workspaceOrganizationalUnits:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive [Text])
workspaceOrganizationalUnits} -> Maybe (Sensitive [Text])
workspaceOrganizationalUnits) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Maybe (Sensitive [Text])
a -> UpdateWorkspace
s {$sel:workspaceOrganizationalUnits:UpdateWorkspace' :: Maybe (Sensitive [Text])
workspaceOrganizationalUnits = Maybe (Sensitive [Text])
a} :: UpdateWorkspace) ((Maybe (Sensitive [Text]) -> f (Maybe (Sensitive [Text])))
 -> UpdateWorkspace -> f UpdateWorkspace)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe (Sensitive [Text]) -> f (Maybe (Sensitive [Text])))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateWorkspace
-> f UpdateWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive [Text]) (Sensitive [Text]) [Text] [Text]
-> Iso
     (Maybe (Sensitive [Text]))
     (Maybe (Sensitive [Text]))
     (Maybe [Text])
     (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping (AnIso (Sensitive [Text]) (Sensitive [Text]) [Text] [Text]
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso (Sensitive [Text]) (Sensitive [Text]) [Text] [Text]
-> (Exchange [Text] [Text] [Text] (Identity [Text])
    -> Exchange [Text] [Text] [Text] (Identity [Text]))
-> AnIso (Sensitive [Text]) (Sensitive [Text]) [Text] [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange [Text] [Text] [Text] (Identity [Text])
-> Exchange [Text] [Text] [Text] (Identity [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The ID of the workspace to update.
updateWorkspace_workspaceId :: Lens.Lens' UpdateWorkspace Prelude.Text
updateWorkspace_workspaceId :: (Text -> f Text) -> UpdateWorkspace -> f UpdateWorkspace
updateWorkspace_workspaceId = (UpdateWorkspace -> Text)
-> (UpdateWorkspace -> Text -> UpdateWorkspace)
-> Lens UpdateWorkspace UpdateWorkspace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspace' {Text
workspaceId :: Text
$sel:workspaceId:UpdateWorkspace' :: UpdateWorkspace -> Text
workspaceId} -> Text
workspaceId) (\s :: UpdateWorkspace
s@UpdateWorkspace' {} Text
a -> UpdateWorkspace
s {$sel:workspaceId:UpdateWorkspace' :: Text
workspaceId = Text
a} :: UpdateWorkspace)

instance Core.AWSRequest UpdateWorkspace where
  type
    AWSResponse UpdateWorkspace =
      UpdateWorkspaceResponse
  request :: UpdateWorkspace -> Request UpdateWorkspace
request = Service -> UpdateWorkspace -> Request UpdateWorkspace
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateWorkspace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateWorkspace)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateWorkspace))
-> Logger
-> Service
-> Proxy UpdateWorkspace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateWorkspace)))
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 ->
          Int -> WorkspaceDescription -> UpdateWorkspaceResponse
UpdateWorkspaceResponse'
            (Int -> WorkspaceDescription -> UpdateWorkspaceResponse)
-> Either String Int
-> Either String (WorkspaceDescription -> UpdateWorkspaceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (WorkspaceDescription -> UpdateWorkspaceResponse)
-> Either String WorkspaceDescription
-> Either String UpdateWorkspaceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String WorkspaceDescription
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"workspace")
      )

instance Prelude.Hashable UpdateWorkspace

instance Prelude.NFData UpdateWorkspace

instance Core.ToHeaders UpdateWorkspace where
  toHeaders :: UpdateWorkspace -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateWorkspace -> 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.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateWorkspace where
  toJSON :: UpdateWorkspace -> Value
toJSON UpdateWorkspace' {Maybe [DataSourceType]
Maybe [NotificationDestinationType]
Maybe Text
Maybe (Sensitive [Text])
Maybe (Sensitive Text)
Maybe AccountAccessType
Maybe PermissionType
Text
workspaceId :: Text
workspaceOrganizationalUnits :: Maybe (Sensitive [Text])
stackSetName :: Maybe Text
workspaceDescription :: Maybe (Sensitive Text)
organizationRoleName :: Maybe (Sensitive Text)
accountAccessType :: Maybe AccountAccessType
workspaceName :: Maybe (Sensitive Text)
workspaceNotificationDestinations :: Maybe [NotificationDestinationType]
permissionType :: Maybe PermissionType
workspaceDataSources :: Maybe [DataSourceType]
workspaceRoleArn :: Maybe (Sensitive Text)
$sel:workspaceId:UpdateWorkspace' :: UpdateWorkspace -> Text
$sel:workspaceOrganizationalUnits:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive [Text])
$sel:stackSetName:UpdateWorkspace' :: UpdateWorkspace -> Maybe Text
$sel:workspaceDescription:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
$sel:organizationRoleName:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
$sel:accountAccessType:UpdateWorkspace' :: UpdateWorkspace -> Maybe AccountAccessType
$sel:workspaceName:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
$sel:workspaceNotificationDestinations:UpdateWorkspace' :: UpdateWorkspace -> Maybe [NotificationDestinationType]
$sel:permissionType:UpdateWorkspace' :: UpdateWorkspace -> Maybe PermissionType
$sel:workspaceDataSources:UpdateWorkspace' :: UpdateWorkspace -> Maybe [DataSourceType]
$sel:workspaceRoleArn:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"workspaceRoleArn" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
workspaceRoleArn,
            (Text
"workspaceDataSources" Text -> [DataSourceType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([DataSourceType] -> Pair) -> Maybe [DataSourceType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DataSourceType]
workspaceDataSources,
            (Text
"permissionType" Text -> PermissionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PermissionType -> Pair) -> Maybe PermissionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PermissionType
permissionType,
            (Text
"workspaceNotificationDestinations" Text -> [NotificationDestinationType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([NotificationDestinationType] -> Pair)
-> Maybe [NotificationDestinationType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NotificationDestinationType]
workspaceNotificationDestinations,
            (Text
"workspaceName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
workspaceName,
            (Text
"accountAccessType" Text -> AccountAccessType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AccountAccessType -> Pair)
-> Maybe AccountAccessType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccountAccessType
accountAccessType,
            (Text
"organizationRoleName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
organizationRoleName,
            (Text
"workspaceDescription" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
workspaceDescription,
            (Text
"stackSetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
stackSetName,
            (Text
"workspaceOrganizationalUnits" Text -> Sensitive [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive [Text] -> Pair)
-> Maybe (Sensitive [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive [Text])
workspaceOrganizationalUnits
          ]
      )

instance Core.ToPath UpdateWorkspace where
  toPath :: UpdateWorkspace -> ByteString
toPath UpdateWorkspace' {Maybe [DataSourceType]
Maybe [NotificationDestinationType]
Maybe Text
Maybe (Sensitive [Text])
Maybe (Sensitive Text)
Maybe AccountAccessType
Maybe PermissionType
Text
workspaceId :: Text
workspaceOrganizationalUnits :: Maybe (Sensitive [Text])
stackSetName :: Maybe Text
workspaceDescription :: Maybe (Sensitive Text)
organizationRoleName :: Maybe (Sensitive Text)
accountAccessType :: Maybe AccountAccessType
workspaceName :: Maybe (Sensitive Text)
workspaceNotificationDestinations :: Maybe [NotificationDestinationType]
permissionType :: Maybe PermissionType
workspaceDataSources :: Maybe [DataSourceType]
workspaceRoleArn :: Maybe (Sensitive Text)
$sel:workspaceId:UpdateWorkspace' :: UpdateWorkspace -> Text
$sel:workspaceOrganizationalUnits:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive [Text])
$sel:stackSetName:UpdateWorkspace' :: UpdateWorkspace -> Maybe Text
$sel:workspaceDescription:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
$sel:organizationRoleName:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
$sel:accountAccessType:UpdateWorkspace' :: UpdateWorkspace -> Maybe AccountAccessType
$sel:workspaceName:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
$sel:workspaceNotificationDestinations:UpdateWorkspace' :: UpdateWorkspace -> Maybe [NotificationDestinationType]
$sel:permissionType:UpdateWorkspace' :: UpdateWorkspace -> Maybe PermissionType
$sel:workspaceDataSources:UpdateWorkspace' :: UpdateWorkspace -> Maybe [DataSourceType]
$sel:workspaceRoleArn:UpdateWorkspace' :: UpdateWorkspace -> Maybe (Sensitive Text)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/workspaces/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workspaceId]

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

-- | /See:/ 'newUpdateWorkspaceResponse' smart constructor.
data UpdateWorkspaceResponse = UpdateWorkspaceResponse'
  { -- | The response's http status code.
    UpdateWorkspaceResponse -> Int
httpStatus :: Prelude.Int,
    -- | A structure containing data about the workspace that was created.
    UpdateWorkspaceResponse -> WorkspaceDescription
workspace :: WorkspaceDescription
  }
  deriving (UpdateWorkspaceResponse -> UpdateWorkspaceResponse -> Bool
(UpdateWorkspaceResponse -> UpdateWorkspaceResponse -> Bool)
-> (UpdateWorkspaceResponse -> UpdateWorkspaceResponse -> Bool)
-> Eq UpdateWorkspaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWorkspaceResponse -> UpdateWorkspaceResponse -> Bool
$c/= :: UpdateWorkspaceResponse -> UpdateWorkspaceResponse -> Bool
== :: UpdateWorkspaceResponse -> UpdateWorkspaceResponse -> Bool
$c== :: UpdateWorkspaceResponse -> UpdateWorkspaceResponse -> Bool
Prelude.Eq, Int -> UpdateWorkspaceResponse -> ShowS
[UpdateWorkspaceResponse] -> ShowS
UpdateWorkspaceResponse -> String
(Int -> UpdateWorkspaceResponse -> ShowS)
-> (UpdateWorkspaceResponse -> String)
-> ([UpdateWorkspaceResponse] -> ShowS)
-> Show UpdateWorkspaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWorkspaceResponse] -> ShowS
$cshowList :: [UpdateWorkspaceResponse] -> ShowS
show :: UpdateWorkspaceResponse -> String
$cshow :: UpdateWorkspaceResponse -> String
showsPrec :: Int -> UpdateWorkspaceResponse -> ShowS
$cshowsPrec :: Int -> UpdateWorkspaceResponse -> ShowS
Prelude.Show, (forall x.
 UpdateWorkspaceResponse -> Rep UpdateWorkspaceResponse x)
-> (forall x.
    Rep UpdateWorkspaceResponse x -> UpdateWorkspaceResponse)
-> Generic UpdateWorkspaceResponse
forall x. Rep UpdateWorkspaceResponse x -> UpdateWorkspaceResponse
forall x. UpdateWorkspaceResponse -> Rep UpdateWorkspaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateWorkspaceResponse x -> UpdateWorkspaceResponse
$cfrom :: forall x. UpdateWorkspaceResponse -> Rep UpdateWorkspaceResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateWorkspaceResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'updateWorkspaceResponse_httpStatus' - The response's http status code.
--
-- 'workspace', 'updateWorkspaceResponse_workspace' - A structure containing data about the workspace that was created.
newUpdateWorkspaceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'workspace'
  WorkspaceDescription ->
  UpdateWorkspaceResponse
newUpdateWorkspaceResponse :: Int -> WorkspaceDescription -> UpdateWorkspaceResponse
newUpdateWorkspaceResponse Int
pHttpStatus_ WorkspaceDescription
pWorkspace_ =
  UpdateWorkspaceResponse' :: Int -> WorkspaceDescription -> UpdateWorkspaceResponse
UpdateWorkspaceResponse'
    { $sel:httpStatus:UpdateWorkspaceResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:workspace:UpdateWorkspaceResponse' :: WorkspaceDescription
workspace = WorkspaceDescription
pWorkspace_
    }

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

-- | A structure containing data about the workspace that was created.
updateWorkspaceResponse_workspace :: Lens.Lens' UpdateWorkspaceResponse WorkspaceDescription
updateWorkspaceResponse_workspace :: (WorkspaceDescription -> f WorkspaceDescription)
-> UpdateWorkspaceResponse -> f UpdateWorkspaceResponse
updateWorkspaceResponse_workspace = (UpdateWorkspaceResponse -> WorkspaceDescription)
-> (UpdateWorkspaceResponse
    -> WorkspaceDescription -> UpdateWorkspaceResponse)
-> Lens
     UpdateWorkspaceResponse
     UpdateWorkspaceResponse
     WorkspaceDescription
     WorkspaceDescription
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspaceResponse' {WorkspaceDescription
workspace :: WorkspaceDescription
$sel:workspace:UpdateWorkspaceResponse' :: UpdateWorkspaceResponse -> WorkspaceDescription
workspace} -> WorkspaceDescription
workspace) (\s :: UpdateWorkspaceResponse
s@UpdateWorkspaceResponse' {} WorkspaceDescription
a -> UpdateWorkspaceResponse
s {$sel:workspace:UpdateWorkspaceResponse' :: WorkspaceDescription
workspace = WorkspaceDescription
a} :: UpdateWorkspaceResponse)

instance Prelude.NFData UpdateWorkspaceResponse