{-# 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.SecurityHub.Types.AwsEc2SecurityGroupUserIdGroupPair
-- 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.SecurityHub.Types.AwsEc2SecurityGroupUserIdGroupPair where

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

-- | A relationship between a security group and a user.
--
-- /See:/ 'newAwsEc2SecurityGroupUserIdGroupPair' smart constructor.
data AwsEc2SecurityGroupUserIdGroupPair = AwsEc2SecurityGroupUserIdGroupPair'
  { -- | The ID of the VPC peering connection, if applicable.
    AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
vpcPeeringConnectionId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VPC for the referenced security group, if applicable.
    AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The ID of an Amazon Web Services account.
    --
    -- For a referenced security group in another VPC, the account ID of the
    -- referenced security group is returned in the response. If the referenced
    -- security group is deleted, this value is not returned.
    --
    -- [EC2-Classic] Required when adding or removing rules that reference a
    -- security group in another VPC.
    AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the security group.
    AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
    -- | The name of the security group.
    AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | The status of a VPC peering connection, if applicable.
    AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
peeringStatus :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEc2SecurityGroupUserIdGroupPair
-> AwsEc2SecurityGroupUserIdGroupPair -> Bool
(AwsEc2SecurityGroupUserIdGroupPair
 -> AwsEc2SecurityGroupUserIdGroupPair -> Bool)
-> (AwsEc2SecurityGroupUserIdGroupPair
    -> AwsEc2SecurityGroupUserIdGroupPair -> Bool)
-> Eq AwsEc2SecurityGroupUserIdGroupPair
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEc2SecurityGroupUserIdGroupPair
-> AwsEc2SecurityGroupUserIdGroupPair -> Bool
$c/= :: AwsEc2SecurityGroupUserIdGroupPair
-> AwsEc2SecurityGroupUserIdGroupPair -> Bool
== :: AwsEc2SecurityGroupUserIdGroupPair
-> AwsEc2SecurityGroupUserIdGroupPair -> Bool
$c== :: AwsEc2SecurityGroupUserIdGroupPair
-> AwsEc2SecurityGroupUserIdGroupPair -> Bool
Prelude.Eq, ReadPrec [AwsEc2SecurityGroupUserIdGroupPair]
ReadPrec AwsEc2SecurityGroupUserIdGroupPair
Int -> ReadS AwsEc2SecurityGroupUserIdGroupPair
ReadS [AwsEc2SecurityGroupUserIdGroupPair]
(Int -> ReadS AwsEc2SecurityGroupUserIdGroupPair)
-> ReadS [AwsEc2SecurityGroupUserIdGroupPair]
-> ReadPrec AwsEc2SecurityGroupUserIdGroupPair
-> ReadPrec [AwsEc2SecurityGroupUserIdGroupPair]
-> Read AwsEc2SecurityGroupUserIdGroupPair
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEc2SecurityGroupUserIdGroupPair]
$creadListPrec :: ReadPrec [AwsEc2SecurityGroupUserIdGroupPair]
readPrec :: ReadPrec AwsEc2SecurityGroupUserIdGroupPair
$creadPrec :: ReadPrec AwsEc2SecurityGroupUserIdGroupPair
readList :: ReadS [AwsEc2SecurityGroupUserIdGroupPair]
$creadList :: ReadS [AwsEc2SecurityGroupUserIdGroupPair]
readsPrec :: Int -> ReadS AwsEc2SecurityGroupUserIdGroupPair
$creadsPrec :: Int -> ReadS AwsEc2SecurityGroupUserIdGroupPair
Prelude.Read, Int -> AwsEc2SecurityGroupUserIdGroupPair -> ShowS
[AwsEc2SecurityGroupUserIdGroupPair] -> ShowS
AwsEc2SecurityGroupUserIdGroupPair -> String
(Int -> AwsEc2SecurityGroupUserIdGroupPair -> ShowS)
-> (AwsEc2SecurityGroupUserIdGroupPair -> String)
-> ([AwsEc2SecurityGroupUserIdGroupPair] -> ShowS)
-> Show AwsEc2SecurityGroupUserIdGroupPair
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEc2SecurityGroupUserIdGroupPair] -> ShowS
$cshowList :: [AwsEc2SecurityGroupUserIdGroupPair] -> ShowS
show :: AwsEc2SecurityGroupUserIdGroupPair -> String
$cshow :: AwsEc2SecurityGroupUserIdGroupPair -> String
showsPrec :: Int -> AwsEc2SecurityGroupUserIdGroupPair -> ShowS
$cshowsPrec :: Int -> AwsEc2SecurityGroupUserIdGroupPair -> ShowS
Prelude.Show, (forall x.
 AwsEc2SecurityGroupUserIdGroupPair
 -> Rep AwsEc2SecurityGroupUserIdGroupPair x)
-> (forall x.
    Rep AwsEc2SecurityGroupUserIdGroupPair x
    -> AwsEc2SecurityGroupUserIdGroupPair)
-> Generic AwsEc2SecurityGroupUserIdGroupPair
forall x.
Rep AwsEc2SecurityGroupUserIdGroupPair x
-> AwsEc2SecurityGroupUserIdGroupPair
forall x.
AwsEc2SecurityGroupUserIdGroupPair
-> Rep AwsEc2SecurityGroupUserIdGroupPair x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEc2SecurityGroupUserIdGroupPair x
-> AwsEc2SecurityGroupUserIdGroupPair
$cfrom :: forall x.
AwsEc2SecurityGroupUserIdGroupPair
-> Rep AwsEc2SecurityGroupUserIdGroupPair x
Prelude.Generic)

-- |
-- Create a value of 'AwsEc2SecurityGroupUserIdGroupPair' 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:
--
-- 'vpcPeeringConnectionId', 'awsEc2SecurityGroupUserIdGroupPair_vpcPeeringConnectionId' - The ID of the VPC peering connection, if applicable.
--
-- 'vpcId', 'awsEc2SecurityGroupUserIdGroupPair_vpcId' - The ID of the VPC for the referenced security group, if applicable.
--
-- 'userId', 'awsEc2SecurityGroupUserIdGroupPair_userId' - The ID of an Amazon Web Services account.
--
-- For a referenced security group in another VPC, the account ID of the
-- referenced security group is returned in the response. If the referenced
-- security group is deleted, this value is not returned.
--
-- [EC2-Classic] Required when adding or removing rules that reference a
-- security group in another VPC.
--
-- 'groupId', 'awsEc2SecurityGroupUserIdGroupPair_groupId' - The ID of the security group.
--
-- 'groupName', 'awsEc2SecurityGroupUserIdGroupPair_groupName' - The name of the security group.
--
-- 'peeringStatus', 'awsEc2SecurityGroupUserIdGroupPair_peeringStatus' - The status of a VPC peering connection, if applicable.
newAwsEc2SecurityGroupUserIdGroupPair ::
  AwsEc2SecurityGroupUserIdGroupPair
newAwsEc2SecurityGroupUserIdGroupPair :: AwsEc2SecurityGroupUserIdGroupPair
newAwsEc2SecurityGroupUserIdGroupPair =
  AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsEc2SecurityGroupUserIdGroupPair
AwsEc2SecurityGroupUserIdGroupPair'
    { $sel:vpcPeeringConnectionId:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
vpcPeeringConnectionId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userId:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupId:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
groupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:peeringStatus:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
peeringStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the VPC peering connection, if applicable.
awsEc2SecurityGroupUserIdGroupPair_vpcPeeringConnectionId :: Lens.Lens' AwsEc2SecurityGroupUserIdGroupPair (Prelude.Maybe Prelude.Text)
awsEc2SecurityGroupUserIdGroupPair_vpcPeeringConnectionId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2SecurityGroupUserIdGroupPair
-> f AwsEc2SecurityGroupUserIdGroupPair
awsEc2SecurityGroupUserIdGroupPair_vpcPeeringConnectionId = (AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text)
-> (AwsEc2SecurityGroupUserIdGroupPair
    -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Lens
     AwsEc2SecurityGroupUserIdGroupPair
     AwsEc2SecurityGroupUserIdGroupPair
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2SecurityGroupUserIdGroupPair' {Maybe Text
vpcPeeringConnectionId :: Maybe Text
$sel:vpcPeeringConnectionId:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
vpcPeeringConnectionId} -> Maybe Text
vpcPeeringConnectionId) (\s :: AwsEc2SecurityGroupUserIdGroupPair
s@AwsEc2SecurityGroupUserIdGroupPair' {} Maybe Text
a -> AwsEc2SecurityGroupUserIdGroupPair
s {$sel:vpcPeeringConnectionId:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
vpcPeeringConnectionId = Maybe Text
a} :: AwsEc2SecurityGroupUserIdGroupPair)

-- | The ID of the VPC for the referenced security group, if applicable.
awsEc2SecurityGroupUserIdGroupPair_vpcId :: Lens.Lens' AwsEc2SecurityGroupUserIdGroupPair (Prelude.Maybe Prelude.Text)
awsEc2SecurityGroupUserIdGroupPair_vpcId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2SecurityGroupUserIdGroupPair
-> f AwsEc2SecurityGroupUserIdGroupPair
awsEc2SecurityGroupUserIdGroupPair_vpcId = (AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text)
-> (AwsEc2SecurityGroupUserIdGroupPair
    -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Lens
     AwsEc2SecurityGroupUserIdGroupPair
     AwsEc2SecurityGroupUserIdGroupPair
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2SecurityGroupUserIdGroupPair' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: AwsEc2SecurityGroupUserIdGroupPair
s@AwsEc2SecurityGroupUserIdGroupPair' {} Maybe Text
a -> AwsEc2SecurityGroupUserIdGroupPair
s {$sel:vpcId:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
vpcId = Maybe Text
a} :: AwsEc2SecurityGroupUserIdGroupPair)

-- | The ID of an Amazon Web Services account.
--
-- For a referenced security group in another VPC, the account ID of the
-- referenced security group is returned in the response. If the referenced
-- security group is deleted, this value is not returned.
--
-- [EC2-Classic] Required when adding or removing rules that reference a
-- security group in another VPC.
awsEc2SecurityGroupUserIdGroupPair_userId :: Lens.Lens' AwsEc2SecurityGroupUserIdGroupPair (Prelude.Maybe Prelude.Text)
awsEc2SecurityGroupUserIdGroupPair_userId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2SecurityGroupUserIdGroupPair
-> f AwsEc2SecurityGroupUserIdGroupPair
awsEc2SecurityGroupUserIdGroupPair_userId = (AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text)
-> (AwsEc2SecurityGroupUserIdGroupPair
    -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Lens
     AwsEc2SecurityGroupUserIdGroupPair
     AwsEc2SecurityGroupUserIdGroupPair
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2SecurityGroupUserIdGroupPair' {Maybe Text
userId :: Maybe Text
$sel:userId:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
userId} -> Maybe Text
userId) (\s :: AwsEc2SecurityGroupUserIdGroupPair
s@AwsEc2SecurityGroupUserIdGroupPair' {} Maybe Text
a -> AwsEc2SecurityGroupUserIdGroupPair
s {$sel:userId:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
userId = Maybe Text
a} :: AwsEc2SecurityGroupUserIdGroupPair)

-- | The ID of the security group.
awsEc2SecurityGroupUserIdGroupPair_groupId :: Lens.Lens' AwsEc2SecurityGroupUserIdGroupPair (Prelude.Maybe Prelude.Text)
awsEc2SecurityGroupUserIdGroupPair_groupId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2SecurityGroupUserIdGroupPair
-> f AwsEc2SecurityGroupUserIdGroupPair
awsEc2SecurityGroupUserIdGroupPair_groupId = (AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text)
-> (AwsEc2SecurityGroupUserIdGroupPair
    -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Lens
     AwsEc2SecurityGroupUserIdGroupPair
     AwsEc2SecurityGroupUserIdGroupPair
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2SecurityGroupUserIdGroupPair' {Maybe Text
groupId :: Maybe Text
$sel:groupId:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: AwsEc2SecurityGroupUserIdGroupPair
s@AwsEc2SecurityGroupUserIdGroupPair' {} Maybe Text
a -> AwsEc2SecurityGroupUserIdGroupPair
s {$sel:groupId:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
groupId = Maybe Text
a} :: AwsEc2SecurityGroupUserIdGroupPair)

-- | The name of the security group.
awsEc2SecurityGroupUserIdGroupPair_groupName :: Lens.Lens' AwsEc2SecurityGroupUserIdGroupPair (Prelude.Maybe Prelude.Text)
awsEc2SecurityGroupUserIdGroupPair_groupName :: (Maybe Text -> f (Maybe Text))
-> AwsEc2SecurityGroupUserIdGroupPair
-> f AwsEc2SecurityGroupUserIdGroupPair
awsEc2SecurityGroupUserIdGroupPair_groupName = (AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text)
-> (AwsEc2SecurityGroupUserIdGroupPair
    -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Lens
     AwsEc2SecurityGroupUserIdGroupPair
     AwsEc2SecurityGroupUserIdGroupPair
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2SecurityGroupUserIdGroupPair' {Maybe Text
groupName :: Maybe Text
$sel:groupName:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: AwsEc2SecurityGroupUserIdGroupPair
s@AwsEc2SecurityGroupUserIdGroupPair' {} Maybe Text
a -> AwsEc2SecurityGroupUserIdGroupPair
s {$sel:groupName:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
groupName = Maybe Text
a} :: AwsEc2SecurityGroupUserIdGroupPair)

-- | The status of a VPC peering connection, if applicable.
awsEc2SecurityGroupUserIdGroupPair_peeringStatus :: Lens.Lens' AwsEc2SecurityGroupUserIdGroupPair (Prelude.Maybe Prelude.Text)
awsEc2SecurityGroupUserIdGroupPair_peeringStatus :: (Maybe Text -> f (Maybe Text))
-> AwsEc2SecurityGroupUserIdGroupPair
-> f AwsEc2SecurityGroupUserIdGroupPair
awsEc2SecurityGroupUserIdGroupPair_peeringStatus = (AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text)
-> (AwsEc2SecurityGroupUserIdGroupPair
    -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Lens
     AwsEc2SecurityGroupUserIdGroupPair
     AwsEc2SecurityGroupUserIdGroupPair
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2SecurityGroupUserIdGroupPair' {Maybe Text
peeringStatus :: Maybe Text
$sel:peeringStatus:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
peeringStatus} -> Maybe Text
peeringStatus) (\s :: AwsEc2SecurityGroupUserIdGroupPair
s@AwsEc2SecurityGroupUserIdGroupPair' {} Maybe Text
a -> AwsEc2SecurityGroupUserIdGroupPair
s {$sel:peeringStatus:AwsEc2SecurityGroupUserIdGroupPair' :: Maybe Text
peeringStatus = Maybe Text
a} :: AwsEc2SecurityGroupUserIdGroupPair)

instance
  Core.FromJSON
    AwsEc2SecurityGroupUserIdGroupPair
  where
  parseJSON :: Value -> Parser AwsEc2SecurityGroupUserIdGroupPair
parseJSON =
    String
-> (Object -> Parser AwsEc2SecurityGroupUserIdGroupPair)
-> Value
-> Parser AwsEc2SecurityGroupUserIdGroupPair
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEc2SecurityGroupUserIdGroupPair"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsEc2SecurityGroupUserIdGroupPair
AwsEc2SecurityGroupUserIdGroupPair'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsEc2SecurityGroupUserIdGroupPair)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsEc2SecurityGroupUserIdGroupPair)
forall (f :: * -> *) a b. Functor 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
"VpcPeeringConnectionId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsEc2SecurityGroupUserIdGroupPair)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsEc2SecurityGroupUserIdGroupPair)
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
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsEc2SecurityGroupUserIdGroupPair)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
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
"UserId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
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
"GroupId")
            Parser
  (Maybe Text -> Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
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
"GroupName")
            Parser (Maybe Text -> AwsEc2SecurityGroupUserIdGroupPair)
-> Parser (Maybe Text) -> Parser AwsEc2SecurityGroupUserIdGroupPair
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
"PeeringStatus")
      )

instance
  Prelude.Hashable
    AwsEc2SecurityGroupUserIdGroupPair

instance
  Prelude.NFData
    AwsEc2SecurityGroupUserIdGroupPair

instance
  Core.ToJSON
    AwsEc2SecurityGroupUserIdGroupPair
  where
  toJSON :: AwsEc2SecurityGroupUserIdGroupPair -> Value
toJSON AwsEc2SecurityGroupUserIdGroupPair' {Maybe Text
peeringStatus :: Maybe Text
groupName :: Maybe Text
groupId :: Maybe Text
userId :: Maybe Text
vpcId :: Maybe Text
vpcPeeringConnectionId :: Maybe Text
$sel:peeringStatus:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
$sel:groupName:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
$sel:groupId:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
$sel:userId:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
$sel:vpcId:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
$sel:vpcPeeringConnectionId:AwsEc2SecurityGroupUserIdGroupPair' :: AwsEc2SecurityGroupUserIdGroupPair -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"VpcPeeringConnectionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vpcPeeringConnectionId,
            (Text
"VpcId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vpcId,
            (Text
"UserId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
userId,
            (Text
"GroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupId,
            (Text
"GroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupName,
            (Text
"PeeringStatus" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
peeringStatus
          ]
      )