{-# 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.MediaLive.Types.VpcOutputSettingsDescription
-- 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.MediaLive.Types.VpcOutputSettingsDescription where

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

-- | The properties for a private VPC Output
--
-- /See:/ 'newVpcOutputSettingsDescription' smart constructor.
data VpcOutputSettingsDescription = VpcOutputSettingsDescription'
  { -- | A list of up EC2 VPC security group IDs attached to the Output VPC
    -- network interfaces.
    VpcOutputSettingsDescription -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | A list of VPC subnet IDs from the same VPC. If STANDARD channel, subnet
    -- IDs must be mapped to two unique availability zones (AZ).
    VpcOutputSettingsDescription -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
    -- | A list of Elastic Network Interfaces created by MediaLive in the
    -- customer\'s VPC
    VpcOutputSettingsDescription -> Maybe [Text]
networkInterfaceIds :: Prelude.Maybe [Prelude.Text],
    -- | The Availability Zones where the vpc subnets are located. The first
    -- Availability Zone applies to the first subnet in the list of subnets.
    -- The second Availability Zone applies to the second subnet.
    VpcOutputSettingsDescription -> Maybe [Text]
availabilityZones :: Prelude.Maybe [Prelude.Text]
  }
  deriving (VpcOutputSettingsDescription
-> VpcOutputSettingsDescription -> Bool
(VpcOutputSettingsDescription
 -> VpcOutputSettingsDescription -> Bool)
-> (VpcOutputSettingsDescription
    -> VpcOutputSettingsDescription -> Bool)
-> Eq VpcOutputSettingsDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcOutputSettingsDescription
-> VpcOutputSettingsDescription -> Bool
$c/= :: VpcOutputSettingsDescription
-> VpcOutputSettingsDescription -> Bool
== :: VpcOutputSettingsDescription
-> VpcOutputSettingsDescription -> Bool
$c== :: VpcOutputSettingsDescription
-> VpcOutputSettingsDescription -> Bool
Prelude.Eq, ReadPrec [VpcOutputSettingsDescription]
ReadPrec VpcOutputSettingsDescription
Int -> ReadS VpcOutputSettingsDescription
ReadS [VpcOutputSettingsDescription]
(Int -> ReadS VpcOutputSettingsDescription)
-> ReadS [VpcOutputSettingsDescription]
-> ReadPrec VpcOutputSettingsDescription
-> ReadPrec [VpcOutputSettingsDescription]
-> Read VpcOutputSettingsDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcOutputSettingsDescription]
$creadListPrec :: ReadPrec [VpcOutputSettingsDescription]
readPrec :: ReadPrec VpcOutputSettingsDescription
$creadPrec :: ReadPrec VpcOutputSettingsDescription
readList :: ReadS [VpcOutputSettingsDescription]
$creadList :: ReadS [VpcOutputSettingsDescription]
readsPrec :: Int -> ReadS VpcOutputSettingsDescription
$creadsPrec :: Int -> ReadS VpcOutputSettingsDescription
Prelude.Read, Int -> VpcOutputSettingsDescription -> ShowS
[VpcOutputSettingsDescription] -> ShowS
VpcOutputSettingsDescription -> String
(Int -> VpcOutputSettingsDescription -> ShowS)
-> (VpcOutputSettingsDescription -> String)
-> ([VpcOutputSettingsDescription] -> ShowS)
-> Show VpcOutputSettingsDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcOutputSettingsDescription] -> ShowS
$cshowList :: [VpcOutputSettingsDescription] -> ShowS
show :: VpcOutputSettingsDescription -> String
$cshow :: VpcOutputSettingsDescription -> String
showsPrec :: Int -> VpcOutputSettingsDescription -> ShowS
$cshowsPrec :: Int -> VpcOutputSettingsDescription -> ShowS
Prelude.Show, (forall x.
 VpcOutputSettingsDescription -> Rep VpcOutputSettingsDescription x)
-> (forall x.
    Rep VpcOutputSettingsDescription x -> VpcOutputSettingsDescription)
-> Generic VpcOutputSettingsDescription
forall x.
Rep VpcOutputSettingsDescription x -> VpcOutputSettingsDescription
forall x.
VpcOutputSettingsDescription -> Rep VpcOutputSettingsDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VpcOutputSettingsDescription x -> VpcOutputSettingsDescription
$cfrom :: forall x.
VpcOutputSettingsDescription -> Rep VpcOutputSettingsDescription x
Prelude.Generic)

-- |
-- Create a value of 'VpcOutputSettingsDescription' 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:
--
-- 'securityGroupIds', 'vpcOutputSettingsDescription_securityGroupIds' - A list of up EC2 VPC security group IDs attached to the Output VPC
-- network interfaces.
--
-- 'subnetIds', 'vpcOutputSettingsDescription_subnetIds' - A list of VPC subnet IDs from the same VPC. If STANDARD channel, subnet
-- IDs must be mapped to two unique availability zones (AZ).
--
-- 'networkInterfaceIds', 'vpcOutputSettingsDescription_networkInterfaceIds' - A list of Elastic Network Interfaces created by MediaLive in the
-- customer\'s VPC
--
-- 'availabilityZones', 'vpcOutputSettingsDescription_availabilityZones' - The Availability Zones where the vpc subnets are located. The first
-- Availability Zone applies to the first subnet in the list of subnets.
-- The second Availability Zone applies to the second subnet.
newVpcOutputSettingsDescription ::
  VpcOutputSettingsDescription
newVpcOutputSettingsDescription :: VpcOutputSettingsDescription
newVpcOutputSettingsDescription =
  VpcOutputSettingsDescription' :: Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> VpcOutputSettingsDescription
VpcOutputSettingsDescription'
    { $sel:securityGroupIds:VpcOutputSettingsDescription' :: Maybe [Text]
securityGroupIds =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetIds:VpcOutputSettingsDescription' :: Maybe [Text]
subnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaceIds:VpcOutputSettingsDescription' :: Maybe [Text]
networkInterfaceIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZones:VpcOutputSettingsDescription' :: Maybe [Text]
availabilityZones = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of up EC2 VPC security group IDs attached to the Output VPC
-- network interfaces.
vpcOutputSettingsDescription_securityGroupIds :: Lens.Lens' VpcOutputSettingsDescription (Prelude.Maybe [Prelude.Text])
vpcOutputSettingsDescription_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> VpcOutputSettingsDescription -> f VpcOutputSettingsDescription
vpcOutputSettingsDescription_securityGroupIds = (VpcOutputSettingsDescription -> Maybe [Text])
-> (VpcOutputSettingsDescription
    -> Maybe [Text] -> VpcOutputSettingsDescription)
-> Lens
     VpcOutputSettingsDescription
     VpcOutputSettingsDescription
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcOutputSettingsDescription' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:VpcOutputSettingsDescription' :: VpcOutputSettingsDescription -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: VpcOutputSettingsDescription
s@VpcOutputSettingsDescription' {} Maybe [Text]
a -> VpcOutputSettingsDescription
s {$sel:securityGroupIds:VpcOutputSettingsDescription' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: VpcOutputSettingsDescription) ((Maybe [Text] -> f (Maybe [Text]))
 -> VpcOutputSettingsDescription -> f VpcOutputSettingsDescription)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> VpcOutputSettingsDescription
-> f VpcOutputSettingsDescription
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

-- | A list of VPC subnet IDs from the same VPC. If STANDARD channel, subnet
-- IDs must be mapped to two unique availability zones (AZ).
vpcOutputSettingsDescription_subnetIds :: Lens.Lens' VpcOutputSettingsDescription (Prelude.Maybe [Prelude.Text])
vpcOutputSettingsDescription_subnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> VpcOutputSettingsDescription -> f VpcOutputSettingsDescription
vpcOutputSettingsDescription_subnetIds = (VpcOutputSettingsDescription -> Maybe [Text])
-> (VpcOutputSettingsDescription
    -> Maybe [Text] -> VpcOutputSettingsDescription)
-> Lens
     VpcOutputSettingsDescription
     VpcOutputSettingsDescription
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcOutputSettingsDescription' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:VpcOutputSettingsDescription' :: VpcOutputSettingsDescription -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: VpcOutputSettingsDescription
s@VpcOutputSettingsDescription' {} Maybe [Text]
a -> VpcOutputSettingsDescription
s {$sel:subnetIds:VpcOutputSettingsDescription' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: VpcOutputSettingsDescription) ((Maybe [Text] -> f (Maybe [Text]))
 -> VpcOutputSettingsDescription -> f VpcOutputSettingsDescription)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> VpcOutputSettingsDescription
-> f VpcOutputSettingsDescription
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

-- | A list of Elastic Network Interfaces created by MediaLive in the
-- customer\'s VPC
vpcOutputSettingsDescription_networkInterfaceIds :: Lens.Lens' VpcOutputSettingsDescription (Prelude.Maybe [Prelude.Text])
vpcOutputSettingsDescription_networkInterfaceIds :: (Maybe [Text] -> f (Maybe [Text]))
-> VpcOutputSettingsDescription -> f VpcOutputSettingsDescription
vpcOutputSettingsDescription_networkInterfaceIds = (VpcOutputSettingsDescription -> Maybe [Text])
-> (VpcOutputSettingsDescription
    -> Maybe [Text] -> VpcOutputSettingsDescription)
-> Lens
     VpcOutputSettingsDescription
     VpcOutputSettingsDescription
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcOutputSettingsDescription' {Maybe [Text]
networkInterfaceIds :: Maybe [Text]
$sel:networkInterfaceIds:VpcOutputSettingsDescription' :: VpcOutputSettingsDescription -> Maybe [Text]
networkInterfaceIds} -> Maybe [Text]
networkInterfaceIds) (\s :: VpcOutputSettingsDescription
s@VpcOutputSettingsDescription' {} Maybe [Text]
a -> VpcOutputSettingsDescription
s {$sel:networkInterfaceIds:VpcOutputSettingsDescription' :: Maybe [Text]
networkInterfaceIds = Maybe [Text]
a} :: VpcOutputSettingsDescription) ((Maybe [Text] -> f (Maybe [Text]))
 -> VpcOutputSettingsDescription -> f VpcOutputSettingsDescription)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> VpcOutputSettingsDescription
-> f VpcOutputSettingsDescription
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 Availability Zones where the vpc subnets are located. The first
-- Availability Zone applies to the first subnet in the list of subnets.
-- The second Availability Zone applies to the second subnet.
vpcOutputSettingsDescription_availabilityZones :: Lens.Lens' VpcOutputSettingsDescription (Prelude.Maybe [Prelude.Text])
vpcOutputSettingsDescription_availabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> VpcOutputSettingsDescription -> f VpcOutputSettingsDescription
vpcOutputSettingsDescription_availabilityZones = (VpcOutputSettingsDescription -> Maybe [Text])
-> (VpcOutputSettingsDescription
    -> Maybe [Text] -> VpcOutputSettingsDescription)
-> Lens
     VpcOutputSettingsDescription
     VpcOutputSettingsDescription
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcOutputSettingsDescription' {Maybe [Text]
availabilityZones :: Maybe [Text]
$sel:availabilityZones:VpcOutputSettingsDescription' :: VpcOutputSettingsDescription -> Maybe [Text]
availabilityZones} -> Maybe [Text]
availabilityZones) (\s :: VpcOutputSettingsDescription
s@VpcOutputSettingsDescription' {} Maybe [Text]
a -> VpcOutputSettingsDescription
s {$sel:availabilityZones:VpcOutputSettingsDescription' :: Maybe [Text]
availabilityZones = Maybe [Text]
a} :: VpcOutputSettingsDescription) ((Maybe [Text] -> f (Maybe [Text]))
 -> VpcOutputSettingsDescription -> f VpcOutputSettingsDescription)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> VpcOutputSettingsDescription
-> f VpcOutputSettingsDescription
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

instance Core.FromJSON VpcOutputSettingsDescription where
  parseJSON :: Value -> Parser VpcOutputSettingsDescription
parseJSON =
    String
-> (Object -> Parser VpcOutputSettingsDescription)
-> Value
-> Parser VpcOutputSettingsDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VpcOutputSettingsDescription"
      ( \Object
x ->
          Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> VpcOutputSettingsDescription
VpcOutputSettingsDescription'
            (Maybe [Text]
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe [Text]
 -> VpcOutputSettingsDescription)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text]
      -> Maybe [Text] -> Maybe [Text] -> VpcOutputSettingsDescription)
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
"securityGroupIds"
                            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] -> VpcOutputSettingsDescription)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text] -> Maybe [Text] -> VpcOutputSettingsDescription)
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] -> VpcOutputSettingsDescription)
-> Parser (Maybe [Text])
-> Parser (Maybe [Text] -> VpcOutputSettingsDescription)
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
"networkInterfaceIds"
                            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] -> VpcOutputSettingsDescription)
-> Parser (Maybe [Text]) -> Parser VpcOutputSettingsDescription
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
"availabilityZones"
                            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
                        )
      )

instance
  Prelude.Hashable
    VpcOutputSettingsDescription

instance Prelude.NFData VpcOutputSettingsDescription