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