{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:attributes:AttributesResource' :: Maybe [Text]
attributes = 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 :: Lens' AttributesResource (Maybe [Text])
attributesResource_attributes = 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) 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
attributesResource_attributeType :: Lens.Lens' AttributesResource Prelude.Text
attributesResource_attributeType :: Lens' AttributesResource Text
attributesResource_attributeType = 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 :: Lens' AttributesResource Text
attributesResource_applicationId = 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 Data.FromJSON AttributesResource where
parseJSON :: Value -> Parser AttributesResource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AttributesResource"
( \Object
x ->
Maybe [Text] -> Text -> Text -> AttributesResource
AttributesResource'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Attributes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AttributeType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ApplicationId")
)
instance Prelude.Hashable AttributesResource where
hashWithSalt :: Int -> AttributesResource -> Int
hashWithSalt Int
_salt AttributesResource' {Maybe [Text]
Text
applicationId :: Text
attributeType :: Text
attributes :: Maybe [Text]
$sel:applicationId:AttributesResource' :: AttributesResource -> Text
$sel:attributeType:AttributesResource' :: AttributesResource -> Text
$sel:attributes:AttributesResource' :: AttributesResource -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
attributes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
attributeType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
instance Prelude.NFData AttributesResource where
rnf :: AttributesResource -> ()
rnf AttributesResource' {Maybe [Text]
Text
applicationId :: Text
attributeType :: Text
attributes :: Maybe [Text]
$sel:applicationId:AttributesResource' :: AttributesResource -> Text
$sel:attributeType:AttributesResource' :: AttributesResource -> Text
$sel:attributes:AttributesResource' :: AttributesResource -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
attributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
attributeType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
applicationId