{-# 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.IoTWireless.Types.Destinations where
import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.Types.ExpressionType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Destinations = Destinations'
{
Destinations -> Maybe ExpressionType
expressionType :: Prelude.Maybe ExpressionType,
Destinations -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Destinations -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Destinations -> Maybe Text
expression :: Prelude.Maybe Prelude.Text,
Destinations -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Destinations -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
}
deriving (Destinations -> Destinations -> Bool
(Destinations -> Destinations -> Bool)
-> (Destinations -> Destinations -> Bool) -> Eq Destinations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Destinations -> Destinations -> Bool
$c/= :: Destinations -> Destinations -> Bool
== :: Destinations -> Destinations -> Bool
$c== :: Destinations -> Destinations -> Bool
Prelude.Eq, ReadPrec [Destinations]
ReadPrec Destinations
Int -> ReadS Destinations
ReadS [Destinations]
(Int -> ReadS Destinations)
-> ReadS [Destinations]
-> ReadPrec Destinations
-> ReadPrec [Destinations]
-> Read Destinations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Destinations]
$creadListPrec :: ReadPrec [Destinations]
readPrec :: ReadPrec Destinations
$creadPrec :: ReadPrec Destinations
readList :: ReadS [Destinations]
$creadList :: ReadS [Destinations]
readsPrec :: Int -> ReadS Destinations
$creadsPrec :: Int -> ReadS Destinations
Prelude.Read, Int -> Destinations -> ShowS
[Destinations] -> ShowS
Destinations -> String
(Int -> Destinations -> ShowS)
-> (Destinations -> String)
-> ([Destinations] -> ShowS)
-> Show Destinations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Destinations] -> ShowS
$cshowList :: [Destinations] -> ShowS
show :: Destinations -> String
$cshow :: Destinations -> String
showsPrec :: Int -> Destinations -> ShowS
$cshowsPrec :: Int -> Destinations -> ShowS
Prelude.Show, (forall x. Destinations -> Rep Destinations x)
-> (forall x. Rep Destinations x -> Destinations)
-> Generic Destinations
forall x. Rep Destinations x -> Destinations
forall x. Destinations -> Rep Destinations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Destinations x -> Destinations
$cfrom :: forall x. Destinations -> Rep Destinations x
Prelude.Generic)
newDestinations ::
Destinations
newDestinations :: Destinations
newDestinations =
Destinations' :: Maybe ExpressionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destinations
Destinations'
{ $sel:expressionType:Destinations' :: Maybe ExpressionType
expressionType = Maybe ExpressionType
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Destinations' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Destinations' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expression:Destinations' :: Maybe Text
expression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:Destinations' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:Destinations' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
destinations_expressionType :: Lens.Lens' Destinations (Prelude.Maybe ExpressionType)
destinations_expressionType :: (Maybe ExpressionType -> f (Maybe ExpressionType))
-> Destinations -> f Destinations
destinations_expressionType = (Destinations -> Maybe ExpressionType)
-> (Destinations -> Maybe ExpressionType -> Destinations)
-> Lens
Destinations
Destinations
(Maybe ExpressionType)
(Maybe ExpressionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destinations' {Maybe ExpressionType
expressionType :: Maybe ExpressionType
$sel:expressionType:Destinations' :: Destinations -> Maybe ExpressionType
expressionType} -> Maybe ExpressionType
expressionType) (\s :: Destinations
s@Destinations' {} Maybe ExpressionType
a -> Destinations
s {$sel:expressionType:Destinations' :: Maybe ExpressionType
expressionType = Maybe ExpressionType
a} :: Destinations)
destinations_arn :: Lens.Lens' Destinations (Prelude.Maybe Prelude.Text)
destinations_arn :: (Maybe Text -> f (Maybe Text)) -> Destinations -> f Destinations
destinations_arn = (Destinations -> Maybe Text)
-> (Destinations -> Maybe Text -> Destinations)
-> Lens Destinations Destinations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destinations' {Maybe Text
arn :: Maybe Text
$sel:arn:Destinations' :: Destinations -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Destinations
s@Destinations' {} Maybe Text
a -> Destinations
s {$sel:arn:Destinations' :: Maybe Text
arn = Maybe Text
a} :: Destinations)
destinations_name :: Lens.Lens' Destinations (Prelude.Maybe Prelude.Text)
destinations_name :: (Maybe Text -> f (Maybe Text)) -> Destinations -> f Destinations
destinations_name = (Destinations -> Maybe Text)
-> (Destinations -> Maybe Text -> Destinations)
-> Lens Destinations Destinations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destinations' {Maybe Text
name :: Maybe Text
$sel:name:Destinations' :: Destinations -> Maybe Text
name} -> Maybe Text
name) (\s :: Destinations
s@Destinations' {} Maybe Text
a -> Destinations
s {$sel:name:Destinations' :: Maybe Text
name = Maybe Text
a} :: Destinations)
destinations_expression :: Lens.Lens' Destinations (Prelude.Maybe Prelude.Text)
destinations_expression :: (Maybe Text -> f (Maybe Text)) -> Destinations -> f Destinations
destinations_expression = (Destinations -> Maybe Text)
-> (Destinations -> Maybe Text -> Destinations)
-> Lens Destinations Destinations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destinations' {Maybe Text
expression :: Maybe Text
$sel:expression:Destinations' :: Destinations -> Maybe Text
expression} -> Maybe Text
expression) (\s :: Destinations
s@Destinations' {} Maybe Text
a -> Destinations
s {$sel:expression:Destinations' :: Maybe Text
expression = Maybe Text
a} :: Destinations)
destinations_description :: Lens.Lens' Destinations (Prelude.Maybe Prelude.Text)
destinations_description :: (Maybe Text -> f (Maybe Text)) -> Destinations -> f Destinations
destinations_description = (Destinations -> Maybe Text)
-> (Destinations -> Maybe Text -> Destinations)
-> Lens Destinations Destinations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destinations' {Maybe Text
description :: Maybe Text
$sel:description:Destinations' :: Destinations -> Maybe Text
description} -> Maybe Text
description) (\s :: Destinations
s@Destinations' {} Maybe Text
a -> Destinations
s {$sel:description:Destinations' :: Maybe Text
description = Maybe Text
a} :: Destinations)
destinations_roleArn :: Lens.Lens' Destinations (Prelude.Maybe Prelude.Text)
destinations_roleArn :: (Maybe Text -> f (Maybe Text)) -> Destinations -> f Destinations
destinations_roleArn = (Destinations -> Maybe Text)
-> (Destinations -> Maybe Text -> Destinations)
-> Lens Destinations Destinations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destinations' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:Destinations' :: Destinations -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: Destinations
s@Destinations' {} Maybe Text
a -> Destinations
s {$sel:roleArn:Destinations' :: Maybe Text
roleArn = Maybe Text
a} :: Destinations)
instance Core.FromJSON Destinations where
parseJSON :: Value -> Parser Destinations
parseJSON =
String
-> (Object -> Parser Destinations) -> Value -> Parser Destinations
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Destinations"
( \Object
x ->
Maybe ExpressionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destinations
Destinations'
(Maybe ExpressionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destinations)
-> Parser (Maybe ExpressionType)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destinations)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ExpressionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExpressionType")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destinations)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Destinations)
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
"Arn")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Destinations)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Destinations)
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 -> Destinations)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Destinations)
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
"Expression")
Parser (Maybe Text -> Maybe Text -> Destinations)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Destinations)
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 Text -> Destinations)
-> Parser (Maybe Text) -> Parser Destinations
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
"RoleArn")
)
instance Prelude.Hashable Destinations
instance Prelude.NFData Destinations