{-# 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.EC2.Types.ServiceTypeDetail
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.ServiceTypeDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.ServiceType
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'ServiceTypeDetail' 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', 'serviceTypeDetail_serviceType' - The type of service.
newServiceTypeDetail ::
  ServiceTypeDetail
newServiceTypeDetail :: ServiceTypeDetail
newServiceTypeDetail =
  ServiceTypeDetail' {$sel:serviceType:ServiceTypeDetail' :: Maybe ServiceType
serviceType = forall a. Maybe a
Prelude.Nothing}

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

instance Data.FromXML ServiceTypeDetail where
  parseXML :: [Node] -> Either String ServiceTypeDetail
parseXML [Node]
x =
    Maybe ServiceType -> ServiceTypeDetail
ServiceTypeDetail'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"serviceType")

instance Prelude.Hashable ServiceTypeDetail where
  hashWithSalt :: Int -> ServiceTypeDetail -> Int
hashWithSalt Int
_salt ServiceTypeDetail' {Maybe ServiceType
serviceType :: Maybe ServiceType
$sel:serviceType:ServiceTypeDetail' :: ServiceTypeDetail -> Maybe ServiceType
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceType
serviceType

instance Prelude.NFData ServiceTypeDetail where
  rnf :: ServiceTypeDetail -> ()
rnf ServiceTypeDetail' {Maybe ServiceType
serviceType :: Maybe ServiceType
$sel:serviceType:ServiceTypeDetail' :: ServiceTypeDetail -> Maybe ServiceType
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceType
serviceType