{-# 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.ElasticSearch.UpgradeElasticsearchDomain
-- 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)
--
-- Allows you to either upgrade your domain or perform an Upgrade
-- eligibility check to a compatible Elasticsearch version.
module Amazonka.ElasticSearch.UpgradeElasticsearchDomain
  ( -- * Creating a Request
    UpgradeElasticsearchDomain (..),
    newUpgradeElasticsearchDomain,

    -- * Request Lenses
    upgradeElasticsearchDomain_performCheckOnly,
    upgradeElasticsearchDomain_domainName,
    upgradeElasticsearchDomain_targetVersion,

    -- * Destructuring the Response
    UpgradeElasticsearchDomainResponse (..),
    newUpgradeElasticsearchDomainResponse,

    -- * Response Lenses
    upgradeElasticsearchDomainResponse_domainName,
    upgradeElasticsearchDomainResponse_performCheckOnly,
    upgradeElasticsearchDomainResponse_targetVersion,
    upgradeElasticsearchDomainResponse_httpStatus,
  )
where

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

-- | Container for request parameters to @ UpgradeElasticsearchDomain @
-- operation.
--
-- /See:/ 'newUpgradeElasticsearchDomain' smart constructor.
data UpgradeElasticsearchDomain = UpgradeElasticsearchDomain'
  { -- | This flag, when set to True, indicates that an Upgrade Eligibility Check
    -- needs to be performed. This will not actually perform the Upgrade.
    UpgradeElasticsearchDomain -> Maybe Bool
performCheckOnly :: Prelude.Maybe Prelude.Bool,
    UpgradeElasticsearchDomain -> Text
domainName :: Prelude.Text,
    -- | The version of Elasticsearch that you intend to upgrade the domain to.
    UpgradeElasticsearchDomain -> Text
targetVersion :: Prelude.Text
  }
  deriving (UpgradeElasticsearchDomain -> UpgradeElasticsearchDomain -> Bool
(UpgradeElasticsearchDomain -> UpgradeElasticsearchDomain -> Bool)
-> (UpgradeElasticsearchDomain
    -> UpgradeElasticsearchDomain -> Bool)
-> Eq UpgradeElasticsearchDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpgradeElasticsearchDomain -> UpgradeElasticsearchDomain -> Bool
$c/= :: UpgradeElasticsearchDomain -> UpgradeElasticsearchDomain -> Bool
== :: UpgradeElasticsearchDomain -> UpgradeElasticsearchDomain -> Bool
$c== :: UpgradeElasticsearchDomain -> UpgradeElasticsearchDomain -> Bool
Prelude.Eq, ReadPrec [UpgradeElasticsearchDomain]
ReadPrec UpgradeElasticsearchDomain
Int -> ReadS UpgradeElasticsearchDomain
ReadS [UpgradeElasticsearchDomain]
(Int -> ReadS UpgradeElasticsearchDomain)
-> ReadS [UpgradeElasticsearchDomain]
-> ReadPrec UpgradeElasticsearchDomain
-> ReadPrec [UpgradeElasticsearchDomain]
-> Read UpgradeElasticsearchDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpgradeElasticsearchDomain]
$creadListPrec :: ReadPrec [UpgradeElasticsearchDomain]
readPrec :: ReadPrec UpgradeElasticsearchDomain
$creadPrec :: ReadPrec UpgradeElasticsearchDomain
readList :: ReadS [UpgradeElasticsearchDomain]
$creadList :: ReadS [UpgradeElasticsearchDomain]
readsPrec :: Int -> ReadS UpgradeElasticsearchDomain
$creadsPrec :: Int -> ReadS UpgradeElasticsearchDomain
Prelude.Read, Int -> UpgradeElasticsearchDomain -> ShowS
[UpgradeElasticsearchDomain] -> ShowS
UpgradeElasticsearchDomain -> String
(Int -> UpgradeElasticsearchDomain -> ShowS)
-> (UpgradeElasticsearchDomain -> String)
-> ([UpgradeElasticsearchDomain] -> ShowS)
-> Show UpgradeElasticsearchDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpgradeElasticsearchDomain] -> ShowS
$cshowList :: [UpgradeElasticsearchDomain] -> ShowS
show :: UpgradeElasticsearchDomain -> String
$cshow :: UpgradeElasticsearchDomain -> String
showsPrec :: Int -> UpgradeElasticsearchDomain -> ShowS
$cshowsPrec :: Int -> UpgradeElasticsearchDomain -> ShowS
Prelude.Show, (forall x.
 UpgradeElasticsearchDomain -> Rep UpgradeElasticsearchDomain x)
-> (forall x.
    Rep UpgradeElasticsearchDomain x -> UpgradeElasticsearchDomain)
-> Generic UpgradeElasticsearchDomain
forall x.
Rep UpgradeElasticsearchDomain x -> UpgradeElasticsearchDomain
forall x.
UpgradeElasticsearchDomain -> Rep UpgradeElasticsearchDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpgradeElasticsearchDomain x -> UpgradeElasticsearchDomain
$cfrom :: forall x.
UpgradeElasticsearchDomain -> Rep UpgradeElasticsearchDomain x
Prelude.Generic)

-- |
-- Create a value of 'UpgradeElasticsearchDomain' 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:
--
-- 'performCheckOnly', 'upgradeElasticsearchDomain_performCheckOnly' - This flag, when set to True, indicates that an Upgrade Eligibility Check
-- needs to be performed. This will not actually perform the Upgrade.
--
-- 'domainName', 'upgradeElasticsearchDomain_domainName' - Undocumented member.
--
-- 'targetVersion', 'upgradeElasticsearchDomain_targetVersion' - The version of Elasticsearch that you intend to upgrade the domain to.
newUpgradeElasticsearchDomain ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'targetVersion'
  Prelude.Text ->
  UpgradeElasticsearchDomain
newUpgradeElasticsearchDomain :: Text -> Text -> UpgradeElasticsearchDomain
newUpgradeElasticsearchDomain
  Text
pDomainName_
  Text
pTargetVersion_ =
    UpgradeElasticsearchDomain' :: Maybe Bool -> Text -> Text -> UpgradeElasticsearchDomain
UpgradeElasticsearchDomain'
      { $sel:performCheckOnly:UpgradeElasticsearchDomain' :: Maybe Bool
performCheckOnly =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:domainName:UpgradeElasticsearchDomain' :: Text
domainName = Text
pDomainName_,
        $sel:targetVersion:UpgradeElasticsearchDomain' :: Text
targetVersion = Text
pTargetVersion_
      }

-- | This flag, when set to True, indicates that an Upgrade Eligibility Check
-- needs to be performed. This will not actually perform the Upgrade.
upgradeElasticsearchDomain_performCheckOnly :: Lens.Lens' UpgradeElasticsearchDomain (Prelude.Maybe Prelude.Bool)
upgradeElasticsearchDomain_performCheckOnly :: (Maybe Bool -> f (Maybe Bool))
-> UpgradeElasticsearchDomain -> f UpgradeElasticsearchDomain
upgradeElasticsearchDomain_performCheckOnly = (UpgradeElasticsearchDomain -> Maybe Bool)
-> (UpgradeElasticsearchDomain
    -> Maybe Bool -> UpgradeElasticsearchDomain)
-> Lens
     UpgradeElasticsearchDomain
     UpgradeElasticsearchDomain
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeElasticsearchDomain' {Maybe Bool
performCheckOnly :: Maybe Bool
$sel:performCheckOnly:UpgradeElasticsearchDomain' :: UpgradeElasticsearchDomain -> Maybe Bool
performCheckOnly} -> Maybe Bool
performCheckOnly) (\s :: UpgradeElasticsearchDomain
s@UpgradeElasticsearchDomain' {} Maybe Bool
a -> UpgradeElasticsearchDomain
s {$sel:performCheckOnly:UpgradeElasticsearchDomain' :: Maybe Bool
performCheckOnly = Maybe Bool
a} :: UpgradeElasticsearchDomain)

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

-- | The version of Elasticsearch that you intend to upgrade the domain to.
upgradeElasticsearchDomain_targetVersion :: Lens.Lens' UpgradeElasticsearchDomain Prelude.Text
upgradeElasticsearchDomain_targetVersion :: (Text -> f Text)
-> UpgradeElasticsearchDomain -> f UpgradeElasticsearchDomain
upgradeElasticsearchDomain_targetVersion = (UpgradeElasticsearchDomain -> Text)
-> (UpgradeElasticsearchDomain
    -> Text -> UpgradeElasticsearchDomain)
-> Lens
     UpgradeElasticsearchDomain UpgradeElasticsearchDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeElasticsearchDomain' {Text
targetVersion :: Text
$sel:targetVersion:UpgradeElasticsearchDomain' :: UpgradeElasticsearchDomain -> Text
targetVersion} -> Text
targetVersion) (\s :: UpgradeElasticsearchDomain
s@UpgradeElasticsearchDomain' {} Text
a -> UpgradeElasticsearchDomain
s {$sel:targetVersion:UpgradeElasticsearchDomain' :: Text
targetVersion = Text
a} :: UpgradeElasticsearchDomain)

instance Core.AWSRequest UpgradeElasticsearchDomain where
  type
    AWSResponse UpgradeElasticsearchDomain =
      UpgradeElasticsearchDomainResponse
  request :: UpgradeElasticsearchDomain -> Request UpgradeElasticsearchDomain
request = Service
-> UpgradeElasticsearchDomain -> Request UpgradeElasticsearchDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpgradeElasticsearchDomain
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpgradeElasticsearchDomain)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpgradeElasticsearchDomain))
-> Logger
-> Service
-> Proxy UpgradeElasticsearchDomain
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpgradeElasticsearchDomain)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Int
-> UpgradeElasticsearchDomainResponse
UpgradeElasticsearchDomainResponse'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Int
 -> UpgradeElasticsearchDomainResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text -> Int -> UpgradeElasticsearchDomainResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DomainName")
            Either
  String
  (Maybe Bool
   -> Maybe Text -> Int -> UpgradeElasticsearchDomainResponse)
-> Either String (Maybe Bool)
-> Either
     String (Maybe Text -> Int -> UpgradeElasticsearchDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PerformCheckOnly")
            Either
  String (Maybe Text -> Int -> UpgradeElasticsearchDomainResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpgradeElasticsearchDomainResponse)
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
"TargetVersion")
            Either String (Int -> UpgradeElasticsearchDomainResponse)
-> Either String Int
-> Either String UpgradeElasticsearchDomainResponse
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 UpgradeElasticsearchDomain

instance Prelude.NFData UpgradeElasticsearchDomain

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

instance Core.ToJSON UpgradeElasticsearchDomain where
  toJSON :: UpgradeElasticsearchDomain -> Value
toJSON UpgradeElasticsearchDomain' {Maybe Bool
Text
targetVersion :: Text
domainName :: Text
performCheckOnly :: Maybe Bool
$sel:targetVersion:UpgradeElasticsearchDomain' :: UpgradeElasticsearchDomain -> Text
$sel:domainName:UpgradeElasticsearchDomain' :: UpgradeElasticsearchDomain -> Text
$sel:performCheckOnly:UpgradeElasticsearchDomain' :: UpgradeElasticsearchDomain -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PerformCheckOnly" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
performCheckOnly,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TargetVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
targetVersion)
          ]
      )

instance Core.ToPath UpgradeElasticsearchDomain where
  toPath :: UpgradeElasticsearchDomain -> ByteString
toPath = ByteString -> UpgradeElasticsearchDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2015-01-01/es/upgradeDomain"

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

-- | Container for response returned by @ UpgradeElasticsearchDomain @
-- operation.
--
-- /See:/ 'newUpgradeElasticsearchDomainResponse' smart constructor.
data UpgradeElasticsearchDomainResponse = UpgradeElasticsearchDomainResponse'
  { UpgradeElasticsearchDomainResponse -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | This flag, when set to True, indicates that an Upgrade Eligibility Check
    -- needs to be performed. This will not actually perform the Upgrade.
    UpgradeElasticsearchDomainResponse -> Maybe Bool
performCheckOnly :: Prelude.Maybe Prelude.Bool,
    -- | The version of Elasticsearch that you intend to upgrade the domain to.
    UpgradeElasticsearchDomainResponse -> Maybe Text
targetVersion :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpgradeElasticsearchDomainResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpgradeElasticsearchDomainResponse
-> UpgradeElasticsearchDomainResponse -> Bool
(UpgradeElasticsearchDomainResponse
 -> UpgradeElasticsearchDomainResponse -> Bool)
-> (UpgradeElasticsearchDomainResponse
    -> UpgradeElasticsearchDomainResponse -> Bool)
-> Eq UpgradeElasticsearchDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpgradeElasticsearchDomainResponse
-> UpgradeElasticsearchDomainResponse -> Bool
$c/= :: UpgradeElasticsearchDomainResponse
-> UpgradeElasticsearchDomainResponse -> Bool
== :: UpgradeElasticsearchDomainResponse
-> UpgradeElasticsearchDomainResponse -> Bool
$c== :: UpgradeElasticsearchDomainResponse
-> UpgradeElasticsearchDomainResponse -> Bool
Prelude.Eq, ReadPrec [UpgradeElasticsearchDomainResponse]
ReadPrec UpgradeElasticsearchDomainResponse
Int -> ReadS UpgradeElasticsearchDomainResponse
ReadS [UpgradeElasticsearchDomainResponse]
(Int -> ReadS UpgradeElasticsearchDomainResponse)
-> ReadS [UpgradeElasticsearchDomainResponse]
-> ReadPrec UpgradeElasticsearchDomainResponse
-> ReadPrec [UpgradeElasticsearchDomainResponse]
-> Read UpgradeElasticsearchDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpgradeElasticsearchDomainResponse]
$creadListPrec :: ReadPrec [UpgradeElasticsearchDomainResponse]
readPrec :: ReadPrec UpgradeElasticsearchDomainResponse
$creadPrec :: ReadPrec UpgradeElasticsearchDomainResponse
readList :: ReadS [UpgradeElasticsearchDomainResponse]
$creadList :: ReadS [UpgradeElasticsearchDomainResponse]
readsPrec :: Int -> ReadS UpgradeElasticsearchDomainResponse
$creadsPrec :: Int -> ReadS UpgradeElasticsearchDomainResponse
Prelude.Read, Int -> UpgradeElasticsearchDomainResponse -> ShowS
[UpgradeElasticsearchDomainResponse] -> ShowS
UpgradeElasticsearchDomainResponse -> String
(Int -> UpgradeElasticsearchDomainResponse -> ShowS)
-> (UpgradeElasticsearchDomainResponse -> String)
-> ([UpgradeElasticsearchDomainResponse] -> ShowS)
-> Show UpgradeElasticsearchDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpgradeElasticsearchDomainResponse] -> ShowS
$cshowList :: [UpgradeElasticsearchDomainResponse] -> ShowS
show :: UpgradeElasticsearchDomainResponse -> String
$cshow :: UpgradeElasticsearchDomainResponse -> String
showsPrec :: Int -> UpgradeElasticsearchDomainResponse -> ShowS
$cshowsPrec :: Int -> UpgradeElasticsearchDomainResponse -> ShowS
Prelude.Show, (forall x.
 UpgradeElasticsearchDomainResponse
 -> Rep UpgradeElasticsearchDomainResponse x)
-> (forall x.
    Rep UpgradeElasticsearchDomainResponse x
    -> UpgradeElasticsearchDomainResponse)
-> Generic UpgradeElasticsearchDomainResponse
forall x.
Rep UpgradeElasticsearchDomainResponse x
-> UpgradeElasticsearchDomainResponse
forall x.
UpgradeElasticsearchDomainResponse
-> Rep UpgradeElasticsearchDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpgradeElasticsearchDomainResponse x
-> UpgradeElasticsearchDomainResponse
$cfrom :: forall x.
UpgradeElasticsearchDomainResponse
-> Rep UpgradeElasticsearchDomainResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpgradeElasticsearchDomainResponse' 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:
--
-- 'domainName', 'upgradeElasticsearchDomainResponse_domainName' - Undocumented member.
--
-- 'performCheckOnly', 'upgradeElasticsearchDomainResponse_performCheckOnly' - This flag, when set to True, indicates that an Upgrade Eligibility Check
-- needs to be performed. This will not actually perform the Upgrade.
--
-- 'targetVersion', 'upgradeElasticsearchDomainResponse_targetVersion' - The version of Elasticsearch that you intend to upgrade the domain to.
--
-- 'httpStatus', 'upgradeElasticsearchDomainResponse_httpStatus' - The response's http status code.
newUpgradeElasticsearchDomainResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpgradeElasticsearchDomainResponse
newUpgradeElasticsearchDomainResponse :: Int -> UpgradeElasticsearchDomainResponse
newUpgradeElasticsearchDomainResponse Int
pHttpStatus_ =
  UpgradeElasticsearchDomainResponse' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Int
-> UpgradeElasticsearchDomainResponse
UpgradeElasticsearchDomainResponse'
    { $sel:domainName:UpgradeElasticsearchDomainResponse' :: Maybe Text
domainName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:performCheckOnly:UpgradeElasticsearchDomainResponse' :: Maybe Bool
performCheckOnly = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:targetVersion:UpgradeElasticsearchDomainResponse' :: Maybe Text
targetVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpgradeElasticsearchDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | This flag, when set to True, indicates that an Upgrade Eligibility Check
-- needs to be performed. This will not actually perform the Upgrade.
upgradeElasticsearchDomainResponse_performCheckOnly :: Lens.Lens' UpgradeElasticsearchDomainResponse (Prelude.Maybe Prelude.Bool)
upgradeElasticsearchDomainResponse_performCheckOnly :: (Maybe Bool -> f (Maybe Bool))
-> UpgradeElasticsearchDomainResponse
-> f UpgradeElasticsearchDomainResponse
upgradeElasticsearchDomainResponse_performCheckOnly = (UpgradeElasticsearchDomainResponse -> Maybe Bool)
-> (UpgradeElasticsearchDomainResponse
    -> Maybe Bool -> UpgradeElasticsearchDomainResponse)
-> Lens
     UpgradeElasticsearchDomainResponse
     UpgradeElasticsearchDomainResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeElasticsearchDomainResponse' {Maybe Bool
performCheckOnly :: Maybe Bool
$sel:performCheckOnly:UpgradeElasticsearchDomainResponse' :: UpgradeElasticsearchDomainResponse -> Maybe Bool
performCheckOnly} -> Maybe Bool
performCheckOnly) (\s :: UpgradeElasticsearchDomainResponse
s@UpgradeElasticsearchDomainResponse' {} Maybe Bool
a -> UpgradeElasticsearchDomainResponse
s {$sel:performCheckOnly:UpgradeElasticsearchDomainResponse' :: Maybe Bool
performCheckOnly = Maybe Bool
a} :: UpgradeElasticsearchDomainResponse)

-- | The version of Elasticsearch that you intend to upgrade the domain to.
upgradeElasticsearchDomainResponse_targetVersion :: Lens.Lens' UpgradeElasticsearchDomainResponse (Prelude.Maybe Prelude.Text)
upgradeElasticsearchDomainResponse_targetVersion :: (Maybe Text -> f (Maybe Text))
-> UpgradeElasticsearchDomainResponse
-> f UpgradeElasticsearchDomainResponse
upgradeElasticsearchDomainResponse_targetVersion = (UpgradeElasticsearchDomainResponse -> Maybe Text)
-> (UpgradeElasticsearchDomainResponse
    -> Maybe Text -> UpgradeElasticsearchDomainResponse)
-> Lens
     UpgradeElasticsearchDomainResponse
     UpgradeElasticsearchDomainResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeElasticsearchDomainResponse' {Maybe Text
targetVersion :: Maybe Text
$sel:targetVersion:UpgradeElasticsearchDomainResponse' :: UpgradeElasticsearchDomainResponse -> Maybe Text
targetVersion} -> Maybe Text
targetVersion) (\s :: UpgradeElasticsearchDomainResponse
s@UpgradeElasticsearchDomainResponse' {} Maybe Text
a -> UpgradeElasticsearchDomainResponse
s {$sel:targetVersion:UpgradeElasticsearchDomainResponse' :: Maybe Text
targetVersion = Maybe Text
a} :: UpgradeElasticsearchDomainResponse)

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

instance
  Prelude.NFData
    UpgradeElasticsearchDomainResponse