{-# 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.DhcpOptions 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 Amazonka.EC2.Types.DhcpConfiguration
import Amazonka.EC2.Types.Tag
import qualified Amazonka.Prelude as Prelude
data DhcpOptions = DhcpOptions'
{
DhcpOptions -> Maybe [DhcpConfiguration]
dhcpConfigurations :: Prelude.Maybe [DhcpConfiguration],
DhcpOptions -> Maybe Text
dhcpOptionsId :: Prelude.Maybe Prelude.Text,
DhcpOptions -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
DhcpOptions -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (DhcpOptions -> DhcpOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DhcpOptions -> DhcpOptions -> Bool
$c/= :: DhcpOptions -> DhcpOptions -> Bool
== :: DhcpOptions -> DhcpOptions -> Bool
$c== :: DhcpOptions -> DhcpOptions -> Bool
Prelude.Eq, ReadPrec [DhcpOptions]
ReadPrec DhcpOptions
Int -> ReadS DhcpOptions
ReadS [DhcpOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DhcpOptions]
$creadListPrec :: ReadPrec [DhcpOptions]
readPrec :: ReadPrec DhcpOptions
$creadPrec :: ReadPrec DhcpOptions
readList :: ReadS [DhcpOptions]
$creadList :: ReadS [DhcpOptions]
readsPrec :: Int -> ReadS DhcpOptions
$creadsPrec :: Int -> ReadS DhcpOptions
Prelude.Read, Int -> DhcpOptions -> ShowS
[DhcpOptions] -> ShowS
DhcpOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DhcpOptions] -> ShowS
$cshowList :: [DhcpOptions] -> ShowS
show :: DhcpOptions -> String
$cshow :: DhcpOptions -> String
showsPrec :: Int -> DhcpOptions -> ShowS
$cshowsPrec :: Int -> DhcpOptions -> ShowS
Prelude.Show, forall x. Rep DhcpOptions x -> DhcpOptions
forall x. DhcpOptions -> Rep DhcpOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DhcpOptions x -> DhcpOptions
$cfrom :: forall x. DhcpOptions -> Rep DhcpOptions x
Prelude.Generic)
newDhcpOptions ::
DhcpOptions
newDhcpOptions :: DhcpOptions
newDhcpOptions =
DhcpOptions'
{ $sel:dhcpConfigurations:DhcpOptions' :: Maybe [DhcpConfiguration]
dhcpConfigurations = forall a. Maybe a
Prelude.Nothing,
$sel:dhcpOptionsId:DhcpOptions' :: Maybe Text
dhcpOptionsId = forall a. Maybe a
Prelude.Nothing,
$sel:ownerId:DhcpOptions' :: Maybe Text
ownerId = forall a. Maybe a
Prelude.Nothing,
$sel:tags:DhcpOptions' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
}
dhcpOptions_dhcpConfigurations :: Lens.Lens' DhcpOptions (Prelude.Maybe [DhcpConfiguration])
dhcpOptions_dhcpConfigurations :: Lens' DhcpOptions (Maybe [DhcpConfiguration])
dhcpOptions_dhcpConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DhcpOptions' {Maybe [DhcpConfiguration]
dhcpConfigurations :: Maybe [DhcpConfiguration]
$sel:dhcpConfigurations:DhcpOptions' :: DhcpOptions -> Maybe [DhcpConfiguration]
dhcpConfigurations} -> Maybe [DhcpConfiguration]
dhcpConfigurations) (\s :: DhcpOptions
s@DhcpOptions' {} Maybe [DhcpConfiguration]
a -> DhcpOptions
s {$sel:dhcpConfigurations:DhcpOptions' :: Maybe [DhcpConfiguration]
dhcpConfigurations = Maybe [DhcpConfiguration]
a} :: DhcpOptions) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dhcpOptions_dhcpOptionsId :: Lens.Lens' DhcpOptions (Prelude.Maybe Prelude.Text)
dhcpOptions_dhcpOptionsId :: Lens' DhcpOptions (Maybe Text)
dhcpOptions_dhcpOptionsId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DhcpOptions' {Maybe Text
dhcpOptionsId :: Maybe Text
$sel:dhcpOptionsId:DhcpOptions' :: DhcpOptions -> Maybe Text
dhcpOptionsId} -> Maybe Text
dhcpOptionsId) (\s :: DhcpOptions
s@DhcpOptions' {} Maybe Text
a -> DhcpOptions
s {$sel:dhcpOptionsId:DhcpOptions' :: Maybe Text
dhcpOptionsId = Maybe Text
a} :: DhcpOptions)
dhcpOptions_ownerId :: Lens.Lens' DhcpOptions (Prelude.Maybe Prelude.Text)
dhcpOptions_ownerId :: Lens' DhcpOptions (Maybe Text)
dhcpOptions_ownerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DhcpOptions' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:DhcpOptions' :: DhcpOptions -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: DhcpOptions
s@DhcpOptions' {} Maybe Text
a -> DhcpOptions
s {$sel:ownerId:DhcpOptions' :: Maybe Text
ownerId = Maybe Text
a} :: DhcpOptions)
dhcpOptions_tags :: Lens.Lens' DhcpOptions (Prelude.Maybe [Tag])
dhcpOptions_tags :: Lens' DhcpOptions (Maybe [Tag])
dhcpOptions_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DhcpOptions' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:DhcpOptions' :: DhcpOptions -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: DhcpOptions
s@DhcpOptions' {} Maybe [Tag]
a -> DhcpOptions
s {$sel:tags:DhcpOptions' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: DhcpOptions) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromXML DhcpOptions where
parseXML :: [Node] -> Either String DhcpOptions
parseXML [Node]
x =
Maybe [DhcpConfiguration]
-> Maybe Text -> Maybe Text -> Maybe [Tag] -> DhcpOptions
DhcpOptions'
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
"dhcpConfigurationSet"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
)
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
"dhcpOptionsId")
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
"ownerId")
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
"tagSet"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
)
instance Prelude.Hashable DhcpOptions where
hashWithSalt :: Int -> DhcpOptions -> Int
hashWithSalt Int
_salt DhcpOptions' {Maybe [DhcpConfiguration]
Maybe [Tag]
Maybe Text
tags :: Maybe [Tag]
ownerId :: Maybe Text
dhcpOptionsId :: Maybe Text
dhcpConfigurations :: Maybe [DhcpConfiguration]
$sel:tags:DhcpOptions' :: DhcpOptions -> Maybe [Tag]
$sel:ownerId:DhcpOptions' :: DhcpOptions -> Maybe Text
$sel:dhcpOptionsId:DhcpOptions' :: DhcpOptions -> Maybe Text
$sel:dhcpConfigurations:DhcpOptions' :: DhcpOptions -> Maybe [DhcpConfiguration]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DhcpConfiguration]
dhcpConfigurations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dhcpOptionsId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownerId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
instance Prelude.NFData DhcpOptions where
rnf :: DhcpOptions -> ()
rnf DhcpOptions' {Maybe [DhcpConfiguration]
Maybe [Tag]
Maybe Text
tags :: Maybe [Tag]
ownerId :: Maybe Text
dhcpOptionsId :: Maybe Text
dhcpConfigurations :: Maybe [DhcpConfiguration]
$sel:tags:DhcpOptions' :: DhcpOptions -> Maybe [Tag]
$sel:ownerId:DhcpOptions' :: DhcpOptions -> Maybe Text
$sel:dhcpOptionsId:DhcpOptions' :: DhcpOptions -> Maybe Text
$sel:dhcpConfigurations:DhcpOptions' :: DhcpOptions -> Maybe [DhcpConfiguration]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [DhcpConfiguration]
dhcpConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dhcpOptionsId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags