{-# 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.DescribeBlueGreenDeployments
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about blue\/green deployments.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments.html Using Amazon RDS Blue\/Green Deployments for database updates>
-- in the /Amazon RDS User Guide/ and
-- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html Using Amazon RDS Blue\/Green Deployments for database updates>
-- in the /Amazon Aurora User Guide/.
--
-- This operation returns paginated results.
module Amazonka.RDS.DescribeBlueGreenDeployments
  ( -- * Creating a Request
    DescribeBlueGreenDeployments (..),
    newDescribeBlueGreenDeployments,

    -- * Request Lenses
    describeBlueGreenDeployments_blueGreenDeploymentIdentifier,
    describeBlueGreenDeployments_filters,
    describeBlueGreenDeployments_marker,
    describeBlueGreenDeployments_maxRecords,

    -- * Destructuring the Response
    DescribeBlueGreenDeploymentsResponse (..),
    newDescribeBlueGreenDeploymentsResponse,

    -- * Response Lenses
    describeBlueGreenDeploymentsResponse_blueGreenDeployments,
    describeBlueGreenDeploymentsResponse_marker,
    describeBlueGreenDeploymentsResponse_httpStatus,
  )
where

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 Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeBlueGreenDeployments' smart constructor.
data DescribeBlueGreenDeployments = DescribeBlueGreenDeployments'
  { -- | The blue\/green deployment identifier. If this parameter is specified,
    -- information from only the specific blue\/green deployment is returned.
    -- This parameter isn\'t case-sensitive.
    --
    -- Constraints:
    --
    -- -   If supplied, must match an existing blue\/green deployment
    --     identifier.
    DescribeBlueGreenDeployments -> Maybe Text
blueGreenDeploymentIdentifier :: Prelude.Maybe Prelude.Text,
    -- | A filter that specifies one or more blue\/green deployments to describe.
    --
    -- Supported filters:
    --
    -- -   @blue-green-deployment-identifier@ - Accepts system-generated
    --     identifiers for blue\/green deployments. The results list only
    --     includes information about the blue\/green deployments with the
    --     specified identifiers.
    --
    -- -   @blue-green-deployment-name@ - Accepts user-supplied names for
    --     blue\/green deployments. The results list only includes information
    --     about the blue\/green deployments with the specified names.
    --
    -- -   @source@ - Accepts source databases for a blue\/green deployment.
    --     The results list only includes information about the blue\/green
    --     deployments with the specified source databases.
    --
    -- -   @target@ - Accepts target databases for a blue\/green deployment.
    --     The results list only includes information about the blue\/green
    --     deployments with the specified target databases.
    DescribeBlueGreenDeployments -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous
    -- @DescribeBlueGreenDeployments@ request. If this parameter is specified,
    -- the response includes only records beyond the marker, up to the value
    -- specified by @MaxRecords@.
    DescribeBlueGreenDeployments -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a pagination token
    -- called a marker is included in the response so you can retrieve the
    -- remaining results.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 100.
    DescribeBlueGreenDeployments -> Maybe Natural
maxRecords :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeBlueGreenDeployments
-> DescribeBlueGreenDeployments -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBlueGreenDeployments
-> DescribeBlueGreenDeployments -> Bool
$c/= :: DescribeBlueGreenDeployments
-> DescribeBlueGreenDeployments -> Bool
== :: DescribeBlueGreenDeployments
-> DescribeBlueGreenDeployments -> Bool
$c== :: DescribeBlueGreenDeployments
-> DescribeBlueGreenDeployments -> Bool
Prelude.Eq, ReadPrec [DescribeBlueGreenDeployments]
ReadPrec DescribeBlueGreenDeployments
Int -> ReadS DescribeBlueGreenDeployments
ReadS [DescribeBlueGreenDeployments]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBlueGreenDeployments]
$creadListPrec :: ReadPrec [DescribeBlueGreenDeployments]
readPrec :: ReadPrec DescribeBlueGreenDeployments
$creadPrec :: ReadPrec DescribeBlueGreenDeployments
readList :: ReadS [DescribeBlueGreenDeployments]
$creadList :: ReadS [DescribeBlueGreenDeployments]
readsPrec :: Int -> ReadS DescribeBlueGreenDeployments
$creadsPrec :: Int -> ReadS DescribeBlueGreenDeployments
Prelude.Read, Int -> DescribeBlueGreenDeployments -> ShowS
[DescribeBlueGreenDeployments] -> ShowS
DescribeBlueGreenDeployments -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBlueGreenDeployments] -> ShowS
$cshowList :: [DescribeBlueGreenDeployments] -> ShowS
show :: DescribeBlueGreenDeployments -> String
$cshow :: DescribeBlueGreenDeployments -> String
showsPrec :: Int -> DescribeBlueGreenDeployments -> ShowS
$cshowsPrec :: Int -> DescribeBlueGreenDeployments -> ShowS
Prelude.Show, forall x.
Rep DescribeBlueGreenDeployments x -> DescribeBlueGreenDeployments
forall x.
DescribeBlueGreenDeployments -> Rep DescribeBlueGreenDeployments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeBlueGreenDeployments x -> DescribeBlueGreenDeployments
$cfrom :: forall x.
DescribeBlueGreenDeployments -> Rep DescribeBlueGreenDeployments x
Prelude.Generic)

-- |
-- Create a value of 'DescribeBlueGreenDeployments' 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:
--
-- 'blueGreenDeploymentIdentifier', 'describeBlueGreenDeployments_blueGreenDeploymentIdentifier' - The blue\/green deployment identifier. If this parameter is specified,
-- information from only the specific blue\/green deployment is returned.
-- This parameter isn\'t case-sensitive.
--
-- Constraints:
--
-- -   If supplied, must match an existing blue\/green deployment
--     identifier.
--
-- 'filters', 'describeBlueGreenDeployments_filters' - A filter that specifies one or more blue\/green deployments to describe.
--
-- Supported filters:
--
-- -   @blue-green-deployment-identifier@ - Accepts system-generated
--     identifiers for blue\/green deployments. The results list only
--     includes information about the blue\/green deployments with the
--     specified identifiers.
--
-- -   @blue-green-deployment-name@ - Accepts user-supplied names for
--     blue\/green deployments. The results list only includes information
--     about the blue\/green deployments with the specified names.
--
-- -   @source@ - Accepts source databases for a blue\/green deployment.
--     The results list only includes information about the blue\/green
--     deployments with the specified source databases.
--
-- -   @target@ - Accepts target databases for a blue\/green deployment.
--     The results list only includes information about the blue\/green
--     deployments with the specified target databases.
--
-- 'marker', 'describeBlueGreenDeployments_marker' - An optional pagination token provided by a previous
-- @DescribeBlueGreenDeployments@ request. If this parameter is specified,
-- the response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
--
-- 'maxRecords', 'describeBlueGreenDeployments_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so you can retrieve the
-- remaining results.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
newDescribeBlueGreenDeployments ::
  DescribeBlueGreenDeployments
newDescribeBlueGreenDeployments :: DescribeBlueGreenDeployments
newDescribeBlueGreenDeployments =
  DescribeBlueGreenDeployments'
    { $sel:blueGreenDeploymentIdentifier:DescribeBlueGreenDeployments' :: Maybe Text
blueGreenDeploymentIdentifier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeBlueGreenDeployments' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeBlueGreenDeployments' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeBlueGreenDeployments' :: Maybe Natural
maxRecords = forall a. Maybe a
Prelude.Nothing
    }

-- | The blue\/green deployment identifier. If this parameter is specified,
-- information from only the specific blue\/green deployment is returned.
-- This parameter isn\'t case-sensitive.
--
-- Constraints:
--
-- -   If supplied, must match an existing blue\/green deployment
--     identifier.
describeBlueGreenDeployments_blueGreenDeploymentIdentifier :: Lens.Lens' DescribeBlueGreenDeployments (Prelude.Maybe Prelude.Text)
describeBlueGreenDeployments_blueGreenDeploymentIdentifier :: Lens' DescribeBlueGreenDeployments (Maybe Text)
describeBlueGreenDeployments_blueGreenDeploymentIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBlueGreenDeployments' {Maybe Text
blueGreenDeploymentIdentifier :: Maybe Text
$sel:blueGreenDeploymentIdentifier:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe Text
blueGreenDeploymentIdentifier} -> Maybe Text
blueGreenDeploymentIdentifier) (\s :: DescribeBlueGreenDeployments
s@DescribeBlueGreenDeployments' {} Maybe Text
a -> DescribeBlueGreenDeployments
s {$sel:blueGreenDeploymentIdentifier:DescribeBlueGreenDeployments' :: Maybe Text
blueGreenDeploymentIdentifier = Maybe Text
a} :: DescribeBlueGreenDeployments)

-- | A filter that specifies one or more blue\/green deployments to describe.
--
-- Supported filters:
--
-- -   @blue-green-deployment-identifier@ - Accepts system-generated
--     identifiers for blue\/green deployments. The results list only
--     includes information about the blue\/green deployments with the
--     specified identifiers.
--
-- -   @blue-green-deployment-name@ - Accepts user-supplied names for
--     blue\/green deployments. The results list only includes information
--     about the blue\/green deployments with the specified names.
--
-- -   @source@ - Accepts source databases for a blue\/green deployment.
--     The results list only includes information about the blue\/green
--     deployments with the specified source databases.
--
-- -   @target@ - Accepts target databases for a blue\/green deployment.
--     The results list only includes information about the blue\/green
--     deployments with the specified target databases.
describeBlueGreenDeployments_filters :: Lens.Lens' DescribeBlueGreenDeployments (Prelude.Maybe [Filter])
describeBlueGreenDeployments_filters :: Lens' DescribeBlueGreenDeployments (Maybe [Filter])
describeBlueGreenDeployments_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBlueGreenDeployments' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeBlueGreenDeployments
s@DescribeBlueGreenDeployments' {} Maybe [Filter]
a -> DescribeBlueGreenDeployments
s {$sel:filters:DescribeBlueGreenDeployments' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeBlueGreenDeployments) 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

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

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so you can retrieve the
-- remaining results.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
describeBlueGreenDeployments_maxRecords :: Lens.Lens' DescribeBlueGreenDeployments (Prelude.Maybe Prelude.Natural)
describeBlueGreenDeployments_maxRecords :: Lens' DescribeBlueGreenDeployments (Maybe Natural)
describeBlueGreenDeployments_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBlueGreenDeployments' {Maybe Natural
maxRecords :: Maybe Natural
$sel:maxRecords:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe Natural
maxRecords} -> Maybe Natural
maxRecords) (\s :: DescribeBlueGreenDeployments
s@DescribeBlueGreenDeployments' {} Maybe Natural
a -> DescribeBlueGreenDeployments
s {$sel:maxRecords:DescribeBlueGreenDeployments' :: Maybe Natural
maxRecords = Maybe Natural
a} :: DescribeBlueGreenDeployments)

instance Core.AWSPager DescribeBlueGreenDeployments where
  page :: DescribeBlueGreenDeployments
-> AWSResponse DescribeBlueGreenDeployments
-> Maybe DescribeBlueGreenDeployments
page DescribeBlueGreenDeployments
rq AWSResponse DescribeBlueGreenDeployments
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeBlueGreenDeployments
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeBlueGreenDeploymentsResponse (Maybe Text)
describeBlueGreenDeploymentsResponse_marker
            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 DescribeBlueGreenDeployments
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeBlueGreenDeploymentsResponse (Maybe [BlueGreenDeployment])
describeBlueGreenDeploymentsResponse_blueGreenDeployments
            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.$ DescribeBlueGreenDeployments
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeBlueGreenDeployments (Maybe Text)
describeBlueGreenDeployments_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeBlueGreenDeployments
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeBlueGreenDeploymentsResponse (Maybe Text)
describeBlueGreenDeploymentsResponse_marker
          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 DescribeBlueGreenDeployments where
  type
    AWSResponse DescribeBlueGreenDeployments =
      DescribeBlueGreenDeploymentsResponse
  request :: (Service -> Service)
-> DescribeBlueGreenDeployments
-> Request DescribeBlueGreenDeployments
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeBlueGreenDeployments
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeBlueGreenDeployments)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeBlueGreenDeploymentsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [BlueGreenDeployment]
-> Maybe Text -> Int -> DescribeBlueGreenDeploymentsResponse
DescribeBlueGreenDeploymentsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"BlueGreenDeployments"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            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
    DescribeBlueGreenDeployments
  where
  hashWithSalt :: Int -> DescribeBlueGreenDeployments -> Int
hashWithSalt Int
_salt DescribeBlueGreenDeployments' {Maybe Natural
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Natural
marker :: Maybe Text
filters :: Maybe [Filter]
blueGreenDeploymentIdentifier :: Maybe Text
$sel:maxRecords:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe Natural
$sel:marker:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe Text
$sel:filters:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe [Filter]
$sel:blueGreenDeploymentIdentifier:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
blueGreenDeploymentIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxRecords

instance Prelude.NFData DescribeBlueGreenDeployments where
  rnf :: DescribeBlueGreenDeployments -> ()
rnf DescribeBlueGreenDeployments' {Maybe Natural
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Natural
marker :: Maybe Text
filters :: Maybe [Filter]
blueGreenDeploymentIdentifier :: Maybe Text
$sel:maxRecords:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe Natural
$sel:marker:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe Text
$sel:filters:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe [Filter]
$sel:blueGreenDeploymentIdentifier:DescribeBlueGreenDeployments' :: DescribeBlueGreenDeployments -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
blueGreenDeploymentIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxRecords

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

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

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

-- | /See:/ 'newDescribeBlueGreenDeploymentsResponse' smart constructor.
data DescribeBlueGreenDeploymentsResponse = DescribeBlueGreenDeploymentsResponse'
  { -- | Contains a list of blue\/green deployments for the user.
    DescribeBlueGreenDeploymentsResponse -> Maybe [BlueGreenDeployment]
blueGreenDeployments :: Prelude.Maybe [BlueGreenDeployment],
    -- | A pagination token that can be used in a later
    -- DescribeBlueGreenDeployments request.
    DescribeBlueGreenDeploymentsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeBlueGreenDeploymentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeBlueGreenDeploymentsResponse
-> DescribeBlueGreenDeploymentsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBlueGreenDeploymentsResponse
-> DescribeBlueGreenDeploymentsResponse -> Bool
$c/= :: DescribeBlueGreenDeploymentsResponse
-> DescribeBlueGreenDeploymentsResponse -> Bool
== :: DescribeBlueGreenDeploymentsResponse
-> DescribeBlueGreenDeploymentsResponse -> Bool
$c== :: DescribeBlueGreenDeploymentsResponse
-> DescribeBlueGreenDeploymentsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeBlueGreenDeploymentsResponse]
ReadPrec DescribeBlueGreenDeploymentsResponse
Int -> ReadS DescribeBlueGreenDeploymentsResponse
ReadS [DescribeBlueGreenDeploymentsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBlueGreenDeploymentsResponse]
$creadListPrec :: ReadPrec [DescribeBlueGreenDeploymentsResponse]
readPrec :: ReadPrec DescribeBlueGreenDeploymentsResponse
$creadPrec :: ReadPrec DescribeBlueGreenDeploymentsResponse
readList :: ReadS [DescribeBlueGreenDeploymentsResponse]
$creadList :: ReadS [DescribeBlueGreenDeploymentsResponse]
readsPrec :: Int -> ReadS DescribeBlueGreenDeploymentsResponse
$creadsPrec :: Int -> ReadS DescribeBlueGreenDeploymentsResponse
Prelude.Read, Int -> DescribeBlueGreenDeploymentsResponse -> ShowS
[DescribeBlueGreenDeploymentsResponse] -> ShowS
DescribeBlueGreenDeploymentsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBlueGreenDeploymentsResponse] -> ShowS
$cshowList :: [DescribeBlueGreenDeploymentsResponse] -> ShowS
show :: DescribeBlueGreenDeploymentsResponse -> String
$cshow :: DescribeBlueGreenDeploymentsResponse -> String
showsPrec :: Int -> DescribeBlueGreenDeploymentsResponse -> ShowS
$cshowsPrec :: Int -> DescribeBlueGreenDeploymentsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeBlueGreenDeploymentsResponse x
-> DescribeBlueGreenDeploymentsResponse
forall x.
DescribeBlueGreenDeploymentsResponse
-> Rep DescribeBlueGreenDeploymentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeBlueGreenDeploymentsResponse x
-> DescribeBlueGreenDeploymentsResponse
$cfrom :: forall x.
DescribeBlueGreenDeploymentsResponse
-> Rep DescribeBlueGreenDeploymentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeBlueGreenDeploymentsResponse' 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:
--
-- 'blueGreenDeployments', 'describeBlueGreenDeploymentsResponse_blueGreenDeployments' - Contains a list of blue\/green deployments for the user.
--
-- 'marker', 'describeBlueGreenDeploymentsResponse_marker' - A pagination token that can be used in a later
-- DescribeBlueGreenDeployments request.
--
-- 'httpStatus', 'describeBlueGreenDeploymentsResponse_httpStatus' - The response's http status code.
newDescribeBlueGreenDeploymentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeBlueGreenDeploymentsResponse
newDescribeBlueGreenDeploymentsResponse :: Int -> DescribeBlueGreenDeploymentsResponse
newDescribeBlueGreenDeploymentsResponse Int
pHttpStatus_ =
  DescribeBlueGreenDeploymentsResponse'
    { $sel:blueGreenDeployments:DescribeBlueGreenDeploymentsResponse' :: Maybe [BlueGreenDeployment]
blueGreenDeployments =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeBlueGreenDeploymentsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeBlueGreenDeploymentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Contains a list of blue\/green deployments for the user.
describeBlueGreenDeploymentsResponse_blueGreenDeployments :: Lens.Lens' DescribeBlueGreenDeploymentsResponse (Prelude.Maybe [BlueGreenDeployment])
describeBlueGreenDeploymentsResponse_blueGreenDeployments :: Lens'
  DescribeBlueGreenDeploymentsResponse (Maybe [BlueGreenDeployment])
describeBlueGreenDeploymentsResponse_blueGreenDeployments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBlueGreenDeploymentsResponse' {Maybe [BlueGreenDeployment]
blueGreenDeployments :: Maybe [BlueGreenDeployment]
$sel:blueGreenDeployments:DescribeBlueGreenDeploymentsResponse' :: DescribeBlueGreenDeploymentsResponse -> Maybe [BlueGreenDeployment]
blueGreenDeployments} -> Maybe [BlueGreenDeployment]
blueGreenDeployments) (\s :: DescribeBlueGreenDeploymentsResponse
s@DescribeBlueGreenDeploymentsResponse' {} Maybe [BlueGreenDeployment]
a -> DescribeBlueGreenDeploymentsResponse
s {$sel:blueGreenDeployments:DescribeBlueGreenDeploymentsResponse' :: Maybe [BlueGreenDeployment]
blueGreenDeployments = Maybe [BlueGreenDeployment]
a} :: DescribeBlueGreenDeploymentsResponse) 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

-- | A pagination token that can be used in a later
-- DescribeBlueGreenDeployments request.
describeBlueGreenDeploymentsResponse_marker :: Lens.Lens' DescribeBlueGreenDeploymentsResponse (Prelude.Maybe Prelude.Text)
describeBlueGreenDeploymentsResponse_marker :: Lens' DescribeBlueGreenDeploymentsResponse (Maybe Text)
describeBlueGreenDeploymentsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBlueGreenDeploymentsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeBlueGreenDeploymentsResponse' :: DescribeBlueGreenDeploymentsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeBlueGreenDeploymentsResponse
s@DescribeBlueGreenDeploymentsResponse' {} Maybe Text
a -> DescribeBlueGreenDeploymentsResponse
s {$sel:marker:DescribeBlueGreenDeploymentsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeBlueGreenDeploymentsResponse)

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

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