{-# 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.SSOAdmin.DeletePermissionsBoundaryFromPermissionSet
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the permissions boundary from a specified PermissionSet.
module Amazonka.SSOAdmin.DeletePermissionsBoundaryFromPermissionSet
  ( -- * Creating a Request
    DeletePermissionsBoundaryFromPermissionSet (..),
    newDeletePermissionsBoundaryFromPermissionSet,

    -- * Request Lenses
    deletePermissionsBoundaryFromPermissionSet_instanceArn,
    deletePermissionsBoundaryFromPermissionSet_permissionSetArn,

    -- * Destructuring the Response
    DeletePermissionsBoundaryFromPermissionSetResponse (..),
    newDeletePermissionsBoundaryFromPermissionSetResponse,

    -- * Response Lenses
    deletePermissionsBoundaryFromPermissionSetResponse_httpStatus,
  )
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSOAdmin.Types

-- | /See:/ 'newDeletePermissionsBoundaryFromPermissionSet' smart constructor.
data DeletePermissionsBoundaryFromPermissionSet = DeletePermissionsBoundaryFromPermissionSet'
  { -- | The ARN of the IAM Identity Center instance under which the operation
    -- will be executed.
    DeletePermissionsBoundaryFromPermissionSet -> Text
instanceArn :: Prelude.Text,
    -- | The ARN of the @PermissionSet@.
    DeletePermissionsBoundaryFromPermissionSet -> Text
permissionSetArn :: Prelude.Text
  }
  deriving (DeletePermissionsBoundaryFromPermissionSet
-> DeletePermissionsBoundaryFromPermissionSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePermissionsBoundaryFromPermissionSet
-> DeletePermissionsBoundaryFromPermissionSet -> Bool
$c/= :: DeletePermissionsBoundaryFromPermissionSet
-> DeletePermissionsBoundaryFromPermissionSet -> Bool
== :: DeletePermissionsBoundaryFromPermissionSet
-> DeletePermissionsBoundaryFromPermissionSet -> Bool
$c== :: DeletePermissionsBoundaryFromPermissionSet
-> DeletePermissionsBoundaryFromPermissionSet -> Bool
Prelude.Eq, ReadPrec [DeletePermissionsBoundaryFromPermissionSet]
ReadPrec DeletePermissionsBoundaryFromPermissionSet
Int -> ReadS DeletePermissionsBoundaryFromPermissionSet
ReadS [DeletePermissionsBoundaryFromPermissionSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePermissionsBoundaryFromPermissionSet]
$creadListPrec :: ReadPrec [DeletePermissionsBoundaryFromPermissionSet]
readPrec :: ReadPrec DeletePermissionsBoundaryFromPermissionSet
$creadPrec :: ReadPrec DeletePermissionsBoundaryFromPermissionSet
readList :: ReadS [DeletePermissionsBoundaryFromPermissionSet]
$creadList :: ReadS [DeletePermissionsBoundaryFromPermissionSet]
readsPrec :: Int -> ReadS DeletePermissionsBoundaryFromPermissionSet
$creadsPrec :: Int -> ReadS DeletePermissionsBoundaryFromPermissionSet
Prelude.Read, Int -> DeletePermissionsBoundaryFromPermissionSet -> ShowS
[DeletePermissionsBoundaryFromPermissionSet] -> ShowS
DeletePermissionsBoundaryFromPermissionSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePermissionsBoundaryFromPermissionSet] -> ShowS
$cshowList :: [DeletePermissionsBoundaryFromPermissionSet] -> ShowS
show :: DeletePermissionsBoundaryFromPermissionSet -> String
$cshow :: DeletePermissionsBoundaryFromPermissionSet -> String
showsPrec :: Int -> DeletePermissionsBoundaryFromPermissionSet -> ShowS
$cshowsPrec :: Int -> DeletePermissionsBoundaryFromPermissionSet -> ShowS
Prelude.Show, forall x.
Rep DeletePermissionsBoundaryFromPermissionSet x
-> DeletePermissionsBoundaryFromPermissionSet
forall x.
DeletePermissionsBoundaryFromPermissionSet
-> Rep DeletePermissionsBoundaryFromPermissionSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletePermissionsBoundaryFromPermissionSet x
-> DeletePermissionsBoundaryFromPermissionSet
$cfrom :: forall x.
DeletePermissionsBoundaryFromPermissionSet
-> Rep DeletePermissionsBoundaryFromPermissionSet x
Prelude.Generic)

-- |
-- Create a value of 'DeletePermissionsBoundaryFromPermissionSet' 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:
--
-- 'instanceArn', 'deletePermissionsBoundaryFromPermissionSet_instanceArn' - The ARN of the IAM Identity Center instance under which the operation
-- will be executed.
--
-- 'permissionSetArn', 'deletePermissionsBoundaryFromPermissionSet_permissionSetArn' - The ARN of the @PermissionSet@.
newDeletePermissionsBoundaryFromPermissionSet ::
  -- | 'instanceArn'
  Prelude.Text ->
  -- | 'permissionSetArn'
  Prelude.Text ->
  DeletePermissionsBoundaryFromPermissionSet
newDeletePermissionsBoundaryFromPermissionSet :: Text -> Text -> DeletePermissionsBoundaryFromPermissionSet
newDeletePermissionsBoundaryFromPermissionSet
  Text
pInstanceArn_
  Text
pPermissionSetArn_ =
    DeletePermissionsBoundaryFromPermissionSet'
      { $sel:instanceArn:DeletePermissionsBoundaryFromPermissionSet' :: Text
instanceArn =
          Text
pInstanceArn_,
        $sel:permissionSetArn:DeletePermissionsBoundaryFromPermissionSet' :: Text
permissionSetArn =
          Text
pPermissionSetArn_
      }

-- | The ARN of the IAM Identity Center instance under which the operation
-- will be executed.
deletePermissionsBoundaryFromPermissionSet_instanceArn :: Lens.Lens' DeletePermissionsBoundaryFromPermissionSet Prelude.Text
deletePermissionsBoundaryFromPermissionSet_instanceArn :: Lens' DeletePermissionsBoundaryFromPermissionSet Text
deletePermissionsBoundaryFromPermissionSet_instanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePermissionsBoundaryFromPermissionSet' {Text
instanceArn :: Text
$sel:instanceArn:DeletePermissionsBoundaryFromPermissionSet' :: DeletePermissionsBoundaryFromPermissionSet -> Text
instanceArn} -> Text
instanceArn) (\s :: DeletePermissionsBoundaryFromPermissionSet
s@DeletePermissionsBoundaryFromPermissionSet' {} Text
a -> DeletePermissionsBoundaryFromPermissionSet
s {$sel:instanceArn:DeletePermissionsBoundaryFromPermissionSet' :: Text
instanceArn = Text
a} :: DeletePermissionsBoundaryFromPermissionSet)

-- | The ARN of the @PermissionSet@.
deletePermissionsBoundaryFromPermissionSet_permissionSetArn :: Lens.Lens' DeletePermissionsBoundaryFromPermissionSet Prelude.Text
deletePermissionsBoundaryFromPermissionSet_permissionSetArn :: Lens' DeletePermissionsBoundaryFromPermissionSet Text
deletePermissionsBoundaryFromPermissionSet_permissionSetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePermissionsBoundaryFromPermissionSet' {Text
permissionSetArn :: Text
$sel:permissionSetArn:DeletePermissionsBoundaryFromPermissionSet' :: DeletePermissionsBoundaryFromPermissionSet -> Text
permissionSetArn} -> Text
permissionSetArn) (\s :: DeletePermissionsBoundaryFromPermissionSet
s@DeletePermissionsBoundaryFromPermissionSet' {} Text
a -> DeletePermissionsBoundaryFromPermissionSet
s {$sel:permissionSetArn:DeletePermissionsBoundaryFromPermissionSet' :: Text
permissionSetArn = Text
a} :: DeletePermissionsBoundaryFromPermissionSet)

instance
  Core.AWSRequest
    DeletePermissionsBoundaryFromPermissionSet
  where
  type
    AWSResponse
      DeletePermissionsBoundaryFromPermissionSet =
      DeletePermissionsBoundaryFromPermissionSetResponse
  request :: (Service -> Service)
-> DeletePermissionsBoundaryFromPermissionSet
-> Request DeletePermissionsBoundaryFromPermissionSet
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeletePermissionsBoundaryFromPermissionSet
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeletePermissionsBoundaryFromPermissionSet)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeletePermissionsBoundaryFromPermissionSetResponse
DeletePermissionsBoundaryFromPermissionSetResponse'
            forall (f :: * -> *) a b. Functor 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
    DeletePermissionsBoundaryFromPermissionSet
  where
  hashWithSalt :: Int -> DeletePermissionsBoundaryFromPermissionSet -> Int
hashWithSalt
    Int
_salt
    DeletePermissionsBoundaryFromPermissionSet' {Text
permissionSetArn :: Text
instanceArn :: Text
$sel:permissionSetArn:DeletePermissionsBoundaryFromPermissionSet' :: DeletePermissionsBoundaryFromPermissionSet -> Text
$sel:instanceArn:DeletePermissionsBoundaryFromPermissionSet' :: DeletePermissionsBoundaryFromPermissionSet -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
permissionSetArn

instance
  Prelude.NFData
    DeletePermissionsBoundaryFromPermissionSet
  where
  rnf :: DeletePermissionsBoundaryFromPermissionSet -> ()
rnf DeletePermissionsBoundaryFromPermissionSet' {Text
permissionSetArn :: Text
instanceArn :: Text
$sel:permissionSetArn:DeletePermissionsBoundaryFromPermissionSet' :: DeletePermissionsBoundaryFromPermissionSet -> Text
$sel:instanceArn:DeletePermissionsBoundaryFromPermissionSet' :: DeletePermissionsBoundaryFromPermissionSet -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
instanceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
permissionSetArn

instance
  Data.ToHeaders
    DeletePermissionsBoundaryFromPermissionSet
  where
  toHeaders :: DeletePermissionsBoundaryFromPermissionSet -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"SWBExternalService.DeletePermissionsBoundaryFromPermissionSet" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    DeletePermissionsBoundaryFromPermissionSet
  where
  toJSON :: DeletePermissionsBoundaryFromPermissionSet -> Value
toJSON
    DeletePermissionsBoundaryFromPermissionSet' {Text
permissionSetArn :: Text
instanceArn :: Text
$sel:permissionSetArn:DeletePermissionsBoundaryFromPermissionSet' :: DeletePermissionsBoundaryFromPermissionSet -> Text
$sel:instanceArn:DeletePermissionsBoundaryFromPermissionSet' :: DeletePermissionsBoundaryFromPermissionSet -> Text
..} =
      [Pair] -> Value
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ forall a. a -> Maybe a
Prelude.Just (Key
"InstanceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceArn),
              forall a. a -> Maybe a
Prelude.Just
                (Key
"PermissionSetArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
permissionSetArn)
            ]
        )

instance
  Data.ToPath
    DeletePermissionsBoundaryFromPermissionSet
  where
  toPath :: DeletePermissionsBoundaryFromPermissionSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDeletePermissionsBoundaryFromPermissionSetResponse' smart constructor.
data DeletePermissionsBoundaryFromPermissionSetResponse = DeletePermissionsBoundaryFromPermissionSetResponse'
  { -- | The response's http status code.
    DeletePermissionsBoundaryFromPermissionSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeletePermissionsBoundaryFromPermissionSetResponse
-> DeletePermissionsBoundaryFromPermissionSetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePermissionsBoundaryFromPermissionSetResponse
-> DeletePermissionsBoundaryFromPermissionSetResponse -> Bool
$c/= :: DeletePermissionsBoundaryFromPermissionSetResponse
-> DeletePermissionsBoundaryFromPermissionSetResponse -> Bool
== :: DeletePermissionsBoundaryFromPermissionSetResponse
-> DeletePermissionsBoundaryFromPermissionSetResponse -> Bool
$c== :: DeletePermissionsBoundaryFromPermissionSetResponse
-> DeletePermissionsBoundaryFromPermissionSetResponse -> Bool
Prelude.Eq, ReadPrec [DeletePermissionsBoundaryFromPermissionSetResponse]
ReadPrec DeletePermissionsBoundaryFromPermissionSetResponse
Int -> ReadS DeletePermissionsBoundaryFromPermissionSetResponse
ReadS [DeletePermissionsBoundaryFromPermissionSetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePermissionsBoundaryFromPermissionSetResponse]
$creadListPrec :: ReadPrec [DeletePermissionsBoundaryFromPermissionSetResponse]
readPrec :: ReadPrec DeletePermissionsBoundaryFromPermissionSetResponse
$creadPrec :: ReadPrec DeletePermissionsBoundaryFromPermissionSetResponse
readList :: ReadS [DeletePermissionsBoundaryFromPermissionSetResponse]
$creadList :: ReadS [DeletePermissionsBoundaryFromPermissionSetResponse]
readsPrec :: Int -> ReadS DeletePermissionsBoundaryFromPermissionSetResponse
$creadsPrec :: Int -> ReadS DeletePermissionsBoundaryFromPermissionSetResponse
Prelude.Read, Int -> DeletePermissionsBoundaryFromPermissionSetResponse -> ShowS
[DeletePermissionsBoundaryFromPermissionSetResponse] -> ShowS
DeletePermissionsBoundaryFromPermissionSetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePermissionsBoundaryFromPermissionSetResponse] -> ShowS
$cshowList :: [DeletePermissionsBoundaryFromPermissionSetResponse] -> ShowS
show :: DeletePermissionsBoundaryFromPermissionSetResponse -> String
$cshow :: DeletePermissionsBoundaryFromPermissionSetResponse -> String
showsPrec :: Int -> DeletePermissionsBoundaryFromPermissionSetResponse -> ShowS
$cshowsPrec :: Int -> DeletePermissionsBoundaryFromPermissionSetResponse -> ShowS
Prelude.Show, forall x.
Rep DeletePermissionsBoundaryFromPermissionSetResponse x
-> DeletePermissionsBoundaryFromPermissionSetResponse
forall x.
DeletePermissionsBoundaryFromPermissionSetResponse
-> Rep DeletePermissionsBoundaryFromPermissionSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletePermissionsBoundaryFromPermissionSetResponse x
-> DeletePermissionsBoundaryFromPermissionSetResponse
$cfrom :: forall x.
DeletePermissionsBoundaryFromPermissionSetResponse
-> Rep DeletePermissionsBoundaryFromPermissionSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeletePermissionsBoundaryFromPermissionSetResponse' 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', 'deletePermissionsBoundaryFromPermissionSetResponse_httpStatus' - The response's http status code.
newDeletePermissionsBoundaryFromPermissionSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeletePermissionsBoundaryFromPermissionSetResponse
newDeletePermissionsBoundaryFromPermissionSetResponse :: Int -> DeletePermissionsBoundaryFromPermissionSetResponse
newDeletePermissionsBoundaryFromPermissionSetResponse
  Int
pHttpStatus_ =
    DeletePermissionsBoundaryFromPermissionSetResponse'
      { $sel:httpStatus:DeletePermissionsBoundaryFromPermissionSetResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

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

instance
  Prelude.NFData
    DeletePermissionsBoundaryFromPermissionSetResponse
  where
  rnf :: DeletePermissionsBoundaryFromPermissionSetResponse -> ()
rnf
    DeletePermissionsBoundaryFromPermissionSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeletePermissionsBoundaryFromPermissionSetResponse' :: DeletePermissionsBoundaryFromPermissionSetResponse -> Int
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus