{-# 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.AttachManagedPolicyToPermissionSet
-- 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)
--
-- Attaches an IAM managed policy ARN to a permission set.
--
-- If the permission set is already referenced by one or more account
-- assignments, you will need to call @ ProvisionPermissionSet @ after this
-- operation. Calling @ProvisionPermissionSet@ applies the corresponding
-- IAM policy updates to all assigned accounts.
module Amazonka.SSOAdmin.AttachManagedPolicyToPermissionSet
  ( -- * Creating a Request
    AttachManagedPolicyToPermissionSet (..),
    newAttachManagedPolicyToPermissionSet,

    -- * Request Lenses
    attachManagedPolicyToPermissionSet_instanceArn,
    attachManagedPolicyToPermissionSet_permissionSetArn,
    attachManagedPolicyToPermissionSet_managedPolicyArn,

    -- * Destructuring the Response
    AttachManagedPolicyToPermissionSetResponse (..),
    newAttachManagedPolicyToPermissionSetResponse,

    -- * Response Lenses
    attachManagedPolicyToPermissionSetResponse_httpStatus,
  )
where

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

-- | /See:/ 'newAttachManagedPolicyToPermissionSet' smart constructor.
data AttachManagedPolicyToPermissionSet = AttachManagedPolicyToPermissionSet'
  { -- | The ARN of the SSO instance under which the operation will be executed.
    -- For more information about ARNs, see
    -- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
    -- in the /Amazon Web Services General Reference/.
    AttachManagedPolicyToPermissionSet -> Text
instanceArn :: Prelude.Text,
    -- | The ARN of the PermissionSet that the managed policy should be attached
    -- to.
    AttachManagedPolicyToPermissionSet -> Text
permissionSetArn :: Prelude.Text,
    -- | The IAM managed policy ARN to be attached to a permission set.
    AttachManagedPolicyToPermissionSet -> Text
managedPolicyArn :: Prelude.Text
  }
  deriving (AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
(AttachManagedPolicyToPermissionSet
 -> AttachManagedPolicyToPermissionSet -> Bool)
-> (AttachManagedPolicyToPermissionSet
    -> AttachManagedPolicyToPermissionSet -> Bool)
-> Eq AttachManagedPolicyToPermissionSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
$c/= :: AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
== :: AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
$c== :: AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
Prelude.Eq, ReadPrec [AttachManagedPolicyToPermissionSet]
ReadPrec AttachManagedPolicyToPermissionSet
Int -> ReadS AttachManagedPolicyToPermissionSet
ReadS [AttachManagedPolicyToPermissionSet]
(Int -> ReadS AttachManagedPolicyToPermissionSet)
-> ReadS [AttachManagedPolicyToPermissionSet]
-> ReadPrec AttachManagedPolicyToPermissionSet
-> ReadPrec [AttachManagedPolicyToPermissionSet]
-> Read AttachManagedPolicyToPermissionSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachManagedPolicyToPermissionSet]
$creadListPrec :: ReadPrec [AttachManagedPolicyToPermissionSet]
readPrec :: ReadPrec AttachManagedPolicyToPermissionSet
$creadPrec :: ReadPrec AttachManagedPolicyToPermissionSet
readList :: ReadS [AttachManagedPolicyToPermissionSet]
$creadList :: ReadS [AttachManagedPolicyToPermissionSet]
readsPrec :: Int -> ReadS AttachManagedPolicyToPermissionSet
$creadsPrec :: Int -> ReadS AttachManagedPolicyToPermissionSet
Prelude.Read, Int -> AttachManagedPolicyToPermissionSet -> ShowS
[AttachManagedPolicyToPermissionSet] -> ShowS
AttachManagedPolicyToPermissionSet -> String
(Int -> AttachManagedPolicyToPermissionSet -> ShowS)
-> (AttachManagedPolicyToPermissionSet -> String)
-> ([AttachManagedPolicyToPermissionSet] -> ShowS)
-> Show AttachManagedPolicyToPermissionSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachManagedPolicyToPermissionSet] -> ShowS
$cshowList :: [AttachManagedPolicyToPermissionSet] -> ShowS
show :: AttachManagedPolicyToPermissionSet -> String
$cshow :: AttachManagedPolicyToPermissionSet -> String
showsPrec :: Int -> AttachManagedPolicyToPermissionSet -> ShowS
$cshowsPrec :: Int -> AttachManagedPolicyToPermissionSet -> ShowS
Prelude.Show, (forall x.
 AttachManagedPolicyToPermissionSet
 -> Rep AttachManagedPolicyToPermissionSet x)
-> (forall x.
    Rep AttachManagedPolicyToPermissionSet x
    -> AttachManagedPolicyToPermissionSet)
-> Generic AttachManagedPolicyToPermissionSet
forall x.
Rep AttachManagedPolicyToPermissionSet x
-> AttachManagedPolicyToPermissionSet
forall x.
AttachManagedPolicyToPermissionSet
-> Rep AttachManagedPolicyToPermissionSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachManagedPolicyToPermissionSet x
-> AttachManagedPolicyToPermissionSet
$cfrom :: forall x.
AttachManagedPolicyToPermissionSet
-> Rep AttachManagedPolicyToPermissionSet x
Prelude.Generic)

-- |
-- Create a value of 'AttachManagedPolicyToPermissionSet' 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', 'attachManagedPolicyToPermissionSet_instanceArn' - The ARN of the SSO instance under which the operation will be executed.
-- For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
--
-- 'permissionSetArn', 'attachManagedPolicyToPermissionSet_permissionSetArn' - The ARN of the PermissionSet that the managed policy should be attached
-- to.
--
-- 'managedPolicyArn', 'attachManagedPolicyToPermissionSet_managedPolicyArn' - The IAM managed policy ARN to be attached to a permission set.
newAttachManagedPolicyToPermissionSet ::
  -- | 'instanceArn'
  Prelude.Text ->
  -- | 'permissionSetArn'
  Prelude.Text ->
  -- | 'managedPolicyArn'
  Prelude.Text ->
  AttachManagedPolicyToPermissionSet
newAttachManagedPolicyToPermissionSet :: Text -> Text -> Text -> AttachManagedPolicyToPermissionSet
newAttachManagedPolicyToPermissionSet
  Text
pInstanceArn_
  Text
pPermissionSetArn_
  Text
pManagedPolicyArn_ =
    AttachManagedPolicyToPermissionSet' :: Text -> Text -> Text -> AttachManagedPolicyToPermissionSet
AttachManagedPolicyToPermissionSet'
      { $sel:instanceArn:AttachManagedPolicyToPermissionSet' :: Text
instanceArn =
          Text
pInstanceArn_,
        $sel:permissionSetArn:AttachManagedPolicyToPermissionSet' :: Text
permissionSetArn = Text
pPermissionSetArn_,
        $sel:managedPolicyArn:AttachManagedPolicyToPermissionSet' :: Text
managedPolicyArn = Text
pManagedPolicyArn_
      }

-- | The ARN of the SSO instance under which the operation will be executed.
-- For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
attachManagedPolicyToPermissionSet_instanceArn :: Lens.Lens' AttachManagedPolicyToPermissionSet Prelude.Text
attachManagedPolicyToPermissionSet_instanceArn :: (Text -> f Text)
-> AttachManagedPolicyToPermissionSet
-> f AttachManagedPolicyToPermissionSet
attachManagedPolicyToPermissionSet_instanceArn = (AttachManagedPolicyToPermissionSet -> Text)
-> (AttachManagedPolicyToPermissionSet
    -> Text -> AttachManagedPolicyToPermissionSet)
-> Lens
     AttachManagedPolicyToPermissionSet
     AttachManagedPolicyToPermissionSet
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachManagedPolicyToPermissionSet' {Text
instanceArn :: Text
$sel:instanceArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
instanceArn} -> Text
instanceArn) (\s :: AttachManagedPolicyToPermissionSet
s@AttachManagedPolicyToPermissionSet' {} Text
a -> AttachManagedPolicyToPermissionSet
s {$sel:instanceArn:AttachManagedPolicyToPermissionSet' :: Text
instanceArn = Text
a} :: AttachManagedPolicyToPermissionSet)

-- | The ARN of the PermissionSet that the managed policy should be attached
-- to.
attachManagedPolicyToPermissionSet_permissionSetArn :: Lens.Lens' AttachManagedPolicyToPermissionSet Prelude.Text
attachManagedPolicyToPermissionSet_permissionSetArn :: (Text -> f Text)
-> AttachManagedPolicyToPermissionSet
-> f AttachManagedPolicyToPermissionSet
attachManagedPolicyToPermissionSet_permissionSetArn = (AttachManagedPolicyToPermissionSet -> Text)
-> (AttachManagedPolicyToPermissionSet
    -> Text -> AttachManagedPolicyToPermissionSet)
-> Lens
     AttachManagedPolicyToPermissionSet
     AttachManagedPolicyToPermissionSet
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachManagedPolicyToPermissionSet' {Text
permissionSetArn :: Text
$sel:permissionSetArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
permissionSetArn} -> Text
permissionSetArn) (\s :: AttachManagedPolicyToPermissionSet
s@AttachManagedPolicyToPermissionSet' {} Text
a -> AttachManagedPolicyToPermissionSet
s {$sel:permissionSetArn:AttachManagedPolicyToPermissionSet' :: Text
permissionSetArn = Text
a} :: AttachManagedPolicyToPermissionSet)

-- | The IAM managed policy ARN to be attached to a permission set.
attachManagedPolicyToPermissionSet_managedPolicyArn :: Lens.Lens' AttachManagedPolicyToPermissionSet Prelude.Text
attachManagedPolicyToPermissionSet_managedPolicyArn :: (Text -> f Text)
-> AttachManagedPolicyToPermissionSet
-> f AttachManagedPolicyToPermissionSet
attachManagedPolicyToPermissionSet_managedPolicyArn = (AttachManagedPolicyToPermissionSet -> Text)
-> (AttachManagedPolicyToPermissionSet
    -> Text -> AttachManagedPolicyToPermissionSet)
-> Lens
     AttachManagedPolicyToPermissionSet
     AttachManagedPolicyToPermissionSet
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachManagedPolicyToPermissionSet' {Text
managedPolicyArn :: Text
$sel:managedPolicyArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
managedPolicyArn} -> Text
managedPolicyArn) (\s :: AttachManagedPolicyToPermissionSet
s@AttachManagedPolicyToPermissionSet' {} Text
a -> AttachManagedPolicyToPermissionSet
s {$sel:managedPolicyArn:AttachManagedPolicyToPermissionSet' :: Text
managedPolicyArn = Text
a} :: AttachManagedPolicyToPermissionSet)

instance
  Core.AWSRequest
    AttachManagedPolicyToPermissionSet
  where
  type
    AWSResponse AttachManagedPolicyToPermissionSet =
      AttachManagedPolicyToPermissionSetResponse
  request :: AttachManagedPolicyToPermissionSet
-> Request AttachManagedPolicyToPermissionSet
request = Service
-> AttachManagedPolicyToPermissionSet
-> Request AttachManagedPolicyToPermissionSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AttachManagedPolicyToPermissionSet
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AttachManagedPolicyToPermissionSet)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse AttachManagedPolicyToPermissionSet))
-> Logger
-> Service
-> Proxy AttachManagedPolicyToPermissionSet
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AttachManagedPolicyToPermissionSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> AttachManagedPolicyToPermissionSetResponse
AttachManagedPolicyToPermissionSetResponse'
            (Int -> AttachManagedPolicyToPermissionSetResponse)
-> Either String Int
-> Either String AttachManagedPolicyToPermissionSetResponse
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))
      )

instance
  Prelude.Hashable
    AttachManagedPolicyToPermissionSet

instance
  Prelude.NFData
    AttachManagedPolicyToPermissionSet

instance
  Core.ToHeaders
    AttachManagedPolicyToPermissionSet
  where
  toHeaders :: AttachManagedPolicyToPermissionSet -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> AttachManagedPolicyToPermissionSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SWBExternalService.AttachManagedPolicyToPermissionSet" ::
                          Prelude.ByteString
                      ),
            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
    AttachManagedPolicyToPermissionSet
  where
  toJSON :: AttachManagedPolicyToPermissionSet -> Value
toJSON AttachManagedPolicyToPermissionSet' {Text
managedPolicyArn :: Text
permissionSetArn :: Text
instanceArn :: Text
$sel:managedPolicyArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
$sel:permissionSetArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
$sel:instanceArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PermissionSetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
permissionSetArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ManagedPolicyArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
managedPolicyArn)
          ]
      )

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

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

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

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

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

instance
  Prelude.NFData
    AttachManagedPolicyToPermissionSetResponse