{-# 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.SSM.DescribeAssociationExecutionTargets
-- 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)
--
-- Views information about a specific execution of a specific association.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeAssociationExecutionTargets
  ( -- * Creating a Request
    DescribeAssociationExecutionTargets (..),
    newDescribeAssociationExecutionTargets,

    -- * Request Lenses
    describeAssociationExecutionTargets_filters,
    describeAssociationExecutionTargets_nextToken,
    describeAssociationExecutionTargets_maxResults,
    describeAssociationExecutionTargets_associationId,
    describeAssociationExecutionTargets_executionId,

    -- * Destructuring the Response
    DescribeAssociationExecutionTargetsResponse (..),
    newDescribeAssociationExecutionTargetsResponse,

    -- * Response Lenses
    describeAssociationExecutionTargetsResponse_nextToken,
    describeAssociationExecutionTargetsResponse_associationExecutionTargets,
    describeAssociationExecutionTargetsResponse_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.SSM.Types

-- | /See:/ 'newDescribeAssociationExecutionTargets' smart constructor.
data DescribeAssociationExecutionTargets = DescribeAssociationExecutionTargets'
  { -- | Filters for the request. You can specify the following filters and
    -- values.
    --
    -- Status (EQUAL)
    --
    -- ResourceId (EQUAL)
    --
    -- ResourceType (EQUAL)
    DescribeAssociationExecutionTargets
-> Maybe (NonEmpty AssociationExecutionTargetsFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty AssociationExecutionTargetsFilter),
    -- | A token to start the list. Use this token to get the next set of
    -- results.
    DescribeAssociationExecutionTargets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return for this call. The call also
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    DescribeAssociationExecutionTargets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The association ID that includes the execution for which you want to
    -- view details.
    DescribeAssociationExecutionTargets -> Text
associationId :: Prelude.Text,
    -- | The execution ID for which you want to view details.
    DescribeAssociationExecutionTargets -> Text
executionId :: Prelude.Text
  }
  deriving (DescribeAssociationExecutionTargets
-> DescribeAssociationExecutionTargets -> Bool
(DescribeAssociationExecutionTargets
 -> DescribeAssociationExecutionTargets -> Bool)
-> (DescribeAssociationExecutionTargets
    -> DescribeAssociationExecutionTargets -> Bool)
-> Eq DescribeAssociationExecutionTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAssociationExecutionTargets
-> DescribeAssociationExecutionTargets -> Bool
$c/= :: DescribeAssociationExecutionTargets
-> DescribeAssociationExecutionTargets -> Bool
== :: DescribeAssociationExecutionTargets
-> DescribeAssociationExecutionTargets -> Bool
$c== :: DescribeAssociationExecutionTargets
-> DescribeAssociationExecutionTargets -> Bool
Prelude.Eq, ReadPrec [DescribeAssociationExecutionTargets]
ReadPrec DescribeAssociationExecutionTargets
Int -> ReadS DescribeAssociationExecutionTargets
ReadS [DescribeAssociationExecutionTargets]
(Int -> ReadS DescribeAssociationExecutionTargets)
-> ReadS [DescribeAssociationExecutionTargets]
-> ReadPrec DescribeAssociationExecutionTargets
-> ReadPrec [DescribeAssociationExecutionTargets]
-> Read DescribeAssociationExecutionTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAssociationExecutionTargets]
$creadListPrec :: ReadPrec [DescribeAssociationExecutionTargets]
readPrec :: ReadPrec DescribeAssociationExecutionTargets
$creadPrec :: ReadPrec DescribeAssociationExecutionTargets
readList :: ReadS [DescribeAssociationExecutionTargets]
$creadList :: ReadS [DescribeAssociationExecutionTargets]
readsPrec :: Int -> ReadS DescribeAssociationExecutionTargets
$creadsPrec :: Int -> ReadS DescribeAssociationExecutionTargets
Prelude.Read, Int -> DescribeAssociationExecutionTargets -> ShowS
[DescribeAssociationExecutionTargets] -> ShowS
DescribeAssociationExecutionTargets -> String
(Int -> DescribeAssociationExecutionTargets -> ShowS)
-> (DescribeAssociationExecutionTargets -> String)
-> ([DescribeAssociationExecutionTargets] -> ShowS)
-> Show DescribeAssociationExecutionTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAssociationExecutionTargets] -> ShowS
$cshowList :: [DescribeAssociationExecutionTargets] -> ShowS
show :: DescribeAssociationExecutionTargets -> String
$cshow :: DescribeAssociationExecutionTargets -> String
showsPrec :: Int -> DescribeAssociationExecutionTargets -> ShowS
$cshowsPrec :: Int -> DescribeAssociationExecutionTargets -> ShowS
Prelude.Show, (forall x.
 DescribeAssociationExecutionTargets
 -> Rep DescribeAssociationExecutionTargets x)
-> (forall x.
    Rep DescribeAssociationExecutionTargets x
    -> DescribeAssociationExecutionTargets)
-> Generic DescribeAssociationExecutionTargets
forall x.
Rep DescribeAssociationExecutionTargets x
-> DescribeAssociationExecutionTargets
forall x.
DescribeAssociationExecutionTargets
-> Rep DescribeAssociationExecutionTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAssociationExecutionTargets x
-> DescribeAssociationExecutionTargets
$cfrom :: forall x.
DescribeAssociationExecutionTargets
-> Rep DescribeAssociationExecutionTargets x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAssociationExecutionTargets' 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:
--
-- 'filters', 'describeAssociationExecutionTargets_filters' - Filters for the request. You can specify the following filters and
-- values.
--
-- Status (EQUAL)
--
-- ResourceId (EQUAL)
--
-- ResourceType (EQUAL)
--
-- 'nextToken', 'describeAssociationExecutionTargets_nextToken' - A token to start the list. Use this token to get the next set of
-- results.
--
-- 'maxResults', 'describeAssociationExecutionTargets_maxResults' - The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
--
-- 'associationId', 'describeAssociationExecutionTargets_associationId' - The association ID that includes the execution for which you want to
-- view details.
--
-- 'executionId', 'describeAssociationExecutionTargets_executionId' - The execution ID for which you want to view details.
newDescribeAssociationExecutionTargets ::
  -- | 'associationId'
  Prelude.Text ->
  -- | 'executionId'
  Prelude.Text ->
  DescribeAssociationExecutionTargets
newDescribeAssociationExecutionTargets :: Text -> Text -> DescribeAssociationExecutionTargets
newDescribeAssociationExecutionTargets
  Text
pAssociationId_
  Text
pExecutionId_ =
    DescribeAssociationExecutionTargets' :: Maybe (NonEmpty AssociationExecutionTargetsFilter)
-> Maybe Text
-> Maybe Natural
-> Text
-> Text
-> DescribeAssociationExecutionTargets
DescribeAssociationExecutionTargets'
      { $sel:filters:DescribeAssociationExecutionTargets' :: Maybe (NonEmpty AssociationExecutionTargetsFilter)
filters =
          Maybe (NonEmpty AssociationExecutionTargetsFilter)
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeAssociationExecutionTargets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:DescribeAssociationExecutionTargets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:associationId:DescribeAssociationExecutionTargets' :: Text
associationId = Text
pAssociationId_,
        $sel:executionId:DescribeAssociationExecutionTargets' :: Text
executionId = Text
pExecutionId_
      }

-- | Filters for the request. You can specify the following filters and
-- values.
--
-- Status (EQUAL)
--
-- ResourceId (EQUAL)
--
-- ResourceType (EQUAL)
describeAssociationExecutionTargets_filters :: Lens.Lens' DescribeAssociationExecutionTargets (Prelude.Maybe (Prelude.NonEmpty AssociationExecutionTargetsFilter))
describeAssociationExecutionTargets_filters :: (Maybe (NonEmpty AssociationExecutionTargetsFilter)
 -> f (Maybe (NonEmpty AssociationExecutionTargetsFilter)))
-> DescribeAssociationExecutionTargets
-> f DescribeAssociationExecutionTargets
describeAssociationExecutionTargets_filters = (DescribeAssociationExecutionTargets
 -> Maybe (NonEmpty AssociationExecutionTargetsFilter))
-> (DescribeAssociationExecutionTargets
    -> Maybe (NonEmpty AssociationExecutionTargetsFilter)
    -> DescribeAssociationExecutionTargets)
-> Lens
     DescribeAssociationExecutionTargets
     DescribeAssociationExecutionTargets
     (Maybe (NonEmpty AssociationExecutionTargetsFilter))
     (Maybe (NonEmpty AssociationExecutionTargetsFilter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssociationExecutionTargets' {Maybe (NonEmpty AssociationExecutionTargetsFilter)
filters :: Maybe (NonEmpty AssociationExecutionTargetsFilter)
$sel:filters:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets
-> Maybe (NonEmpty AssociationExecutionTargetsFilter)
filters} -> Maybe (NonEmpty AssociationExecutionTargetsFilter)
filters) (\s :: DescribeAssociationExecutionTargets
s@DescribeAssociationExecutionTargets' {} Maybe (NonEmpty AssociationExecutionTargetsFilter)
a -> DescribeAssociationExecutionTargets
s {$sel:filters:DescribeAssociationExecutionTargets' :: Maybe (NonEmpty AssociationExecutionTargetsFilter)
filters = Maybe (NonEmpty AssociationExecutionTargetsFilter)
a} :: DescribeAssociationExecutionTargets) ((Maybe (NonEmpty AssociationExecutionTargetsFilter)
  -> f (Maybe (NonEmpty AssociationExecutionTargetsFilter)))
 -> DescribeAssociationExecutionTargets
 -> f DescribeAssociationExecutionTargets)
-> ((Maybe (NonEmpty AssociationExecutionTargetsFilter)
     -> f (Maybe (NonEmpty AssociationExecutionTargetsFilter)))
    -> Maybe (NonEmpty AssociationExecutionTargetsFilter)
    -> f (Maybe (NonEmpty AssociationExecutionTargetsFilter)))
-> (Maybe (NonEmpty AssociationExecutionTargetsFilter)
    -> f (Maybe (NonEmpty AssociationExecutionTargetsFilter)))
-> DescribeAssociationExecutionTargets
-> f DescribeAssociationExecutionTargets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty AssociationExecutionTargetsFilter)
  (NonEmpty AssociationExecutionTargetsFilter)
  (NonEmpty AssociationExecutionTargetsFilter)
  (NonEmpty AssociationExecutionTargetsFilter)
-> Iso
     (Maybe (NonEmpty AssociationExecutionTargetsFilter))
     (Maybe (NonEmpty AssociationExecutionTargetsFilter))
     (Maybe (NonEmpty AssociationExecutionTargetsFilter))
     (Maybe (NonEmpty AssociationExecutionTargetsFilter))
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 AssociationExecutionTargetsFilter)
  (NonEmpty AssociationExecutionTargetsFilter)
  (NonEmpty AssociationExecutionTargetsFilter)
  (NonEmpty AssociationExecutionTargetsFilter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token to start the list. Use this token to get the next set of
-- results.
describeAssociationExecutionTargets_nextToken :: Lens.Lens' DescribeAssociationExecutionTargets (Prelude.Maybe Prelude.Text)
describeAssociationExecutionTargets_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeAssociationExecutionTargets
-> f DescribeAssociationExecutionTargets
describeAssociationExecutionTargets_nextToken = (DescribeAssociationExecutionTargets -> Maybe Text)
-> (DescribeAssociationExecutionTargets
    -> Maybe Text -> DescribeAssociationExecutionTargets)
-> Lens
     DescribeAssociationExecutionTargets
     DescribeAssociationExecutionTargets
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssociationExecutionTargets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAssociationExecutionTargets
s@DescribeAssociationExecutionTargets' {} Maybe Text
a -> DescribeAssociationExecutionTargets
s {$sel:nextToken:DescribeAssociationExecutionTargets' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAssociationExecutionTargets)

-- | The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
describeAssociationExecutionTargets_maxResults :: Lens.Lens' DescribeAssociationExecutionTargets (Prelude.Maybe Prelude.Natural)
describeAssociationExecutionTargets_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeAssociationExecutionTargets
-> f DescribeAssociationExecutionTargets
describeAssociationExecutionTargets_maxResults = (DescribeAssociationExecutionTargets -> Maybe Natural)
-> (DescribeAssociationExecutionTargets
    -> Maybe Natural -> DescribeAssociationExecutionTargets)
-> Lens
     DescribeAssociationExecutionTargets
     DescribeAssociationExecutionTargets
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssociationExecutionTargets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeAssociationExecutionTargets
s@DescribeAssociationExecutionTargets' {} Maybe Natural
a -> DescribeAssociationExecutionTargets
s {$sel:maxResults:DescribeAssociationExecutionTargets' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeAssociationExecutionTargets)

-- | The association ID that includes the execution for which you want to
-- view details.
describeAssociationExecutionTargets_associationId :: Lens.Lens' DescribeAssociationExecutionTargets Prelude.Text
describeAssociationExecutionTargets_associationId :: (Text -> f Text)
-> DescribeAssociationExecutionTargets
-> f DescribeAssociationExecutionTargets
describeAssociationExecutionTargets_associationId = (DescribeAssociationExecutionTargets -> Text)
-> (DescribeAssociationExecutionTargets
    -> Text -> DescribeAssociationExecutionTargets)
-> Lens
     DescribeAssociationExecutionTargets
     DescribeAssociationExecutionTargets
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssociationExecutionTargets' {Text
associationId :: Text
$sel:associationId:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets -> Text
associationId} -> Text
associationId) (\s :: DescribeAssociationExecutionTargets
s@DescribeAssociationExecutionTargets' {} Text
a -> DescribeAssociationExecutionTargets
s {$sel:associationId:DescribeAssociationExecutionTargets' :: Text
associationId = Text
a} :: DescribeAssociationExecutionTargets)

-- | The execution ID for which you want to view details.
describeAssociationExecutionTargets_executionId :: Lens.Lens' DescribeAssociationExecutionTargets Prelude.Text
describeAssociationExecutionTargets_executionId :: (Text -> f Text)
-> DescribeAssociationExecutionTargets
-> f DescribeAssociationExecutionTargets
describeAssociationExecutionTargets_executionId = (DescribeAssociationExecutionTargets -> Text)
-> (DescribeAssociationExecutionTargets
    -> Text -> DescribeAssociationExecutionTargets)
-> Lens
     DescribeAssociationExecutionTargets
     DescribeAssociationExecutionTargets
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssociationExecutionTargets' {Text
executionId :: Text
$sel:executionId:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets -> Text
executionId} -> Text
executionId) (\s :: DescribeAssociationExecutionTargets
s@DescribeAssociationExecutionTargets' {} Text
a -> DescribeAssociationExecutionTargets
s {$sel:executionId:DescribeAssociationExecutionTargets' :: Text
executionId = Text
a} :: DescribeAssociationExecutionTargets)

instance
  Core.AWSPager
    DescribeAssociationExecutionTargets
  where
  page :: DescribeAssociationExecutionTargets
-> AWSResponse DescribeAssociationExecutionTargets
-> Maybe DescribeAssociationExecutionTargets
page DescribeAssociationExecutionTargets
rq AWSResponse DescribeAssociationExecutionTargets
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAssociationExecutionTargets
DescribeAssociationExecutionTargetsResponse
rs
            DescribeAssociationExecutionTargetsResponse
-> Getting
     (First Text) DescribeAssociationExecutionTargetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeAssociationExecutionTargetsResponse
-> Const (First Text) DescribeAssociationExecutionTargetsResponse
Lens' DescribeAssociationExecutionTargetsResponse (Maybe Text)
describeAssociationExecutionTargetsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeAssociationExecutionTargetsResponse
 -> Const (First Text) DescribeAssociationExecutionTargetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) DescribeAssociationExecutionTargetsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeAssociationExecutionTargets
forall a. Maybe a
Prelude.Nothing
    | Maybe [AssociationExecutionTarget] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAssociationExecutionTargets
DescribeAssociationExecutionTargetsResponse
rs
            DescribeAssociationExecutionTargetsResponse
-> Getting
     (First [AssociationExecutionTarget])
     DescribeAssociationExecutionTargetsResponse
     [AssociationExecutionTarget]
-> Maybe [AssociationExecutionTarget]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [AssociationExecutionTarget]
 -> Const
      (First [AssociationExecutionTarget])
      (Maybe [AssociationExecutionTarget]))
-> DescribeAssociationExecutionTargetsResponse
-> Const
     (First [AssociationExecutionTarget])
     DescribeAssociationExecutionTargetsResponse
Lens'
  DescribeAssociationExecutionTargetsResponse
  (Maybe [AssociationExecutionTarget])
describeAssociationExecutionTargetsResponse_associationExecutionTargets
              ((Maybe [AssociationExecutionTarget]
  -> Const
       (First [AssociationExecutionTarget])
       (Maybe [AssociationExecutionTarget]))
 -> DescribeAssociationExecutionTargetsResponse
 -> Const
      (First [AssociationExecutionTarget])
      DescribeAssociationExecutionTargetsResponse)
-> (([AssociationExecutionTarget]
     -> Const
          (First [AssociationExecutionTarget]) [AssociationExecutionTarget])
    -> Maybe [AssociationExecutionTarget]
    -> Const
         (First [AssociationExecutionTarget])
         (Maybe [AssociationExecutionTarget]))
-> Getting
     (First [AssociationExecutionTarget])
     DescribeAssociationExecutionTargetsResponse
     [AssociationExecutionTarget]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssociationExecutionTarget]
 -> Const
      (First [AssociationExecutionTarget]) [AssociationExecutionTarget])
-> Maybe [AssociationExecutionTarget]
-> Const
     (First [AssociationExecutionTarget])
     (Maybe [AssociationExecutionTarget])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeAssociationExecutionTargets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeAssociationExecutionTargets
-> Maybe DescribeAssociationExecutionTargets
forall a. a -> Maybe a
Prelude.Just (DescribeAssociationExecutionTargets
 -> Maybe DescribeAssociationExecutionTargets)
-> DescribeAssociationExecutionTargets
-> Maybe DescribeAssociationExecutionTargets
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeAssociationExecutionTargets
rq
          DescribeAssociationExecutionTargets
-> (DescribeAssociationExecutionTargets
    -> DescribeAssociationExecutionTargets)
-> DescribeAssociationExecutionTargets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeAssociationExecutionTargets
-> Identity DescribeAssociationExecutionTargets
Lens
  DescribeAssociationExecutionTargets
  DescribeAssociationExecutionTargets
  (Maybe Text)
  (Maybe Text)
describeAssociationExecutionTargets_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeAssociationExecutionTargets
 -> Identity DescribeAssociationExecutionTargets)
-> Maybe Text
-> DescribeAssociationExecutionTargets
-> DescribeAssociationExecutionTargets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeAssociationExecutionTargets
DescribeAssociationExecutionTargetsResponse
rs
          DescribeAssociationExecutionTargetsResponse
-> Getting
     (First Text) DescribeAssociationExecutionTargetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeAssociationExecutionTargetsResponse
-> Const (First Text) DescribeAssociationExecutionTargetsResponse
Lens' DescribeAssociationExecutionTargetsResponse (Maybe Text)
describeAssociationExecutionTargetsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeAssociationExecutionTargetsResponse
 -> Const (First Text) DescribeAssociationExecutionTargetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) DescribeAssociationExecutionTargetsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance
  Prelude.NFData
    DescribeAssociationExecutionTargets

instance
  Core.ToHeaders
    DescribeAssociationExecutionTargets
  where
  toHeaders :: DescribeAssociationExecutionTargets -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DescribeAssociationExecutionTargets -> 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
"AmazonSSM.DescribeAssociationExecutionTargets" ::
                          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
    DescribeAssociationExecutionTargets
  where
  toJSON :: DescribeAssociationExecutionTargets -> Value
toJSON DescribeAssociationExecutionTargets' {Maybe Natural
Maybe (NonEmpty AssociationExecutionTargetsFilter)
Maybe Text
Text
executionId :: Text
associationId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe (NonEmpty AssociationExecutionTargetsFilter)
$sel:executionId:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets -> Text
$sel:associationId:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets -> Text
$sel:maxResults:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets -> Maybe Natural
$sel:nextToken:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets -> Maybe Text
$sel:filters:DescribeAssociationExecutionTargets' :: DescribeAssociationExecutionTargets
-> Maybe (NonEmpty AssociationExecutionTargetsFilter)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> NonEmpty AssociationExecutionTargetsFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty AssociationExecutionTargetsFilter -> Pair)
-> Maybe (NonEmpty AssociationExecutionTargetsFilter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty AssociationExecutionTargetsFilter)
filters,
            (Text
"NextToken" 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
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AssociationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
associationId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ExecutionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
executionId)
          ]
      )

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

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

-- | /See:/ 'newDescribeAssociationExecutionTargetsResponse' smart constructor.
data DescribeAssociationExecutionTargetsResponse = DescribeAssociationExecutionTargetsResponse'
  { -- | The token for the next set of items to return. Use this token to get the
    -- next set of results.
    DescribeAssociationExecutionTargetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the execution.
    DescribeAssociationExecutionTargetsResponse
-> Maybe [AssociationExecutionTarget]
associationExecutionTargets :: Prelude.Maybe [AssociationExecutionTarget],
    -- | The response's http status code.
    DescribeAssociationExecutionTargetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAssociationExecutionTargetsResponse
-> DescribeAssociationExecutionTargetsResponse -> Bool
(DescribeAssociationExecutionTargetsResponse
 -> DescribeAssociationExecutionTargetsResponse -> Bool)
-> (DescribeAssociationExecutionTargetsResponse
    -> DescribeAssociationExecutionTargetsResponse -> Bool)
-> Eq DescribeAssociationExecutionTargetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAssociationExecutionTargetsResponse
-> DescribeAssociationExecutionTargetsResponse -> Bool
$c/= :: DescribeAssociationExecutionTargetsResponse
-> DescribeAssociationExecutionTargetsResponse -> Bool
== :: DescribeAssociationExecutionTargetsResponse
-> DescribeAssociationExecutionTargetsResponse -> Bool
$c== :: DescribeAssociationExecutionTargetsResponse
-> DescribeAssociationExecutionTargetsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAssociationExecutionTargetsResponse]
ReadPrec DescribeAssociationExecutionTargetsResponse
Int -> ReadS DescribeAssociationExecutionTargetsResponse
ReadS [DescribeAssociationExecutionTargetsResponse]
(Int -> ReadS DescribeAssociationExecutionTargetsResponse)
-> ReadS [DescribeAssociationExecutionTargetsResponse]
-> ReadPrec DescribeAssociationExecutionTargetsResponse
-> ReadPrec [DescribeAssociationExecutionTargetsResponse]
-> Read DescribeAssociationExecutionTargetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAssociationExecutionTargetsResponse]
$creadListPrec :: ReadPrec [DescribeAssociationExecutionTargetsResponse]
readPrec :: ReadPrec DescribeAssociationExecutionTargetsResponse
$creadPrec :: ReadPrec DescribeAssociationExecutionTargetsResponse
readList :: ReadS [DescribeAssociationExecutionTargetsResponse]
$creadList :: ReadS [DescribeAssociationExecutionTargetsResponse]
readsPrec :: Int -> ReadS DescribeAssociationExecutionTargetsResponse
$creadsPrec :: Int -> ReadS DescribeAssociationExecutionTargetsResponse
Prelude.Read, Int -> DescribeAssociationExecutionTargetsResponse -> ShowS
[DescribeAssociationExecutionTargetsResponse] -> ShowS
DescribeAssociationExecutionTargetsResponse -> String
(Int -> DescribeAssociationExecutionTargetsResponse -> ShowS)
-> (DescribeAssociationExecutionTargetsResponse -> String)
-> ([DescribeAssociationExecutionTargetsResponse] -> ShowS)
-> Show DescribeAssociationExecutionTargetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAssociationExecutionTargetsResponse] -> ShowS
$cshowList :: [DescribeAssociationExecutionTargetsResponse] -> ShowS
show :: DescribeAssociationExecutionTargetsResponse -> String
$cshow :: DescribeAssociationExecutionTargetsResponse -> String
showsPrec :: Int -> DescribeAssociationExecutionTargetsResponse -> ShowS
$cshowsPrec :: Int -> DescribeAssociationExecutionTargetsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeAssociationExecutionTargetsResponse
 -> Rep DescribeAssociationExecutionTargetsResponse x)
-> (forall x.
    Rep DescribeAssociationExecutionTargetsResponse x
    -> DescribeAssociationExecutionTargetsResponse)
-> Generic DescribeAssociationExecutionTargetsResponse
forall x.
Rep DescribeAssociationExecutionTargetsResponse x
-> DescribeAssociationExecutionTargetsResponse
forall x.
DescribeAssociationExecutionTargetsResponse
-> Rep DescribeAssociationExecutionTargetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAssociationExecutionTargetsResponse x
-> DescribeAssociationExecutionTargetsResponse
$cfrom :: forall x.
DescribeAssociationExecutionTargetsResponse
-> Rep DescribeAssociationExecutionTargetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAssociationExecutionTargetsResponse' 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:
--
-- 'nextToken', 'describeAssociationExecutionTargetsResponse_nextToken' - The token for the next set of items to return. Use this token to get the
-- next set of results.
--
-- 'associationExecutionTargets', 'describeAssociationExecutionTargetsResponse_associationExecutionTargets' - Information about the execution.
--
-- 'httpStatus', 'describeAssociationExecutionTargetsResponse_httpStatus' - The response's http status code.
newDescribeAssociationExecutionTargetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAssociationExecutionTargetsResponse
newDescribeAssociationExecutionTargetsResponse :: Int -> DescribeAssociationExecutionTargetsResponse
newDescribeAssociationExecutionTargetsResponse
  Int
pHttpStatus_ =
    DescribeAssociationExecutionTargetsResponse' :: Maybe Text
-> Maybe [AssociationExecutionTarget]
-> Int
-> DescribeAssociationExecutionTargetsResponse
DescribeAssociationExecutionTargetsResponse'
      { $sel:nextToken:DescribeAssociationExecutionTargetsResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:associationExecutionTargets:DescribeAssociationExecutionTargetsResponse' :: Maybe [AssociationExecutionTarget]
associationExecutionTargets =
          Maybe [AssociationExecutionTarget]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeAssociationExecutionTargetsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The token for the next set of items to return. Use this token to get the
-- next set of results.
describeAssociationExecutionTargetsResponse_nextToken :: Lens.Lens' DescribeAssociationExecutionTargetsResponse (Prelude.Maybe Prelude.Text)
describeAssociationExecutionTargetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeAssociationExecutionTargetsResponse
-> f DescribeAssociationExecutionTargetsResponse
describeAssociationExecutionTargetsResponse_nextToken = (DescribeAssociationExecutionTargetsResponse -> Maybe Text)
-> (DescribeAssociationExecutionTargetsResponse
    -> Maybe Text -> DescribeAssociationExecutionTargetsResponse)
-> Lens' DescribeAssociationExecutionTargetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssociationExecutionTargetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAssociationExecutionTargetsResponse' :: DescribeAssociationExecutionTargetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAssociationExecutionTargetsResponse
s@DescribeAssociationExecutionTargetsResponse' {} Maybe Text
a -> DescribeAssociationExecutionTargetsResponse
s {$sel:nextToken:DescribeAssociationExecutionTargetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAssociationExecutionTargetsResponse)

-- | Information about the execution.
describeAssociationExecutionTargetsResponse_associationExecutionTargets :: Lens.Lens' DescribeAssociationExecutionTargetsResponse (Prelude.Maybe [AssociationExecutionTarget])
describeAssociationExecutionTargetsResponse_associationExecutionTargets :: (Maybe [AssociationExecutionTarget]
 -> f (Maybe [AssociationExecutionTarget]))
-> DescribeAssociationExecutionTargetsResponse
-> f DescribeAssociationExecutionTargetsResponse
describeAssociationExecutionTargetsResponse_associationExecutionTargets = (DescribeAssociationExecutionTargetsResponse
 -> Maybe [AssociationExecutionTarget])
-> (DescribeAssociationExecutionTargetsResponse
    -> Maybe [AssociationExecutionTarget]
    -> DescribeAssociationExecutionTargetsResponse)
-> Lens'
     DescribeAssociationExecutionTargetsResponse
     (Maybe [AssociationExecutionTarget])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAssociationExecutionTargetsResponse' {Maybe [AssociationExecutionTarget]
associationExecutionTargets :: Maybe [AssociationExecutionTarget]
$sel:associationExecutionTargets:DescribeAssociationExecutionTargetsResponse' :: DescribeAssociationExecutionTargetsResponse
-> Maybe [AssociationExecutionTarget]
associationExecutionTargets} -> Maybe [AssociationExecutionTarget]
associationExecutionTargets) (\s :: DescribeAssociationExecutionTargetsResponse
s@DescribeAssociationExecutionTargetsResponse' {} Maybe [AssociationExecutionTarget]
a -> DescribeAssociationExecutionTargetsResponse
s {$sel:associationExecutionTargets:DescribeAssociationExecutionTargetsResponse' :: Maybe [AssociationExecutionTarget]
associationExecutionTargets = Maybe [AssociationExecutionTarget]
a} :: DescribeAssociationExecutionTargetsResponse) ((Maybe [AssociationExecutionTarget]
  -> f (Maybe [AssociationExecutionTarget]))
 -> DescribeAssociationExecutionTargetsResponse
 -> f DescribeAssociationExecutionTargetsResponse)
-> ((Maybe [AssociationExecutionTarget]
     -> f (Maybe [AssociationExecutionTarget]))
    -> Maybe [AssociationExecutionTarget]
    -> f (Maybe [AssociationExecutionTarget]))
-> (Maybe [AssociationExecutionTarget]
    -> f (Maybe [AssociationExecutionTarget]))
-> DescribeAssociationExecutionTargetsResponse
-> f DescribeAssociationExecutionTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AssociationExecutionTarget]
  [AssociationExecutionTarget]
  [AssociationExecutionTarget]
  [AssociationExecutionTarget]
-> Iso
     (Maybe [AssociationExecutionTarget])
     (Maybe [AssociationExecutionTarget])
     (Maybe [AssociationExecutionTarget])
     (Maybe [AssociationExecutionTarget])
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
  [AssociationExecutionTarget]
  [AssociationExecutionTarget]
  [AssociationExecutionTarget]
  [AssociationExecutionTarget]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeAssociationExecutionTargetsResponse