{-# 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.StorageGateway.DescribeVTLDevices
-- 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)
--
-- Returns a description of virtual tape library (VTL) devices for the
-- specified tape gateway. In the response, Storage Gateway returns VTL
-- device information.
--
-- This operation is only supported in the tape gateway type.
--
-- This operation returns paginated results.
module Amazonka.StorageGateway.DescribeVTLDevices
  ( -- * Creating a Request
    DescribeVTLDevices (..),
    newDescribeVTLDevices,

    -- * Request Lenses
    describeVTLDevices_marker,
    describeVTLDevices_limit,
    describeVTLDevices_vTLDeviceARNs,
    describeVTLDevices_gatewayARN,

    -- * Destructuring the Response
    DescribeVTLDevicesResponse (..),
    newDescribeVTLDevicesResponse,

    -- * Response Lenses
    describeVTLDevicesResponse_vTLDevices,
    describeVTLDevicesResponse_gatewayARN,
    describeVTLDevicesResponse_marker,
    describeVTLDevicesResponse_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.StorageGateway.Types

-- | DescribeVTLDevicesInput
--
-- /See:/ 'newDescribeVTLDevices' smart constructor.
data DescribeVTLDevices = DescribeVTLDevices'
  { -- | An opaque string that indicates the position at which to begin
    -- describing the VTL devices.
    DescribeVTLDevices -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Specifies that the number of VTL devices described be limited to the
    -- specified number.
    DescribeVTLDevices -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | An array of strings, where each string represents the Amazon Resource
    -- Name (ARN) of a VTL device.
    --
    -- All of the specified VTL devices must be from the same gateway. If no
    -- VTL devices are specified, the result will contain all devices on the
    -- specified gateway.
    DescribeVTLDevices -> Maybe [Text]
vTLDeviceARNs :: Prelude.Maybe [Prelude.Text],
    DescribeVTLDevices -> Text
gatewayARN :: Prelude.Text
  }
  deriving (DescribeVTLDevices -> DescribeVTLDevices -> Bool
(DescribeVTLDevices -> DescribeVTLDevices -> Bool)
-> (DescribeVTLDevices -> DescribeVTLDevices -> Bool)
-> Eq DescribeVTLDevices
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVTLDevices -> DescribeVTLDevices -> Bool
$c/= :: DescribeVTLDevices -> DescribeVTLDevices -> Bool
== :: DescribeVTLDevices -> DescribeVTLDevices -> Bool
$c== :: DescribeVTLDevices -> DescribeVTLDevices -> Bool
Prelude.Eq, ReadPrec [DescribeVTLDevices]
ReadPrec DescribeVTLDevices
Int -> ReadS DescribeVTLDevices
ReadS [DescribeVTLDevices]
(Int -> ReadS DescribeVTLDevices)
-> ReadS [DescribeVTLDevices]
-> ReadPrec DescribeVTLDevices
-> ReadPrec [DescribeVTLDevices]
-> Read DescribeVTLDevices
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVTLDevices]
$creadListPrec :: ReadPrec [DescribeVTLDevices]
readPrec :: ReadPrec DescribeVTLDevices
$creadPrec :: ReadPrec DescribeVTLDevices
readList :: ReadS [DescribeVTLDevices]
$creadList :: ReadS [DescribeVTLDevices]
readsPrec :: Int -> ReadS DescribeVTLDevices
$creadsPrec :: Int -> ReadS DescribeVTLDevices
Prelude.Read, Int -> DescribeVTLDevices -> ShowS
[DescribeVTLDevices] -> ShowS
DescribeVTLDevices -> String
(Int -> DescribeVTLDevices -> ShowS)
-> (DescribeVTLDevices -> String)
-> ([DescribeVTLDevices] -> ShowS)
-> Show DescribeVTLDevices
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVTLDevices] -> ShowS
$cshowList :: [DescribeVTLDevices] -> ShowS
show :: DescribeVTLDevices -> String
$cshow :: DescribeVTLDevices -> String
showsPrec :: Int -> DescribeVTLDevices -> ShowS
$cshowsPrec :: Int -> DescribeVTLDevices -> ShowS
Prelude.Show, (forall x. DescribeVTLDevices -> Rep DescribeVTLDevices x)
-> (forall x. Rep DescribeVTLDevices x -> DescribeVTLDevices)
-> Generic DescribeVTLDevices
forall x. Rep DescribeVTLDevices x -> DescribeVTLDevices
forall x. DescribeVTLDevices -> Rep DescribeVTLDevices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVTLDevices x -> DescribeVTLDevices
$cfrom :: forall x. DescribeVTLDevices -> Rep DescribeVTLDevices x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVTLDevices' 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:
--
-- 'marker', 'describeVTLDevices_marker' - An opaque string that indicates the position at which to begin
-- describing the VTL devices.
--
-- 'limit', 'describeVTLDevices_limit' - Specifies that the number of VTL devices described be limited to the
-- specified number.
--
-- 'vTLDeviceARNs', 'describeVTLDevices_vTLDeviceARNs' - An array of strings, where each string represents the Amazon Resource
-- Name (ARN) of a VTL device.
--
-- All of the specified VTL devices must be from the same gateway. If no
-- VTL devices are specified, the result will contain all devices on the
-- specified gateway.
--
-- 'gatewayARN', 'describeVTLDevices_gatewayARN' - Undocumented member.
newDescribeVTLDevices ::
  -- | 'gatewayARN'
  Prelude.Text ->
  DescribeVTLDevices
newDescribeVTLDevices :: Text -> DescribeVTLDevices
newDescribeVTLDevices Text
pGatewayARN_ =
  DescribeVTLDevices' :: Maybe Text
-> Maybe Natural -> Maybe [Text] -> Text -> DescribeVTLDevices
DescribeVTLDevices'
    { $sel:marker:DescribeVTLDevices' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeVTLDevices' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDeviceARNs:DescribeVTLDevices' :: Maybe [Text]
vTLDeviceARNs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayARN:DescribeVTLDevices' :: Text
gatewayARN = Text
pGatewayARN_
    }

-- | An opaque string that indicates the position at which to begin
-- describing the VTL devices.
describeVTLDevices_marker :: Lens.Lens' DescribeVTLDevices (Prelude.Maybe Prelude.Text)
describeVTLDevices_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeVTLDevices -> f DescribeVTLDevices
describeVTLDevices_marker = (DescribeVTLDevices -> Maybe Text)
-> (DescribeVTLDevices -> Maybe Text -> DescribeVTLDevices)
-> Lens
     DescribeVTLDevices DescribeVTLDevices (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVTLDevices' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeVTLDevices' :: DescribeVTLDevices -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeVTLDevices
s@DescribeVTLDevices' {} Maybe Text
a -> DescribeVTLDevices
s {$sel:marker:DescribeVTLDevices' :: Maybe Text
marker = Maybe Text
a} :: DescribeVTLDevices)

-- | Specifies that the number of VTL devices described be limited to the
-- specified number.
describeVTLDevices_limit :: Lens.Lens' DescribeVTLDevices (Prelude.Maybe Prelude.Natural)
describeVTLDevices_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeVTLDevices -> f DescribeVTLDevices
describeVTLDevices_limit = (DescribeVTLDevices -> Maybe Natural)
-> (DescribeVTLDevices -> Maybe Natural -> DescribeVTLDevices)
-> Lens
     DescribeVTLDevices
     DescribeVTLDevices
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVTLDevices' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeVTLDevices' :: DescribeVTLDevices -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeVTLDevices
s@DescribeVTLDevices' {} Maybe Natural
a -> DescribeVTLDevices
s {$sel:limit:DescribeVTLDevices' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeVTLDevices)

-- | An array of strings, where each string represents the Amazon Resource
-- Name (ARN) of a VTL device.
--
-- All of the specified VTL devices must be from the same gateway. If no
-- VTL devices are specified, the result will contain all devices on the
-- specified gateway.
describeVTLDevices_vTLDeviceARNs :: Lens.Lens' DescribeVTLDevices (Prelude.Maybe [Prelude.Text])
describeVTLDevices_vTLDeviceARNs :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeVTLDevices -> f DescribeVTLDevices
describeVTLDevices_vTLDeviceARNs = (DescribeVTLDevices -> Maybe [Text])
-> (DescribeVTLDevices -> Maybe [Text] -> DescribeVTLDevices)
-> Lens
     DescribeVTLDevices DescribeVTLDevices (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVTLDevices' {Maybe [Text]
vTLDeviceARNs :: Maybe [Text]
$sel:vTLDeviceARNs:DescribeVTLDevices' :: DescribeVTLDevices -> Maybe [Text]
vTLDeviceARNs} -> Maybe [Text]
vTLDeviceARNs) (\s :: DescribeVTLDevices
s@DescribeVTLDevices' {} Maybe [Text]
a -> DescribeVTLDevices
s {$sel:vTLDeviceARNs:DescribeVTLDevices' :: Maybe [Text]
vTLDeviceARNs = Maybe [Text]
a} :: DescribeVTLDevices) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeVTLDevices -> f DescribeVTLDevices)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeVTLDevices
-> f DescribeVTLDevices
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
describeVTLDevices_gatewayARN :: Lens.Lens' DescribeVTLDevices Prelude.Text
describeVTLDevices_gatewayARN :: (Text -> f Text) -> DescribeVTLDevices -> f DescribeVTLDevices
describeVTLDevices_gatewayARN = (DescribeVTLDevices -> Text)
-> (DescribeVTLDevices -> Text -> DescribeVTLDevices)
-> Lens DescribeVTLDevices DescribeVTLDevices Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVTLDevices' {Text
gatewayARN :: Text
$sel:gatewayARN:DescribeVTLDevices' :: DescribeVTLDevices -> Text
gatewayARN} -> Text
gatewayARN) (\s :: DescribeVTLDevices
s@DescribeVTLDevices' {} Text
a -> DescribeVTLDevices
s {$sel:gatewayARN:DescribeVTLDevices' :: Text
gatewayARN = Text
a} :: DescribeVTLDevices)

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

instance Prelude.NFData DescribeVTLDevices

instance Core.ToHeaders DescribeVTLDevices where
  toHeaders :: DescribeVTLDevices -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeVTLDevices -> 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
"StorageGateway_20130630.DescribeVTLDevices" ::
                          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 DescribeVTLDevices where
  toJSON :: DescribeVTLDevices -> Value
toJSON DescribeVTLDevices' {Maybe Natural
Maybe [Text]
Maybe Text
Text
gatewayARN :: Text
vTLDeviceARNs :: Maybe [Text]
limit :: Maybe Natural
marker :: Maybe Text
$sel:gatewayARN:DescribeVTLDevices' :: DescribeVTLDevices -> Text
$sel:vTLDeviceARNs:DescribeVTLDevices' :: DescribeVTLDevices -> Maybe [Text]
$sel:limit:DescribeVTLDevices' :: DescribeVTLDevices -> Maybe Natural
$sel:marker:DescribeVTLDevices' :: DescribeVTLDevices -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Marker" 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
marker,
            (Text
"Limit" 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
limit,
            (Text
"VTLDeviceARNs" 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]
vTLDeviceARNs,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GatewayARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayARN)
          ]
      )

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

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

-- | DescribeVTLDevicesOutput
--
-- /See:/ 'newDescribeVTLDevicesResponse' smart constructor.
data DescribeVTLDevicesResponse = DescribeVTLDevicesResponse'
  { -- | An array of VTL device objects composed of the Amazon Resource Name
    -- (ARN) of the VTL devices.
    DescribeVTLDevicesResponse -> Maybe [VTLDevice]
vTLDevices :: Prelude.Maybe [VTLDevice],
    DescribeVTLDevicesResponse -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | An opaque string that indicates the position at which the VTL devices
    -- that were fetched for description ended. Use the marker in your next
    -- request to fetch the next set of VTL devices in the list. If there are
    -- no more VTL devices to describe, this field does not appear in the
    -- response.
    DescribeVTLDevicesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeVTLDevicesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeVTLDevicesResponse -> DescribeVTLDevicesResponse -> Bool
(DescribeVTLDevicesResponse -> DescribeVTLDevicesResponse -> Bool)
-> (DescribeVTLDevicesResponse
    -> DescribeVTLDevicesResponse -> Bool)
-> Eq DescribeVTLDevicesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVTLDevicesResponse -> DescribeVTLDevicesResponse -> Bool
$c/= :: DescribeVTLDevicesResponse -> DescribeVTLDevicesResponse -> Bool
== :: DescribeVTLDevicesResponse -> DescribeVTLDevicesResponse -> Bool
$c== :: DescribeVTLDevicesResponse -> DescribeVTLDevicesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeVTLDevicesResponse]
ReadPrec DescribeVTLDevicesResponse
Int -> ReadS DescribeVTLDevicesResponse
ReadS [DescribeVTLDevicesResponse]
(Int -> ReadS DescribeVTLDevicesResponse)
-> ReadS [DescribeVTLDevicesResponse]
-> ReadPrec DescribeVTLDevicesResponse
-> ReadPrec [DescribeVTLDevicesResponse]
-> Read DescribeVTLDevicesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVTLDevicesResponse]
$creadListPrec :: ReadPrec [DescribeVTLDevicesResponse]
readPrec :: ReadPrec DescribeVTLDevicesResponse
$creadPrec :: ReadPrec DescribeVTLDevicesResponse
readList :: ReadS [DescribeVTLDevicesResponse]
$creadList :: ReadS [DescribeVTLDevicesResponse]
readsPrec :: Int -> ReadS DescribeVTLDevicesResponse
$creadsPrec :: Int -> ReadS DescribeVTLDevicesResponse
Prelude.Read, Int -> DescribeVTLDevicesResponse -> ShowS
[DescribeVTLDevicesResponse] -> ShowS
DescribeVTLDevicesResponse -> String
(Int -> DescribeVTLDevicesResponse -> ShowS)
-> (DescribeVTLDevicesResponse -> String)
-> ([DescribeVTLDevicesResponse] -> ShowS)
-> Show DescribeVTLDevicesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVTLDevicesResponse] -> ShowS
$cshowList :: [DescribeVTLDevicesResponse] -> ShowS
show :: DescribeVTLDevicesResponse -> String
$cshow :: DescribeVTLDevicesResponse -> String
showsPrec :: Int -> DescribeVTLDevicesResponse -> ShowS
$cshowsPrec :: Int -> DescribeVTLDevicesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeVTLDevicesResponse -> Rep DescribeVTLDevicesResponse x)
-> (forall x.
    Rep DescribeVTLDevicesResponse x -> DescribeVTLDevicesResponse)
-> Generic DescribeVTLDevicesResponse
forall x.
Rep DescribeVTLDevicesResponse x -> DescribeVTLDevicesResponse
forall x.
DescribeVTLDevicesResponse -> Rep DescribeVTLDevicesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVTLDevicesResponse x -> DescribeVTLDevicesResponse
$cfrom :: forall x.
DescribeVTLDevicesResponse -> Rep DescribeVTLDevicesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVTLDevicesResponse' 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:
--
-- 'vTLDevices', 'describeVTLDevicesResponse_vTLDevices' - An array of VTL device objects composed of the Amazon Resource Name
-- (ARN) of the VTL devices.
--
-- 'gatewayARN', 'describeVTLDevicesResponse_gatewayARN' - Undocumented member.
--
-- 'marker', 'describeVTLDevicesResponse_marker' - An opaque string that indicates the position at which the VTL devices
-- that were fetched for description ended. Use the marker in your next
-- request to fetch the next set of VTL devices in the list. If there are
-- no more VTL devices to describe, this field does not appear in the
-- response.
--
-- 'httpStatus', 'describeVTLDevicesResponse_httpStatus' - The response's http status code.
newDescribeVTLDevicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeVTLDevicesResponse
newDescribeVTLDevicesResponse :: Int -> DescribeVTLDevicesResponse
newDescribeVTLDevicesResponse Int
pHttpStatus_ =
  DescribeVTLDevicesResponse' :: Maybe [VTLDevice]
-> Maybe Text -> Maybe Text -> Int -> DescribeVTLDevicesResponse
DescribeVTLDevicesResponse'
    { $sel:vTLDevices:DescribeVTLDevicesResponse' :: Maybe [VTLDevice]
vTLDevices =
        Maybe [VTLDevice]
forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayARN:DescribeVTLDevicesResponse' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeVTLDevicesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeVTLDevicesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of VTL device objects composed of the Amazon Resource Name
-- (ARN) of the VTL devices.
describeVTLDevicesResponse_vTLDevices :: Lens.Lens' DescribeVTLDevicesResponse (Prelude.Maybe [VTLDevice])
describeVTLDevicesResponse_vTLDevices :: (Maybe [VTLDevice] -> f (Maybe [VTLDevice]))
-> DescribeVTLDevicesResponse -> f DescribeVTLDevicesResponse
describeVTLDevicesResponse_vTLDevices = (DescribeVTLDevicesResponse -> Maybe [VTLDevice])
-> (DescribeVTLDevicesResponse
    -> Maybe [VTLDevice] -> DescribeVTLDevicesResponse)
-> Lens' DescribeVTLDevicesResponse (Maybe [VTLDevice])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVTLDevicesResponse' {Maybe [VTLDevice]
vTLDevices :: Maybe [VTLDevice]
$sel:vTLDevices:DescribeVTLDevicesResponse' :: DescribeVTLDevicesResponse -> Maybe [VTLDevice]
vTLDevices} -> Maybe [VTLDevice]
vTLDevices) (\s :: DescribeVTLDevicesResponse
s@DescribeVTLDevicesResponse' {} Maybe [VTLDevice]
a -> DescribeVTLDevicesResponse
s {$sel:vTLDevices:DescribeVTLDevicesResponse' :: Maybe [VTLDevice]
vTLDevices = Maybe [VTLDevice]
a} :: DescribeVTLDevicesResponse) ((Maybe [VTLDevice] -> f (Maybe [VTLDevice]))
 -> DescribeVTLDevicesResponse -> f DescribeVTLDevicesResponse)
-> ((Maybe [VTLDevice] -> f (Maybe [VTLDevice]))
    -> Maybe [VTLDevice] -> f (Maybe [VTLDevice]))
-> (Maybe [VTLDevice] -> f (Maybe [VTLDevice]))
-> DescribeVTLDevicesResponse
-> f DescribeVTLDevicesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [VTLDevice] [VTLDevice] [VTLDevice] [VTLDevice]
-> Iso
     (Maybe [VTLDevice])
     (Maybe [VTLDevice])
     (Maybe [VTLDevice])
     (Maybe [VTLDevice])
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 [VTLDevice] [VTLDevice] [VTLDevice] [VTLDevice]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
describeVTLDevicesResponse_gatewayARN :: Lens.Lens' DescribeVTLDevicesResponse (Prelude.Maybe Prelude.Text)
describeVTLDevicesResponse_gatewayARN :: (Maybe Text -> f (Maybe Text))
-> DescribeVTLDevicesResponse -> f DescribeVTLDevicesResponse
describeVTLDevicesResponse_gatewayARN = (DescribeVTLDevicesResponse -> Maybe Text)
-> (DescribeVTLDevicesResponse
    -> Maybe Text -> DescribeVTLDevicesResponse)
-> Lens' DescribeVTLDevicesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVTLDevicesResponse' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:DescribeVTLDevicesResponse' :: DescribeVTLDevicesResponse -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: DescribeVTLDevicesResponse
s@DescribeVTLDevicesResponse' {} Maybe Text
a -> DescribeVTLDevicesResponse
s {$sel:gatewayARN:DescribeVTLDevicesResponse' :: Maybe Text
gatewayARN = Maybe Text
a} :: DescribeVTLDevicesResponse)

-- | An opaque string that indicates the position at which the VTL devices
-- that were fetched for description ended. Use the marker in your next
-- request to fetch the next set of VTL devices in the list. If there are
-- no more VTL devices to describe, this field does not appear in the
-- response.
describeVTLDevicesResponse_marker :: Lens.Lens' DescribeVTLDevicesResponse (Prelude.Maybe Prelude.Text)
describeVTLDevicesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeVTLDevicesResponse -> f DescribeVTLDevicesResponse
describeVTLDevicesResponse_marker = (DescribeVTLDevicesResponse -> Maybe Text)
-> (DescribeVTLDevicesResponse
    -> Maybe Text -> DescribeVTLDevicesResponse)
-> Lens' DescribeVTLDevicesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVTLDevicesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeVTLDevicesResponse' :: DescribeVTLDevicesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeVTLDevicesResponse
s@DescribeVTLDevicesResponse' {} Maybe Text
a -> DescribeVTLDevicesResponse
s {$sel:marker:DescribeVTLDevicesResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeVTLDevicesResponse)

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

instance Prelude.NFData DescribeVTLDevicesResponse