{-# 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.EC2.Types.IdFormat where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude
data IdFormat = IdFormat'
{
IdFormat -> Maybe ISO8601
deadline :: Prelude.Maybe Data.ISO8601,
IdFormat -> Maybe Text
resource :: Prelude.Maybe Prelude.Text,
IdFormat -> Maybe Bool
useLongIds :: Prelude.Maybe Prelude.Bool
}
deriving (IdFormat -> IdFormat -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdFormat -> IdFormat -> Bool
$c/= :: IdFormat -> IdFormat -> Bool
== :: IdFormat -> IdFormat -> Bool
$c== :: IdFormat -> IdFormat -> Bool
Prelude.Eq, ReadPrec [IdFormat]
ReadPrec IdFormat
Int -> ReadS IdFormat
ReadS [IdFormat]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdFormat]
$creadListPrec :: ReadPrec [IdFormat]
readPrec :: ReadPrec IdFormat
$creadPrec :: ReadPrec IdFormat
readList :: ReadS [IdFormat]
$creadList :: ReadS [IdFormat]
readsPrec :: Int -> ReadS IdFormat
$creadsPrec :: Int -> ReadS IdFormat
Prelude.Read, Int -> IdFormat -> ShowS
[IdFormat] -> ShowS
IdFormat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdFormat] -> ShowS
$cshowList :: [IdFormat] -> ShowS
show :: IdFormat -> String
$cshow :: IdFormat -> String
showsPrec :: Int -> IdFormat -> ShowS
$cshowsPrec :: Int -> IdFormat -> ShowS
Prelude.Show, forall x. Rep IdFormat x -> IdFormat
forall x. IdFormat -> Rep IdFormat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IdFormat x -> IdFormat
$cfrom :: forall x. IdFormat -> Rep IdFormat x
Prelude.Generic)
newIdFormat ::
IdFormat
newIdFormat :: IdFormat
newIdFormat =
IdFormat'
{ $sel:deadline:IdFormat' :: Maybe ISO8601
deadline = forall a. Maybe a
Prelude.Nothing,
$sel:resource:IdFormat' :: Maybe Text
resource = forall a. Maybe a
Prelude.Nothing,
$sel:useLongIds:IdFormat' :: Maybe Bool
useLongIds = forall a. Maybe a
Prelude.Nothing
}
idFormat_deadline :: Lens.Lens' IdFormat (Prelude.Maybe Prelude.UTCTime)
idFormat_deadline :: Lens' IdFormat (Maybe UTCTime)
idFormat_deadline = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdFormat' {Maybe ISO8601
deadline :: Maybe ISO8601
$sel:deadline:IdFormat' :: IdFormat -> Maybe ISO8601
deadline} -> Maybe ISO8601
deadline) (\s :: IdFormat
s@IdFormat' {} Maybe ISO8601
a -> IdFormat
s {$sel:deadline:IdFormat' :: Maybe ISO8601
deadline = Maybe ISO8601
a} :: IdFormat) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
idFormat_resource :: Lens.Lens' IdFormat (Prelude.Maybe Prelude.Text)
idFormat_resource :: Lens' IdFormat (Maybe Text)
idFormat_resource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdFormat' {Maybe Text
resource :: Maybe Text
$sel:resource:IdFormat' :: IdFormat -> Maybe Text
resource} -> Maybe Text
resource) (\s :: IdFormat
s@IdFormat' {} Maybe Text
a -> IdFormat
s {$sel:resource:IdFormat' :: Maybe Text
resource = Maybe Text
a} :: IdFormat)
idFormat_useLongIds :: Lens.Lens' IdFormat (Prelude.Maybe Prelude.Bool)
idFormat_useLongIds :: Lens' IdFormat (Maybe Bool)
idFormat_useLongIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdFormat' {Maybe Bool
useLongIds :: Maybe Bool
$sel:useLongIds:IdFormat' :: IdFormat -> Maybe Bool
useLongIds} -> Maybe Bool
useLongIds) (\s :: IdFormat
s@IdFormat' {} Maybe Bool
a -> IdFormat
s {$sel:useLongIds:IdFormat' :: Maybe Bool
useLongIds = Maybe Bool
a} :: IdFormat)
instance Data.FromXML IdFormat where
parseXML :: [Node] -> Either String IdFormat
parseXML [Node]
x =
Maybe ISO8601 -> Maybe Text -> Maybe Bool -> IdFormat
IdFormat'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"deadline")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"resource")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"useLongIds")
instance Prelude.Hashable IdFormat where
hashWithSalt :: Int -> IdFormat -> Int
hashWithSalt Int
_salt IdFormat' {Maybe Bool
Maybe Text
Maybe ISO8601
useLongIds :: Maybe Bool
resource :: Maybe Text
deadline :: Maybe ISO8601
$sel:useLongIds:IdFormat' :: IdFormat -> Maybe Bool
$sel:resource:IdFormat' :: IdFormat -> Maybe Text
$sel:deadline:IdFormat' :: IdFormat -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
deadline
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resource
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useLongIds
instance Prelude.NFData IdFormat where
rnf :: IdFormat -> ()
rnf IdFormat' {Maybe Bool
Maybe Text
Maybe ISO8601
useLongIds :: Maybe Bool
resource :: Maybe Text
deadline :: Maybe ISO8601
$sel:useLongIds:IdFormat' :: IdFormat -> Maybe Bool
$sel:resource:IdFormat' :: IdFormat -> Maybe Text
$sel:deadline:IdFormat' :: IdFormat -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
deadline
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resource
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useLongIds