{-# 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.Route53AutoNaming.Types.Namespace where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53AutoNaming.Types.NamespaceProperties
import Amazonka.Route53AutoNaming.Types.NamespaceType
data Namespace = Namespace'
{
Namespace -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Namespace -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
Namespace -> Maybe POSIX
createDate :: Prelude.Maybe Core.POSIX,
Namespace -> Maybe Int
serviceCount :: Prelude.Maybe Prelude.Int,
Namespace -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Namespace -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Namespace -> Maybe NamespaceType
type' :: Prelude.Maybe NamespaceType,
Namespace -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Namespace -> Maybe NamespaceProperties
properties :: Prelude.Maybe NamespaceProperties
}
deriving (Namespace -> Namespace -> Bool
(Namespace -> Namespace -> Bool)
-> (Namespace -> Namespace -> Bool) -> Eq Namespace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Namespace -> Namespace -> Bool
$c/= :: Namespace -> Namespace -> Bool
== :: Namespace -> Namespace -> Bool
$c== :: Namespace -> Namespace -> Bool
Prelude.Eq, ReadPrec [Namespace]
ReadPrec Namespace
Int -> ReadS Namespace
ReadS [Namespace]
(Int -> ReadS Namespace)
-> ReadS [Namespace]
-> ReadPrec Namespace
-> ReadPrec [Namespace]
-> Read Namespace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Namespace]
$creadListPrec :: ReadPrec [Namespace]
readPrec :: ReadPrec Namespace
$creadPrec :: ReadPrec Namespace
readList :: ReadS [Namespace]
$creadList :: ReadS [Namespace]
readsPrec :: Int -> ReadS Namespace
$creadsPrec :: Int -> ReadS Namespace
Prelude.Read, Int -> Namespace -> ShowS
[Namespace] -> ShowS
Namespace -> String
(Int -> Namespace -> ShowS)
-> (Namespace -> String)
-> ([Namespace] -> ShowS)
-> Show Namespace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Namespace] -> ShowS
$cshowList :: [Namespace] -> ShowS
show :: Namespace -> String
$cshow :: Namespace -> String
showsPrec :: Int -> Namespace -> ShowS
$cshowsPrec :: Int -> Namespace -> ShowS
Prelude.Show, (forall x. Namespace -> Rep Namespace x)
-> (forall x. Rep Namespace x -> Namespace) -> Generic Namespace
forall x. Rep Namespace x -> Namespace
forall x. Namespace -> Rep Namespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Namespace x -> Namespace
$cfrom :: forall x. Namespace -> Rep Namespace x
Prelude.Generic)
newNamespace ::
Namespace
newNamespace :: Namespace
newNamespace =
Namespace' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace
Namespace'
{ $sel:arn:Namespace' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creatorRequestId:Namespace' :: Maybe Text
creatorRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createDate:Namespace' :: Maybe POSIX
createDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:serviceCount:Namespace' :: Maybe Int
serviceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:name:Namespace' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Namespace' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':Namespace' :: Maybe NamespaceType
type' = Maybe NamespaceType
forall a. Maybe a
Prelude.Nothing,
$sel:description:Namespace' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:properties:Namespace' :: Maybe NamespaceProperties
properties = Maybe NamespaceProperties
forall a. Maybe a
Prelude.Nothing
}
namespace_arn :: Lens.Lens' Namespace (Prelude.Maybe Prelude.Text)
namespace_arn :: (Maybe Text -> f (Maybe Text)) -> Namespace -> f Namespace
namespace_arn = (Namespace -> Maybe Text)
-> (Namespace -> Maybe Text -> Namespace)
-> Lens Namespace Namespace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe Text
arn :: Maybe Text
$sel:arn:Namespace' :: Namespace -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Namespace
s@Namespace' {} Maybe Text
a -> Namespace
s {$sel:arn:Namespace' :: Maybe Text
arn = Maybe Text
a} :: Namespace)
namespace_creatorRequestId :: Lens.Lens' Namespace (Prelude.Maybe Prelude.Text)
namespace_creatorRequestId :: (Maybe Text -> f (Maybe Text)) -> Namespace -> f Namespace
namespace_creatorRequestId = (Namespace -> Maybe Text)
-> (Namespace -> Maybe Text -> Namespace)
-> Lens Namespace Namespace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:Namespace' :: Namespace -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: Namespace
s@Namespace' {} Maybe Text
a -> Namespace
s {$sel:creatorRequestId:Namespace' :: Maybe Text
creatorRequestId = Maybe Text
a} :: Namespace)
namespace_createDate :: Lens.Lens' Namespace (Prelude.Maybe Prelude.UTCTime)
namespace_createDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Namespace -> f Namespace
namespace_createDate = (Namespace -> Maybe POSIX)
-> (Namespace -> Maybe POSIX -> Namespace)
-> Lens Namespace Namespace (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe POSIX
createDate :: Maybe POSIX
$sel:createDate:Namespace' :: Namespace -> Maybe POSIX
createDate} -> Maybe POSIX
createDate) (\s :: Namespace
s@Namespace' {} Maybe POSIX
a -> Namespace
s {$sel:createDate:Namespace' :: Maybe POSIX
createDate = Maybe POSIX
a} :: Namespace) ((Maybe POSIX -> f (Maybe POSIX)) -> Namespace -> f Namespace)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Namespace
-> f Namespace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
namespace_serviceCount :: Lens.Lens' Namespace (Prelude.Maybe Prelude.Int)
namespace_serviceCount :: (Maybe Int -> f (Maybe Int)) -> Namespace -> f Namespace
namespace_serviceCount = (Namespace -> Maybe Int)
-> (Namespace -> Maybe Int -> Namespace)
-> Lens Namespace Namespace (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe Int
serviceCount :: Maybe Int
$sel:serviceCount:Namespace' :: Namespace -> Maybe Int
serviceCount} -> Maybe Int
serviceCount) (\s :: Namespace
s@Namespace' {} Maybe Int
a -> Namespace
s {$sel:serviceCount:Namespace' :: Maybe Int
serviceCount = Maybe Int
a} :: Namespace)
namespace_name :: Lens.Lens' Namespace (Prelude.Maybe Prelude.Text)
namespace_name :: (Maybe Text -> f (Maybe Text)) -> Namespace -> f Namespace
namespace_name = (Namespace -> Maybe Text)
-> (Namespace -> Maybe Text -> Namespace)
-> Lens Namespace Namespace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe Text
name :: Maybe Text
$sel:name:Namespace' :: Namespace -> Maybe Text
name} -> Maybe Text
name) (\s :: Namespace
s@Namespace' {} Maybe Text
a -> Namespace
s {$sel:name:Namespace' :: Maybe Text
name = Maybe Text
a} :: Namespace)
namespace_id :: Lens.Lens' Namespace (Prelude.Maybe Prelude.Text)
namespace_id :: (Maybe Text -> f (Maybe Text)) -> Namespace -> f Namespace
namespace_id = (Namespace -> Maybe Text)
-> (Namespace -> Maybe Text -> Namespace)
-> Lens Namespace Namespace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe Text
id :: Maybe Text
$sel:id:Namespace' :: Namespace -> Maybe Text
id} -> Maybe Text
id) (\s :: Namespace
s@Namespace' {} Maybe Text
a -> Namespace
s {$sel:id:Namespace' :: Maybe Text
id = Maybe Text
a} :: Namespace)
namespace_type :: Lens.Lens' Namespace (Prelude.Maybe NamespaceType)
namespace_type :: (Maybe NamespaceType -> f (Maybe NamespaceType))
-> Namespace -> f Namespace
namespace_type = (Namespace -> Maybe NamespaceType)
-> (Namespace -> Maybe NamespaceType -> Namespace)
-> Lens
Namespace Namespace (Maybe NamespaceType) (Maybe NamespaceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe NamespaceType
type' :: Maybe NamespaceType
$sel:type':Namespace' :: Namespace -> Maybe NamespaceType
type'} -> Maybe NamespaceType
type') (\s :: Namespace
s@Namespace' {} Maybe NamespaceType
a -> Namespace
s {$sel:type':Namespace' :: Maybe NamespaceType
type' = Maybe NamespaceType
a} :: Namespace)
namespace_description :: Lens.Lens' Namespace (Prelude.Maybe Prelude.Text)
namespace_description :: (Maybe Text -> f (Maybe Text)) -> Namespace -> f Namespace
namespace_description = (Namespace -> Maybe Text)
-> (Namespace -> Maybe Text -> Namespace)
-> Lens Namespace Namespace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe Text
description :: Maybe Text
$sel:description:Namespace' :: Namespace -> Maybe Text
description} -> Maybe Text
description) (\s :: Namespace
s@Namespace' {} Maybe Text
a -> Namespace
s {$sel:description:Namespace' :: Maybe Text
description = Maybe Text
a} :: Namespace)
namespace_properties :: Lens.Lens' Namespace (Prelude.Maybe NamespaceProperties)
namespace_properties :: (Maybe NamespaceProperties -> f (Maybe NamespaceProperties))
-> Namespace -> f Namespace
namespace_properties = (Namespace -> Maybe NamespaceProperties)
-> (Namespace -> Maybe NamespaceProperties -> Namespace)
-> Lens
Namespace
Namespace
(Maybe NamespaceProperties)
(Maybe NamespaceProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Namespace' {Maybe NamespaceProperties
properties :: Maybe NamespaceProperties
$sel:properties:Namespace' :: Namespace -> Maybe NamespaceProperties
properties} -> Maybe NamespaceProperties
properties) (\s :: Namespace
s@Namespace' {} Maybe NamespaceProperties
a -> Namespace
s {$sel:properties:Namespace' :: Maybe NamespaceProperties
properties = Maybe NamespaceProperties
a} :: Namespace)
instance Core.FromJSON Namespace where
parseJSON :: Value -> Parser Namespace
parseJSON =
String -> (Object -> Parser Namespace) -> Value -> Parser Namespace
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Namespace"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace
Namespace'
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
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
"Arn")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
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
"CreatorRequestId")
Parser
(Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateDate")
Parser
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceCount")
Parser
(Maybe Text
-> Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
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 NamespaceType
-> Maybe Text
-> Maybe NamespaceProperties
-> Namespace)
-> Parser (Maybe Text)
-> Parser
(Maybe NamespaceType
-> Maybe Text -> Maybe NamespaceProperties -> Namespace)
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
"Id")
Parser
(Maybe NamespaceType
-> Maybe Text -> Maybe NamespaceProperties -> Namespace)
-> Parser (Maybe NamespaceType)
-> Parser (Maybe Text -> Maybe NamespaceProperties -> Namespace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NamespaceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Text -> Maybe NamespaceProperties -> Namespace)
-> Parser (Maybe Text)
-> Parser (Maybe NamespaceProperties -> Namespace)
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 NamespaceProperties -> Namespace)
-> Parser (Maybe NamespaceProperties) -> Parser Namespace
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NamespaceProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Properties")
)
instance Prelude.Hashable Namespace
instance Prelude.NFData Namespace