{-# 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.Outposts.Types.Site where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Site = Site'
{ Site -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
Site -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Site -> Maybe Text
siteId :: Prelude.Maybe Prelude.Text,
Site -> Maybe Text
siteArn :: Prelude.Maybe Prelude.Text,
Site -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Site -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (Site -> Site -> Bool
(Site -> Site -> Bool) -> (Site -> Site -> Bool) -> Eq Site
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Site -> Site -> Bool
$c/= :: Site -> Site -> Bool
== :: Site -> Site -> Bool
$c== :: Site -> Site -> Bool
Prelude.Eq, ReadPrec [Site]
ReadPrec Site
Int -> ReadS Site
ReadS [Site]
(Int -> ReadS Site)
-> ReadS [Site] -> ReadPrec Site -> ReadPrec [Site] -> Read Site
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Site]
$creadListPrec :: ReadPrec [Site]
readPrec :: ReadPrec Site
$creadPrec :: ReadPrec Site
readList :: ReadS [Site]
$creadList :: ReadS [Site]
readsPrec :: Int -> ReadS Site
$creadsPrec :: Int -> ReadS Site
Prelude.Read, Int -> Site -> ShowS
[Site] -> ShowS
Site -> String
(Int -> Site -> ShowS)
-> (Site -> String) -> ([Site] -> ShowS) -> Show Site
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Site] -> ShowS
$cshowList :: [Site] -> ShowS
show :: Site -> String
$cshow :: Site -> String
showsPrec :: Int -> Site -> ShowS
$cshowsPrec :: Int -> Site -> ShowS
Prelude.Show, (forall x. Site -> Rep Site x)
-> (forall x. Rep Site x -> Site) -> Generic Site
forall x. Rep Site x -> Site
forall x. Site -> Rep Site x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Site x -> Site
$cfrom :: forall x. Site -> Rep Site x
Prelude.Generic)
newSite ::
Site
newSite :: Site
newSite =
Site' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Site
Site'
{ $sel:accountId:Site' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Site' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:siteId:Site' :: Maybe Text
siteId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:siteArn:Site' :: Maybe Text
siteArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:Site' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:Site' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
site_accountId :: Lens.Lens' Site (Prelude.Maybe Prelude.Text)
site_accountId :: (Maybe Text -> f (Maybe Text)) -> Site -> f Site
site_accountId = (Site -> Maybe Text)
-> (Site -> Maybe Text -> Site)
-> Lens Site Site (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Site' {Maybe Text
accountId :: Maybe Text
$sel:accountId:Site' :: Site -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: Site
s@Site' {} Maybe Text
a -> Site
s {$sel:accountId:Site' :: Maybe Text
accountId = Maybe Text
a} :: Site)
site_name :: Lens.Lens' Site (Prelude.Maybe Prelude.Text)
site_name :: (Maybe Text -> f (Maybe Text)) -> Site -> f Site
site_name = (Site -> Maybe Text)
-> (Site -> Maybe Text -> Site)
-> Lens Site Site (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Site' {Maybe Text
name :: Maybe Text
$sel:name:Site' :: Site -> Maybe Text
name} -> Maybe Text
name) (\s :: Site
s@Site' {} Maybe Text
a -> Site
s {$sel:name:Site' :: Maybe Text
name = Maybe Text
a} :: Site)
site_siteId :: Lens.Lens' Site (Prelude.Maybe Prelude.Text)
site_siteId :: (Maybe Text -> f (Maybe Text)) -> Site -> f Site
site_siteId = (Site -> Maybe Text)
-> (Site -> Maybe Text -> Site)
-> Lens Site Site (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Site' {Maybe Text
siteId :: Maybe Text
$sel:siteId:Site' :: Site -> Maybe Text
siteId} -> Maybe Text
siteId) (\s :: Site
s@Site' {} Maybe Text
a -> Site
s {$sel:siteId:Site' :: Maybe Text
siteId = Maybe Text
a} :: Site)
site_siteArn :: Lens.Lens' Site (Prelude.Maybe Prelude.Text)
site_siteArn :: (Maybe Text -> f (Maybe Text)) -> Site -> f Site
site_siteArn = (Site -> Maybe Text)
-> (Site -> Maybe Text -> Site)
-> Lens Site Site (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Site' {Maybe Text
siteArn :: Maybe Text
$sel:siteArn:Site' :: Site -> Maybe Text
siteArn} -> Maybe Text
siteArn) (\s :: Site
s@Site' {} Maybe Text
a -> Site
s {$sel:siteArn:Site' :: Maybe Text
siteArn = Maybe Text
a} :: Site)
site_description :: Lens.Lens' Site (Prelude.Maybe Prelude.Text)
site_description :: (Maybe Text -> f (Maybe Text)) -> Site -> f Site
site_description = (Site -> Maybe Text)
-> (Site -> Maybe Text -> Site)
-> Lens Site Site (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Site' {Maybe Text
description :: Maybe Text
$sel:description:Site' :: Site -> Maybe Text
description} -> Maybe Text
description) (\s :: Site
s@Site' {} Maybe Text
a -> Site
s {$sel:description:Site' :: Maybe Text
description = Maybe Text
a} :: Site)
site_tags :: Lens.Lens' Site (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
site_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Site -> f Site
site_tags = (Site -> Maybe (HashMap Text Text))
-> (Site -> Maybe (HashMap Text Text) -> Site)
-> Lens
Site Site (Maybe (HashMap Text Text)) (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Site' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Site' :: Site -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Site
s@Site' {} Maybe (HashMap Text Text)
a -> Site
s {$sel:tags:Site' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Site) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Site -> f Site)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Site
-> f Site
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Site where
parseJSON :: Value -> Parser Site
parseJSON =
String -> (Object -> Parser Site) -> Value -> Parser Site
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Site"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Site
Site'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Site)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Site)
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
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Site)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe (HashMap Text Text) -> Site)
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
-> Maybe Text -> Maybe Text -> Maybe (HashMap Text Text) -> Site)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe (HashMap Text Text) -> Site)
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
"SiteId")
Parser
(Maybe Text -> Maybe Text -> Maybe (HashMap Text Text) -> Site)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> Site)
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
"SiteArn")
Parser (Maybe Text -> Maybe (HashMap Text Text) -> Site)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> Site)
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
"Description")
Parser (Maybe (HashMap Text Text) -> Site)
-> Parser (Maybe (HashMap Text Text)) -> Parser Site
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Site
instance Prelude.NFData Site