{-# 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.GreengrassV2.ListEffectiveDeployments
-- 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)
--
-- Retrieves a paginated list of deployment jobs that IoT Greengrass sends
-- to Greengrass core devices.
--
-- This operation returns paginated results.
module Amazonka.GreengrassV2.ListEffectiveDeployments
  ( -- * Creating a Request
    ListEffectiveDeployments (..),
    newListEffectiveDeployments,

    -- * Request Lenses
    listEffectiveDeployments_nextToken,
    listEffectiveDeployments_maxResults,
    listEffectiveDeployments_coreDeviceThingName,

    -- * Destructuring the Response
    ListEffectiveDeploymentsResponse (..),
    newListEffectiveDeploymentsResponse,

    -- * Response Lenses
    listEffectiveDeploymentsResponse_nextToken,
    listEffectiveDeploymentsResponse_effectiveDeployments,
    listEffectiveDeploymentsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.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:/ 'newListEffectiveDeployments' smart constructor.
data ListEffectiveDeployments = ListEffectiveDeployments'
  { -- | The token to be used for the next set of paginated results.
    ListEffectiveDeployments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per paginated request.
    ListEffectiveDeployments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the core device. This is also the name of the IoT thing.
    ListEffectiveDeployments -> Text
coreDeviceThingName :: Prelude.Text
  }
  deriving (ListEffectiveDeployments -> ListEffectiveDeployments -> Bool
(ListEffectiveDeployments -> ListEffectiveDeployments -> Bool)
-> (ListEffectiveDeployments -> ListEffectiveDeployments -> Bool)
-> Eq ListEffectiveDeployments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEffectiveDeployments -> ListEffectiveDeployments -> Bool
$c/= :: ListEffectiveDeployments -> ListEffectiveDeployments -> Bool
== :: ListEffectiveDeployments -> ListEffectiveDeployments -> Bool
$c== :: ListEffectiveDeployments -> ListEffectiveDeployments -> Bool
Prelude.Eq, ReadPrec [ListEffectiveDeployments]
ReadPrec ListEffectiveDeployments
Int -> ReadS ListEffectiveDeployments
ReadS [ListEffectiveDeployments]
(Int -> ReadS ListEffectiveDeployments)
-> ReadS [ListEffectiveDeployments]
-> ReadPrec ListEffectiveDeployments
-> ReadPrec [ListEffectiveDeployments]
-> Read ListEffectiveDeployments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEffectiveDeployments]
$creadListPrec :: ReadPrec [ListEffectiveDeployments]
readPrec :: ReadPrec ListEffectiveDeployments
$creadPrec :: ReadPrec ListEffectiveDeployments
readList :: ReadS [ListEffectiveDeployments]
$creadList :: ReadS [ListEffectiveDeployments]
readsPrec :: Int -> ReadS ListEffectiveDeployments
$creadsPrec :: Int -> ReadS ListEffectiveDeployments
Prelude.Read, Int -> ListEffectiveDeployments -> ShowS
[ListEffectiveDeployments] -> ShowS
ListEffectiveDeployments -> String
(Int -> ListEffectiveDeployments -> ShowS)
-> (ListEffectiveDeployments -> String)
-> ([ListEffectiveDeployments] -> ShowS)
-> Show ListEffectiveDeployments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEffectiveDeployments] -> ShowS
$cshowList :: [ListEffectiveDeployments] -> ShowS
show :: ListEffectiveDeployments -> String
$cshow :: ListEffectiveDeployments -> String
showsPrec :: Int -> ListEffectiveDeployments -> ShowS
$cshowsPrec :: Int -> ListEffectiveDeployments -> ShowS
Prelude.Show, (forall x.
 ListEffectiveDeployments -> Rep ListEffectiveDeployments x)
-> (forall x.
    Rep ListEffectiveDeployments x -> ListEffectiveDeployments)
-> Generic ListEffectiveDeployments
forall x.
Rep ListEffectiveDeployments x -> ListEffectiveDeployments
forall x.
ListEffectiveDeployments -> Rep ListEffectiveDeployments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEffectiveDeployments x -> ListEffectiveDeployments
$cfrom :: forall x.
ListEffectiveDeployments -> Rep ListEffectiveDeployments x
Prelude.Generic)

-- |
-- Create a value of 'ListEffectiveDeployments' 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', 'listEffectiveDeployments_nextToken' - The token to be used for the next set of paginated results.
--
-- 'maxResults', 'listEffectiveDeployments_maxResults' - The maximum number of results to be returned per paginated request.
--
-- 'coreDeviceThingName', 'listEffectiveDeployments_coreDeviceThingName' - The name of the core device. This is also the name of the IoT thing.
newListEffectiveDeployments ::
  -- | 'coreDeviceThingName'
  Prelude.Text ->
  ListEffectiveDeployments
newListEffectiveDeployments :: Text -> ListEffectiveDeployments
newListEffectiveDeployments Text
pCoreDeviceThingName_ =
  ListEffectiveDeployments' :: Maybe Text -> Maybe Natural -> Text -> ListEffectiveDeployments
ListEffectiveDeployments'
    { $sel:nextToken:ListEffectiveDeployments' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListEffectiveDeployments' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:coreDeviceThingName:ListEffectiveDeployments' :: Text
coreDeviceThingName = Text
pCoreDeviceThingName_
    }

-- | The token to be used for the next set of paginated results.
listEffectiveDeployments_nextToken :: Lens.Lens' ListEffectiveDeployments (Prelude.Maybe Prelude.Text)
listEffectiveDeployments_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEffectiveDeployments -> f ListEffectiveDeployments
listEffectiveDeployments_nextToken = (ListEffectiveDeployments -> Maybe Text)
-> (ListEffectiveDeployments
    -> Maybe Text -> ListEffectiveDeployments)
-> Lens
     ListEffectiveDeployments
     ListEffectiveDeployments
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEffectiveDeployments' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEffectiveDeployments' :: ListEffectiveDeployments -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEffectiveDeployments
s@ListEffectiveDeployments' {} Maybe Text
a -> ListEffectiveDeployments
s {$sel:nextToken:ListEffectiveDeployments' :: Maybe Text
nextToken = Maybe Text
a} :: ListEffectiveDeployments)

-- | The maximum number of results to be returned per paginated request.
listEffectiveDeployments_maxResults :: Lens.Lens' ListEffectiveDeployments (Prelude.Maybe Prelude.Natural)
listEffectiveDeployments_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListEffectiveDeployments -> f ListEffectiveDeployments
listEffectiveDeployments_maxResults = (ListEffectiveDeployments -> Maybe Natural)
-> (ListEffectiveDeployments
    -> Maybe Natural -> ListEffectiveDeployments)
-> Lens
     ListEffectiveDeployments
     ListEffectiveDeployments
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEffectiveDeployments' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListEffectiveDeployments' :: ListEffectiveDeployments -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListEffectiveDeployments
s@ListEffectiveDeployments' {} Maybe Natural
a -> ListEffectiveDeployments
s {$sel:maxResults:ListEffectiveDeployments' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListEffectiveDeployments)

-- | The name of the core device. This is also the name of the IoT thing.
listEffectiveDeployments_coreDeviceThingName :: Lens.Lens' ListEffectiveDeployments Prelude.Text
listEffectiveDeployments_coreDeviceThingName :: (Text -> f Text)
-> ListEffectiveDeployments -> f ListEffectiveDeployments
listEffectiveDeployments_coreDeviceThingName = (ListEffectiveDeployments -> Text)
-> (ListEffectiveDeployments -> Text -> ListEffectiveDeployments)
-> Lens ListEffectiveDeployments ListEffectiveDeployments Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEffectiveDeployments' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:ListEffectiveDeployments' :: ListEffectiveDeployments -> Text
coreDeviceThingName} -> Text
coreDeviceThingName) (\s :: ListEffectiveDeployments
s@ListEffectiveDeployments' {} Text
a -> ListEffectiveDeployments
s {$sel:coreDeviceThingName:ListEffectiveDeployments' :: Text
coreDeviceThingName = Text
a} :: ListEffectiveDeployments)

instance Core.AWSPager ListEffectiveDeployments where
  page :: ListEffectiveDeployments
-> AWSResponse ListEffectiveDeployments
-> Maybe ListEffectiveDeployments
page ListEffectiveDeployments
rq AWSResponse ListEffectiveDeployments
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEffectiveDeployments
ListEffectiveDeploymentsResponse
rs
            ListEffectiveDeploymentsResponse
-> Getting (First Text) ListEffectiveDeploymentsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEffectiveDeploymentsResponse
-> Const (First Text) ListEffectiveDeploymentsResponse
Lens' ListEffectiveDeploymentsResponse (Maybe Text)
listEffectiveDeploymentsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEffectiveDeploymentsResponse
 -> Const (First Text) ListEffectiveDeploymentsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListEffectiveDeploymentsResponse 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 ListEffectiveDeployments
forall a. Maybe a
Prelude.Nothing
    | Maybe [EffectiveDeployment] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListEffectiveDeployments
ListEffectiveDeploymentsResponse
rs
            ListEffectiveDeploymentsResponse
-> Getting
     (First [EffectiveDeployment])
     ListEffectiveDeploymentsResponse
     [EffectiveDeployment]
-> Maybe [EffectiveDeployment]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [EffectiveDeployment]
 -> Const
      (First [EffectiveDeployment]) (Maybe [EffectiveDeployment]))
-> ListEffectiveDeploymentsResponse
-> Const
     (First [EffectiveDeployment]) ListEffectiveDeploymentsResponse
Lens'
  ListEffectiveDeploymentsResponse (Maybe [EffectiveDeployment])
listEffectiveDeploymentsResponse_effectiveDeployments
              ((Maybe [EffectiveDeployment]
  -> Const
       (First [EffectiveDeployment]) (Maybe [EffectiveDeployment]))
 -> ListEffectiveDeploymentsResponse
 -> Const
      (First [EffectiveDeployment]) ListEffectiveDeploymentsResponse)
-> (([EffectiveDeployment]
     -> Const (First [EffectiveDeployment]) [EffectiveDeployment])
    -> Maybe [EffectiveDeployment]
    -> Const
         (First [EffectiveDeployment]) (Maybe [EffectiveDeployment]))
-> Getting
     (First [EffectiveDeployment])
     ListEffectiveDeploymentsResponse
     [EffectiveDeployment]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([EffectiveDeployment]
 -> Const (First [EffectiveDeployment]) [EffectiveDeployment])
-> Maybe [EffectiveDeployment]
-> Const
     (First [EffectiveDeployment]) (Maybe [EffectiveDeployment])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListEffectiveDeployments
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListEffectiveDeployments -> Maybe ListEffectiveDeployments
forall a. a -> Maybe a
Prelude.Just (ListEffectiveDeployments -> Maybe ListEffectiveDeployments)
-> ListEffectiveDeployments -> Maybe ListEffectiveDeployments
forall a b. (a -> b) -> a -> b
Prelude.$
        ListEffectiveDeployments
rq
          ListEffectiveDeployments
-> (ListEffectiveDeployments -> ListEffectiveDeployments)
-> ListEffectiveDeployments
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListEffectiveDeployments -> Identity ListEffectiveDeployments
Lens
  ListEffectiveDeployments
  ListEffectiveDeployments
  (Maybe Text)
  (Maybe Text)
listEffectiveDeployments_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListEffectiveDeployments -> Identity ListEffectiveDeployments)
-> Maybe Text
-> ListEffectiveDeployments
-> ListEffectiveDeployments
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListEffectiveDeployments
ListEffectiveDeploymentsResponse
rs
          ListEffectiveDeploymentsResponse
-> Getting (First Text) ListEffectiveDeploymentsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListEffectiveDeploymentsResponse
-> Const (First Text) ListEffectiveDeploymentsResponse
Lens' ListEffectiveDeploymentsResponse (Maybe Text)
listEffectiveDeploymentsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListEffectiveDeploymentsResponse
 -> Const (First Text) ListEffectiveDeploymentsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListEffectiveDeploymentsResponse 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 ListEffectiveDeployments where
  type
    AWSResponse ListEffectiveDeployments =
      ListEffectiveDeploymentsResponse
  request :: ListEffectiveDeployments -> Request ListEffectiveDeployments
request = Service
-> ListEffectiveDeployments -> Request ListEffectiveDeployments
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListEffectiveDeployments
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEffectiveDeployments)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListEffectiveDeployments))
-> Logger
-> Service
-> Proxy ListEffectiveDeployments
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListEffectiveDeployments)))
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 [EffectiveDeployment]
-> Int
-> ListEffectiveDeploymentsResponse
ListEffectiveDeploymentsResponse'
            (Maybe Text
 -> Maybe [EffectiveDeployment]
 -> Int
 -> ListEffectiveDeploymentsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [EffectiveDeployment]
      -> Int -> ListEffectiveDeploymentsResponse)
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 [EffectiveDeployment]
   -> Int -> ListEffectiveDeploymentsResponse)
-> Either String (Maybe [EffectiveDeployment])
-> Either String (Int -> ListEffectiveDeploymentsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [EffectiveDeployment]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"effectiveDeployments"
                            Either String (Maybe (Maybe [EffectiveDeployment]))
-> Maybe [EffectiveDeployment]
-> Either String (Maybe [EffectiveDeployment])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EffectiveDeployment]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListEffectiveDeploymentsResponse)
-> Either String Int
-> Either String ListEffectiveDeploymentsResponse
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 ListEffectiveDeployments

instance Prelude.NFData ListEffectiveDeployments

instance Core.ToHeaders ListEffectiveDeployments where
  toHeaders :: ListEffectiveDeployments -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListEffectiveDeployments -> 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.ToPath ListEffectiveDeployments where
  toPath :: ListEffectiveDeployments -> ByteString
toPath ListEffectiveDeployments' {Maybe Natural
Maybe Text
Text
coreDeviceThingName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:coreDeviceThingName:ListEffectiveDeployments' :: ListEffectiveDeployments -> Text
$sel:maxResults:ListEffectiveDeployments' :: ListEffectiveDeployments -> Maybe Natural
$sel:nextToken:ListEffectiveDeployments' :: ListEffectiveDeployments -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/v2/coreDevices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
coreDeviceThingName,
        ByteString
"/effectiveDeployments"
      ]

instance Core.ToQuery ListEffectiveDeployments where
  toQuery :: ListEffectiveDeployments -> QueryString
toQuery ListEffectiveDeployments' {Maybe Natural
Maybe Text
Text
coreDeviceThingName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:coreDeviceThingName:ListEffectiveDeployments' :: ListEffectiveDeployments -> Text
$sel:maxResults:ListEffectiveDeployments' :: ListEffectiveDeployments -> Maybe Natural
$sel:nextToken:ListEffectiveDeployments' :: ListEffectiveDeployments -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListEffectiveDeploymentsResponse' smart constructor.
data ListEffectiveDeploymentsResponse = ListEffectiveDeploymentsResponse'
  { -- | The token for the next set of results, or null if there are no
    -- additional results.
    ListEffectiveDeploymentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list that summarizes each deployment on the core device.
    ListEffectiveDeploymentsResponse -> Maybe [EffectiveDeployment]
effectiveDeployments :: Prelude.Maybe [EffectiveDeployment],
    -- | The response's http status code.
    ListEffectiveDeploymentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListEffectiveDeploymentsResponse
-> ListEffectiveDeploymentsResponse -> Bool
(ListEffectiveDeploymentsResponse
 -> ListEffectiveDeploymentsResponse -> Bool)
-> (ListEffectiveDeploymentsResponse
    -> ListEffectiveDeploymentsResponse -> Bool)
-> Eq ListEffectiveDeploymentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEffectiveDeploymentsResponse
-> ListEffectiveDeploymentsResponse -> Bool
$c/= :: ListEffectiveDeploymentsResponse
-> ListEffectiveDeploymentsResponse -> Bool
== :: ListEffectiveDeploymentsResponse
-> ListEffectiveDeploymentsResponse -> Bool
$c== :: ListEffectiveDeploymentsResponse
-> ListEffectiveDeploymentsResponse -> Bool
Prelude.Eq, ReadPrec [ListEffectiveDeploymentsResponse]
ReadPrec ListEffectiveDeploymentsResponse
Int -> ReadS ListEffectiveDeploymentsResponse
ReadS [ListEffectiveDeploymentsResponse]
(Int -> ReadS ListEffectiveDeploymentsResponse)
-> ReadS [ListEffectiveDeploymentsResponse]
-> ReadPrec ListEffectiveDeploymentsResponse
-> ReadPrec [ListEffectiveDeploymentsResponse]
-> Read ListEffectiveDeploymentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEffectiveDeploymentsResponse]
$creadListPrec :: ReadPrec [ListEffectiveDeploymentsResponse]
readPrec :: ReadPrec ListEffectiveDeploymentsResponse
$creadPrec :: ReadPrec ListEffectiveDeploymentsResponse
readList :: ReadS [ListEffectiveDeploymentsResponse]
$creadList :: ReadS [ListEffectiveDeploymentsResponse]
readsPrec :: Int -> ReadS ListEffectiveDeploymentsResponse
$creadsPrec :: Int -> ReadS ListEffectiveDeploymentsResponse
Prelude.Read, Int -> ListEffectiveDeploymentsResponse -> ShowS
[ListEffectiveDeploymentsResponse] -> ShowS
ListEffectiveDeploymentsResponse -> String
(Int -> ListEffectiveDeploymentsResponse -> ShowS)
-> (ListEffectiveDeploymentsResponse -> String)
-> ([ListEffectiveDeploymentsResponse] -> ShowS)
-> Show ListEffectiveDeploymentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEffectiveDeploymentsResponse] -> ShowS
$cshowList :: [ListEffectiveDeploymentsResponse] -> ShowS
show :: ListEffectiveDeploymentsResponse -> String
$cshow :: ListEffectiveDeploymentsResponse -> String
showsPrec :: Int -> ListEffectiveDeploymentsResponse -> ShowS
$cshowsPrec :: Int -> ListEffectiveDeploymentsResponse -> ShowS
Prelude.Show, (forall x.
 ListEffectiveDeploymentsResponse
 -> Rep ListEffectiveDeploymentsResponse x)
-> (forall x.
    Rep ListEffectiveDeploymentsResponse x
    -> ListEffectiveDeploymentsResponse)
-> Generic ListEffectiveDeploymentsResponse
forall x.
Rep ListEffectiveDeploymentsResponse x
-> ListEffectiveDeploymentsResponse
forall x.
ListEffectiveDeploymentsResponse
-> Rep ListEffectiveDeploymentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEffectiveDeploymentsResponse x
-> ListEffectiveDeploymentsResponse
$cfrom :: forall x.
ListEffectiveDeploymentsResponse
-> Rep ListEffectiveDeploymentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListEffectiveDeploymentsResponse' 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', 'listEffectiveDeploymentsResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'effectiveDeployments', 'listEffectiveDeploymentsResponse_effectiveDeployments' - A list that summarizes each deployment on the core device.
--
-- 'httpStatus', 'listEffectiveDeploymentsResponse_httpStatus' - The response's http status code.
newListEffectiveDeploymentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListEffectiveDeploymentsResponse
newListEffectiveDeploymentsResponse :: Int -> ListEffectiveDeploymentsResponse
newListEffectiveDeploymentsResponse Int
pHttpStatus_ =
  ListEffectiveDeploymentsResponse' :: Maybe Text
-> Maybe [EffectiveDeployment]
-> Int
-> ListEffectiveDeploymentsResponse
ListEffectiveDeploymentsResponse'
    { $sel:nextToken:ListEffectiveDeploymentsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:effectiveDeployments:ListEffectiveDeploymentsResponse' :: Maybe [EffectiveDeployment]
effectiveDeployments = Maybe [EffectiveDeployment]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListEffectiveDeploymentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of results, or null if there are no
-- additional results.
listEffectiveDeploymentsResponse_nextToken :: Lens.Lens' ListEffectiveDeploymentsResponse (Prelude.Maybe Prelude.Text)
listEffectiveDeploymentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEffectiveDeploymentsResponse
-> f ListEffectiveDeploymentsResponse
listEffectiveDeploymentsResponse_nextToken = (ListEffectiveDeploymentsResponse -> Maybe Text)
-> (ListEffectiveDeploymentsResponse
    -> Maybe Text -> ListEffectiveDeploymentsResponse)
-> Lens' ListEffectiveDeploymentsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEffectiveDeploymentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEffectiveDeploymentsResponse' :: ListEffectiveDeploymentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEffectiveDeploymentsResponse
s@ListEffectiveDeploymentsResponse' {} Maybe Text
a -> ListEffectiveDeploymentsResponse
s {$sel:nextToken:ListEffectiveDeploymentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEffectiveDeploymentsResponse)

-- | A list that summarizes each deployment on the core device.
listEffectiveDeploymentsResponse_effectiveDeployments :: Lens.Lens' ListEffectiveDeploymentsResponse (Prelude.Maybe [EffectiveDeployment])
listEffectiveDeploymentsResponse_effectiveDeployments :: (Maybe [EffectiveDeployment] -> f (Maybe [EffectiveDeployment]))
-> ListEffectiveDeploymentsResponse
-> f ListEffectiveDeploymentsResponse
listEffectiveDeploymentsResponse_effectiveDeployments = (ListEffectiveDeploymentsResponse -> Maybe [EffectiveDeployment])
-> (ListEffectiveDeploymentsResponse
    -> Maybe [EffectiveDeployment] -> ListEffectiveDeploymentsResponse)
-> Lens'
     ListEffectiveDeploymentsResponse (Maybe [EffectiveDeployment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEffectiveDeploymentsResponse' {Maybe [EffectiveDeployment]
effectiveDeployments :: Maybe [EffectiveDeployment]
$sel:effectiveDeployments:ListEffectiveDeploymentsResponse' :: ListEffectiveDeploymentsResponse -> Maybe [EffectiveDeployment]
effectiveDeployments} -> Maybe [EffectiveDeployment]
effectiveDeployments) (\s :: ListEffectiveDeploymentsResponse
s@ListEffectiveDeploymentsResponse' {} Maybe [EffectiveDeployment]
a -> ListEffectiveDeploymentsResponse
s {$sel:effectiveDeployments:ListEffectiveDeploymentsResponse' :: Maybe [EffectiveDeployment]
effectiveDeployments = Maybe [EffectiveDeployment]
a} :: ListEffectiveDeploymentsResponse) ((Maybe [EffectiveDeployment] -> f (Maybe [EffectiveDeployment]))
 -> ListEffectiveDeploymentsResponse
 -> f ListEffectiveDeploymentsResponse)
-> ((Maybe [EffectiveDeployment]
     -> f (Maybe [EffectiveDeployment]))
    -> Maybe [EffectiveDeployment] -> f (Maybe [EffectiveDeployment]))
-> (Maybe [EffectiveDeployment] -> f (Maybe [EffectiveDeployment]))
-> ListEffectiveDeploymentsResponse
-> f ListEffectiveDeploymentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EffectiveDeployment]
  [EffectiveDeployment]
  [EffectiveDeployment]
  [EffectiveDeployment]
-> Iso
     (Maybe [EffectiveDeployment])
     (Maybe [EffectiveDeployment])
     (Maybe [EffectiveDeployment])
     (Maybe [EffectiveDeployment])
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
  [EffectiveDeployment]
  [EffectiveDeployment]
  [EffectiveDeployment]
  [EffectiveDeployment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListEffectiveDeploymentsResponse