{-# 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.MigrationHubReFactorSpaces.Types.EnvironmentVpc
-- 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.MigrationHubReFactorSpaces.Types.EnvironmentVpc 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

-- | Provides summary information for the @EnvironmentVpc@ resource as a
-- response to @ListEnvironmentVpc@.
--
-- /See:/ 'newEnvironmentVpc' smart constructor.
data EnvironmentVpc = EnvironmentVpc'
  { -- | The Amazon Web Services account ID of the virtual private cloud (VPC)
    -- owner.
    EnvironmentVpc -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The list of Amazon Virtual Private Cloud (Amazon VPC) CIDR blocks.
    EnvironmentVpc -> Maybe (NonEmpty Text)
cidrBlocks :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A timestamp that indicates when the VPC is first added to the
    -- environment.
    EnvironmentVpc -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
    -- | The unique identifier of the environment.
    EnvironmentVpc -> Maybe Text
environmentId :: Prelude.Maybe Prelude.Text,
    -- | A timestamp that indicates when the VPC was last updated by the
    -- environment.
    EnvironmentVpc -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Data.POSIX,
    -- | The ID of the VPC.
    EnvironmentVpc -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The name of the VPC at the time it is added to the environment.
    EnvironmentVpc -> Maybe Text
vpcName :: Prelude.Maybe Prelude.Text
  }
  deriving (EnvironmentVpc -> EnvironmentVpc -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnvironmentVpc -> EnvironmentVpc -> Bool
$c/= :: EnvironmentVpc -> EnvironmentVpc -> Bool
== :: EnvironmentVpc -> EnvironmentVpc -> Bool
$c== :: EnvironmentVpc -> EnvironmentVpc -> Bool
Prelude.Eq, ReadPrec [EnvironmentVpc]
ReadPrec EnvironmentVpc
Int -> ReadS EnvironmentVpc
ReadS [EnvironmentVpc]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnvironmentVpc]
$creadListPrec :: ReadPrec [EnvironmentVpc]
readPrec :: ReadPrec EnvironmentVpc
$creadPrec :: ReadPrec EnvironmentVpc
readList :: ReadS [EnvironmentVpc]
$creadList :: ReadS [EnvironmentVpc]
readsPrec :: Int -> ReadS EnvironmentVpc
$creadsPrec :: Int -> ReadS EnvironmentVpc
Prelude.Read, Int -> EnvironmentVpc -> ShowS
[EnvironmentVpc] -> ShowS
EnvironmentVpc -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvironmentVpc] -> ShowS
$cshowList :: [EnvironmentVpc] -> ShowS
show :: EnvironmentVpc -> String
$cshow :: EnvironmentVpc -> String
showsPrec :: Int -> EnvironmentVpc -> ShowS
$cshowsPrec :: Int -> EnvironmentVpc -> ShowS
Prelude.Show, forall x. Rep EnvironmentVpc x -> EnvironmentVpc
forall x. EnvironmentVpc -> Rep EnvironmentVpc x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnvironmentVpc x -> EnvironmentVpc
$cfrom :: forall x. EnvironmentVpc -> Rep EnvironmentVpc x
Prelude.Generic)

-- |
-- Create a value of 'EnvironmentVpc' 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:
--
-- 'accountId', 'environmentVpc_accountId' - The Amazon Web Services account ID of the virtual private cloud (VPC)
-- owner.
--
-- 'cidrBlocks', 'environmentVpc_cidrBlocks' - The list of Amazon Virtual Private Cloud (Amazon VPC) CIDR blocks.
--
-- 'createdTime', 'environmentVpc_createdTime' - A timestamp that indicates when the VPC is first added to the
-- environment.
--
-- 'environmentId', 'environmentVpc_environmentId' - The unique identifier of the environment.
--
-- 'lastUpdatedTime', 'environmentVpc_lastUpdatedTime' - A timestamp that indicates when the VPC was last updated by the
-- environment.
--
-- 'vpcId', 'environmentVpc_vpcId' - The ID of the VPC.
--
-- 'vpcName', 'environmentVpc_vpcName' - The name of the VPC at the time it is added to the environment.
newEnvironmentVpc ::
  EnvironmentVpc
newEnvironmentVpc :: EnvironmentVpc
newEnvironmentVpc =
  EnvironmentVpc'
    { $sel:accountId:EnvironmentVpc' :: Maybe Text
accountId = forall a. Maybe a
Prelude.Nothing,
      $sel:cidrBlocks:EnvironmentVpc' :: Maybe (NonEmpty Text)
cidrBlocks = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:EnvironmentVpc' :: Maybe POSIX
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:environmentId:EnvironmentVpc' :: Maybe Text
environmentId = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:EnvironmentVpc' :: Maybe POSIX
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:EnvironmentVpc' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcName:EnvironmentVpc' :: Maybe Text
vpcName = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Web Services account ID of the virtual private cloud (VPC)
-- owner.
environmentVpc_accountId :: Lens.Lens' EnvironmentVpc (Prelude.Maybe Prelude.Text)
environmentVpc_accountId :: Lens' EnvironmentVpc (Maybe Text)
environmentVpc_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentVpc' {Maybe Text
accountId :: Maybe Text
$sel:accountId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: EnvironmentVpc
s@EnvironmentVpc' {} Maybe Text
a -> EnvironmentVpc
s {$sel:accountId:EnvironmentVpc' :: Maybe Text
accountId = Maybe Text
a} :: EnvironmentVpc)

-- | The list of Amazon Virtual Private Cloud (Amazon VPC) CIDR blocks.
environmentVpc_cidrBlocks :: Lens.Lens' EnvironmentVpc (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
environmentVpc_cidrBlocks :: Lens' EnvironmentVpc (Maybe (NonEmpty Text))
environmentVpc_cidrBlocks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentVpc' {Maybe (NonEmpty Text)
cidrBlocks :: Maybe (NonEmpty Text)
$sel:cidrBlocks:EnvironmentVpc' :: EnvironmentVpc -> Maybe (NonEmpty Text)
cidrBlocks} -> Maybe (NonEmpty Text)
cidrBlocks) (\s :: EnvironmentVpc
s@EnvironmentVpc' {} Maybe (NonEmpty Text)
a -> EnvironmentVpc
s {$sel:cidrBlocks:EnvironmentVpc' :: Maybe (NonEmpty Text)
cidrBlocks = Maybe (NonEmpty Text)
a} :: EnvironmentVpc) 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 timestamp that indicates when the VPC is first added to the
-- environment.
environmentVpc_createdTime :: Lens.Lens' EnvironmentVpc (Prelude.Maybe Prelude.UTCTime)
environmentVpc_createdTime :: Lens' EnvironmentVpc (Maybe UTCTime)
environmentVpc_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentVpc' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:EnvironmentVpc' :: EnvironmentVpc -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: EnvironmentVpc
s@EnvironmentVpc' {} Maybe POSIX
a -> EnvironmentVpc
s {$sel:createdTime:EnvironmentVpc' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: EnvironmentVpc) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The unique identifier of the environment.
environmentVpc_environmentId :: Lens.Lens' EnvironmentVpc (Prelude.Maybe Prelude.Text)
environmentVpc_environmentId :: Lens' EnvironmentVpc (Maybe Text)
environmentVpc_environmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentVpc' {Maybe Text
environmentId :: Maybe Text
$sel:environmentId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
environmentId} -> Maybe Text
environmentId) (\s :: EnvironmentVpc
s@EnvironmentVpc' {} Maybe Text
a -> EnvironmentVpc
s {$sel:environmentId:EnvironmentVpc' :: Maybe Text
environmentId = Maybe Text
a} :: EnvironmentVpc)

-- | A timestamp that indicates when the VPC was last updated by the
-- environment.
environmentVpc_lastUpdatedTime :: Lens.Lens' EnvironmentVpc (Prelude.Maybe Prelude.UTCTime)
environmentVpc_lastUpdatedTime :: Lens' EnvironmentVpc (Maybe UTCTime)
environmentVpc_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentVpc' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:EnvironmentVpc' :: EnvironmentVpc -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: EnvironmentVpc
s@EnvironmentVpc' {} Maybe POSIX
a -> EnvironmentVpc
s {$sel:lastUpdatedTime:EnvironmentVpc' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: EnvironmentVpc) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ID of the VPC.
environmentVpc_vpcId :: Lens.Lens' EnvironmentVpc (Prelude.Maybe Prelude.Text)
environmentVpc_vpcId :: Lens' EnvironmentVpc (Maybe Text)
environmentVpc_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentVpc' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: EnvironmentVpc
s@EnvironmentVpc' {} Maybe Text
a -> EnvironmentVpc
s {$sel:vpcId:EnvironmentVpc' :: Maybe Text
vpcId = Maybe Text
a} :: EnvironmentVpc)

-- | The name of the VPC at the time it is added to the environment.
environmentVpc_vpcName :: Lens.Lens' EnvironmentVpc (Prelude.Maybe Prelude.Text)
environmentVpc_vpcName :: Lens' EnvironmentVpc (Maybe Text)
environmentVpc_vpcName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentVpc' {Maybe Text
vpcName :: Maybe Text
$sel:vpcName:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
vpcName} -> Maybe Text
vpcName) (\s :: EnvironmentVpc
s@EnvironmentVpc' {} Maybe Text
a -> EnvironmentVpc
s {$sel:vpcName:EnvironmentVpc' :: Maybe Text
vpcName = Maybe Text
a} :: EnvironmentVpc)

instance Data.FromJSON EnvironmentVpc where
  parseJSON :: Value -> Parser EnvironmentVpc
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EnvironmentVpc"
      ( \Object
x ->
          Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EnvironmentVpc
EnvironmentVpc'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AccountId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CidrBlocks")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EnvironmentId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastUpdatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VpcId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VpcName")
      )

instance Prelude.Hashable EnvironmentVpc where
  hashWithSalt :: Int -> EnvironmentVpc -> Int
hashWithSalt Int
_salt EnvironmentVpc' {Maybe (NonEmpty Text)
Maybe Text
Maybe POSIX
vpcName :: Maybe Text
vpcId :: Maybe Text
lastUpdatedTime :: Maybe POSIX
environmentId :: Maybe Text
createdTime :: Maybe POSIX
cidrBlocks :: Maybe (NonEmpty Text)
accountId :: Maybe Text
$sel:vpcName:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
$sel:vpcId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
$sel:lastUpdatedTime:EnvironmentVpc' :: EnvironmentVpc -> Maybe POSIX
$sel:environmentId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
$sel:createdTime:EnvironmentVpc' :: EnvironmentVpc -> Maybe POSIX
$sel:cidrBlocks:EnvironmentVpc' :: EnvironmentVpc -> Maybe (NonEmpty Text)
$sel:accountId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
cidrBlocks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
environmentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcName

instance Prelude.NFData EnvironmentVpc where
  rnf :: EnvironmentVpc -> ()
rnf EnvironmentVpc' {Maybe (NonEmpty Text)
Maybe Text
Maybe POSIX
vpcName :: Maybe Text
vpcId :: Maybe Text
lastUpdatedTime :: Maybe POSIX
environmentId :: Maybe Text
createdTime :: Maybe POSIX
cidrBlocks :: Maybe (NonEmpty Text)
accountId :: Maybe Text
$sel:vpcName:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
$sel:vpcId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
$sel:lastUpdatedTime:EnvironmentVpc' :: EnvironmentVpc -> Maybe POSIX
$sel:environmentId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
$sel:createdTime:EnvironmentVpc' :: EnvironmentVpc -> Maybe POSIX
$sel:cidrBlocks:EnvironmentVpc' :: EnvironmentVpc -> Maybe (NonEmpty Text)
$sel:accountId:EnvironmentVpc' :: EnvironmentVpc -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
cidrBlocks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
environmentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcName