{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2.Types.MovingAddressStatus
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.MovingAddressStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.MoveStatus
import qualified Amazonka.Prelude as Prelude

-- | Describes the status of a moving Elastic IP address.
--
-- We are retiring EC2-Classic. We recommend that you migrate from
-- EC2-Classic to a VPC. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html Migrate from EC2-Classic to a VPC>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- /See:/ 'newMovingAddressStatus' smart constructor.
data MovingAddressStatus = MovingAddressStatus'
  { -- | The status of the Elastic IP address that\'s being moved to the EC2-VPC
    -- platform, or restored to the EC2-Classic platform.
    MovingAddressStatus -> Maybe MoveStatus
moveStatus :: Prelude.Maybe MoveStatus,
    -- | The Elastic IP address.
    MovingAddressStatus -> Maybe Text
publicIp :: Prelude.Maybe Prelude.Text
  }
  deriving (MovingAddressStatus -> MovingAddressStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MovingAddressStatus -> MovingAddressStatus -> Bool
$c/= :: MovingAddressStatus -> MovingAddressStatus -> Bool
== :: MovingAddressStatus -> MovingAddressStatus -> Bool
$c== :: MovingAddressStatus -> MovingAddressStatus -> Bool
Prelude.Eq, ReadPrec [MovingAddressStatus]
ReadPrec MovingAddressStatus
Int -> ReadS MovingAddressStatus
ReadS [MovingAddressStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MovingAddressStatus]
$creadListPrec :: ReadPrec [MovingAddressStatus]
readPrec :: ReadPrec MovingAddressStatus
$creadPrec :: ReadPrec MovingAddressStatus
readList :: ReadS [MovingAddressStatus]
$creadList :: ReadS [MovingAddressStatus]
readsPrec :: Int -> ReadS MovingAddressStatus
$creadsPrec :: Int -> ReadS MovingAddressStatus
Prelude.Read, Int -> MovingAddressStatus -> ShowS
[MovingAddressStatus] -> ShowS
MovingAddressStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MovingAddressStatus] -> ShowS
$cshowList :: [MovingAddressStatus] -> ShowS
show :: MovingAddressStatus -> String
$cshow :: MovingAddressStatus -> String
showsPrec :: Int -> MovingAddressStatus -> ShowS
$cshowsPrec :: Int -> MovingAddressStatus -> ShowS
Prelude.Show, forall x. Rep MovingAddressStatus x -> MovingAddressStatus
forall x. MovingAddressStatus -> Rep MovingAddressStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MovingAddressStatus x -> MovingAddressStatus
$cfrom :: forall x. MovingAddressStatus -> Rep MovingAddressStatus x
Prelude.Generic)

-- |
-- Create a value of 'MovingAddressStatus' 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:
--
-- 'moveStatus', 'movingAddressStatus_moveStatus' - The status of the Elastic IP address that\'s being moved to the EC2-VPC
-- platform, or restored to the EC2-Classic platform.
--
-- 'publicIp', 'movingAddressStatus_publicIp' - The Elastic IP address.
newMovingAddressStatus ::
  MovingAddressStatus
newMovingAddressStatus :: MovingAddressStatus
newMovingAddressStatus =
  MovingAddressStatus'
    { $sel:moveStatus:MovingAddressStatus' :: Maybe MoveStatus
moveStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:publicIp:MovingAddressStatus' :: Maybe Text
publicIp = forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the Elastic IP address that\'s being moved to the EC2-VPC
-- platform, or restored to the EC2-Classic platform.
movingAddressStatus_moveStatus :: Lens.Lens' MovingAddressStatus (Prelude.Maybe MoveStatus)
movingAddressStatus_moveStatus :: Lens' MovingAddressStatus (Maybe MoveStatus)
movingAddressStatus_moveStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MovingAddressStatus' {Maybe MoveStatus
moveStatus :: Maybe MoveStatus
$sel:moveStatus:MovingAddressStatus' :: MovingAddressStatus -> Maybe MoveStatus
moveStatus} -> Maybe MoveStatus
moveStatus) (\s :: MovingAddressStatus
s@MovingAddressStatus' {} Maybe MoveStatus
a -> MovingAddressStatus
s {$sel:moveStatus:MovingAddressStatus' :: Maybe MoveStatus
moveStatus = Maybe MoveStatus
a} :: MovingAddressStatus)

-- | The Elastic IP address.
movingAddressStatus_publicIp :: Lens.Lens' MovingAddressStatus (Prelude.Maybe Prelude.Text)
movingAddressStatus_publicIp :: Lens' MovingAddressStatus (Maybe Text)
movingAddressStatus_publicIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MovingAddressStatus' {Maybe Text
publicIp :: Maybe Text
$sel:publicIp:MovingAddressStatus' :: MovingAddressStatus -> Maybe Text
publicIp} -> Maybe Text
publicIp) (\s :: MovingAddressStatus
s@MovingAddressStatus' {} Maybe Text
a -> MovingAddressStatus
s {$sel:publicIp:MovingAddressStatus' :: Maybe Text
publicIp = Maybe Text
a} :: MovingAddressStatus)

instance Data.FromXML MovingAddressStatus where
  parseXML :: [Node] -> Either String MovingAddressStatus
parseXML [Node]
x =
    Maybe MoveStatus -> Maybe Text -> MovingAddressStatus
MovingAddressStatus'
      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
"moveStatus")
      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
"publicIp")

instance Prelude.Hashable MovingAddressStatus where
  hashWithSalt :: Int -> MovingAddressStatus -> Int
hashWithSalt Int
_salt MovingAddressStatus' {Maybe Text
Maybe MoveStatus
publicIp :: Maybe Text
moveStatus :: Maybe MoveStatus
$sel:publicIp:MovingAddressStatus' :: MovingAddressStatus -> Maybe Text
$sel:moveStatus:MovingAddressStatus' :: MovingAddressStatus -> Maybe MoveStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MoveStatus
moveStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
publicIp

instance Prelude.NFData MovingAddressStatus where
  rnf :: MovingAddressStatus -> ()
rnf MovingAddressStatus' {Maybe Text
Maybe MoveStatus
publicIp :: Maybe Text
moveStatus :: Maybe MoveStatus
$sel:publicIp:MovingAddressStatus' :: MovingAddressStatus -> Maybe Text
$sel:moveStatus:MovingAddressStatus' :: MovingAddressStatus -> Maybe MoveStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MoveStatus
moveStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publicIp