{-# 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.Pinpoint.Types.AttributesResource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AttributesResource = AttributesResource'
{
AttributesResource -> Maybe [Text]
attributes :: Prelude.Maybe [Prelude.Text],
AttributesResource -> Text
attributeType :: Prelude.Text,
AttributesResource -> Text
applicationId :: Prelude.Text
}
deriving (AttributesResource -> AttributesResource -> Bool
(AttributesResource -> AttributesResource -> Bool)
-> (AttributesResource -> AttributesResource -> Bool)
-> Eq AttributesResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttributesResource -> AttributesResource -> Bool
$c/= :: AttributesResource -> AttributesResource -> Bool
== :: AttributesResource -> AttributesResource -> Bool
$c== :: AttributesResource -> AttributesResource -> Bool
Prelude.Eq, ReadPrec [AttributesResource]
ReadPrec AttributesResource
Int -> ReadS AttributesResource
ReadS [AttributesResource]
(Int -> ReadS AttributesResource)
-> ReadS [AttributesResource]
-> ReadPrec AttributesResource
-> ReadPrec [AttributesResource]
-> Read AttributesResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttributesResource]
$creadListPrec :: ReadPrec [AttributesResource]
readPrec :: ReadPrec AttributesResource
$creadPrec :: ReadPrec AttributesResource
readList :: ReadS [AttributesResource]
$creadList :: ReadS [AttributesResource]
readsPrec :: Int -> ReadS AttributesResource
$creadsPrec :: Int -> ReadS AttributesResource
Prelude.Read, Int -> AttributesResource -> ShowS
[AttributesResource] -> ShowS
AttributesResource -> String
(Int -> AttributesResource -> ShowS)
-> (AttributesResource -> String)
-> ([AttributesResource] -> ShowS)
-> Show AttributesResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttributesResource] -> ShowS
$cshowList :: [AttributesResource] -> ShowS
show :: AttributesResource -> String
$cshow :: AttributesResource -> String
showsPrec :: Int -> AttributesResource -> ShowS
$cshowsPrec :: Int -> AttributesResource -> ShowS
Prelude.Show, (forall x. AttributesResource -> Rep AttributesResource x)
-> (forall x. Rep AttributesResource x -> AttributesResource)
-> Generic AttributesResource
forall x. Rep AttributesResource x -> AttributesResource
forall x. AttributesResource -> Rep AttributesResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttributesResource x -> AttributesResource
$cfrom :: forall x. AttributesResource -> Rep AttributesResource x
Prelude.Generic)
newAttributesResource ::
Prelude.Text ->
Prelude.Text ->
AttributesResource
newAttributesResource :: Text -> Text -> AttributesResource
newAttributesResource Text
pAttributeType_ Text
pApplicationId_ =
AttributesResource' :: Maybe [Text] -> Text -> Text -> AttributesResource
AttributesResource'
{ $sel:attributes:AttributesResource' :: Maybe [Text]
attributes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:attributeType:AttributesResource' :: Text
attributeType = Text
pAttributeType_,
$sel:applicationId:AttributesResource' :: Text
applicationId = Text
pApplicationId_
}
attributesResource_attributes :: Lens.Lens' AttributesResource (Prelude.Maybe [Prelude.Text])
attributesResource_attributes :: (Maybe [Text] -> f (Maybe [Text]))
-> AttributesResource -> f AttributesResource
attributesResource_attributes = (AttributesResource -> Maybe [Text])
-> (AttributesResource -> Maybe [Text] -> AttributesResource)
-> Lens
AttributesResource AttributesResource (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributesResource' {Maybe [Text]
attributes :: Maybe [Text]
$sel:attributes:AttributesResource' :: AttributesResource -> Maybe [Text]
attributes} -> Maybe [Text]
attributes) (\s :: AttributesResource
s@AttributesResource' {} Maybe [Text]
a -> AttributesResource
s {$sel:attributes:AttributesResource' :: Maybe [Text]
attributes = Maybe [Text]
a} :: AttributesResource) ((Maybe [Text] -> f (Maybe [Text]))
-> AttributesResource -> f AttributesResource)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AttributesResource
-> f AttributesResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
attributesResource_attributeType :: Lens.Lens' AttributesResource Prelude.Text
attributesResource_attributeType :: (Text -> f Text) -> AttributesResource -> f AttributesResource
attributesResource_attributeType = (AttributesResource -> Text)
-> (AttributesResource -> Text -> AttributesResource)
-> Lens AttributesResource AttributesResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributesResource' {Text
attributeType :: Text
$sel:attributeType:AttributesResource' :: AttributesResource -> Text
attributeType} -> Text
attributeType) (\s :: AttributesResource
s@AttributesResource' {} Text
a -> AttributesResource
s {$sel:attributeType:AttributesResource' :: Text
attributeType = Text
a} :: AttributesResource)
attributesResource_applicationId :: Lens.Lens' AttributesResource Prelude.Text
attributesResource_applicationId :: (Text -> f Text) -> AttributesResource -> f AttributesResource
attributesResource_applicationId = (AttributesResource -> Text)
-> (AttributesResource -> Text -> AttributesResource)
-> Lens AttributesResource AttributesResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributesResource' {Text
applicationId :: Text
$sel:applicationId:AttributesResource' :: AttributesResource -> Text
applicationId} -> Text
applicationId) (\s :: AttributesResource
s@AttributesResource' {} Text
a -> AttributesResource
s {$sel:applicationId:AttributesResource' :: Text
applicationId = Text
a} :: AttributesResource)
instance Core.FromJSON AttributesResource where
parseJSON :: Value -> Parser AttributesResource
parseJSON =
String
-> (Object -> Parser AttributesResource)
-> Value
-> Parser AttributesResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AttributesResource"
( \Object
x ->
Maybe [Text] -> Text -> Text -> AttributesResource
AttributesResource'
(Maybe [Text] -> Text -> Text -> AttributesResource)
-> Parser (Maybe [Text])
-> Parser (Text -> Text -> AttributesResource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attributes" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> Text -> AttributesResource)
-> Parser Text -> Parser (Text -> AttributesResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AttributeType")
Parser (Text -> AttributesResource)
-> Parser Text -> Parser AttributesResource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationId")
)
instance Prelude.Hashable AttributesResource
instance Prelude.NFData AttributesResource