{-# 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.GuardDuty.InviteMembers
-- 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)
--
-- Invites other AWS accounts (created as members of the current AWS
-- account by CreateMembers) to enable GuardDuty, and allow the current AWS
-- account to view and manage these accounts\' findings on their behalf as
-- the GuardDuty administrator account.
module Amazonka.GuardDuty.InviteMembers
  ( -- * Creating a Request
    InviteMembers (..),
    newInviteMembers,

    -- * Request Lenses
    inviteMembers_disableEmailNotification,
    inviteMembers_message,
    inviteMembers_detectorId,
    inviteMembers_accountIds,

    -- * Destructuring the Response
    InviteMembersResponse (..),
    newInviteMembersResponse,

    -- * Response Lenses
    inviteMembersResponse_httpStatus,
    inviteMembersResponse_unprocessedAccounts,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.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:/ 'newInviteMembers' smart constructor.
data InviteMembers = InviteMembers'
  { -- | A Boolean value that specifies whether you want to disable email
    -- notification to the accounts that you are inviting to GuardDuty as
    -- members.
    InviteMembers -> Maybe Bool
disableEmailNotification :: Prelude.Maybe Prelude.Bool,
    -- | The invitation message that you want to send to the accounts that
    -- you\'re inviting to GuardDuty as members.
    InviteMembers -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of the detector of the GuardDuty account that you want to
    -- invite members with.
    InviteMembers -> Text
detectorId :: Prelude.Text,
    -- | A list of account IDs of the accounts that you want to invite to
    -- GuardDuty as members.
    InviteMembers -> NonEmpty Text
accountIds :: Prelude.NonEmpty Prelude.Text
  }
  deriving (InviteMembers -> InviteMembers -> Bool
(InviteMembers -> InviteMembers -> Bool)
-> (InviteMembers -> InviteMembers -> Bool) -> Eq InviteMembers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InviteMembers -> InviteMembers -> Bool
$c/= :: InviteMembers -> InviteMembers -> Bool
== :: InviteMembers -> InviteMembers -> Bool
$c== :: InviteMembers -> InviteMembers -> Bool
Prelude.Eq, ReadPrec [InviteMembers]
ReadPrec InviteMembers
Int -> ReadS InviteMembers
ReadS [InviteMembers]
(Int -> ReadS InviteMembers)
-> ReadS [InviteMembers]
-> ReadPrec InviteMembers
-> ReadPrec [InviteMembers]
-> Read InviteMembers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InviteMembers]
$creadListPrec :: ReadPrec [InviteMembers]
readPrec :: ReadPrec InviteMembers
$creadPrec :: ReadPrec InviteMembers
readList :: ReadS [InviteMembers]
$creadList :: ReadS [InviteMembers]
readsPrec :: Int -> ReadS InviteMembers
$creadsPrec :: Int -> ReadS InviteMembers
Prelude.Read, Int -> InviteMembers -> ShowS
[InviteMembers] -> ShowS
InviteMembers -> String
(Int -> InviteMembers -> ShowS)
-> (InviteMembers -> String)
-> ([InviteMembers] -> ShowS)
-> Show InviteMembers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InviteMembers] -> ShowS
$cshowList :: [InviteMembers] -> ShowS
show :: InviteMembers -> String
$cshow :: InviteMembers -> String
showsPrec :: Int -> InviteMembers -> ShowS
$cshowsPrec :: Int -> InviteMembers -> ShowS
Prelude.Show, (forall x. InviteMembers -> Rep InviteMembers x)
-> (forall x. Rep InviteMembers x -> InviteMembers)
-> Generic InviteMembers
forall x. Rep InviteMembers x -> InviteMembers
forall x. InviteMembers -> Rep InviteMembers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InviteMembers x -> InviteMembers
$cfrom :: forall x. InviteMembers -> Rep InviteMembers x
Prelude.Generic)

-- |
-- Create a value of 'InviteMembers' 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:
--
-- 'disableEmailNotification', 'inviteMembers_disableEmailNotification' - A Boolean value that specifies whether you want to disable email
-- notification to the accounts that you are inviting to GuardDuty as
-- members.
--
-- 'message', 'inviteMembers_message' - The invitation message that you want to send to the accounts that
-- you\'re inviting to GuardDuty as members.
--
-- 'detectorId', 'inviteMembers_detectorId' - The unique ID of the detector of the GuardDuty account that you want to
-- invite members with.
--
-- 'accountIds', 'inviteMembers_accountIds' - A list of account IDs of the accounts that you want to invite to
-- GuardDuty as members.
newInviteMembers ::
  -- | 'detectorId'
  Prelude.Text ->
  -- | 'accountIds'
  Prelude.NonEmpty Prelude.Text ->
  InviteMembers
newInviteMembers :: Text -> NonEmpty Text -> InviteMembers
newInviteMembers Text
pDetectorId_ NonEmpty Text
pAccountIds_ =
  InviteMembers' :: Maybe Bool -> Maybe Text -> Text -> NonEmpty Text -> InviteMembers
InviteMembers'
    { $sel:disableEmailNotification:InviteMembers' :: Maybe Bool
disableEmailNotification =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:message:InviteMembers' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:detectorId:InviteMembers' :: Text
detectorId = Text
pDetectorId_,
      $sel:accountIds:InviteMembers' :: NonEmpty Text
accountIds = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pAccountIds_
    }

-- | A Boolean value that specifies whether you want to disable email
-- notification to the accounts that you are inviting to GuardDuty as
-- members.
inviteMembers_disableEmailNotification :: Lens.Lens' InviteMembers (Prelude.Maybe Prelude.Bool)
inviteMembers_disableEmailNotification :: (Maybe Bool -> f (Maybe Bool)) -> InviteMembers -> f InviteMembers
inviteMembers_disableEmailNotification = (InviteMembers -> Maybe Bool)
-> (InviteMembers -> Maybe Bool -> InviteMembers)
-> Lens InviteMembers InviteMembers (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteMembers' {Maybe Bool
disableEmailNotification :: Maybe Bool
$sel:disableEmailNotification:InviteMembers' :: InviteMembers -> Maybe Bool
disableEmailNotification} -> Maybe Bool
disableEmailNotification) (\s :: InviteMembers
s@InviteMembers' {} Maybe Bool
a -> InviteMembers
s {$sel:disableEmailNotification:InviteMembers' :: Maybe Bool
disableEmailNotification = Maybe Bool
a} :: InviteMembers)

-- | The invitation message that you want to send to the accounts that
-- you\'re inviting to GuardDuty as members.
inviteMembers_message :: Lens.Lens' InviteMembers (Prelude.Maybe Prelude.Text)
inviteMembers_message :: (Maybe Text -> f (Maybe Text)) -> InviteMembers -> f InviteMembers
inviteMembers_message = (InviteMembers -> Maybe Text)
-> (InviteMembers -> Maybe Text -> InviteMembers)
-> Lens InviteMembers InviteMembers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteMembers' {Maybe Text
message :: Maybe Text
$sel:message:InviteMembers' :: InviteMembers -> Maybe Text
message} -> Maybe Text
message) (\s :: InviteMembers
s@InviteMembers' {} Maybe Text
a -> InviteMembers
s {$sel:message:InviteMembers' :: Maybe Text
message = Maybe Text
a} :: InviteMembers)

-- | The unique ID of the detector of the GuardDuty account that you want to
-- invite members with.
inviteMembers_detectorId :: Lens.Lens' InviteMembers Prelude.Text
inviteMembers_detectorId :: (Text -> f Text) -> InviteMembers -> f InviteMembers
inviteMembers_detectorId = (InviteMembers -> Text)
-> (InviteMembers -> Text -> InviteMembers)
-> Lens InviteMembers InviteMembers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteMembers' {Text
detectorId :: Text
$sel:detectorId:InviteMembers' :: InviteMembers -> Text
detectorId} -> Text
detectorId) (\s :: InviteMembers
s@InviteMembers' {} Text
a -> InviteMembers
s {$sel:detectorId:InviteMembers' :: Text
detectorId = Text
a} :: InviteMembers)

-- | A list of account IDs of the accounts that you want to invite to
-- GuardDuty as members.
inviteMembers_accountIds :: Lens.Lens' InviteMembers (Prelude.NonEmpty Prelude.Text)
inviteMembers_accountIds :: (NonEmpty Text -> f (NonEmpty Text))
-> InviteMembers -> f InviteMembers
inviteMembers_accountIds = (InviteMembers -> NonEmpty Text)
-> (InviteMembers -> NonEmpty Text -> InviteMembers)
-> Lens InviteMembers InviteMembers (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteMembers' {NonEmpty Text
accountIds :: NonEmpty Text
$sel:accountIds:InviteMembers' :: InviteMembers -> NonEmpty Text
accountIds} -> NonEmpty Text
accountIds) (\s :: InviteMembers
s@InviteMembers' {} NonEmpty Text
a -> InviteMembers
s {$sel:accountIds:InviteMembers' :: NonEmpty Text
accountIds = NonEmpty Text
a} :: InviteMembers) ((NonEmpty Text -> f (NonEmpty Text))
 -> InviteMembers -> f InviteMembers)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> InviteMembers
-> f InviteMembers
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest InviteMembers where
  type
    AWSResponse InviteMembers =
      InviteMembersResponse
  request :: InviteMembers -> Request InviteMembers
request = Service -> InviteMembers -> Request InviteMembers
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy InviteMembers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse InviteMembers)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse InviteMembers))
-> Logger
-> Service
-> Proxy InviteMembers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse InviteMembers)))
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 -> [UnprocessedAccount] -> InviteMembersResponse
InviteMembersResponse'
            (Int -> [UnprocessedAccount] -> InviteMembersResponse)
-> Either String Int
-> Either String ([UnprocessedAccount] -> InviteMembersResponse)
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 ([UnprocessedAccount] -> InviteMembersResponse)
-> Either String [UnprocessedAccount]
-> Either String InviteMembersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [UnprocessedAccount])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"unprocessedAccounts"
                            Either String (Maybe [UnprocessedAccount])
-> [UnprocessedAccount] -> Either String [UnprocessedAccount]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [UnprocessedAccount]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable InviteMembers

instance Prelude.NFData InviteMembers

instance Core.ToHeaders InviteMembers where
  toHeaders :: InviteMembers -> ResponseHeaders
toHeaders =
    ResponseHeaders -> InviteMembers -> 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 InviteMembers where
  toJSON :: InviteMembers -> Value
toJSON InviteMembers' {Maybe Bool
Maybe Text
NonEmpty Text
Text
accountIds :: NonEmpty Text
detectorId :: Text
message :: Maybe Text
disableEmailNotification :: Maybe Bool
$sel:accountIds:InviteMembers' :: InviteMembers -> NonEmpty Text
$sel:detectorId:InviteMembers' :: InviteMembers -> Text
$sel:message:InviteMembers' :: InviteMembers -> Maybe Text
$sel:disableEmailNotification:InviteMembers' :: InviteMembers -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"disableEmailNotification" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableEmailNotification,
            (Text
"message" 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
message,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"accountIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
accountIds)
          ]
      )

instance Core.ToPath InviteMembers where
  toPath :: InviteMembers -> ByteString
toPath InviteMembers' {Maybe Bool
Maybe Text
NonEmpty Text
Text
accountIds :: NonEmpty Text
detectorId :: Text
message :: Maybe Text
disableEmailNotification :: Maybe Bool
$sel:accountIds:InviteMembers' :: InviteMembers -> NonEmpty Text
$sel:detectorId:InviteMembers' :: InviteMembers -> Text
$sel:message:InviteMembers' :: InviteMembers -> Maybe Text
$sel:disableEmailNotification:InviteMembers' :: InviteMembers -> Maybe Bool
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/detector/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
detectorId,
        ByteString
"/member/invite"
      ]

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

-- | /See:/ 'newInviteMembersResponse' smart constructor.
data InviteMembersResponse = InviteMembersResponse'
  { -- | The response's http status code.
    InviteMembersResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of objects that contain the unprocessed account and a result
    -- string that explains why it was unprocessed.
    InviteMembersResponse -> [UnprocessedAccount]
unprocessedAccounts :: [UnprocessedAccount]
  }
  deriving (InviteMembersResponse -> InviteMembersResponse -> Bool
(InviteMembersResponse -> InviteMembersResponse -> Bool)
-> (InviteMembersResponse -> InviteMembersResponse -> Bool)
-> Eq InviteMembersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InviteMembersResponse -> InviteMembersResponse -> Bool
$c/= :: InviteMembersResponse -> InviteMembersResponse -> Bool
== :: InviteMembersResponse -> InviteMembersResponse -> Bool
$c== :: InviteMembersResponse -> InviteMembersResponse -> Bool
Prelude.Eq, ReadPrec [InviteMembersResponse]
ReadPrec InviteMembersResponse
Int -> ReadS InviteMembersResponse
ReadS [InviteMembersResponse]
(Int -> ReadS InviteMembersResponse)
-> ReadS [InviteMembersResponse]
-> ReadPrec InviteMembersResponse
-> ReadPrec [InviteMembersResponse]
-> Read InviteMembersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InviteMembersResponse]
$creadListPrec :: ReadPrec [InviteMembersResponse]
readPrec :: ReadPrec InviteMembersResponse
$creadPrec :: ReadPrec InviteMembersResponse
readList :: ReadS [InviteMembersResponse]
$creadList :: ReadS [InviteMembersResponse]
readsPrec :: Int -> ReadS InviteMembersResponse
$creadsPrec :: Int -> ReadS InviteMembersResponse
Prelude.Read, Int -> InviteMembersResponse -> ShowS
[InviteMembersResponse] -> ShowS
InviteMembersResponse -> String
(Int -> InviteMembersResponse -> ShowS)
-> (InviteMembersResponse -> String)
-> ([InviteMembersResponse] -> ShowS)
-> Show InviteMembersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InviteMembersResponse] -> ShowS
$cshowList :: [InviteMembersResponse] -> ShowS
show :: InviteMembersResponse -> String
$cshow :: InviteMembersResponse -> String
showsPrec :: Int -> InviteMembersResponse -> ShowS
$cshowsPrec :: Int -> InviteMembersResponse -> ShowS
Prelude.Show, (forall x. InviteMembersResponse -> Rep InviteMembersResponse x)
-> (forall x. Rep InviteMembersResponse x -> InviteMembersResponse)
-> Generic InviteMembersResponse
forall x. Rep InviteMembersResponse x -> InviteMembersResponse
forall x. InviteMembersResponse -> Rep InviteMembersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InviteMembersResponse x -> InviteMembersResponse
$cfrom :: forall x. InviteMembersResponse -> Rep InviteMembersResponse x
Prelude.Generic)

-- |
-- Create a value of 'InviteMembersResponse' 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', 'inviteMembersResponse_httpStatus' - The response's http status code.
--
-- 'unprocessedAccounts', 'inviteMembersResponse_unprocessedAccounts' - A list of objects that contain the unprocessed account and a result
-- string that explains why it was unprocessed.
newInviteMembersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  InviteMembersResponse
newInviteMembersResponse :: Int -> InviteMembersResponse
newInviteMembersResponse Int
pHttpStatus_ =
  InviteMembersResponse' :: Int -> [UnprocessedAccount] -> InviteMembersResponse
InviteMembersResponse'
    { $sel:httpStatus:InviteMembersResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:unprocessedAccounts:InviteMembersResponse' :: [UnprocessedAccount]
unprocessedAccounts = [UnprocessedAccount]
forall a. Monoid a => a
Prelude.mempty
    }

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

-- | A list of objects that contain the unprocessed account and a result
-- string that explains why it was unprocessed.
inviteMembersResponse_unprocessedAccounts :: Lens.Lens' InviteMembersResponse [UnprocessedAccount]
inviteMembersResponse_unprocessedAccounts :: ([UnprocessedAccount] -> f [UnprocessedAccount])
-> InviteMembersResponse -> f InviteMembersResponse
inviteMembersResponse_unprocessedAccounts = (InviteMembersResponse -> [UnprocessedAccount])
-> (InviteMembersResponse
    -> [UnprocessedAccount] -> InviteMembersResponse)
-> Lens
     InviteMembersResponse
     InviteMembersResponse
     [UnprocessedAccount]
     [UnprocessedAccount]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteMembersResponse' {[UnprocessedAccount]
unprocessedAccounts :: [UnprocessedAccount]
$sel:unprocessedAccounts:InviteMembersResponse' :: InviteMembersResponse -> [UnprocessedAccount]
unprocessedAccounts} -> [UnprocessedAccount]
unprocessedAccounts) (\s :: InviteMembersResponse
s@InviteMembersResponse' {} [UnprocessedAccount]
a -> InviteMembersResponse
s {$sel:unprocessedAccounts:InviteMembersResponse' :: [UnprocessedAccount]
unprocessedAccounts = [UnprocessedAccount]
a} :: InviteMembersResponse) (([UnprocessedAccount] -> f [UnprocessedAccount])
 -> InviteMembersResponse -> f InviteMembersResponse)
-> (([UnprocessedAccount] -> f [UnprocessedAccount])
    -> [UnprocessedAccount] -> f [UnprocessedAccount])
-> ([UnprocessedAccount] -> f [UnprocessedAccount])
-> InviteMembersResponse
-> f InviteMembersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([UnprocessedAccount] -> f [UnprocessedAccount])
-> [UnprocessedAccount] -> f [UnprocessedAccount]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData InviteMembersResponse