{-# 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.IoT.Types.VpcDestinationSummary
-- 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.IoT.Types.VpcDestinationSummary where

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

-- | The summary of a virtual private cloud (VPC) destination.
--
-- /See:/ 'newVpcDestinationSummary' smart constructor.
data VpcDestinationSummary = VpcDestinationSummary'
  { -- | The security groups of the VPC destination.
    VpcDestinationSummary -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
    -- | The subnet IDs of the VPC destination.
    VpcDestinationSummary -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the VPC.
    VpcDestinationSummary -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of a role that has permission to create and attach to elastic
    -- network interfaces (ENIs).
    VpcDestinationSummary -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (VpcDestinationSummary -> VpcDestinationSummary -> Bool
(VpcDestinationSummary -> VpcDestinationSummary -> Bool)
-> (VpcDestinationSummary -> VpcDestinationSummary -> Bool)
-> Eq VpcDestinationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcDestinationSummary -> VpcDestinationSummary -> Bool
$c/= :: VpcDestinationSummary -> VpcDestinationSummary -> Bool
== :: VpcDestinationSummary -> VpcDestinationSummary -> Bool
$c== :: VpcDestinationSummary -> VpcDestinationSummary -> Bool
Prelude.Eq, ReadPrec [VpcDestinationSummary]
ReadPrec VpcDestinationSummary
Int -> ReadS VpcDestinationSummary
ReadS [VpcDestinationSummary]
(Int -> ReadS VpcDestinationSummary)
-> ReadS [VpcDestinationSummary]
-> ReadPrec VpcDestinationSummary
-> ReadPrec [VpcDestinationSummary]
-> Read VpcDestinationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcDestinationSummary]
$creadListPrec :: ReadPrec [VpcDestinationSummary]
readPrec :: ReadPrec VpcDestinationSummary
$creadPrec :: ReadPrec VpcDestinationSummary
readList :: ReadS [VpcDestinationSummary]
$creadList :: ReadS [VpcDestinationSummary]
readsPrec :: Int -> ReadS VpcDestinationSummary
$creadsPrec :: Int -> ReadS VpcDestinationSummary
Prelude.Read, Int -> VpcDestinationSummary -> ShowS
[VpcDestinationSummary] -> ShowS
VpcDestinationSummary -> String
(Int -> VpcDestinationSummary -> ShowS)
-> (VpcDestinationSummary -> String)
-> ([VpcDestinationSummary] -> ShowS)
-> Show VpcDestinationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcDestinationSummary] -> ShowS
$cshowList :: [VpcDestinationSummary] -> ShowS
show :: VpcDestinationSummary -> String
$cshow :: VpcDestinationSummary -> String
showsPrec :: Int -> VpcDestinationSummary -> ShowS
$cshowsPrec :: Int -> VpcDestinationSummary -> ShowS
Prelude.Show, (forall x. VpcDestinationSummary -> Rep VpcDestinationSummary x)
-> (forall x. Rep VpcDestinationSummary x -> VpcDestinationSummary)
-> Generic VpcDestinationSummary
forall x. Rep VpcDestinationSummary x -> VpcDestinationSummary
forall x. VpcDestinationSummary -> Rep VpcDestinationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcDestinationSummary x -> VpcDestinationSummary
$cfrom :: forall x. VpcDestinationSummary -> Rep VpcDestinationSummary x
Prelude.Generic)

-- |
-- Create a value of 'VpcDestinationSummary' 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', 'vpcDestinationSummary_securityGroups' - The security groups of the VPC destination.
--
-- 'subnetIds', 'vpcDestinationSummary_subnetIds' - The subnet IDs of the VPC destination.
--
-- 'vpcId', 'vpcDestinationSummary_vpcId' - The ID of the VPC.
--
-- 'roleArn', 'vpcDestinationSummary_roleArn' - The ARN of a role that has permission to create and attach to elastic
-- network interfaces (ENIs).
newVpcDestinationSummary ::
  VpcDestinationSummary
newVpcDestinationSummary :: VpcDestinationSummary
newVpcDestinationSummary =
  VpcDestinationSummary' :: Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> VpcDestinationSummary
VpcDestinationSummary'
    { $sel:securityGroups:VpcDestinationSummary' :: Maybe [Text]
securityGroups =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetIds:VpcDestinationSummary' :: Maybe [Text]
subnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:VpcDestinationSummary' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:VpcDestinationSummary' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The security groups of the VPC destination.
vpcDestinationSummary_securityGroups :: Lens.Lens' VpcDestinationSummary (Prelude.Maybe [Prelude.Text])
vpcDestinationSummary_securityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> VpcDestinationSummary -> f VpcDestinationSummary
vpcDestinationSummary_securityGroups = (VpcDestinationSummary -> Maybe [Text])
-> (VpcDestinationSummary -> Maybe [Text] -> VpcDestinationSummary)
-> Lens
     VpcDestinationSummary
     VpcDestinationSummary
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcDestinationSummary' {Maybe [Text]
securityGroups :: Maybe [Text]
$sel:securityGroups:VpcDestinationSummary' :: VpcDestinationSummary -> Maybe [Text]
securityGroups} -> Maybe [Text]
securityGroups) (\s :: VpcDestinationSummary
s@VpcDestinationSummary' {} Maybe [Text]
a -> VpcDestinationSummary
s {$sel:securityGroups:VpcDestinationSummary' :: Maybe [Text]
securityGroups = Maybe [Text]
a} :: VpcDestinationSummary) ((Maybe [Text] -> f (Maybe [Text]))
 -> VpcDestinationSummary -> f VpcDestinationSummary)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> VpcDestinationSummary
-> f VpcDestinationSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The subnet IDs of the VPC destination.
vpcDestinationSummary_subnetIds :: Lens.Lens' VpcDestinationSummary (Prelude.Maybe [Prelude.Text])
vpcDestinationSummary_subnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> VpcDestinationSummary -> f VpcDestinationSummary
vpcDestinationSummary_subnetIds = (VpcDestinationSummary -> Maybe [Text])
-> (VpcDestinationSummary -> Maybe [Text] -> VpcDestinationSummary)
-> Lens
     VpcDestinationSummary
     VpcDestinationSummary
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcDestinationSummary' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:VpcDestinationSummary' :: VpcDestinationSummary -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: VpcDestinationSummary
s@VpcDestinationSummary' {} Maybe [Text]
a -> VpcDestinationSummary
s {$sel:subnetIds:VpcDestinationSummary' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: VpcDestinationSummary) ((Maybe [Text] -> f (Maybe [Text]))
 -> VpcDestinationSummary -> f VpcDestinationSummary)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> VpcDestinationSummary
-> f VpcDestinationSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The ARN of a role that has permission to create and attach to elastic
-- network interfaces (ENIs).
vpcDestinationSummary_roleArn :: Lens.Lens' VpcDestinationSummary (Prelude.Maybe Prelude.Text)
vpcDestinationSummary_roleArn :: (Maybe Text -> f (Maybe Text))
-> VpcDestinationSummary -> f VpcDestinationSummary
vpcDestinationSummary_roleArn = (VpcDestinationSummary -> Maybe Text)
-> (VpcDestinationSummary -> Maybe Text -> VpcDestinationSummary)
-> Lens
     VpcDestinationSummary
     VpcDestinationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcDestinationSummary' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:VpcDestinationSummary' :: VpcDestinationSummary -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: VpcDestinationSummary
s@VpcDestinationSummary' {} Maybe Text
a -> VpcDestinationSummary
s {$sel:roleArn:VpcDestinationSummary' :: Maybe Text
roleArn = Maybe Text
a} :: VpcDestinationSummary)

instance Core.FromJSON VpcDestinationSummary where
  parseJSON :: Value -> Parser VpcDestinationSummary
parseJSON =
    String
-> (Object -> Parser VpcDestinationSummary)
-> Value
-> Parser VpcDestinationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VpcDestinationSummary"
      ( \Object
x ->
          Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> VpcDestinationSummary
VpcDestinationSummary'
            (Maybe [Text]
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> VpcDestinationSummary)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text] -> Maybe Text -> Maybe Text -> VpcDestinationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"securityGroups" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [Text] -> Maybe Text -> Maybe Text -> VpcDestinationSummary)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> Maybe Text -> VpcDestinationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"subnetIds" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Text -> Maybe Text -> VpcDestinationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> VpcDestinationSummary)
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 Text -> VpcDestinationSummary)
-> Parser (Maybe Text) -> Parser VpcDestinationSummary
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
"roleArn")
      )

instance Prelude.Hashable VpcDestinationSummary

instance Prelude.NFData VpcDestinationSummary