{-# 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 #-}
module Amazonka.ServiceQuotas.Types.ServiceInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ServiceInfo = ServiceInfo'
{
ServiceInfo -> Maybe Text
serviceName :: Prelude.Maybe Prelude.Text,
ServiceInfo -> Maybe Text
serviceCode :: Prelude.Maybe Prelude.Text
}
deriving (ServiceInfo -> ServiceInfo -> Bool
(ServiceInfo -> ServiceInfo -> Bool)
-> (ServiceInfo -> ServiceInfo -> Bool) -> Eq ServiceInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceInfo -> ServiceInfo -> Bool
$c/= :: ServiceInfo -> ServiceInfo -> Bool
== :: ServiceInfo -> ServiceInfo -> Bool
$c== :: ServiceInfo -> ServiceInfo -> Bool
Prelude.Eq, ReadPrec [ServiceInfo]
ReadPrec ServiceInfo
Int -> ReadS ServiceInfo
ReadS [ServiceInfo]
(Int -> ReadS ServiceInfo)
-> ReadS [ServiceInfo]
-> ReadPrec ServiceInfo
-> ReadPrec [ServiceInfo]
-> Read ServiceInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceInfo]
$creadListPrec :: ReadPrec [ServiceInfo]
readPrec :: ReadPrec ServiceInfo
$creadPrec :: ReadPrec ServiceInfo
readList :: ReadS [ServiceInfo]
$creadList :: ReadS [ServiceInfo]
readsPrec :: Int -> ReadS ServiceInfo
$creadsPrec :: Int -> ReadS ServiceInfo
Prelude.Read, Int -> ServiceInfo -> ShowS
[ServiceInfo] -> ShowS
ServiceInfo -> String
(Int -> ServiceInfo -> ShowS)
-> (ServiceInfo -> String)
-> ([ServiceInfo] -> ShowS)
-> Show ServiceInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceInfo] -> ShowS
$cshowList :: [ServiceInfo] -> ShowS
show :: ServiceInfo -> String
$cshow :: ServiceInfo -> String
showsPrec :: Int -> ServiceInfo -> ShowS
$cshowsPrec :: Int -> ServiceInfo -> ShowS
Prelude.Show, (forall x. ServiceInfo -> Rep ServiceInfo x)
-> (forall x. Rep ServiceInfo x -> ServiceInfo)
-> Generic ServiceInfo
forall x. Rep ServiceInfo x -> ServiceInfo
forall x. ServiceInfo -> Rep ServiceInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceInfo x -> ServiceInfo
$cfrom :: forall x. ServiceInfo -> Rep ServiceInfo x
Prelude.Generic)
newServiceInfo ::
ServiceInfo
newServiceInfo :: ServiceInfo
newServiceInfo =
ServiceInfo' :: Maybe Text -> Maybe Text -> ServiceInfo
ServiceInfo'
{ $sel:serviceName:ServiceInfo' :: Maybe Text
serviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:serviceCode:ServiceInfo' :: Maybe Text
serviceCode = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
serviceInfo_serviceName :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_serviceName :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_serviceName = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
serviceName :: Maybe Text
$sel:serviceName:ServiceInfo' :: ServiceInfo -> Maybe Text
serviceName} -> Maybe Text
serviceName) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:serviceName:ServiceInfo' :: Maybe Text
serviceName = Maybe Text
a} :: ServiceInfo)
serviceInfo_serviceCode :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_serviceCode :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_serviceCode = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
serviceCode :: Maybe Text
$sel:serviceCode:ServiceInfo' :: ServiceInfo -> Maybe Text
serviceCode} -> Maybe Text
serviceCode) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:serviceCode:ServiceInfo' :: Maybe Text
serviceCode = Maybe Text
a} :: ServiceInfo)
instance Core.FromJSON ServiceInfo where
parseJSON :: Value -> Parser ServiceInfo
parseJSON =
String
-> (Object -> Parser ServiceInfo) -> Value -> Parser ServiceInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServiceInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> ServiceInfo
ServiceInfo'
(Maybe Text -> Maybe Text -> ServiceInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ServiceInfo)
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
"ServiceName")
Parser (Maybe Text -> ServiceInfo)
-> Parser (Maybe Text) -> Parser ServiceInfo
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
"ServiceCode")
)
instance Prelude.Hashable ServiceInfo
instance Prelude.NFData ServiceInfo