{-# 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.RDS.DescribeInstallationMedia
-- 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)
--
-- Describes the available installation media for a DB engine that requires
-- an on-premises customer provided license, such as Microsoft SQL Server.
--
-- This operation returns paginated results.
module Amazonka.RDS.DescribeInstallationMedia
  ( -- * Creating a Request
    DescribeInstallationMedia (..),
    newDescribeInstallationMedia,

    -- * Request Lenses
    describeInstallationMedia_installationMediaId,
    describeInstallationMedia_filters,
    describeInstallationMedia_marker,
    describeInstallationMedia_maxRecords,

    -- * Destructuring the Response
    DescribeInstallationMediaResponse (..),
    newDescribeInstallationMediaResponse,

    -- * Response Lenses
    describeInstallationMediaResponse_marker,
    describeInstallationMediaResponse_installationMedia,
    describeInstallationMediaResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeInstallationMedia' smart constructor.
data DescribeInstallationMedia = DescribeInstallationMedia'
  { -- | The installation medium ID.
    DescribeInstallationMedia -> Maybe Text
installationMediaId :: Prelude.Maybe Prelude.Text,
    -- | A filter that specifies one or more installation media to describe.
    -- Supported filters include the following:
    --
    -- -   @custom-availability-zone-id@ - Accepts custom Availability Zone
    --     (AZ) identifiers. The results list includes information about only
    --     the custom AZs identified by these identifiers.
    --
    -- -   @engine@ - Accepts database engines. The results list includes
    --     information about only the database engines identified by these
    --     identifiers.
    --
    --     For more information about the valid engines for installation media,
    --     see ImportInstallationMedia.
    DescribeInstallationMedia -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeInstallationMedia -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | An optional pagination token provided by a previous
    -- DescribeInstallationMedia request. If this parameter is specified, the
    -- response includes only records beyond the marker, up to the value
    -- specified by @MaxRecords@.
    DescribeInstallationMedia -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeInstallationMedia -> DescribeInstallationMedia -> Bool
(DescribeInstallationMedia -> DescribeInstallationMedia -> Bool)
-> (DescribeInstallationMedia -> DescribeInstallationMedia -> Bool)
-> Eq DescribeInstallationMedia
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstallationMedia -> DescribeInstallationMedia -> Bool
$c/= :: DescribeInstallationMedia -> DescribeInstallationMedia -> Bool
== :: DescribeInstallationMedia -> DescribeInstallationMedia -> Bool
$c== :: DescribeInstallationMedia -> DescribeInstallationMedia -> Bool
Prelude.Eq, ReadPrec [DescribeInstallationMedia]
ReadPrec DescribeInstallationMedia
Int -> ReadS DescribeInstallationMedia
ReadS [DescribeInstallationMedia]
(Int -> ReadS DescribeInstallationMedia)
-> ReadS [DescribeInstallationMedia]
-> ReadPrec DescribeInstallationMedia
-> ReadPrec [DescribeInstallationMedia]
-> Read DescribeInstallationMedia
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstallationMedia]
$creadListPrec :: ReadPrec [DescribeInstallationMedia]
readPrec :: ReadPrec DescribeInstallationMedia
$creadPrec :: ReadPrec DescribeInstallationMedia
readList :: ReadS [DescribeInstallationMedia]
$creadList :: ReadS [DescribeInstallationMedia]
readsPrec :: Int -> ReadS DescribeInstallationMedia
$creadsPrec :: Int -> ReadS DescribeInstallationMedia
Prelude.Read, Int -> DescribeInstallationMedia -> ShowS
[DescribeInstallationMedia] -> ShowS
DescribeInstallationMedia -> String
(Int -> DescribeInstallationMedia -> ShowS)
-> (DescribeInstallationMedia -> String)
-> ([DescribeInstallationMedia] -> ShowS)
-> Show DescribeInstallationMedia
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstallationMedia] -> ShowS
$cshowList :: [DescribeInstallationMedia] -> ShowS
show :: DescribeInstallationMedia -> String
$cshow :: DescribeInstallationMedia -> String
showsPrec :: Int -> DescribeInstallationMedia -> ShowS
$cshowsPrec :: Int -> DescribeInstallationMedia -> ShowS
Prelude.Show, (forall x.
 DescribeInstallationMedia -> Rep DescribeInstallationMedia x)
-> (forall x.
    Rep DescribeInstallationMedia x -> DescribeInstallationMedia)
-> Generic DescribeInstallationMedia
forall x.
Rep DescribeInstallationMedia x -> DescribeInstallationMedia
forall x.
DescribeInstallationMedia -> Rep DescribeInstallationMedia x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstallationMedia x -> DescribeInstallationMedia
$cfrom :: forall x.
DescribeInstallationMedia -> Rep DescribeInstallationMedia x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstallationMedia' 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:
--
-- 'installationMediaId', 'describeInstallationMedia_installationMediaId' - The installation medium ID.
--
-- 'filters', 'describeInstallationMedia_filters' - A filter that specifies one or more installation media to describe.
-- Supported filters include the following:
--
-- -   @custom-availability-zone-id@ - Accepts custom Availability Zone
--     (AZ) identifiers. The results list includes information about only
--     the custom AZs identified by these identifiers.
--
-- -   @engine@ - Accepts database engines. The results list includes
--     information about only the database engines identified by these
--     identifiers.
--
--     For more information about the valid engines for installation media,
--     see ImportInstallationMedia.
--
-- 'marker', 'describeInstallationMedia_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeInstallationMedia_maxRecords' - An optional pagination token provided by a previous
-- DescribeInstallationMedia request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
newDescribeInstallationMedia ::
  DescribeInstallationMedia
newDescribeInstallationMedia :: DescribeInstallationMedia
newDescribeInstallationMedia =
  DescribeInstallationMedia' :: Maybe Text
-> Maybe [Filter]
-> Maybe Text
-> Maybe Int
-> DescribeInstallationMedia
DescribeInstallationMedia'
    { $sel:installationMediaId:DescribeInstallationMedia' :: Maybe Text
installationMediaId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeInstallationMedia' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeInstallationMedia' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeInstallationMedia' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The installation medium ID.
describeInstallationMedia_installationMediaId :: Lens.Lens' DescribeInstallationMedia (Prelude.Maybe Prelude.Text)
describeInstallationMedia_installationMediaId :: (Maybe Text -> f (Maybe Text))
-> DescribeInstallationMedia -> f DescribeInstallationMedia
describeInstallationMedia_installationMediaId = (DescribeInstallationMedia -> Maybe Text)
-> (DescribeInstallationMedia
    -> Maybe Text -> DescribeInstallationMedia)
-> Lens
     DescribeInstallationMedia
     DescribeInstallationMedia
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstallationMedia' {Maybe Text
installationMediaId :: Maybe Text
$sel:installationMediaId:DescribeInstallationMedia' :: DescribeInstallationMedia -> Maybe Text
installationMediaId} -> Maybe Text
installationMediaId) (\s :: DescribeInstallationMedia
s@DescribeInstallationMedia' {} Maybe Text
a -> DescribeInstallationMedia
s {$sel:installationMediaId:DescribeInstallationMedia' :: Maybe Text
installationMediaId = Maybe Text
a} :: DescribeInstallationMedia)

-- | A filter that specifies one or more installation media to describe.
-- Supported filters include the following:
--
-- -   @custom-availability-zone-id@ - Accepts custom Availability Zone
--     (AZ) identifiers. The results list includes information about only
--     the custom AZs identified by these identifiers.
--
-- -   @engine@ - Accepts database engines. The results list includes
--     information about only the database engines identified by these
--     identifiers.
--
--     For more information about the valid engines for installation media,
--     see ImportInstallationMedia.
describeInstallationMedia_filters :: Lens.Lens' DescribeInstallationMedia (Prelude.Maybe [Filter])
describeInstallationMedia_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeInstallationMedia -> f DescribeInstallationMedia
describeInstallationMedia_filters = (DescribeInstallationMedia -> Maybe [Filter])
-> (DescribeInstallationMedia
    -> Maybe [Filter] -> DescribeInstallationMedia)
-> Lens
     DescribeInstallationMedia
     DescribeInstallationMedia
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstallationMedia' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeInstallationMedia' :: DescribeInstallationMedia -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeInstallationMedia
s@DescribeInstallationMedia' {} Maybe [Filter]
a -> DescribeInstallationMedia
s {$sel:filters:DescribeInstallationMedia' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeInstallationMedia) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeInstallationMedia -> f DescribeInstallationMedia)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeInstallationMedia
-> f DescribeInstallationMedia
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeInstallationMedia_marker :: Lens.Lens' DescribeInstallationMedia (Prelude.Maybe Prelude.Text)
describeInstallationMedia_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeInstallationMedia -> f DescribeInstallationMedia
describeInstallationMedia_marker = (DescribeInstallationMedia -> Maybe Text)
-> (DescribeInstallationMedia
    -> Maybe Text -> DescribeInstallationMedia)
-> Lens
     DescribeInstallationMedia
     DescribeInstallationMedia
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstallationMedia' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeInstallationMedia' :: DescribeInstallationMedia -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeInstallationMedia
s@DescribeInstallationMedia' {} Maybe Text
a -> DescribeInstallationMedia
s {$sel:marker:DescribeInstallationMedia' :: Maybe Text
marker = Maybe Text
a} :: DescribeInstallationMedia)

-- | An optional pagination token provided by a previous
-- DescribeInstallationMedia request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
describeInstallationMedia_maxRecords :: Lens.Lens' DescribeInstallationMedia (Prelude.Maybe Prelude.Int)
describeInstallationMedia_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeInstallationMedia -> f DescribeInstallationMedia
describeInstallationMedia_maxRecords = (DescribeInstallationMedia -> Maybe Int)
-> (DescribeInstallationMedia
    -> Maybe Int -> DescribeInstallationMedia)
-> Lens
     DescribeInstallationMedia
     DescribeInstallationMedia
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstallationMedia' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeInstallationMedia' :: DescribeInstallationMedia -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeInstallationMedia
s@DescribeInstallationMedia' {} Maybe Int
a -> DescribeInstallationMedia
s {$sel:maxRecords:DescribeInstallationMedia' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeInstallationMedia)

instance Core.AWSPager DescribeInstallationMedia where
  page :: DescribeInstallationMedia
-> AWSResponse DescribeInstallationMedia
-> Maybe DescribeInstallationMedia
page DescribeInstallationMedia
rq AWSResponse DescribeInstallationMedia
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstallationMedia
DescribeInstallationMediaResponse
rs
            DescribeInstallationMediaResponse
-> Getting (First Text) DescribeInstallationMediaResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeInstallationMediaResponse
-> Const (First Text) DescribeInstallationMediaResponse
Lens' DescribeInstallationMediaResponse (Maybe Text)
describeInstallationMediaResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeInstallationMediaResponse
 -> Const (First Text) DescribeInstallationMediaResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeInstallationMediaResponse 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 DescribeInstallationMedia
forall a. Maybe a
Prelude.Nothing
    | Maybe [InstallationMedia] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstallationMedia
DescribeInstallationMediaResponse
rs
            DescribeInstallationMediaResponse
-> Getting
     (First [InstallationMedia])
     DescribeInstallationMediaResponse
     [InstallationMedia]
-> Maybe [InstallationMedia]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [InstallationMedia]
 -> Const (First [InstallationMedia]) (Maybe [InstallationMedia]))
-> DescribeInstallationMediaResponse
-> Const
     (First [InstallationMedia]) DescribeInstallationMediaResponse
Lens' DescribeInstallationMediaResponse (Maybe [InstallationMedia])
describeInstallationMediaResponse_installationMedia
              ((Maybe [InstallationMedia]
  -> Const (First [InstallationMedia]) (Maybe [InstallationMedia]))
 -> DescribeInstallationMediaResponse
 -> Const
      (First [InstallationMedia]) DescribeInstallationMediaResponse)
-> (([InstallationMedia]
     -> Const (First [InstallationMedia]) [InstallationMedia])
    -> Maybe [InstallationMedia]
    -> Const (First [InstallationMedia]) (Maybe [InstallationMedia]))
-> Getting
     (First [InstallationMedia])
     DescribeInstallationMediaResponse
     [InstallationMedia]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([InstallationMedia]
 -> Const (First [InstallationMedia]) [InstallationMedia])
-> Maybe [InstallationMedia]
-> Const (First [InstallationMedia]) (Maybe [InstallationMedia])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeInstallationMedia
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeInstallationMedia -> Maybe DescribeInstallationMedia
forall a. a -> Maybe a
Prelude.Just (DescribeInstallationMedia -> Maybe DescribeInstallationMedia)
-> DescribeInstallationMedia -> Maybe DescribeInstallationMedia
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeInstallationMedia
rq
          DescribeInstallationMedia
-> (DescribeInstallationMedia -> DescribeInstallationMedia)
-> DescribeInstallationMedia
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeInstallationMedia -> Identity DescribeInstallationMedia
Lens
  DescribeInstallationMedia
  DescribeInstallationMedia
  (Maybe Text)
  (Maybe Text)
describeInstallationMedia_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeInstallationMedia -> Identity DescribeInstallationMedia)
-> Maybe Text
-> DescribeInstallationMedia
-> DescribeInstallationMedia
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeInstallationMedia
DescribeInstallationMediaResponse
rs
          DescribeInstallationMediaResponse
-> Getting (First Text) DescribeInstallationMediaResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeInstallationMediaResponse
-> Const (First Text) DescribeInstallationMediaResponse
Lens' DescribeInstallationMediaResponse (Maybe Text)
describeInstallationMediaResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeInstallationMediaResponse
 -> Const (First Text) DescribeInstallationMediaResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeInstallationMediaResponse 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 DescribeInstallationMedia where
  type
    AWSResponse DescribeInstallationMedia =
      DescribeInstallationMediaResponse
  request :: DescribeInstallationMedia -> Request DescribeInstallationMedia
request = Service
-> DescribeInstallationMedia -> Request DescribeInstallationMedia
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeInstallationMedia
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstallationMedia)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeInstallationMedia))
-> Logger
-> Service
-> Proxy DescribeInstallationMedia
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstallationMedia)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeInstallationMediaResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [InstallationMedia]
-> Int
-> DescribeInstallationMediaResponse
DescribeInstallationMediaResponse'
            (Maybe Text
 -> Maybe [InstallationMedia]
 -> Int
 -> DescribeInstallationMediaResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [InstallationMedia]
      -> Int -> DescribeInstallationMediaResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
            Either
  String
  (Maybe [InstallationMedia]
   -> Int -> DescribeInstallationMediaResponse)
-> Either String (Maybe [InstallationMedia])
-> Either String (Int -> DescribeInstallationMediaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"InstallationMedia"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [InstallationMedia]))
-> Either String (Maybe [InstallationMedia])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [InstallationMedia])
-> [Node] -> Either String (Maybe [InstallationMedia])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [InstallationMedia]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"InstallationMedia")
                        )
            Either String (Int -> DescribeInstallationMediaResponse)
-> Either String Int
-> Either String DescribeInstallationMediaResponse
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 DescribeInstallationMedia

instance Prelude.NFData DescribeInstallationMedia

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

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

instance Core.ToQuery DescribeInstallationMedia where
  toQuery :: DescribeInstallationMedia -> QueryString
toQuery DescribeInstallationMedia' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
installationMediaId :: Maybe Text
$sel:maxRecords:DescribeInstallationMedia' :: DescribeInstallationMedia -> Maybe Int
$sel:marker:DescribeInstallationMedia' :: DescribeInstallationMedia -> Maybe Text
$sel:filters:DescribeInstallationMedia' :: DescribeInstallationMedia -> Maybe [Filter]
$sel:installationMediaId:DescribeInstallationMedia' :: DescribeInstallationMedia -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeInstallationMedia" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"InstallationMediaId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
installationMediaId,
        ByteString
"Filters"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Filter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Filter" ([Filter] -> QueryString) -> Maybe [Filter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords
      ]

-- | /See:/ 'newDescribeInstallationMediaResponse' smart constructor.
data DescribeInstallationMediaResponse = DescribeInstallationMediaResponse'
  { -- | An optional pagination token provided by a previous
    -- DescribeInstallationMedia request. If this parameter is specified, the
    -- response includes only records beyond the marker, up to the value
    -- specified by @MaxRecords@.
    DescribeInstallationMediaResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The list of InstallationMedia objects for the Amazon Web Services
    -- account.
    DescribeInstallationMediaResponse -> Maybe [InstallationMedia]
installationMedia :: Prelude.Maybe [InstallationMedia],
    -- | The response's http status code.
    DescribeInstallationMediaResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeInstallationMediaResponse
-> DescribeInstallationMediaResponse -> Bool
(DescribeInstallationMediaResponse
 -> DescribeInstallationMediaResponse -> Bool)
-> (DescribeInstallationMediaResponse
    -> DescribeInstallationMediaResponse -> Bool)
-> Eq DescribeInstallationMediaResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstallationMediaResponse
-> DescribeInstallationMediaResponse -> Bool
$c/= :: DescribeInstallationMediaResponse
-> DescribeInstallationMediaResponse -> Bool
== :: DescribeInstallationMediaResponse
-> DescribeInstallationMediaResponse -> Bool
$c== :: DescribeInstallationMediaResponse
-> DescribeInstallationMediaResponse -> Bool
Prelude.Eq, ReadPrec [DescribeInstallationMediaResponse]
ReadPrec DescribeInstallationMediaResponse
Int -> ReadS DescribeInstallationMediaResponse
ReadS [DescribeInstallationMediaResponse]
(Int -> ReadS DescribeInstallationMediaResponse)
-> ReadS [DescribeInstallationMediaResponse]
-> ReadPrec DescribeInstallationMediaResponse
-> ReadPrec [DescribeInstallationMediaResponse]
-> Read DescribeInstallationMediaResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstallationMediaResponse]
$creadListPrec :: ReadPrec [DescribeInstallationMediaResponse]
readPrec :: ReadPrec DescribeInstallationMediaResponse
$creadPrec :: ReadPrec DescribeInstallationMediaResponse
readList :: ReadS [DescribeInstallationMediaResponse]
$creadList :: ReadS [DescribeInstallationMediaResponse]
readsPrec :: Int -> ReadS DescribeInstallationMediaResponse
$creadsPrec :: Int -> ReadS DescribeInstallationMediaResponse
Prelude.Read, Int -> DescribeInstallationMediaResponse -> ShowS
[DescribeInstallationMediaResponse] -> ShowS
DescribeInstallationMediaResponse -> String
(Int -> DescribeInstallationMediaResponse -> ShowS)
-> (DescribeInstallationMediaResponse -> String)
-> ([DescribeInstallationMediaResponse] -> ShowS)
-> Show DescribeInstallationMediaResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstallationMediaResponse] -> ShowS
$cshowList :: [DescribeInstallationMediaResponse] -> ShowS
show :: DescribeInstallationMediaResponse -> String
$cshow :: DescribeInstallationMediaResponse -> String
showsPrec :: Int -> DescribeInstallationMediaResponse -> ShowS
$cshowsPrec :: Int -> DescribeInstallationMediaResponse -> ShowS
Prelude.Show, (forall x.
 DescribeInstallationMediaResponse
 -> Rep DescribeInstallationMediaResponse x)
-> (forall x.
    Rep DescribeInstallationMediaResponse x
    -> DescribeInstallationMediaResponse)
-> Generic DescribeInstallationMediaResponse
forall x.
Rep DescribeInstallationMediaResponse x
-> DescribeInstallationMediaResponse
forall x.
DescribeInstallationMediaResponse
-> Rep DescribeInstallationMediaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstallationMediaResponse x
-> DescribeInstallationMediaResponse
$cfrom :: forall x.
DescribeInstallationMediaResponse
-> Rep DescribeInstallationMediaResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstallationMediaResponse' 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', 'describeInstallationMediaResponse_marker' - An optional pagination token provided by a previous
-- DescribeInstallationMedia request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
--
-- 'installationMedia', 'describeInstallationMediaResponse_installationMedia' - The list of InstallationMedia objects for the Amazon Web Services
-- account.
--
-- 'httpStatus', 'describeInstallationMediaResponse_httpStatus' - The response's http status code.
newDescribeInstallationMediaResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInstallationMediaResponse
newDescribeInstallationMediaResponse :: Int -> DescribeInstallationMediaResponse
newDescribeInstallationMediaResponse Int
pHttpStatus_ =
  DescribeInstallationMediaResponse' :: Maybe Text
-> Maybe [InstallationMedia]
-> Int
-> DescribeInstallationMediaResponse
DescribeInstallationMediaResponse'
    { $sel:marker:DescribeInstallationMediaResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:installationMedia:DescribeInstallationMediaResponse' :: Maybe [InstallationMedia]
installationMedia = Maybe [InstallationMedia]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInstallationMediaResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An optional pagination token provided by a previous
-- DescribeInstallationMedia request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
describeInstallationMediaResponse_marker :: Lens.Lens' DescribeInstallationMediaResponse (Prelude.Maybe Prelude.Text)
describeInstallationMediaResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeInstallationMediaResponse
-> f DescribeInstallationMediaResponse
describeInstallationMediaResponse_marker = (DescribeInstallationMediaResponse -> Maybe Text)
-> (DescribeInstallationMediaResponse
    -> Maybe Text -> DescribeInstallationMediaResponse)
-> Lens' DescribeInstallationMediaResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstallationMediaResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeInstallationMediaResponse' :: DescribeInstallationMediaResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeInstallationMediaResponse
s@DescribeInstallationMediaResponse' {} Maybe Text
a -> DescribeInstallationMediaResponse
s {$sel:marker:DescribeInstallationMediaResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeInstallationMediaResponse)

-- | The list of InstallationMedia objects for the Amazon Web Services
-- account.
describeInstallationMediaResponse_installationMedia :: Lens.Lens' DescribeInstallationMediaResponse (Prelude.Maybe [InstallationMedia])
describeInstallationMediaResponse_installationMedia :: (Maybe [InstallationMedia] -> f (Maybe [InstallationMedia]))
-> DescribeInstallationMediaResponse
-> f DescribeInstallationMediaResponse
describeInstallationMediaResponse_installationMedia = (DescribeInstallationMediaResponse -> Maybe [InstallationMedia])
-> (DescribeInstallationMediaResponse
    -> Maybe [InstallationMedia] -> DescribeInstallationMediaResponse)
-> Lens'
     DescribeInstallationMediaResponse (Maybe [InstallationMedia])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstallationMediaResponse' {Maybe [InstallationMedia]
installationMedia :: Maybe [InstallationMedia]
$sel:installationMedia:DescribeInstallationMediaResponse' :: DescribeInstallationMediaResponse -> Maybe [InstallationMedia]
installationMedia} -> Maybe [InstallationMedia]
installationMedia) (\s :: DescribeInstallationMediaResponse
s@DescribeInstallationMediaResponse' {} Maybe [InstallationMedia]
a -> DescribeInstallationMediaResponse
s {$sel:installationMedia:DescribeInstallationMediaResponse' :: Maybe [InstallationMedia]
installationMedia = Maybe [InstallationMedia]
a} :: DescribeInstallationMediaResponse) ((Maybe [InstallationMedia] -> f (Maybe [InstallationMedia]))
 -> DescribeInstallationMediaResponse
 -> f DescribeInstallationMediaResponse)
-> ((Maybe [InstallationMedia] -> f (Maybe [InstallationMedia]))
    -> Maybe [InstallationMedia] -> f (Maybe [InstallationMedia]))
-> (Maybe [InstallationMedia] -> f (Maybe [InstallationMedia]))
-> DescribeInstallationMediaResponse
-> f DescribeInstallationMediaResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstallationMedia]
  [InstallationMedia]
  [InstallationMedia]
  [InstallationMedia]
-> Iso
     (Maybe [InstallationMedia])
     (Maybe [InstallationMedia])
     (Maybe [InstallationMedia])
     (Maybe [InstallationMedia])
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
  [InstallationMedia]
  [InstallationMedia]
  [InstallationMedia]
  [InstallationMedia]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeInstallationMediaResponse