{-# 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.DrS.Types.SourceCloudProperties
-- 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.DrS.Types.SourceCloudProperties 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

-- | Properties of the cloud environment where this Source Server originated
-- from.
--
-- /See:/ 'newSourceCloudProperties' smart constructor.
data SourceCloudProperties = SourceCloudProperties'
  { -- | AWS Account ID for an EC2-originated Source Server.
    SourceCloudProperties -> Maybe Text
originAccountID :: Prelude.Maybe Prelude.Text,
    -- | AWS Availability Zone for an EC2-originated Source Server.
    SourceCloudProperties -> Maybe Text
originAvailabilityZone :: Prelude.Maybe Prelude.Text,
    -- | AWS Region for an EC2-originated Source Server.
    SourceCloudProperties -> Maybe Text
originRegion :: Prelude.Maybe Prelude.Text
  }
  deriving (SourceCloudProperties -> SourceCloudProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceCloudProperties -> SourceCloudProperties -> Bool
$c/= :: SourceCloudProperties -> SourceCloudProperties -> Bool
== :: SourceCloudProperties -> SourceCloudProperties -> Bool
$c== :: SourceCloudProperties -> SourceCloudProperties -> Bool
Prelude.Eq, ReadPrec [SourceCloudProperties]
ReadPrec SourceCloudProperties
Int -> ReadS SourceCloudProperties
ReadS [SourceCloudProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceCloudProperties]
$creadListPrec :: ReadPrec [SourceCloudProperties]
readPrec :: ReadPrec SourceCloudProperties
$creadPrec :: ReadPrec SourceCloudProperties
readList :: ReadS [SourceCloudProperties]
$creadList :: ReadS [SourceCloudProperties]
readsPrec :: Int -> ReadS SourceCloudProperties
$creadsPrec :: Int -> ReadS SourceCloudProperties
Prelude.Read, Int -> SourceCloudProperties -> ShowS
[SourceCloudProperties] -> ShowS
SourceCloudProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceCloudProperties] -> ShowS
$cshowList :: [SourceCloudProperties] -> ShowS
show :: SourceCloudProperties -> String
$cshow :: SourceCloudProperties -> String
showsPrec :: Int -> SourceCloudProperties -> ShowS
$cshowsPrec :: Int -> SourceCloudProperties -> ShowS
Prelude.Show, forall x. Rep SourceCloudProperties x -> SourceCloudProperties
forall x. SourceCloudProperties -> Rep SourceCloudProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceCloudProperties x -> SourceCloudProperties
$cfrom :: forall x. SourceCloudProperties -> Rep SourceCloudProperties x
Prelude.Generic)

-- |
-- Create a value of 'SourceCloudProperties' 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:
--
-- 'originAccountID', 'sourceCloudProperties_originAccountID' - AWS Account ID for an EC2-originated Source Server.
--
-- 'originAvailabilityZone', 'sourceCloudProperties_originAvailabilityZone' - AWS Availability Zone for an EC2-originated Source Server.
--
-- 'originRegion', 'sourceCloudProperties_originRegion' - AWS Region for an EC2-originated Source Server.
newSourceCloudProperties ::
  SourceCloudProperties
newSourceCloudProperties :: SourceCloudProperties
newSourceCloudProperties =
  SourceCloudProperties'
    { $sel:originAccountID:SourceCloudProperties' :: Maybe Text
originAccountID =
        forall a. Maybe a
Prelude.Nothing,
      $sel:originAvailabilityZone:SourceCloudProperties' :: Maybe Text
originAvailabilityZone = forall a. Maybe a
Prelude.Nothing,
      $sel:originRegion:SourceCloudProperties' :: Maybe Text
originRegion = forall a. Maybe a
Prelude.Nothing
    }

-- | AWS Account ID for an EC2-originated Source Server.
sourceCloudProperties_originAccountID :: Lens.Lens' SourceCloudProperties (Prelude.Maybe Prelude.Text)
sourceCloudProperties_originAccountID :: Lens' SourceCloudProperties (Maybe Text)
sourceCloudProperties_originAccountID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceCloudProperties' {Maybe Text
originAccountID :: Maybe Text
$sel:originAccountID:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
originAccountID} -> Maybe Text
originAccountID) (\s :: SourceCloudProperties
s@SourceCloudProperties' {} Maybe Text
a -> SourceCloudProperties
s {$sel:originAccountID:SourceCloudProperties' :: Maybe Text
originAccountID = Maybe Text
a} :: SourceCloudProperties)

-- | AWS Availability Zone for an EC2-originated Source Server.
sourceCloudProperties_originAvailabilityZone :: Lens.Lens' SourceCloudProperties (Prelude.Maybe Prelude.Text)
sourceCloudProperties_originAvailabilityZone :: Lens' SourceCloudProperties (Maybe Text)
sourceCloudProperties_originAvailabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceCloudProperties' {Maybe Text
originAvailabilityZone :: Maybe Text
$sel:originAvailabilityZone:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
originAvailabilityZone} -> Maybe Text
originAvailabilityZone) (\s :: SourceCloudProperties
s@SourceCloudProperties' {} Maybe Text
a -> SourceCloudProperties
s {$sel:originAvailabilityZone:SourceCloudProperties' :: Maybe Text
originAvailabilityZone = Maybe Text
a} :: SourceCloudProperties)

-- | AWS Region for an EC2-originated Source Server.
sourceCloudProperties_originRegion :: Lens.Lens' SourceCloudProperties (Prelude.Maybe Prelude.Text)
sourceCloudProperties_originRegion :: Lens' SourceCloudProperties (Maybe Text)
sourceCloudProperties_originRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceCloudProperties' {Maybe Text
originRegion :: Maybe Text
$sel:originRegion:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
originRegion} -> Maybe Text
originRegion) (\s :: SourceCloudProperties
s@SourceCloudProperties' {} Maybe Text
a -> SourceCloudProperties
s {$sel:originRegion:SourceCloudProperties' :: Maybe Text
originRegion = Maybe Text
a} :: SourceCloudProperties)

instance Data.FromJSON SourceCloudProperties where
  parseJSON :: Value -> Parser SourceCloudProperties
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SourceCloudProperties"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> SourceCloudProperties
SourceCloudProperties'
            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
"originAccountID")
            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
"originAvailabilityZone")
            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
"originRegion")
      )

instance Prelude.Hashable SourceCloudProperties where
  hashWithSalt :: Int -> SourceCloudProperties -> Int
hashWithSalt Int
_salt SourceCloudProperties' {Maybe Text
originRegion :: Maybe Text
originAvailabilityZone :: Maybe Text
originAccountID :: Maybe Text
$sel:originRegion:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
$sel:originAvailabilityZone:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
$sel:originAccountID:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
originAccountID
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
originAvailabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
originRegion

instance Prelude.NFData SourceCloudProperties where
  rnf :: SourceCloudProperties -> ()
rnf SourceCloudProperties' {Maybe Text
originRegion :: Maybe Text
originAvailabilityZone :: Maybe Text
originAccountID :: Maybe Text
$sel:originRegion:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
$sel:originAvailabilityZone:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
$sel:originAccountID:SourceCloudProperties' :: SourceCloudProperties -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
originAccountID
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
originAvailabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
originRegion