{-# 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.AwsEc2VpcEndpointServiceServiceTypeDetails
-- 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.AwsEc2VpcEndpointServiceServiceTypeDetails where

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

-- | The service type information for a VPC endpoint service.
--
-- /See:/ 'newAwsEc2VpcEndpointServiceServiceTypeDetails' smart constructor.
data AwsEc2VpcEndpointServiceServiceTypeDetails = AwsEc2VpcEndpointServiceServiceTypeDetails'
  { -- | The type of service.
    AwsEc2VpcEndpointServiceServiceTypeDetails -> Maybe Text
serviceType :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEc2VpcEndpointServiceServiceTypeDetails
-> AwsEc2VpcEndpointServiceServiceTypeDetails -> Bool
(AwsEc2VpcEndpointServiceServiceTypeDetails
 -> AwsEc2VpcEndpointServiceServiceTypeDetails -> Bool)
-> (AwsEc2VpcEndpointServiceServiceTypeDetails
    -> AwsEc2VpcEndpointServiceServiceTypeDetails -> Bool)
-> Eq AwsEc2VpcEndpointServiceServiceTypeDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEc2VpcEndpointServiceServiceTypeDetails
-> AwsEc2VpcEndpointServiceServiceTypeDetails -> Bool
$c/= :: AwsEc2VpcEndpointServiceServiceTypeDetails
-> AwsEc2VpcEndpointServiceServiceTypeDetails -> Bool
== :: AwsEc2VpcEndpointServiceServiceTypeDetails
-> AwsEc2VpcEndpointServiceServiceTypeDetails -> Bool
$c== :: AwsEc2VpcEndpointServiceServiceTypeDetails
-> AwsEc2VpcEndpointServiceServiceTypeDetails -> Bool
Prelude.Eq, ReadPrec [AwsEc2VpcEndpointServiceServiceTypeDetails]
ReadPrec AwsEc2VpcEndpointServiceServiceTypeDetails
Int -> ReadS AwsEc2VpcEndpointServiceServiceTypeDetails
ReadS [AwsEc2VpcEndpointServiceServiceTypeDetails]
(Int -> ReadS AwsEc2VpcEndpointServiceServiceTypeDetails)
-> ReadS [AwsEc2VpcEndpointServiceServiceTypeDetails]
-> ReadPrec AwsEc2VpcEndpointServiceServiceTypeDetails
-> ReadPrec [AwsEc2VpcEndpointServiceServiceTypeDetails]
-> Read AwsEc2VpcEndpointServiceServiceTypeDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEc2VpcEndpointServiceServiceTypeDetails]
$creadListPrec :: ReadPrec [AwsEc2VpcEndpointServiceServiceTypeDetails]
readPrec :: ReadPrec AwsEc2VpcEndpointServiceServiceTypeDetails
$creadPrec :: ReadPrec AwsEc2VpcEndpointServiceServiceTypeDetails
readList :: ReadS [AwsEc2VpcEndpointServiceServiceTypeDetails]
$creadList :: ReadS [AwsEc2VpcEndpointServiceServiceTypeDetails]
readsPrec :: Int -> ReadS AwsEc2VpcEndpointServiceServiceTypeDetails
$creadsPrec :: Int -> ReadS AwsEc2VpcEndpointServiceServiceTypeDetails
Prelude.Read, Int -> AwsEc2VpcEndpointServiceServiceTypeDetails -> ShowS
[AwsEc2VpcEndpointServiceServiceTypeDetails] -> ShowS
AwsEc2VpcEndpointServiceServiceTypeDetails -> String
(Int -> AwsEc2VpcEndpointServiceServiceTypeDetails -> ShowS)
-> (AwsEc2VpcEndpointServiceServiceTypeDetails -> String)
-> ([AwsEc2VpcEndpointServiceServiceTypeDetails] -> ShowS)
-> Show AwsEc2VpcEndpointServiceServiceTypeDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEc2VpcEndpointServiceServiceTypeDetails] -> ShowS
$cshowList :: [AwsEc2VpcEndpointServiceServiceTypeDetails] -> ShowS
show :: AwsEc2VpcEndpointServiceServiceTypeDetails -> String
$cshow :: AwsEc2VpcEndpointServiceServiceTypeDetails -> String
showsPrec :: Int -> AwsEc2VpcEndpointServiceServiceTypeDetails -> ShowS
$cshowsPrec :: Int -> AwsEc2VpcEndpointServiceServiceTypeDetails -> ShowS
Prelude.Show, (forall x.
 AwsEc2VpcEndpointServiceServiceTypeDetails
 -> Rep AwsEc2VpcEndpointServiceServiceTypeDetails x)
-> (forall x.
    Rep AwsEc2VpcEndpointServiceServiceTypeDetails x
    -> AwsEc2VpcEndpointServiceServiceTypeDetails)
-> Generic AwsEc2VpcEndpointServiceServiceTypeDetails
forall x.
Rep AwsEc2VpcEndpointServiceServiceTypeDetails x
-> AwsEc2VpcEndpointServiceServiceTypeDetails
forall x.
AwsEc2VpcEndpointServiceServiceTypeDetails
-> Rep AwsEc2VpcEndpointServiceServiceTypeDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEc2VpcEndpointServiceServiceTypeDetails x
-> AwsEc2VpcEndpointServiceServiceTypeDetails
$cfrom :: forall x.
AwsEc2VpcEndpointServiceServiceTypeDetails
-> Rep AwsEc2VpcEndpointServiceServiceTypeDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEc2VpcEndpointServiceServiceTypeDetails' 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:
--
-- 'serviceType', 'awsEc2VpcEndpointServiceServiceTypeDetails_serviceType' - The type of service.
newAwsEc2VpcEndpointServiceServiceTypeDetails ::
  AwsEc2VpcEndpointServiceServiceTypeDetails
newAwsEc2VpcEndpointServiceServiceTypeDetails :: AwsEc2VpcEndpointServiceServiceTypeDetails
newAwsEc2VpcEndpointServiceServiceTypeDetails =
  AwsEc2VpcEndpointServiceServiceTypeDetails' :: Maybe Text -> AwsEc2VpcEndpointServiceServiceTypeDetails
AwsEc2VpcEndpointServiceServiceTypeDetails'
    { $sel:serviceType:AwsEc2VpcEndpointServiceServiceTypeDetails' :: Maybe Text
serviceType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The type of service.
awsEc2VpcEndpointServiceServiceTypeDetails_serviceType :: Lens.Lens' AwsEc2VpcEndpointServiceServiceTypeDetails (Prelude.Maybe Prelude.Text)
awsEc2VpcEndpointServiceServiceTypeDetails_serviceType :: (Maybe Text -> f (Maybe Text))
-> AwsEc2VpcEndpointServiceServiceTypeDetails
-> f AwsEc2VpcEndpointServiceServiceTypeDetails
awsEc2VpcEndpointServiceServiceTypeDetails_serviceType = (AwsEc2VpcEndpointServiceServiceTypeDetails -> Maybe Text)
-> (AwsEc2VpcEndpointServiceServiceTypeDetails
    -> Maybe Text -> AwsEc2VpcEndpointServiceServiceTypeDetails)
-> Lens
     AwsEc2VpcEndpointServiceServiceTypeDetails
     AwsEc2VpcEndpointServiceServiceTypeDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2VpcEndpointServiceServiceTypeDetails' {Maybe Text
serviceType :: Maybe Text
$sel:serviceType:AwsEc2VpcEndpointServiceServiceTypeDetails' :: AwsEc2VpcEndpointServiceServiceTypeDetails -> Maybe Text
serviceType} -> Maybe Text
serviceType) (\s :: AwsEc2VpcEndpointServiceServiceTypeDetails
s@AwsEc2VpcEndpointServiceServiceTypeDetails' {} Maybe Text
a -> AwsEc2VpcEndpointServiceServiceTypeDetails
s {$sel:serviceType:AwsEc2VpcEndpointServiceServiceTypeDetails' :: Maybe Text
serviceType = Maybe Text
a} :: AwsEc2VpcEndpointServiceServiceTypeDetails)

instance
  Core.FromJSON
    AwsEc2VpcEndpointServiceServiceTypeDetails
  where
  parseJSON :: Value -> Parser AwsEc2VpcEndpointServiceServiceTypeDetails
parseJSON =
    String
-> (Object -> Parser AwsEc2VpcEndpointServiceServiceTypeDetails)
-> Value
-> Parser AwsEc2VpcEndpointServiceServiceTypeDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEc2VpcEndpointServiceServiceTypeDetails"
      ( \Object
x ->
          Maybe Text -> AwsEc2VpcEndpointServiceServiceTypeDetails
AwsEc2VpcEndpointServiceServiceTypeDetails'
            (Maybe Text -> AwsEc2VpcEndpointServiceServiceTypeDetails)
-> Parser (Maybe Text)
-> Parser AwsEc2VpcEndpointServiceServiceTypeDetails
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
"ServiceType")
      )

instance
  Prelude.Hashable
    AwsEc2VpcEndpointServiceServiceTypeDetails

instance
  Prelude.NFData
    AwsEc2VpcEndpointServiceServiceTypeDetails

instance
  Core.ToJSON
    AwsEc2VpcEndpointServiceServiceTypeDetails
  where
  toJSON :: AwsEc2VpcEndpointServiceServiceTypeDetails -> Value
toJSON
    AwsEc2VpcEndpointServiceServiceTypeDetails' {Maybe Text
serviceType :: Maybe Text
$sel:serviceType:AwsEc2VpcEndpointServiceServiceTypeDetails' :: AwsEc2VpcEndpointServiceServiceTypeDetails -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [(Text
"ServiceType" 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
serviceType]
        )