{-# 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.RobOMaker.Types.VPCConfigResponse
-- 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.RobOMaker.Types.VPCConfigResponse 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

-- | VPC configuration associated with your simulation job.
--
-- /See:/ 'newVPCConfigResponse' smart constructor.
data VPCConfigResponse = VPCConfigResponse'
  { -- | A boolean indicating if a public IP was assigned.
    VPCConfigResponse -> Maybe Bool
assignPublicIp :: Prelude.Maybe Prelude.Bool,
    -- | A list of security group IDs associated with the simulation job.
    VPCConfigResponse -> Maybe (NonEmpty Text)
securityGroups :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A list of subnet IDs associated with the simulation job.
    VPCConfigResponse -> Maybe (NonEmpty Text)
subnets :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The VPC ID associated with your simulation job.
    VPCConfigResponse -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text
  }
  deriving (VPCConfigResponse -> VPCConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VPCConfigResponse -> VPCConfigResponse -> Bool
$c/= :: VPCConfigResponse -> VPCConfigResponse -> Bool
== :: VPCConfigResponse -> VPCConfigResponse -> Bool
$c== :: VPCConfigResponse -> VPCConfigResponse -> Bool
Prelude.Eq, ReadPrec [VPCConfigResponse]
ReadPrec VPCConfigResponse
Int -> ReadS VPCConfigResponse
ReadS [VPCConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VPCConfigResponse]
$creadListPrec :: ReadPrec [VPCConfigResponse]
readPrec :: ReadPrec VPCConfigResponse
$creadPrec :: ReadPrec VPCConfigResponse
readList :: ReadS [VPCConfigResponse]
$creadList :: ReadS [VPCConfigResponse]
readsPrec :: Int -> ReadS VPCConfigResponse
$creadsPrec :: Int -> ReadS VPCConfigResponse
Prelude.Read, Int -> VPCConfigResponse -> ShowS
[VPCConfigResponse] -> ShowS
VPCConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VPCConfigResponse] -> ShowS
$cshowList :: [VPCConfigResponse] -> ShowS
show :: VPCConfigResponse -> String
$cshow :: VPCConfigResponse -> String
showsPrec :: Int -> VPCConfigResponse -> ShowS
$cshowsPrec :: Int -> VPCConfigResponse -> ShowS
Prelude.Show, forall x. Rep VPCConfigResponse x -> VPCConfigResponse
forall x. VPCConfigResponse -> Rep VPCConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VPCConfigResponse x -> VPCConfigResponse
$cfrom :: forall x. VPCConfigResponse -> Rep VPCConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'VPCConfigResponse' 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:
--
-- 'assignPublicIp', 'vPCConfigResponse_assignPublicIp' - A boolean indicating if a public IP was assigned.
--
-- 'securityGroups', 'vPCConfigResponse_securityGroups' - A list of security group IDs associated with the simulation job.
--
-- 'subnets', 'vPCConfigResponse_subnets' - A list of subnet IDs associated with the simulation job.
--
-- 'vpcId', 'vPCConfigResponse_vpcId' - The VPC ID associated with your simulation job.
newVPCConfigResponse ::
  VPCConfigResponse
newVPCConfigResponse :: VPCConfigResponse
newVPCConfigResponse =
  VPCConfigResponse'
    { $sel:assignPublicIp:VPCConfigResponse' :: Maybe Bool
assignPublicIp =
        forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroups:VPCConfigResponse' :: Maybe (NonEmpty Text)
securityGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:subnets:VPCConfigResponse' :: Maybe (NonEmpty Text)
subnets = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:VPCConfigResponse' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing
    }

-- | A boolean indicating if a public IP was assigned.
vPCConfigResponse_assignPublicIp :: Lens.Lens' VPCConfigResponse (Prelude.Maybe Prelude.Bool)
vPCConfigResponse_assignPublicIp :: Lens' VPCConfigResponse (Maybe Bool)
vPCConfigResponse_assignPublicIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCConfigResponse' {Maybe Bool
assignPublicIp :: Maybe Bool
$sel:assignPublicIp:VPCConfigResponse' :: VPCConfigResponse -> Maybe Bool
assignPublicIp} -> Maybe Bool
assignPublicIp) (\s :: VPCConfigResponse
s@VPCConfigResponse' {} Maybe Bool
a -> VPCConfigResponse
s {$sel:assignPublicIp:VPCConfigResponse' :: Maybe Bool
assignPublicIp = Maybe Bool
a} :: VPCConfigResponse)

-- | A list of security group IDs associated with the simulation job.
vPCConfigResponse_securityGroups :: Lens.Lens' VPCConfigResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
vPCConfigResponse_securityGroups :: Lens' VPCConfigResponse (Maybe (NonEmpty Text))
vPCConfigResponse_securityGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCConfigResponse' {Maybe (NonEmpty Text)
securityGroups :: Maybe (NonEmpty Text)
$sel:securityGroups:VPCConfigResponse' :: VPCConfigResponse -> Maybe (NonEmpty Text)
securityGroups} -> Maybe (NonEmpty Text)
securityGroups) (\s :: VPCConfigResponse
s@VPCConfigResponse' {} Maybe (NonEmpty Text)
a -> VPCConfigResponse
s {$sel:securityGroups:VPCConfigResponse' :: Maybe (NonEmpty Text)
securityGroups = Maybe (NonEmpty Text)
a} :: VPCConfigResponse) 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 list of subnet IDs associated with the simulation job.
vPCConfigResponse_subnets :: Lens.Lens' VPCConfigResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
vPCConfigResponse_subnets :: Lens' VPCConfigResponse (Maybe (NonEmpty Text))
vPCConfigResponse_subnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCConfigResponse' {Maybe (NonEmpty Text)
subnets :: Maybe (NonEmpty Text)
$sel:subnets:VPCConfigResponse' :: VPCConfigResponse -> Maybe (NonEmpty Text)
subnets} -> Maybe (NonEmpty Text)
subnets) (\s :: VPCConfigResponse
s@VPCConfigResponse' {} Maybe (NonEmpty Text)
a -> VPCConfigResponse
s {$sel:subnets:VPCConfigResponse' :: Maybe (NonEmpty Text)
subnets = Maybe (NonEmpty Text)
a} :: VPCConfigResponse) 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

-- | The VPC ID associated with your simulation job.
vPCConfigResponse_vpcId :: Lens.Lens' VPCConfigResponse (Prelude.Maybe Prelude.Text)
vPCConfigResponse_vpcId :: Lens' VPCConfigResponse (Maybe Text)
vPCConfigResponse_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCConfigResponse' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:VPCConfigResponse' :: VPCConfigResponse -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: VPCConfigResponse
s@VPCConfigResponse' {} Maybe Text
a -> VPCConfigResponse
s {$sel:vpcId:VPCConfigResponse' :: Maybe Text
vpcId = Maybe Text
a} :: VPCConfigResponse)

instance Data.FromJSON VPCConfigResponse where
  parseJSON :: Value -> Parser VPCConfigResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VPCConfigResponse"
      ( \Object
x ->
          Maybe Bool
-> Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text)
-> Maybe Text
-> VPCConfigResponse
VPCConfigResponse'
            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
"assignPublicIp")
            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
"securityGroups")
            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
"subnets")
            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")
      )

instance Prelude.Hashable VPCConfigResponse where
  hashWithSalt :: Int -> VPCConfigResponse -> Int
hashWithSalt Int
_salt VPCConfigResponse' {Maybe Bool
Maybe (NonEmpty Text)
Maybe Text
vpcId :: Maybe Text
subnets :: Maybe (NonEmpty Text)
securityGroups :: Maybe (NonEmpty Text)
assignPublicIp :: Maybe Bool
$sel:vpcId:VPCConfigResponse' :: VPCConfigResponse -> Maybe Text
$sel:subnets:VPCConfigResponse' :: VPCConfigResponse -> Maybe (NonEmpty Text)
$sel:securityGroups:VPCConfigResponse' :: VPCConfigResponse -> Maybe (NonEmpty Text)
$sel:assignPublicIp:VPCConfigResponse' :: VPCConfigResponse -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
assignPublicIp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
securityGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
subnets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId

instance Prelude.NFData VPCConfigResponse where
  rnf :: VPCConfigResponse -> ()
rnf VPCConfigResponse' {Maybe Bool
Maybe (NonEmpty Text)
Maybe Text
vpcId :: Maybe Text
subnets :: Maybe (NonEmpty Text)
securityGroups :: Maybe (NonEmpty Text)
assignPublicIp :: Maybe Bool
$sel:vpcId:VPCConfigResponse' :: VPCConfigResponse -> Maybe Text
$sel:subnets:VPCConfigResponse' :: VPCConfigResponse -> Maybe (NonEmpty Text)
$sel:securityGroups:VPCConfigResponse' :: VPCConfigResponse -> Maybe (NonEmpty Text)
$sel:assignPublicIp:VPCConfigResponse' :: VPCConfigResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
assignPublicIp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
securityGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
subnets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId