{-# 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.CodeDeploy.ListOnPremisesInstances
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a list of names for one or more on-premises instances.
--
-- Unless otherwise specified, both registered and deregistered on-premises
-- instance names are listed. To list only registered or deregistered
-- on-premises instance names, use the registration status parameter.
--
-- This operation returns paginated results.
module Amazonka.CodeDeploy.ListOnPremisesInstances
  ( -- * Creating a Request
    ListOnPremisesInstances (..),
    newListOnPremisesInstances,

    -- * Request Lenses
    listOnPremisesInstances_nextToken,
    listOnPremisesInstances_registrationStatus,
    listOnPremisesInstances_tagFilters,

    -- * Destructuring the Response
    ListOnPremisesInstancesResponse (..),
    newListOnPremisesInstancesResponse,

    -- * Response Lenses
    listOnPremisesInstancesResponse_instanceNames,
    listOnPremisesInstancesResponse_nextToken,
    listOnPremisesInstancesResponse_httpStatus,
  )
where

import Amazonka.CodeDeploy.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input of a @ListOnPremisesInstances@ operation.
--
-- /See:/ 'newListOnPremisesInstances' smart constructor.
data ListOnPremisesInstances = ListOnPremisesInstances'
  { -- | An identifier returned from the previous list on-premises instances
    -- call. It can be used to return the next set of on-premises instances in
    -- the list.
    ListOnPremisesInstances -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The registration status of the on-premises instances:
    --
    -- -   @Deregistered@: Include deregistered on-premises instances in the
    --     resulting list.
    --
    -- -   @Registered@: Include registered on-premises instances in the
    --     resulting list.
    ListOnPremisesInstances -> Maybe RegistrationStatus
registrationStatus :: Prelude.Maybe RegistrationStatus,
    -- | The on-premises instance tags that are used to restrict the on-premises
    -- instance names returned.
    ListOnPremisesInstances -> Maybe [TagFilter]
tagFilters :: Prelude.Maybe [TagFilter]
  }
  deriving (ListOnPremisesInstances -> ListOnPremisesInstances -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOnPremisesInstances -> ListOnPremisesInstances -> Bool
$c/= :: ListOnPremisesInstances -> ListOnPremisesInstances -> Bool
== :: ListOnPremisesInstances -> ListOnPremisesInstances -> Bool
$c== :: ListOnPremisesInstances -> ListOnPremisesInstances -> Bool
Prelude.Eq, ReadPrec [ListOnPremisesInstances]
ReadPrec ListOnPremisesInstances
Int -> ReadS ListOnPremisesInstances
ReadS [ListOnPremisesInstances]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOnPremisesInstances]
$creadListPrec :: ReadPrec [ListOnPremisesInstances]
readPrec :: ReadPrec ListOnPremisesInstances
$creadPrec :: ReadPrec ListOnPremisesInstances
readList :: ReadS [ListOnPremisesInstances]
$creadList :: ReadS [ListOnPremisesInstances]
readsPrec :: Int -> ReadS ListOnPremisesInstances
$creadsPrec :: Int -> ReadS ListOnPremisesInstances
Prelude.Read, Int -> ListOnPremisesInstances -> ShowS
[ListOnPremisesInstances] -> ShowS
ListOnPremisesInstances -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOnPremisesInstances] -> ShowS
$cshowList :: [ListOnPremisesInstances] -> ShowS
show :: ListOnPremisesInstances -> String
$cshow :: ListOnPremisesInstances -> String
showsPrec :: Int -> ListOnPremisesInstances -> ShowS
$cshowsPrec :: Int -> ListOnPremisesInstances -> ShowS
Prelude.Show, forall x. Rep ListOnPremisesInstances x -> ListOnPremisesInstances
forall x. ListOnPremisesInstances -> Rep ListOnPremisesInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListOnPremisesInstances x -> ListOnPremisesInstances
$cfrom :: forall x. ListOnPremisesInstances -> Rep ListOnPremisesInstances x
Prelude.Generic)

-- |
-- Create a value of 'ListOnPremisesInstances' 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', 'listOnPremisesInstances_nextToken' - An identifier returned from the previous list on-premises instances
-- call. It can be used to return the next set of on-premises instances in
-- the list.
--
-- 'registrationStatus', 'listOnPremisesInstances_registrationStatus' - The registration status of the on-premises instances:
--
-- -   @Deregistered@: Include deregistered on-premises instances in the
--     resulting list.
--
-- -   @Registered@: Include registered on-premises instances in the
--     resulting list.
--
-- 'tagFilters', 'listOnPremisesInstances_tagFilters' - The on-premises instance tags that are used to restrict the on-premises
-- instance names returned.
newListOnPremisesInstances ::
  ListOnPremisesInstances
newListOnPremisesInstances :: ListOnPremisesInstances
newListOnPremisesInstances =
  ListOnPremisesInstances'
    { $sel:nextToken:ListOnPremisesInstances' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:registrationStatus:ListOnPremisesInstances' :: Maybe RegistrationStatus
registrationStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:tagFilters:ListOnPremisesInstances' :: Maybe [TagFilter]
tagFilters = forall a. Maybe a
Prelude.Nothing
    }

-- | An identifier returned from the previous list on-premises instances
-- call. It can be used to return the next set of on-premises instances in
-- the list.
listOnPremisesInstances_nextToken :: Lens.Lens' ListOnPremisesInstances (Prelude.Maybe Prelude.Text)
listOnPremisesInstances_nextToken :: Lens' ListOnPremisesInstances (Maybe Text)
listOnPremisesInstances_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOnPremisesInstances' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOnPremisesInstances
s@ListOnPremisesInstances' {} Maybe Text
a -> ListOnPremisesInstances
s {$sel:nextToken:ListOnPremisesInstances' :: Maybe Text
nextToken = Maybe Text
a} :: ListOnPremisesInstances)

-- | The registration status of the on-premises instances:
--
-- -   @Deregistered@: Include deregistered on-premises instances in the
--     resulting list.
--
-- -   @Registered@: Include registered on-premises instances in the
--     resulting list.
listOnPremisesInstances_registrationStatus :: Lens.Lens' ListOnPremisesInstances (Prelude.Maybe RegistrationStatus)
listOnPremisesInstances_registrationStatus :: Lens' ListOnPremisesInstances (Maybe RegistrationStatus)
listOnPremisesInstances_registrationStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOnPremisesInstances' {Maybe RegistrationStatus
registrationStatus :: Maybe RegistrationStatus
$sel:registrationStatus:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe RegistrationStatus
registrationStatus} -> Maybe RegistrationStatus
registrationStatus) (\s :: ListOnPremisesInstances
s@ListOnPremisesInstances' {} Maybe RegistrationStatus
a -> ListOnPremisesInstances
s {$sel:registrationStatus:ListOnPremisesInstances' :: Maybe RegistrationStatus
registrationStatus = Maybe RegistrationStatus
a} :: ListOnPremisesInstances)

-- | The on-premises instance tags that are used to restrict the on-premises
-- instance names returned.
listOnPremisesInstances_tagFilters :: Lens.Lens' ListOnPremisesInstances (Prelude.Maybe [TagFilter])
listOnPremisesInstances_tagFilters :: Lens' ListOnPremisesInstances (Maybe [TagFilter])
listOnPremisesInstances_tagFilters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOnPremisesInstances' {Maybe [TagFilter]
tagFilters :: Maybe [TagFilter]
$sel:tagFilters:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe [TagFilter]
tagFilters} -> Maybe [TagFilter]
tagFilters) (\s :: ListOnPremisesInstances
s@ListOnPremisesInstances' {} Maybe [TagFilter]
a -> ListOnPremisesInstances
s {$sel:tagFilters:ListOnPremisesInstances' :: Maybe [TagFilter]
tagFilters = Maybe [TagFilter]
a} :: ListOnPremisesInstances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager ListOnPremisesInstances where
  page :: ListOnPremisesInstances
-> AWSResponse ListOnPremisesInstances
-> Maybe ListOnPremisesInstances
page ListOnPremisesInstances
rq AWSResponse ListOnPremisesInstances
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListOnPremisesInstances
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListOnPremisesInstancesResponse (Maybe Text)
listOnPremisesInstancesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListOnPremisesInstances
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListOnPremisesInstancesResponse (Maybe [Text])
listOnPremisesInstancesResponse_instanceNames
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListOnPremisesInstances
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListOnPremisesInstances (Maybe Text)
listOnPremisesInstances_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListOnPremisesInstances
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListOnPremisesInstancesResponse (Maybe Text)
listOnPremisesInstancesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListOnPremisesInstances where
  type
    AWSResponse ListOnPremisesInstances =
      ListOnPremisesInstancesResponse
  request :: (Service -> Service)
-> ListOnPremisesInstances -> Request ListOnPremisesInstances
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListOnPremisesInstances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListOnPremisesInstances)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Text]
-> Maybe Text -> Int -> ListOnPremisesInstancesResponse
ListOnPremisesInstancesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"instanceNames" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListOnPremisesInstances where
  hashWithSalt :: Int -> ListOnPremisesInstances -> Int
hashWithSalt Int
_salt ListOnPremisesInstances' {Maybe [TagFilter]
Maybe Text
Maybe RegistrationStatus
tagFilters :: Maybe [TagFilter]
registrationStatus :: Maybe RegistrationStatus
nextToken :: Maybe Text
$sel:tagFilters:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe [TagFilter]
$sel:registrationStatus:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe RegistrationStatus
$sel:nextToken:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RegistrationStatus
registrationStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagFilter]
tagFilters

instance Prelude.NFData ListOnPremisesInstances where
  rnf :: ListOnPremisesInstances -> ()
rnf ListOnPremisesInstances' {Maybe [TagFilter]
Maybe Text
Maybe RegistrationStatus
tagFilters :: Maybe [TagFilter]
registrationStatus :: Maybe RegistrationStatus
nextToken :: Maybe Text
$sel:tagFilters:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe [TagFilter]
$sel:registrationStatus:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe RegistrationStatus
$sel:nextToken:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RegistrationStatus
registrationStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagFilter]
tagFilters

instance Data.ToHeaders ListOnPremisesInstances where
  toHeaders :: ListOnPremisesInstances -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeDeploy_20141006.ListOnPremisesInstances" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListOnPremisesInstances where
  toJSON :: ListOnPremisesInstances -> Value
toJSON ListOnPremisesInstances' {Maybe [TagFilter]
Maybe Text
Maybe RegistrationStatus
tagFilters :: Maybe [TagFilter]
registrationStatus :: Maybe RegistrationStatus
nextToken :: Maybe Text
$sel:tagFilters:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe [TagFilter]
$sel:registrationStatus:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe RegistrationStatus
$sel:nextToken:ListOnPremisesInstances' :: ListOnPremisesInstances -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"registrationStatus" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RegistrationStatus
registrationStatus,
            (Key
"tagFilters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagFilter]
tagFilters
          ]
      )

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

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

-- | Represents the output of the list on-premises instances operation.
--
-- /See:/ 'newListOnPremisesInstancesResponse' smart constructor.
data ListOnPremisesInstancesResponse = ListOnPremisesInstancesResponse'
  { -- | The list of matching on-premises instance names.
    ListOnPremisesInstancesResponse -> Maybe [Text]
instanceNames :: Prelude.Maybe [Prelude.Text],
    -- | If a large amount of information is returned, an identifier is also
    -- returned. It can be used in a subsequent list on-premises instances call
    -- to return the next set of on-premises instances in the list.
    ListOnPremisesInstancesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListOnPremisesInstancesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListOnPremisesInstancesResponse
-> ListOnPremisesInstancesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOnPremisesInstancesResponse
-> ListOnPremisesInstancesResponse -> Bool
$c/= :: ListOnPremisesInstancesResponse
-> ListOnPremisesInstancesResponse -> Bool
== :: ListOnPremisesInstancesResponse
-> ListOnPremisesInstancesResponse -> Bool
$c== :: ListOnPremisesInstancesResponse
-> ListOnPremisesInstancesResponse -> Bool
Prelude.Eq, ReadPrec [ListOnPremisesInstancesResponse]
ReadPrec ListOnPremisesInstancesResponse
Int -> ReadS ListOnPremisesInstancesResponse
ReadS [ListOnPremisesInstancesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOnPremisesInstancesResponse]
$creadListPrec :: ReadPrec [ListOnPremisesInstancesResponse]
readPrec :: ReadPrec ListOnPremisesInstancesResponse
$creadPrec :: ReadPrec ListOnPremisesInstancesResponse
readList :: ReadS [ListOnPremisesInstancesResponse]
$creadList :: ReadS [ListOnPremisesInstancesResponse]
readsPrec :: Int -> ReadS ListOnPremisesInstancesResponse
$creadsPrec :: Int -> ReadS ListOnPremisesInstancesResponse
Prelude.Read, Int -> ListOnPremisesInstancesResponse -> ShowS
[ListOnPremisesInstancesResponse] -> ShowS
ListOnPremisesInstancesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOnPremisesInstancesResponse] -> ShowS
$cshowList :: [ListOnPremisesInstancesResponse] -> ShowS
show :: ListOnPremisesInstancesResponse -> String
$cshow :: ListOnPremisesInstancesResponse -> String
showsPrec :: Int -> ListOnPremisesInstancesResponse -> ShowS
$cshowsPrec :: Int -> ListOnPremisesInstancesResponse -> ShowS
Prelude.Show, forall x.
Rep ListOnPremisesInstancesResponse x
-> ListOnPremisesInstancesResponse
forall x.
ListOnPremisesInstancesResponse
-> Rep ListOnPremisesInstancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListOnPremisesInstancesResponse x
-> ListOnPremisesInstancesResponse
$cfrom :: forall x.
ListOnPremisesInstancesResponse
-> Rep ListOnPremisesInstancesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListOnPremisesInstancesResponse' 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:
--
-- 'instanceNames', 'listOnPremisesInstancesResponse_instanceNames' - The list of matching on-premises instance names.
--
-- 'nextToken', 'listOnPremisesInstancesResponse_nextToken' - If a large amount of information is returned, an identifier is also
-- returned. It can be used in a subsequent list on-premises instances call
-- to return the next set of on-premises instances in the list.
--
-- 'httpStatus', 'listOnPremisesInstancesResponse_httpStatus' - The response's http status code.
newListOnPremisesInstancesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListOnPremisesInstancesResponse
newListOnPremisesInstancesResponse :: Int -> ListOnPremisesInstancesResponse
newListOnPremisesInstancesResponse Int
pHttpStatus_ =
  ListOnPremisesInstancesResponse'
    { $sel:instanceNames:ListOnPremisesInstancesResponse' :: Maybe [Text]
instanceNames =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListOnPremisesInstancesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListOnPremisesInstancesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of matching on-premises instance names.
listOnPremisesInstancesResponse_instanceNames :: Lens.Lens' ListOnPremisesInstancesResponse (Prelude.Maybe [Prelude.Text])
listOnPremisesInstancesResponse_instanceNames :: Lens' ListOnPremisesInstancesResponse (Maybe [Text])
listOnPremisesInstancesResponse_instanceNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOnPremisesInstancesResponse' {Maybe [Text]
instanceNames :: Maybe [Text]
$sel:instanceNames:ListOnPremisesInstancesResponse' :: ListOnPremisesInstancesResponse -> Maybe [Text]
instanceNames} -> Maybe [Text]
instanceNames) (\s :: ListOnPremisesInstancesResponse
s@ListOnPremisesInstancesResponse' {} Maybe [Text]
a -> ListOnPremisesInstancesResponse
s {$sel:instanceNames:ListOnPremisesInstancesResponse' :: Maybe [Text]
instanceNames = Maybe [Text]
a} :: ListOnPremisesInstancesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If a large amount of information is returned, an identifier is also
-- returned. It can be used in a subsequent list on-premises instances call
-- to return the next set of on-premises instances in the list.
listOnPremisesInstancesResponse_nextToken :: Lens.Lens' ListOnPremisesInstancesResponse (Prelude.Maybe Prelude.Text)
listOnPremisesInstancesResponse_nextToken :: Lens' ListOnPremisesInstancesResponse (Maybe Text)
listOnPremisesInstancesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOnPremisesInstancesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOnPremisesInstancesResponse' :: ListOnPremisesInstancesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOnPremisesInstancesResponse
s@ListOnPremisesInstancesResponse' {} Maybe Text
a -> ListOnPremisesInstancesResponse
s {$sel:nextToken:ListOnPremisesInstancesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListOnPremisesInstancesResponse)

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

instance
  Prelude.NFData
    ListOnPremisesInstancesResponse
  where
  rnf :: ListOnPremisesInstancesResponse -> ()
rnf ListOnPremisesInstancesResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
instanceNames :: Maybe [Text]
$sel:httpStatus:ListOnPremisesInstancesResponse' :: ListOnPremisesInstancesResponse -> Int
$sel:nextToken:ListOnPremisesInstancesResponse' :: ListOnPremisesInstancesResponse -> Maybe Text
$sel:instanceNames:ListOnPremisesInstancesResponse' :: ListOnPremisesInstancesResponse -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
instanceNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus