{-# 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-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)
module Amazonka.RobOMaker.Types.VPCConfigResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | VPC configuration associated with your simulation job.
--
-- /See:/ 'newVPCConfigResponse' smart constructor.
data VPCConfigResponse = VPCConfigResponse'
  { -- | A list of security group IDs associated with the simulation job.
    VPCConfigResponse -> Maybe (NonEmpty Text)
securityGroups :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The VPC ID associated with your simulation job.
    VPCConfigResponse -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | A list of subnet IDs associated with the simulation job.
    VPCConfigResponse -> Maybe (NonEmpty Text)
subnets :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A boolean indicating if a public IP was assigned.
    VPCConfigResponse -> Maybe Bool
assignPublicIp :: Prelude.Maybe Prelude.Bool
  }
  deriving (VPCConfigResponse -> VPCConfigResponse -> Bool
(VPCConfigResponse -> VPCConfigResponse -> Bool)
-> (VPCConfigResponse -> VPCConfigResponse -> Bool)
-> Eq VPCConfigResponse
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]
(Int -> ReadS VPCConfigResponse)
-> ReadS [VPCConfigResponse]
-> ReadPrec VPCConfigResponse
-> ReadPrec [VPCConfigResponse]
-> Read 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
(Int -> VPCConfigResponse -> ShowS)
-> (VPCConfigResponse -> String)
-> ([VPCConfigResponse] -> ShowS)
-> Show VPCConfigResponse
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. VPCConfigResponse -> Rep VPCConfigResponse x)
-> (forall x. Rep VPCConfigResponse x -> VPCConfigResponse)
-> Generic VPCConfigResponse
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:
--
-- 'securityGroups', 'vPCConfigResponse_securityGroups' - A list of security group IDs associated with the simulation job.
--
-- 'vpcId', 'vPCConfigResponse_vpcId' - The VPC ID associated with your simulation job.
--
-- 'subnets', 'vPCConfigResponse_subnets' - A list of subnet IDs associated with the simulation job.
--
-- 'assignPublicIp', 'vPCConfigResponse_assignPublicIp' - A boolean indicating if a public IP was assigned.
newVPCConfigResponse ::
  VPCConfigResponse
newVPCConfigResponse :: VPCConfigResponse
newVPCConfigResponse =
  VPCConfigResponse' :: Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Bool
-> VPCConfigResponse
VPCConfigResponse'
    { $sel:securityGroups:VPCConfigResponse' :: Maybe (NonEmpty Text)
securityGroups =
        Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:VPCConfigResponse' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subnets:VPCConfigResponse' :: Maybe (NonEmpty Text)
subnets = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:assignPublicIp:VPCConfigResponse' :: Maybe Bool
assignPublicIp = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of security group IDs associated with the simulation job.
vPCConfigResponse_securityGroups :: Lens.Lens' VPCConfigResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
vPCConfigResponse_securityGroups :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> VPCConfigResponse -> f VPCConfigResponse
vPCConfigResponse_securityGroups = (VPCConfigResponse -> Maybe (NonEmpty Text))
-> (VPCConfigResponse
    -> Maybe (NonEmpty Text) -> VPCConfigResponse)
-> Lens
     VPCConfigResponse
     VPCConfigResponse
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> VPCConfigResponse -> f VPCConfigResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> VPCConfigResponse
-> f VPCConfigResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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 AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
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 :: (Maybe Text -> f (Maybe Text))
-> VPCConfigResponse -> f VPCConfigResponse
vPCConfigResponse_vpcId = (VPCConfigResponse -> Maybe Text)
-> (VPCConfigResponse -> Maybe Text -> VPCConfigResponse)
-> Lens
     VPCConfigResponse VPCConfigResponse (Maybe Text) (Maybe Text)
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)

-- | A list of subnet IDs associated with the simulation job.
vPCConfigResponse_subnets :: Lens.Lens' VPCConfigResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
vPCConfigResponse_subnets :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> VPCConfigResponse -> f VPCConfigResponse
vPCConfigResponse_subnets = (VPCConfigResponse -> Maybe (NonEmpty Text))
-> (VPCConfigResponse
    -> Maybe (NonEmpty Text) -> VPCConfigResponse)
-> Lens
     VPCConfigResponse
     VPCConfigResponse
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> VPCConfigResponse -> f VPCConfigResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> VPCConfigResponse
-> f VPCConfigResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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 AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A boolean indicating if a public IP was assigned.
vPCConfigResponse_assignPublicIp :: Lens.Lens' VPCConfigResponse (Prelude.Maybe Prelude.Bool)
vPCConfigResponse_assignPublicIp :: (Maybe Bool -> f (Maybe Bool))
-> VPCConfigResponse -> f VPCConfigResponse
vPCConfigResponse_assignPublicIp = (VPCConfigResponse -> Maybe Bool)
-> (VPCConfigResponse -> Maybe Bool -> VPCConfigResponse)
-> Lens
     VPCConfigResponse VPCConfigResponse (Maybe Bool) (Maybe Bool)
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)

instance Core.FromJSON VPCConfigResponse where
  parseJSON :: Value -> Parser VPCConfigResponse
parseJSON =
    String
-> (Object -> Parser VPCConfigResponse)
-> Value
-> Parser VPCConfigResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VPCConfigResponse"
      ( \Object
x ->
          Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Bool
-> VPCConfigResponse
VPCConfigResponse'
            (Maybe (NonEmpty Text)
 -> Maybe Text
 -> Maybe (NonEmpty Text)
 -> Maybe Bool
 -> VPCConfigResponse)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty Text) -> Maybe Bool -> VPCConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"securityGroups")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty Text) -> Maybe Bool -> VPCConfigResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty Text) -> Maybe Bool -> VPCConfigResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpcId")
            Parser (Maybe (NonEmpty Text) -> Maybe Bool -> VPCConfigResponse)
-> Parser (Maybe (NonEmpty Text))
-> Parser (Maybe Bool -> VPCConfigResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"subnets")
            Parser (Maybe Bool -> VPCConfigResponse)
-> Parser (Maybe Bool) -> Parser VPCConfigResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"assignPublicIp")
      )

instance Prelude.Hashable VPCConfigResponse

instance Prelude.NFData VPCConfigResponse