{-# 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.XRay.Types.ServiceId where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ServiceId = ServiceId'
{ ServiceId -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
ServiceId -> Maybe [Text]
names :: Prelude.Maybe [Prelude.Text],
ServiceId -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ServiceId -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (ServiceId -> ServiceId -> Bool
(ServiceId -> ServiceId -> Bool)
-> (ServiceId -> ServiceId -> Bool) -> Eq ServiceId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceId -> ServiceId -> Bool
$c/= :: ServiceId -> ServiceId -> Bool
== :: ServiceId -> ServiceId -> Bool
$c== :: ServiceId -> ServiceId -> Bool
Prelude.Eq, ReadPrec [ServiceId]
ReadPrec ServiceId
Int -> ReadS ServiceId
ReadS [ServiceId]
(Int -> ReadS ServiceId)
-> ReadS [ServiceId]
-> ReadPrec ServiceId
-> ReadPrec [ServiceId]
-> Read ServiceId
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceId]
$creadListPrec :: ReadPrec [ServiceId]
readPrec :: ReadPrec ServiceId
$creadPrec :: ReadPrec ServiceId
readList :: ReadS [ServiceId]
$creadList :: ReadS [ServiceId]
readsPrec :: Int -> ReadS ServiceId
$creadsPrec :: Int -> ReadS ServiceId
Prelude.Read, Int -> ServiceId -> ShowS
[ServiceId] -> ShowS
ServiceId -> String
(Int -> ServiceId -> ShowS)
-> (ServiceId -> String)
-> ([ServiceId] -> ShowS)
-> Show ServiceId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceId] -> ShowS
$cshowList :: [ServiceId] -> ShowS
show :: ServiceId -> String
$cshow :: ServiceId -> String
showsPrec :: Int -> ServiceId -> ShowS
$cshowsPrec :: Int -> ServiceId -> ShowS
Prelude.Show, (forall x. ServiceId -> Rep ServiceId x)
-> (forall x. Rep ServiceId x -> ServiceId) -> Generic ServiceId
forall x. Rep ServiceId x -> ServiceId
forall x. ServiceId -> Rep ServiceId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceId x -> ServiceId
$cfrom :: forall x. ServiceId -> Rep ServiceId x
Prelude.Generic)
newServiceId ::
ServiceId
newServiceId :: ServiceId
newServiceId =
ServiceId' :: Maybe Text -> Maybe [Text] -> Maybe Text -> Maybe Text -> ServiceId
ServiceId'
{ $sel:accountId:ServiceId' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:names:ServiceId' :: Maybe [Text]
names = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:name:ServiceId' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':ServiceId' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
serviceId_accountId :: Lens.Lens' ServiceId (Prelude.Maybe Prelude.Text)
serviceId_accountId :: (Maybe Text -> f (Maybe Text)) -> ServiceId -> f ServiceId
serviceId_accountId = (ServiceId -> Maybe Text)
-> (ServiceId -> Maybe Text -> ServiceId)
-> Lens ServiceId ServiceId (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceId' {Maybe Text
accountId :: Maybe Text
$sel:accountId:ServiceId' :: ServiceId -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: ServiceId
s@ServiceId' {} Maybe Text
a -> ServiceId
s {$sel:accountId:ServiceId' :: Maybe Text
accountId = Maybe Text
a} :: ServiceId)
serviceId_names :: Lens.Lens' ServiceId (Prelude.Maybe [Prelude.Text])
serviceId_names :: (Maybe [Text] -> f (Maybe [Text])) -> ServiceId -> f ServiceId
serviceId_names = (ServiceId -> Maybe [Text])
-> (ServiceId -> Maybe [Text] -> ServiceId)
-> Lens ServiceId ServiceId (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceId' {Maybe [Text]
names :: Maybe [Text]
$sel:names:ServiceId' :: ServiceId -> Maybe [Text]
names} -> Maybe [Text]
names) (\s :: ServiceId
s@ServiceId' {} Maybe [Text]
a -> ServiceId
s {$sel:names:ServiceId' :: Maybe [Text]
names = Maybe [Text]
a} :: ServiceId) ((Maybe [Text] -> f (Maybe [Text])) -> ServiceId -> f ServiceId)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ServiceId
-> f ServiceId
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
serviceId_name :: Lens.Lens' ServiceId (Prelude.Maybe Prelude.Text)
serviceId_name :: (Maybe Text -> f (Maybe Text)) -> ServiceId -> f ServiceId
serviceId_name = (ServiceId -> Maybe Text)
-> (ServiceId -> Maybe Text -> ServiceId)
-> Lens ServiceId ServiceId (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceId' {Maybe Text
name :: Maybe Text
$sel:name:ServiceId' :: ServiceId -> Maybe Text
name} -> Maybe Text
name) (\s :: ServiceId
s@ServiceId' {} Maybe Text
a -> ServiceId
s {$sel:name:ServiceId' :: Maybe Text
name = Maybe Text
a} :: ServiceId)
serviceId_type :: Lens.Lens' ServiceId (Prelude.Maybe Prelude.Text)
serviceId_type :: (Maybe Text -> f (Maybe Text)) -> ServiceId -> f ServiceId
serviceId_type = (ServiceId -> Maybe Text)
-> (ServiceId -> Maybe Text -> ServiceId)
-> Lens ServiceId ServiceId (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceId' {Maybe Text
type' :: Maybe Text
$sel:type':ServiceId' :: ServiceId -> Maybe Text
type'} -> Maybe Text
type') (\s :: ServiceId
s@ServiceId' {} Maybe Text
a -> ServiceId
s {$sel:type':ServiceId' :: Maybe Text
type' = Maybe Text
a} :: ServiceId)
instance Core.FromJSON ServiceId where
parseJSON :: Value -> Parser ServiceId
parseJSON =
String -> (Object -> Parser ServiceId) -> Value -> Parser ServiceId
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServiceId"
( \Object
x ->
Maybe Text -> Maybe [Text] -> Maybe Text -> Maybe Text -> ServiceId
ServiceId'
(Maybe Text
-> Maybe [Text] -> Maybe Text -> Maybe Text -> ServiceId)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> Maybe Text -> ServiceId)
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
"AccountId")
Parser (Maybe [Text] -> Maybe Text -> Maybe Text -> ServiceId)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> Maybe Text -> ServiceId)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Names" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> ServiceId)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ServiceId)
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
"Name")
Parser (Maybe Text -> ServiceId)
-> Parser (Maybe Text) -> Parser ServiceId
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
"Type")
)
instance Prelude.Hashable ServiceId
instance Prelude.NFData ServiceId