{-# 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.ResourceGroups.GroupResources
-- 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)
--
-- Adds the specified resources to the specified group.
--
-- __Minimum permissions__
--
-- To run this command, you must have the following permissions:
--
-- -   @resource-groups:GroupResources@
module Amazonka.ResourceGroups.GroupResources
  ( -- * Creating a Request
    GroupResources (..),
    newGroupResources,

    -- * Request Lenses
    groupResources_group,
    groupResources_resourceArns,

    -- * Destructuring the Response
    GroupResourcesResponse (..),
    newGroupResourcesResponse,

    -- * Response Lenses
    groupResourcesResponse_pending,
    groupResourcesResponse_succeeded,
    groupResourcesResponse_failed,
    groupResourcesResponse_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 Amazonka.ResourceGroups.Types
import qualified Amazonka.Response as Response

-- | /See:/ 'newGroupResources' smart constructor.
data GroupResources = GroupResources'
  { -- | The name or the ARN of the resource group to add resources to.
    GroupResources -> Text
group' :: Prelude.Text,
    -- | The list of ARNs for resources to be added to the group.
    GroupResources -> NonEmpty Text
resourceArns :: Prelude.NonEmpty Prelude.Text
  }
  deriving (GroupResources -> GroupResources -> Bool
(GroupResources -> GroupResources -> Bool)
-> (GroupResources -> GroupResources -> Bool) -> Eq GroupResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupResources -> GroupResources -> Bool
$c/= :: GroupResources -> GroupResources -> Bool
== :: GroupResources -> GroupResources -> Bool
$c== :: GroupResources -> GroupResources -> Bool
Prelude.Eq, ReadPrec [GroupResources]
ReadPrec GroupResources
Int -> ReadS GroupResources
ReadS [GroupResources]
(Int -> ReadS GroupResources)
-> ReadS [GroupResources]
-> ReadPrec GroupResources
-> ReadPrec [GroupResources]
-> Read GroupResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupResources]
$creadListPrec :: ReadPrec [GroupResources]
readPrec :: ReadPrec GroupResources
$creadPrec :: ReadPrec GroupResources
readList :: ReadS [GroupResources]
$creadList :: ReadS [GroupResources]
readsPrec :: Int -> ReadS GroupResources
$creadsPrec :: Int -> ReadS GroupResources
Prelude.Read, Int -> GroupResources -> ShowS
[GroupResources] -> ShowS
GroupResources -> String
(Int -> GroupResources -> ShowS)
-> (GroupResources -> String)
-> ([GroupResources] -> ShowS)
-> Show GroupResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupResources] -> ShowS
$cshowList :: [GroupResources] -> ShowS
show :: GroupResources -> String
$cshow :: GroupResources -> String
showsPrec :: Int -> GroupResources -> ShowS
$cshowsPrec :: Int -> GroupResources -> ShowS
Prelude.Show, (forall x. GroupResources -> Rep GroupResources x)
-> (forall x. Rep GroupResources x -> GroupResources)
-> Generic GroupResources
forall x. Rep GroupResources x -> GroupResources
forall x. GroupResources -> Rep GroupResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupResources x -> GroupResources
$cfrom :: forall x. GroupResources -> Rep GroupResources x
Prelude.Generic)

-- |
-- Create a value of 'GroupResources' 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:
--
-- 'group'', 'groupResources_group' - The name or the ARN of the resource group to add resources to.
--
-- 'resourceArns', 'groupResources_resourceArns' - The list of ARNs for resources to be added to the group.
newGroupResources ::
  -- | 'group''
  Prelude.Text ->
  -- | 'resourceArns'
  Prelude.NonEmpty Prelude.Text ->
  GroupResources
newGroupResources :: Text -> NonEmpty Text -> GroupResources
newGroupResources Text
pGroup_ NonEmpty Text
pResourceArns_ =
  GroupResources' :: Text -> NonEmpty Text -> GroupResources
GroupResources'
    { $sel:group':GroupResources' :: Text
group' = Text
pGroup_,
      $sel:resourceArns:GroupResources' :: NonEmpty Text
resourceArns = 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
pResourceArns_
    }

-- | The name or the ARN of the resource group to add resources to.
groupResources_group :: Lens.Lens' GroupResources Prelude.Text
groupResources_group :: (Text -> f Text) -> GroupResources -> f GroupResources
groupResources_group = (GroupResources -> Text)
-> (GroupResources -> Text -> GroupResources)
-> Lens GroupResources GroupResources Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupResources' {Text
group' :: Text
$sel:group':GroupResources' :: GroupResources -> Text
group'} -> Text
group') (\s :: GroupResources
s@GroupResources' {} Text
a -> GroupResources
s {$sel:group':GroupResources' :: Text
group' = Text
a} :: GroupResources)

-- | The list of ARNs for resources to be added to the group.
groupResources_resourceArns :: Lens.Lens' GroupResources (Prelude.NonEmpty Prelude.Text)
groupResources_resourceArns :: (NonEmpty Text -> f (NonEmpty Text))
-> GroupResources -> f GroupResources
groupResources_resourceArns = (GroupResources -> NonEmpty Text)
-> (GroupResources -> NonEmpty Text -> GroupResources)
-> Lens
     GroupResources GroupResources (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupResources' {NonEmpty Text
resourceArns :: NonEmpty Text
$sel:resourceArns:GroupResources' :: GroupResources -> NonEmpty Text
resourceArns} -> NonEmpty Text
resourceArns) (\s :: GroupResources
s@GroupResources' {} NonEmpty Text
a -> GroupResources
s {$sel:resourceArns:GroupResources' :: NonEmpty Text
resourceArns = NonEmpty Text
a} :: GroupResources) ((NonEmpty Text -> f (NonEmpty Text))
 -> GroupResources -> f GroupResources)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> GroupResources
-> f GroupResources
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 GroupResources where
  type
    AWSResponse GroupResources =
      GroupResourcesResponse
  request :: GroupResources -> Request GroupResources
request = Service -> GroupResources -> Request GroupResources
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GroupResources
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GroupResources)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GroupResources))
-> Logger
-> Service
-> Proxy GroupResources
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GroupResources)))
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 ->
          Maybe [PendingResource]
-> Maybe (NonEmpty Text)
-> Maybe [FailedResource]
-> Int
-> GroupResourcesResponse
GroupResourcesResponse'
            (Maybe [PendingResource]
 -> Maybe (NonEmpty Text)
 -> Maybe [FailedResource]
 -> Int
 -> GroupResourcesResponse)
-> Either String (Maybe [PendingResource])
-> Either
     String
     (Maybe (NonEmpty Text)
      -> Maybe [FailedResource] -> Int -> GroupResourcesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [PendingResource]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Pending" Either String (Maybe (Maybe [PendingResource]))
-> Maybe [PendingResource]
-> Either String (Maybe [PendingResource])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PendingResource]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe (NonEmpty Text)
   -> Maybe [FailedResource] -> Int -> GroupResourcesResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either
     String (Maybe [FailedResource] -> Int -> GroupResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Succeeded")
            Either
  String (Maybe [FailedResource] -> Int -> GroupResourcesResponse)
-> Either String (Maybe [FailedResource])
-> Either String (Int -> GroupResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [FailedResource]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Failed" Either String (Maybe (Maybe [FailedResource]))
-> Maybe [FailedResource] -> Either String (Maybe [FailedResource])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FailedResource]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GroupResourcesResponse)
-> Either String Int -> Either String GroupResourcesResponse
forall (f :: * -> *) a b. Applicative f => 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 GroupResources

instance Prelude.NFData GroupResources

instance Core.ToHeaders GroupResources where
  toHeaders :: GroupResources -> ResponseHeaders
toHeaders = ResponseHeaders -> GroupResources -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON GroupResources where
  toJSON :: GroupResources -> Value
toJSON GroupResources' {NonEmpty Text
Text
resourceArns :: NonEmpty Text
group' :: Text
$sel:resourceArns:GroupResources' :: GroupResources -> NonEmpty Text
$sel:group':GroupResources' :: GroupResources -> 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
"Group" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
group'),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceArns" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
resourceArns)
          ]
      )

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

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

-- | /See:/ 'newGroupResourcesResponse' smart constructor.
data GroupResourcesResponse = GroupResourcesResponse'
  { -- | A list of ARNs of any resources that are still in the process of being
    -- added to the group by this operation. These pending additions continue
    -- asynchronously. You can check the status of pending additions by using
    -- the @ ListGroupResources @ operation, and checking the @Resources@ array
    -- in the response and the @Status@ field of each object in that array.
    GroupResourcesResponse -> Maybe [PendingResource]
pending :: Prelude.Maybe [PendingResource],
    -- | A list of ARNs of resources that were successfully added to the group by
    -- this operation.
    GroupResourcesResponse -> Maybe (NonEmpty Text)
succeeded :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A list of ARNs of any resources that failed to be added to the group by
    -- this operation.
    GroupResourcesResponse -> Maybe [FailedResource]
failed :: Prelude.Maybe [FailedResource],
    -- | The response's http status code.
    GroupResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GroupResourcesResponse -> GroupResourcesResponse -> Bool
(GroupResourcesResponse -> GroupResourcesResponse -> Bool)
-> (GroupResourcesResponse -> GroupResourcesResponse -> Bool)
-> Eq GroupResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupResourcesResponse -> GroupResourcesResponse -> Bool
$c/= :: GroupResourcesResponse -> GroupResourcesResponse -> Bool
== :: GroupResourcesResponse -> GroupResourcesResponse -> Bool
$c== :: GroupResourcesResponse -> GroupResourcesResponse -> Bool
Prelude.Eq, ReadPrec [GroupResourcesResponse]
ReadPrec GroupResourcesResponse
Int -> ReadS GroupResourcesResponse
ReadS [GroupResourcesResponse]
(Int -> ReadS GroupResourcesResponse)
-> ReadS [GroupResourcesResponse]
-> ReadPrec GroupResourcesResponse
-> ReadPrec [GroupResourcesResponse]
-> Read GroupResourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupResourcesResponse]
$creadListPrec :: ReadPrec [GroupResourcesResponse]
readPrec :: ReadPrec GroupResourcesResponse
$creadPrec :: ReadPrec GroupResourcesResponse
readList :: ReadS [GroupResourcesResponse]
$creadList :: ReadS [GroupResourcesResponse]
readsPrec :: Int -> ReadS GroupResourcesResponse
$creadsPrec :: Int -> ReadS GroupResourcesResponse
Prelude.Read, Int -> GroupResourcesResponse -> ShowS
[GroupResourcesResponse] -> ShowS
GroupResourcesResponse -> String
(Int -> GroupResourcesResponse -> ShowS)
-> (GroupResourcesResponse -> String)
-> ([GroupResourcesResponse] -> ShowS)
-> Show GroupResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupResourcesResponse] -> ShowS
$cshowList :: [GroupResourcesResponse] -> ShowS
show :: GroupResourcesResponse -> String
$cshow :: GroupResourcesResponse -> String
showsPrec :: Int -> GroupResourcesResponse -> ShowS
$cshowsPrec :: Int -> GroupResourcesResponse -> ShowS
Prelude.Show, (forall x. GroupResourcesResponse -> Rep GroupResourcesResponse x)
-> (forall x.
    Rep GroupResourcesResponse x -> GroupResourcesResponse)
-> Generic GroupResourcesResponse
forall x. Rep GroupResourcesResponse x -> GroupResourcesResponse
forall x. GroupResourcesResponse -> Rep GroupResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupResourcesResponse x -> GroupResourcesResponse
$cfrom :: forall x. GroupResourcesResponse -> Rep GroupResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GroupResourcesResponse' 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:
--
-- 'pending', 'groupResourcesResponse_pending' - A list of ARNs of any resources that are still in the process of being
-- added to the group by this operation. These pending additions continue
-- asynchronously. You can check the status of pending additions by using
-- the @ ListGroupResources @ operation, and checking the @Resources@ array
-- in the response and the @Status@ field of each object in that array.
--
-- 'succeeded', 'groupResourcesResponse_succeeded' - A list of ARNs of resources that were successfully added to the group by
-- this operation.
--
-- 'failed', 'groupResourcesResponse_failed' - A list of ARNs of any resources that failed to be added to the group by
-- this operation.
--
-- 'httpStatus', 'groupResourcesResponse_httpStatus' - The response's http status code.
newGroupResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GroupResourcesResponse
newGroupResourcesResponse :: Int -> GroupResourcesResponse
newGroupResourcesResponse Int
pHttpStatus_ =
  GroupResourcesResponse' :: Maybe [PendingResource]
-> Maybe (NonEmpty Text)
-> Maybe [FailedResource]
-> Int
-> GroupResourcesResponse
GroupResourcesResponse'
    { $sel:pending:GroupResourcesResponse' :: Maybe [PendingResource]
pending = Maybe [PendingResource]
forall a. Maybe a
Prelude.Nothing,
      $sel:succeeded:GroupResourcesResponse' :: Maybe (NonEmpty Text)
succeeded = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:failed:GroupResourcesResponse' :: Maybe [FailedResource]
failed = Maybe [FailedResource]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GroupResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of ARNs of any resources that are still in the process of being
-- added to the group by this operation. These pending additions continue
-- asynchronously. You can check the status of pending additions by using
-- the @ ListGroupResources @ operation, and checking the @Resources@ array
-- in the response and the @Status@ field of each object in that array.
groupResourcesResponse_pending :: Lens.Lens' GroupResourcesResponse (Prelude.Maybe [PendingResource])
groupResourcesResponse_pending :: (Maybe [PendingResource] -> f (Maybe [PendingResource]))
-> GroupResourcesResponse -> f GroupResourcesResponse
groupResourcesResponse_pending = (GroupResourcesResponse -> Maybe [PendingResource])
-> (GroupResourcesResponse
    -> Maybe [PendingResource] -> GroupResourcesResponse)
-> Lens
     GroupResourcesResponse
     GroupResourcesResponse
     (Maybe [PendingResource])
     (Maybe [PendingResource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupResourcesResponse' {Maybe [PendingResource]
pending :: Maybe [PendingResource]
$sel:pending:GroupResourcesResponse' :: GroupResourcesResponse -> Maybe [PendingResource]
pending} -> Maybe [PendingResource]
pending) (\s :: GroupResourcesResponse
s@GroupResourcesResponse' {} Maybe [PendingResource]
a -> GroupResourcesResponse
s {$sel:pending:GroupResourcesResponse' :: Maybe [PendingResource]
pending = Maybe [PendingResource]
a} :: GroupResourcesResponse) ((Maybe [PendingResource] -> f (Maybe [PendingResource]))
 -> GroupResourcesResponse -> f GroupResourcesResponse)
-> ((Maybe [PendingResource] -> f (Maybe [PendingResource]))
    -> Maybe [PendingResource] -> f (Maybe [PendingResource]))
-> (Maybe [PendingResource] -> f (Maybe [PendingResource]))
-> GroupResourcesResponse
-> f GroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PendingResource]
  [PendingResource]
  [PendingResource]
  [PendingResource]
-> Iso
     (Maybe [PendingResource])
     (Maybe [PendingResource])
     (Maybe [PendingResource])
     (Maybe [PendingResource])
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
  [PendingResource]
  [PendingResource]
  [PendingResource]
  [PendingResource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of ARNs of resources that were successfully added to the group by
-- this operation.
groupResourcesResponse_succeeded :: Lens.Lens' GroupResourcesResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
groupResourcesResponse_succeeded :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GroupResourcesResponse -> f GroupResourcesResponse
groupResourcesResponse_succeeded = (GroupResourcesResponse -> Maybe (NonEmpty Text))
-> (GroupResourcesResponse
    -> Maybe (NonEmpty Text) -> GroupResourcesResponse)
-> Lens
     GroupResourcesResponse
     GroupResourcesResponse
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupResourcesResponse' {Maybe (NonEmpty Text)
succeeded :: Maybe (NonEmpty Text)
$sel:succeeded:GroupResourcesResponse' :: GroupResourcesResponse -> Maybe (NonEmpty Text)
succeeded} -> Maybe (NonEmpty Text)
succeeded) (\s :: GroupResourcesResponse
s@GroupResourcesResponse' {} Maybe (NonEmpty Text)
a -> GroupResourcesResponse
s {$sel:succeeded:GroupResourcesResponse' :: Maybe (NonEmpty Text)
succeeded = Maybe (NonEmpty Text)
a} :: GroupResourcesResponse) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> GroupResourcesResponse -> f GroupResourcesResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GroupResourcesResponse
-> f GroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of ARNs of any resources that failed to be added to the group by
-- this operation.
groupResourcesResponse_failed :: Lens.Lens' GroupResourcesResponse (Prelude.Maybe [FailedResource])
groupResourcesResponse_failed :: (Maybe [FailedResource] -> f (Maybe [FailedResource]))
-> GroupResourcesResponse -> f GroupResourcesResponse
groupResourcesResponse_failed = (GroupResourcesResponse -> Maybe [FailedResource])
-> (GroupResourcesResponse
    -> Maybe [FailedResource] -> GroupResourcesResponse)
-> Lens
     GroupResourcesResponse
     GroupResourcesResponse
     (Maybe [FailedResource])
     (Maybe [FailedResource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupResourcesResponse' {Maybe [FailedResource]
failed :: Maybe [FailedResource]
$sel:failed:GroupResourcesResponse' :: GroupResourcesResponse -> Maybe [FailedResource]
failed} -> Maybe [FailedResource]
failed) (\s :: GroupResourcesResponse
s@GroupResourcesResponse' {} Maybe [FailedResource]
a -> GroupResourcesResponse
s {$sel:failed:GroupResourcesResponse' :: Maybe [FailedResource]
failed = Maybe [FailedResource]
a} :: GroupResourcesResponse) ((Maybe [FailedResource] -> f (Maybe [FailedResource]))
 -> GroupResourcesResponse -> f GroupResourcesResponse)
-> ((Maybe [FailedResource] -> f (Maybe [FailedResource]))
    -> Maybe [FailedResource] -> f (Maybe [FailedResource]))
-> (Maybe [FailedResource] -> f (Maybe [FailedResource]))
-> GroupResourcesResponse
-> f GroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FailedResource] [FailedResource] [FailedResource] [FailedResource]
-> Iso
     (Maybe [FailedResource])
     (Maybe [FailedResource])
     (Maybe [FailedResource])
     (Maybe [FailedResource])
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
  [FailedResource] [FailedResource] [FailedResource] [FailedResource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GroupResourcesResponse